@ariakit/core 0.3.10 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/cjs/__chunks/{Y6PHIDP6.cjs → 5JEQEZFR.cjs} +12 -12
  3. package/cjs/__chunks/{YIUPKKEK.cjs → 7DU6YMLQ.cjs} +6 -6
  4. package/cjs/__chunks/{MWNFQD55.cjs → AETQC2AR.cjs} +17 -16
  5. package/cjs/__chunks/{5CBCKBZ2.cjs → B4LYZ4EM.cjs} +12 -12
  6. package/cjs/__chunks/{3UT5FE6K.cjs → EEDWPDM2.cjs} +14 -1
  7. package/cjs/__chunks/{YLMJBIQM.cjs → FFZYCAXA.cjs} +24 -15
  8. package/cjs/__chunks/{MFSCSSBJ.cjs → LTLFSC4X.cjs} +2 -2
  9. package/cjs/__chunks/{CWDUO5EV.cjs → SU2BSHGB.cjs} +7 -7
  10. package/cjs/__chunks/{HMO4CKUP.cjs → UEZLSKZ4.cjs} +10 -10
  11. package/cjs/__chunks/{5F4DVUNS.cjs → UKR6TQI3.cjs} +1 -2
  12. package/cjs/__chunks/{ZXCB7MXN.cjs → Y7KNI5NS.cjs} +17 -17
  13. package/cjs/checkbox/checkbox-store.cjs +5 -5
  14. package/cjs/collection/collection-store.cjs +5 -5
  15. package/cjs/combobox/combobox-store.cjs +35 -35
  16. package/cjs/composite/composite-overflow-store.cjs +6 -6
  17. package/cjs/composite/composite-store.cjs +6 -6
  18. package/cjs/dialog/dialog-store.cjs +5 -5
  19. package/cjs/disclosure/disclosure-store.cjs +4 -4
  20. package/cjs/disclosure/disclosure-store.d.cts +6 -2
  21. package/cjs/disclosure/disclosure-store.d.ts +6 -2
  22. package/cjs/form/form-store.cjs +24 -24
  23. package/cjs/form/form-store.d.cts +1 -1
  24. package/cjs/form/form-store.d.ts +1 -1
  25. package/cjs/hovercard/hovercard-store.cjs +7 -7
  26. package/cjs/hovercard/hovercard-store.d.cts +14 -7
  27. package/cjs/hovercard/hovercard-store.d.ts +14 -7
  28. package/cjs/menu/menu-bar-store.cjs +7 -7
  29. package/cjs/menu/menu-store.cjs +27 -27
  30. package/cjs/menu/menu-store.d.cts +16 -7
  31. package/cjs/menu/menu-store.d.ts +16 -7
  32. package/cjs/menubar/menubar-store.cjs +7 -7
  33. package/cjs/popover/popover-store.cjs +6 -6
  34. package/cjs/popover/popover-store.d.cts +31 -6
  35. package/cjs/popover/popover-store.d.ts +31 -6
  36. package/cjs/radio/radio-store.cjs +9 -9
  37. package/cjs/radio/radio-store.d.cts +2 -1
  38. package/cjs/radio/radio-store.d.ts +2 -1
  39. package/cjs/select/select-store.cjs +29 -29
  40. package/cjs/select/select-store.d.cts +2 -1
  41. package/cjs/select/select-store.d.ts +2 -1
  42. package/cjs/tab/tab-store.cjs +21 -21
  43. package/cjs/tab/tab-store.d.cts +5 -11
  44. package/cjs/tab/tab-store.d.ts +5 -11
  45. package/cjs/toolbar/toolbar-store.cjs +8 -8
  46. package/cjs/toolbar/toolbar-store.d.cts +2 -6
  47. package/cjs/toolbar/toolbar-store.d.ts +2 -6
  48. package/cjs/tooltip/tooltip-store.cjs +21 -12
  49. package/cjs/tooltip/tooltip-store.d.cts +6 -4
  50. package/cjs/tooltip/tooltip-store.d.ts +6 -4
  51. package/cjs/utils/dom.cjs +2 -2
  52. package/cjs/utils/events.cjs +5 -5
  53. package/cjs/utils/focus.cjs +13 -13
  54. package/cjs/utils/misc.cjs +4 -2
  55. package/cjs/utils/misc.d.cts +4 -0
  56. package/cjs/utils/misc.d.ts +4 -0
  57. package/cjs/utils/platform.cjs +3 -3
  58. package/cjs/utils/store.cjs +3 -3
  59. package/esm/__chunks/{I2VQ3XGR.js → 22HHDS5F.js} +13 -0
  60. package/esm/__chunks/{VEUNYQYR.js → 2H5K47H4.js} +3 -3
  61. package/esm/__chunks/{25MEC56I.js → 5RJNXXU2.js} +1 -1
  62. package/esm/__chunks/{QJ5CUA32.js → BRS7GKWU.js} +3 -3
  63. package/esm/__chunks/{AKMSZ36N.js → MFZZDIHG.js} +3 -3
  64. package/esm/__chunks/{UUFF4PQ6.js → PXYVPXSS.js} +3 -3
  65. package/esm/__chunks/{K6ELJFXN.js → R676XYVY.js} +1 -1
  66. package/esm/__chunks/{DLOEKDPY.js → RRSZHCH6.js} +1 -2
  67. package/esm/__chunks/{MYUKSFP5.js → URUD7X4C.js} +14 -5
  68. package/esm/__chunks/{MHPO2BXA.js → VDNATJW2.js} +1 -1
  69. package/esm/__chunks/{L5RYKTVQ.js → WCKXDMU7.js} +3 -2
  70. package/esm/checkbox/checkbox-store.js +2 -2
  71. package/esm/collection/collection-store.js +4 -4
  72. package/esm/combobox/combobox-store.js +9 -9
  73. package/esm/composite/composite-overflow-store.js +5 -5
  74. package/esm/composite/composite-store.js +5 -5
  75. package/esm/dialog/dialog-store.js +4 -4
  76. package/esm/disclosure/disclosure-store.d.ts +6 -2
  77. package/esm/disclosure/disclosure-store.js +3 -3
  78. package/esm/form/form-store.d.ts +1 -1
  79. package/esm/form/form-store.js +4 -4
  80. package/esm/hovercard/hovercard-store.d.ts +14 -7
  81. package/esm/hovercard/hovercard-store.js +6 -6
  82. package/esm/menu/menu-bar-store.js +6 -6
  83. package/esm/menu/menu-store.d.ts +16 -7
  84. package/esm/menu/menu-store.js +9 -9
  85. package/esm/menubar/menubar-store.js +6 -6
  86. package/esm/popover/popover-store.d.ts +31 -6
  87. package/esm/popover/popover-store.js +5 -5
  88. package/esm/radio/radio-store.d.ts +2 -1
  89. package/esm/radio/radio-store.js +5 -5
  90. package/esm/select/select-store.d.ts +2 -1
  91. package/esm/select/select-store.js +8 -8
  92. package/esm/tab/tab-store.d.ts +5 -11
  93. package/esm/tab/tab-store.js +5 -5
  94. package/esm/toolbar/toolbar-store.d.ts +2 -6
  95. package/esm/toolbar/toolbar-store.js +5 -5
  96. package/esm/tooltip/tooltip-store.d.ts +6 -4
  97. package/esm/tooltip/tooltip-store.js +15 -6
  98. package/esm/utils/dom.js +1 -1
  99. package/esm/utils/events.js +2 -2
  100. package/esm/utils/focus.js +1 -1
  101. package/esm/utils/misc.d.ts +4 -0
  102. package/esm/utils/misc.js +3 -1
  103. package/esm/utils/platform.js +2 -2
  104. package/esm/utils/store.js +2 -2
  105. package/package.json +1 -1
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _5F4DVUNScjs = require('../__chunks/5F4DVUNS.cjs');
9
+ var _UKR6TQI3cjs = require('../__chunks/UKR6TQI3.cjs');
10
10
 
11
11
 
12
12
  var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
@@ -18,11 +18,11 @@ function hasNegativeTabIndex(element) {
18
18
  return tabIndex < 0;
19
19
  }
20
20
  function isFocusable(element) {
21
- if (!_5F4DVUNScjs.matches.call(void 0, element, selector))
21
+ if (!_UKR6TQI3cjs.matches.call(void 0, element, selector))
22
22
  return false;
23
- if (!_5F4DVUNScjs.isVisible.call(void 0, element))
23
+ if (!_UKR6TQI3cjs.isVisible.call(void 0, element))
24
24
  return false;
25
- if (_5F4DVUNScjs.closest.call(void 0, element, "[inert]"))
25
+ if (_UKR6TQI3cjs.closest.call(void 0, element, "[inert]"))
26
26
  return false;
27
27
  return true;
28
28
  }
@@ -44,7 +44,7 @@ function isTabbable(element) {
44
44
  return true;
45
45
  if (!("length" in radioGroup))
46
46
  return true;
47
- const activeElement = _5F4DVUNScjs.getActiveElement.call(void 0, element);
47
+ const activeElement = _UKR6TQI3cjs.getActiveElement.call(void 0, element);
48
48
  if (!activeElement)
49
49
  return true;
50
50
  if (activeElement === element)
@@ -66,7 +66,7 @@ function getAllFocusableIn(container, includeContainer) {
66
66
  }
67
67
  const focusableElements = elements.filter(isFocusable);
68
68
  focusableElements.forEach((element, i) => {
69
- if (_5F4DVUNScjs.isFrame.call(void 0, element) && element.contentDocument) {
69
+ if (_UKR6TQI3cjs.isFrame.call(void 0, element) && element.contentDocument) {
70
70
  const frameBody = element.contentDocument.body;
71
71
  focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
72
72
  }
@@ -92,7 +92,7 @@ function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
92
92
  tabbableElements.unshift(container);
93
93
  }
94
94
  tabbableElements.forEach((element, i) => {
95
- if (_5F4DVUNScjs.isFrame.call(void 0, element) && element.contentDocument) {
95
+ if (_UKR6TQI3cjs.isFrame.call(void 0, element) && element.contentDocument) {
96
96
  const frameBody = element.contentDocument.body;
97
97
  const allFrameTabbable = getAllTabbableIn(
98
98
  frameBody,
@@ -133,7 +133,7 @@ function getLastTabbable(fallbackToFocusable) {
133
133
  return getLastTabbableIn(document.body, false, fallbackToFocusable);
134
134
  }
135
135
  function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) {
136
- const activeElement = _5F4DVUNScjs.getActiveElement.call(void 0, container);
136
+ const activeElement = _UKR6TQI3cjs.getActiveElement.call(void 0, container);
137
137
  const allFocusable = getAllFocusableIn(container, includeContainer);
138
138
  const activeIndex = allFocusable.indexOf(activeElement);
139
139
  const nextFocusableElements = allFocusable.slice(activeIndex + 1);
@@ -148,7 +148,7 @@ function getNextTabbable(fallbackToFirst, fallbackToFocusable) {
148
148
  );
149
149
  }
150
150
  function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) {
151
- const activeElement = _5F4DVUNScjs.getActiveElement.call(void 0, container);
151
+ const activeElement = _UKR6TQI3cjs.getActiveElement.call(void 0, container);
152
152
  const allFocusable = getAllFocusableIn(container, includeContainer).reverse();
153
153
  const activeIndex = allFocusable.indexOf(activeElement);
154
154
  const previousFocusableElements = allFocusable.slice(activeIndex + 1);
@@ -164,12 +164,12 @@ function getPreviousTabbable(fallbackToFirst, fallbackToFocusable) {
164
164
  }
165
165
  function getClosestFocusable(element) {
166
166
  while (element && !isFocusable(element)) {
167
- element = _5F4DVUNScjs.closest.call(void 0, element, selector);
167
+ element = _UKR6TQI3cjs.closest.call(void 0, element, selector);
168
168
  }
169
169
  return element || null;
170
170
  }
171
171
  function hasFocus(element) {
172
- const activeElement = _5F4DVUNScjs.getActiveElement.call(void 0, element);
172
+ const activeElement = _UKR6TQI3cjs.getActiveElement.call(void 0, element);
173
173
  if (!activeElement)
174
174
  return false;
175
175
  if (activeElement === element)
@@ -180,10 +180,10 @@ function hasFocus(element) {
180
180
  return activeDescendant === element.id;
181
181
  }
182
182
  function hasFocusWithin(element) {
183
- const activeElement = _5F4DVUNScjs.getActiveElement.call(void 0, element);
183
+ const activeElement = _UKR6TQI3cjs.getActiveElement.call(void 0, element);
184
184
  if (!activeElement)
185
185
  return false;
186
- if (_5F4DVUNScjs.contains.call(void 0, element, activeElement))
186
+ if (_UKR6TQI3cjs.contains.call(void 0, element, activeElement))
187
187
  return true;
188
188
  const activeDescendant = activeElement.getAttribute("aria-activedescendant");
189
189
  if (!activeDescendant)
@@ -20,7 +20,8 @@
20
20
 
21
21
 
22
22
 
23
- var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
23
+
24
+ var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
24
25
  require('../__chunks/AV6KTKLE.cjs');
25
26
 
26
27
 
@@ -43,4 +44,5 @@ require('../__chunks/AV6KTKLE.cjs');
43
44
 
44
45
 
45
46
 
46
- exports.afterPaint = _3UT5FE6Kcjs.afterPaint; exports.applyState = _3UT5FE6Kcjs.applyState; exports.beforePaint = _3UT5FE6Kcjs.beforePaint; exports.chain = _3UT5FE6Kcjs.chain; exports.cx = _3UT5FE6Kcjs.cx; exports.defaultValue = _3UT5FE6Kcjs.defaultValue; exports.disabledFromProps = _3UT5FE6Kcjs.disabledFromProps; exports.getKeys = _3UT5FE6Kcjs.getKeys; exports.hasOwnProperty = _3UT5FE6Kcjs.hasOwnProperty; exports.identity = _3UT5FE6Kcjs.identity; exports.invariant = _3UT5FE6Kcjs.invariant; exports.isEmpty = _3UT5FE6Kcjs.isEmpty; exports.isFalsyBooleanCallback = _3UT5FE6Kcjs.isFalsyBooleanCallback; exports.isInteger = _3UT5FE6Kcjs.isInteger; exports.isObject = _3UT5FE6Kcjs.isObject; exports.noop = _3UT5FE6Kcjs.noop; exports.normalizeString = _3UT5FE6Kcjs.normalizeString; exports.omit = _3UT5FE6Kcjs.omit; exports.pick = _3UT5FE6Kcjs.pick; exports.shallowEqual = _3UT5FE6Kcjs.shallowEqual;
47
+
48
+ exports.afterPaint = _EEDWPDM2cjs.afterPaint; exports.applyState = _EEDWPDM2cjs.applyState; exports.beforePaint = _EEDWPDM2cjs.beforePaint; exports.chain = _EEDWPDM2cjs.chain; exports.cx = _EEDWPDM2cjs.cx; exports.defaultValue = _EEDWPDM2cjs.defaultValue; exports.disabledFromProps = _EEDWPDM2cjs.disabledFromProps; exports.getKeys = _EEDWPDM2cjs.getKeys; exports.hasOwnProperty = _EEDWPDM2cjs.hasOwnProperty; exports.identity = _EEDWPDM2cjs.identity; exports.invariant = _EEDWPDM2cjs.invariant; exports.isEmpty = _EEDWPDM2cjs.isEmpty; exports.isFalsyBooleanCallback = _EEDWPDM2cjs.isFalsyBooleanCallback; exports.isInteger = _EEDWPDM2cjs.isInteger; exports.isObject = _EEDWPDM2cjs.isObject; exports.noop = _EEDWPDM2cjs.noop; exports.normalizeString = _EEDWPDM2cjs.normalizeString; exports.omit = _EEDWPDM2cjs.omit; exports.pick = _EEDWPDM2cjs.pick; exports.removeUndefinedValues = _EEDWPDM2cjs.removeUndefinedValues; exports.shallowEqual = _EEDWPDM2cjs.shallowEqual;
@@ -113,6 +113,10 @@ export declare function disabledFromProps(props: {
113
113
  disabled?: boolean;
114
114
  "aria-disabled"?: boolean | "true" | "false";
115
115
  }): boolean;
116
+ /**
117
+ * Removes undefined values from an object.
118
+ */
119
+ export declare function removeUndefinedValues<T extends AnyObject>(obj: T): T;
116
120
  /**
117
121
  * Returns the first value that is not `undefined`.
118
122
  */
@@ -113,6 +113,10 @@ export declare function disabledFromProps(props: {
113
113
  disabled?: boolean;
114
114
  "aria-disabled"?: boolean | "true" | "false";
115
115
  }): boolean;
116
+ /**
117
+ * Removes undefined values from an object.
118
+ */
119
+ export declare function removeUndefinedValues<T extends AnyObject>(obj: T): T;
116
120
  /**
117
121
  * Returns the first value that is not `undefined`.
118
122
  */
@@ -5,8 +5,8 @@
5
5
 
6
6
 
7
7
 
8
- var _YIUPKKEKcjs = require('../__chunks/YIUPKKEK.cjs');
9
- require('../__chunks/5F4DVUNS.cjs');
8
+ var _7DU6YMLQcjs = require('../__chunks/7DU6YMLQ.cjs');
9
+ require('../__chunks/UKR6TQI3.cjs');
10
10
  require('../__chunks/AV6KTKLE.cjs');
11
11
 
12
12
 
@@ -14,4 +14,4 @@ require('../__chunks/AV6KTKLE.cjs');
14
14
 
15
15
 
16
16
 
17
- exports.isApple = _YIUPKKEKcjs.isApple; exports.isFirefox = _YIUPKKEKcjs.isFirefox; exports.isMac = _YIUPKKEKcjs.isMac; exports.isSafari = _YIUPKKEKcjs.isSafari; exports.isTouchDevice = _YIUPKKEKcjs.isTouchDevice;
17
+ exports.isApple = _7DU6YMLQcjs.isApple; exports.isFirefox = _7DU6YMLQcjs.isFirefox; exports.isMac = _7DU6YMLQcjs.isMac; exports.isSafari = _7DU6YMLQcjs.isSafari; exports.isTouchDevice = _7DU6YMLQcjs.isTouchDevice;
@@ -10,8 +10,8 @@
10
10
 
11
11
 
12
12
 
13
- var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
14
- require('../__chunks/3UT5FE6K.cjs');
13
+ var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
14
+ require('../__chunks/EEDWPDM2.cjs');
15
15
  require('../__chunks/AV6KTKLE.cjs');
16
16
 
17
17
 
@@ -24,4 +24,4 @@ require('../__chunks/AV6KTKLE.cjs');
24
24
 
25
25
 
26
26
 
27
- exports.batch = _5CBCKBZ2cjs.batch; exports.createStore = _5CBCKBZ2cjs.createStore; exports.init = _5CBCKBZ2cjs.init; exports.mergeStore = _5CBCKBZ2cjs.mergeStore; exports.omit = _5CBCKBZ2cjs.omit; exports.pick = _5CBCKBZ2cjs.pick; exports.setup = _5CBCKBZ2cjs.setup; exports.subscribe = _5CBCKBZ2cjs.subscribe; exports.sync = _5CBCKBZ2cjs.sync; exports.throwOnConflictingProps = _5CBCKBZ2cjs.throwOnConflictingProps;
27
+ exports.batch = _B4LYZ4EMcjs.batch; exports.createStore = _B4LYZ4EMcjs.createStore; exports.init = _B4LYZ4EMcjs.init; exports.mergeStore = _B4LYZ4EMcjs.mergeStore; exports.omit = _B4LYZ4EMcjs.omit; exports.pick = _B4LYZ4EMcjs.pick; exports.setup = _B4LYZ4EMcjs.setup; exports.subscribe = _B4LYZ4EMcjs.subscribe; exports.sync = _B4LYZ4EMcjs.sync; exports.throwOnConflictingProps = _B4LYZ4EMcjs.throwOnConflictingProps;
@@ -63,6 +63,9 @@ function isInteger(arg) {
63
63
  return String(Math.floor(Number(arg))) === arg;
64
64
  }
65
65
  function hasOwnProperty(object, prop) {
66
+ if (typeof Object.hasOwn === "function") {
67
+ return Object.hasOwn(object, prop);
68
+ }
66
69
  return Object.prototype.hasOwnProperty.call(object, prop);
67
70
  }
68
71
  function chain(...fns) {
@@ -130,6 +133,15 @@ function isFalsyBooleanCallback(booleanOrCallback, ...args) {
130
133
  function disabledFromProps(props) {
131
134
  return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
132
135
  }
136
+ function removeUndefinedValues(obj) {
137
+ const result = {};
138
+ for (const key in obj) {
139
+ if (obj[key] !== void 0) {
140
+ result[key] = obj[key];
141
+ }
142
+ }
143
+ return result;
144
+ }
133
145
  function defaultValue(...values) {
134
146
  for (const value of values) {
135
147
  if (value !== void 0)
@@ -158,5 +170,6 @@ export {
158
170
  getKeys,
159
171
  isFalsyBooleanCallback,
160
172
  disabledFromProps,
173
+ removeUndefinedValues,
161
174
  defaultValue
162
175
  };
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
  import {
3
3
  createCollectionStore
4
- } from "./MYUKSFP5.js";
4
+ } from "./URUD7X4C.js";
5
5
  import {
6
6
  createStore,
7
7
  setup,
8
8
  sync
9
- } from "./K6ELJFXN.js";
9
+ } from "./R676XYVY.js";
10
10
  import {
11
11
  defaultValue
12
- } from "./I2VQ3XGR.js";
12
+ } from "./22HHDS5F.js";
13
13
  import {
14
14
  flatten2DArray,
15
15
  reverseArray
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  createDisclosureStore
4
- } from "./L5RYKTVQ.js";
4
+ } from "./WCKXDMU7.js";
5
5
 
6
6
  // src/dialog/dialog-store.ts
7
7
  function createDialogStore(props = {}) {
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import {
3
3
  createPopoverStore
4
- } from "./AKMSZ36N.js";
4
+ } from "./MFZZDIHG.js";
5
5
  import {
6
6
  createStore
7
- } from "./K6ELJFXN.js";
7
+ } from "./R676XYVY.js";
8
8
  import {
9
9
  defaultValue
10
- } from "./I2VQ3XGR.js";
10
+ } from "./22HHDS5F.js";
11
11
  import {
12
12
  __spreadProps,
13
13
  __spreadValues
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import {
3
3
  createDialogStore
4
- } from "./25MEC56I.js";
4
+ } from "./5RJNXXU2.js";
5
5
  import {
6
6
  createStore,
7
7
  mergeStore,
8
8
  omit,
9
9
  throwOnConflictingProps
10
- } from "./K6ELJFXN.js";
10
+ } from "./R676XYVY.js";
11
11
  import {
12
12
  defaultValue
13
- } from "./I2VQ3XGR.js";
13
+ } from "./22HHDS5F.js";
14
14
  import {
15
15
  __objRest,
16
16
  __spreadProps,
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import {
3
3
  createCompositeStore
4
- } from "./VEUNYQYR.js";
4
+ } from "./2H5K47H4.js";
5
5
  import {
6
6
  createStore
7
- } from "./K6ELJFXN.js";
7
+ } from "./R676XYVY.js";
8
8
  import {
9
9
  defaultValue
10
- } from "./I2VQ3XGR.js";
10
+ } from "./22HHDS5F.js";
11
11
  import {
12
12
  __spreadProps,
13
13
  __spreadValues
@@ -8,7 +8,7 @@ import {
8
8
  noop,
9
9
  omit,
10
10
  pick
11
- } from "./I2VQ3XGR.js";
11
+ } from "./22HHDS5F.js";
12
12
  import {
13
13
  __spreadProps,
14
14
  __spreadValues
@@ -102,8 +102,7 @@ function getPopupItemRole(element, fallback) {
102
102
  const itemRoleByPopupRole = {
103
103
  menu: "menuitem",
104
104
  listbox: "option",
105
- tree: "treeitem",
106
- grid: "gridcell"
105
+ tree: "treeitem"
107
106
  };
108
107
  const popupRole = getPopupRole(element);
109
108
  if (!popupRole)
@@ -5,14 +5,14 @@ import {
5
5
  init,
6
6
  setup,
7
7
  throwOnConflictingProps
8
- } from "./K6ELJFXN.js";
8
+ } from "./R676XYVY.js";
9
9
  import {
10
10
  chain,
11
11
  defaultValue
12
- } from "./I2VQ3XGR.js";
12
+ } from "./22HHDS5F.js";
13
13
  import {
14
14
  getDocument
15
- } from "./DLOEKDPY.js";
15
+ } from "./RRSZHCH6.js";
16
16
  import {
17
17
  __spreadProps,
18
18
  __spreadValues
@@ -84,7 +84,7 @@ function createCollectionStore(props = {}) {
84
84
  };
85
85
  const syncPrivateStore = getPrivateStore(props.store);
86
86
  const privateStore = createStore(
87
- { renderedItems: initialState.renderedItems },
87
+ { items, renderedItems: initialState.renderedItems },
88
88
  syncPrivateStore
89
89
  );
90
90
  const collection = createStore(initialState, props.store);
@@ -94,6 +94,11 @@ function createCollectionStore(props = {}) {
94
94
  collection.setState("renderedItems", sortedItems);
95
95
  };
96
96
  setup(collection, () => init(privateStore));
97
+ setup(privateStore, () => {
98
+ return batch(privateStore, ["items"], (state) => {
99
+ collection.setState("items", state.items);
100
+ });
101
+ });
97
102
  setup(privateStore, () => {
98
103
  return batch(privateStore, ["renderedItems"], (state) => {
99
104
  let firstRun = true;
@@ -162,7 +167,11 @@ function createCollectionStore(props = {}) {
162
167
  };
163
168
  return unmergeItem;
164
169
  };
165
- const registerItem = (item) => mergeItem(item, (getItems) => collection.setState("items", getItems), true);
170
+ const registerItem = (item) => mergeItem(
171
+ item,
172
+ (getItems) => privateStore.setState("items", getItems),
173
+ true
174
+ );
166
175
  return __spreadProps(__spreadValues({}, collection), {
167
176
  registerItem,
168
177
  renderItem: (item) => chain(
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  canUseDOM
4
- } from "./DLOEKDPY.js";
4
+ } from "./RRSZHCH6.js";
5
5
 
6
6
  // src/utils/platform.ts
7
7
  function isTouchDevice() {
@@ -7,10 +7,10 @@ import {
7
7
  subscribe,
8
8
  sync,
9
9
  throwOnConflictingProps
10
- } from "./K6ELJFXN.js";
10
+ } from "./R676XYVY.js";
11
11
  import {
12
12
  defaultValue
13
- } from "./I2VQ3XGR.js";
13
+ } from "./22HHDS5F.js";
14
14
  import {
15
15
  __spreadProps,
16
16
  __spreadValues
@@ -63,6 +63,7 @@ function createDisclosureStore(props = {}) {
63
63
  })
64
64
  );
65
65
  return __spreadProps(__spreadValues({}, disclosure), {
66
+ disclosure: props.disclosure,
66
67
  setOpen: (value) => disclosure.setState("open", value),
67
68
  show: () => disclosure.setState("open", true),
68
69
  hide: () => disclosure.setState("open", false),
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  createStore,
4
4
  throwOnConflictingProps
5
- } from "../__chunks/K6ELJFXN.js";
5
+ } from "../__chunks/R676XYVY.js";
6
6
  import {
7
7
  defaultValue
8
- } from "../__chunks/I2VQ3XGR.js";
8
+ } from "../__chunks/22HHDS5F.js";
9
9
  import {
10
10
  __spreadProps,
11
11
  __spreadValues
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  createCollectionStore
4
- } from "../__chunks/MYUKSFP5.js";
5
- import "../__chunks/K6ELJFXN.js";
6
- import "../__chunks/I2VQ3XGR.js";
7
- import "../__chunks/DLOEKDPY.js";
4
+ } from "../__chunks/URUD7X4C.js";
5
+ import "../__chunks/R676XYVY.js";
6
+ import "../__chunks/22HHDS5F.js";
7
+ import "../__chunks/RRSZHCH6.js";
8
8
  import "../__chunks/4R3V3JGP.js";
9
9
  export {
10
10
  createCollectionStore
@@ -1,28 +1,28 @@
1
1
  "use client";
2
2
  import {
3
3
  createPopoverStore
4
- } from "../__chunks/AKMSZ36N.js";
5
- import "../__chunks/25MEC56I.js";
6
- import "../__chunks/L5RYKTVQ.js";
4
+ } from "../__chunks/MFZZDIHG.js";
5
+ import "../__chunks/5RJNXXU2.js";
6
+ import "../__chunks/WCKXDMU7.js";
7
7
  import {
8
8
  createCompositeStore
9
- } from "../__chunks/VEUNYQYR.js";
10
- import "../__chunks/MYUKSFP5.js";
9
+ } from "../__chunks/2H5K47H4.js";
10
+ import "../__chunks/URUD7X4C.js";
11
11
  import {
12
12
  batch,
13
13
  createStore,
14
14
  setup,
15
15
  sync,
16
16
  throwOnConflictingProps
17
- } from "../__chunks/K6ELJFXN.js";
17
+ } from "../__chunks/R676XYVY.js";
18
18
  import {
19
19
  defaultValue
20
- } from "../__chunks/I2VQ3XGR.js";
20
+ } from "../__chunks/22HHDS5F.js";
21
21
  import {
22
22
  isSafari,
23
23
  isTouchDevice
24
- } from "../__chunks/MHPO2BXA.js";
25
- import "../__chunks/DLOEKDPY.js";
24
+ } from "../__chunks/VDNATJW2.js";
25
+ import "../__chunks/RRSZHCH6.js";
26
26
  import "../__chunks/7PRQYBBV.js";
27
27
  import {
28
28
  __spreadProps,
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  createPopoverStore
4
- } from "../__chunks/AKMSZ36N.js";
5
- import "../__chunks/25MEC56I.js";
6
- import "../__chunks/L5RYKTVQ.js";
7
- import "../__chunks/K6ELJFXN.js";
8
- import "../__chunks/I2VQ3XGR.js";
4
+ } from "../__chunks/MFZZDIHG.js";
5
+ import "../__chunks/5RJNXXU2.js";
6
+ import "../__chunks/WCKXDMU7.js";
7
+ import "../__chunks/R676XYVY.js";
8
+ import "../__chunks/22HHDS5F.js";
9
9
  import "../__chunks/4R3V3JGP.js";
10
10
 
11
11
  // src/composite/composite-overflow-store.ts
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  createCompositeStore
4
- } from "../__chunks/VEUNYQYR.js";
5
- import "../__chunks/MYUKSFP5.js";
6
- import "../__chunks/K6ELJFXN.js";
7
- import "../__chunks/I2VQ3XGR.js";
8
- import "../__chunks/DLOEKDPY.js";
4
+ } from "../__chunks/2H5K47H4.js";
5
+ import "../__chunks/URUD7X4C.js";
6
+ import "../__chunks/R676XYVY.js";
7
+ import "../__chunks/22HHDS5F.js";
8
+ import "../__chunks/RRSZHCH6.js";
9
9
  import "../__chunks/7PRQYBBV.js";
10
10
  import "../__chunks/4R3V3JGP.js";
11
11
  export {
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  createDialogStore
4
- } from "../__chunks/25MEC56I.js";
5
- import "../__chunks/L5RYKTVQ.js";
6
- import "../__chunks/K6ELJFXN.js";
7
- import "../__chunks/I2VQ3XGR.js";
4
+ } from "../__chunks/5RJNXXU2.js";
5
+ import "../__chunks/WCKXDMU7.js";
6
+ import "../__chunks/R676XYVY.js";
7
+ import "../__chunks/22HHDS5F.js";
8
8
  import "../__chunks/4R3V3JGP.js";
9
9
  export {
10
10
  createDialogStore
@@ -38,7 +38,6 @@ export interface DisclosureStoreState {
38
38
  * - If it's set to a number, the `animating` state will be `true` when the
39
39
  * content is shown or hidden and it will wait for the number of
40
40
  * milliseconds to pass before becoming `false`.
41
- * @default false
42
41
  */
43
42
  animated: boolean | number;
44
43
  /**
@@ -54,7 +53,7 @@ export interface DisclosureStoreState {
54
53
  */
55
54
  disclosureElement: HTMLElement | null;
56
55
  }
57
- export interface DisclosureStoreFunctions {
56
+ export interface DisclosureStoreFunctions extends Pick<DisclosureStoreOptions, "disclosure"> {
58
57
  /**
59
58
  * Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
60
59
  * state.
@@ -115,6 +114,11 @@ export interface DisclosureStoreFunctions {
115
114
  setDisclosureElement: SetState<DisclosureStoreState["disclosureElement"]>;
116
115
  }
117
116
  export interface DisclosureStoreOptions extends StoreOptions<DisclosureStoreState, "open" | "animated"> {
117
+ /**
118
+ * @deprecated Manually setting the `animated` prop is no longer necessary.
119
+ * This will be removed in a future release.
120
+ */
121
+ animated?: DisclosureStoreState["animated"];
118
122
  /**
119
123
  * Whether the content should be visible by default.
120
124
  * @default false
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  createDisclosureStore
4
- } from "../__chunks/L5RYKTVQ.js";
5
- import "../__chunks/K6ELJFXN.js";
6
- import "../__chunks/I2VQ3XGR.js";
4
+ } from "../__chunks/WCKXDMU7.js";
5
+ import "../__chunks/R676XYVY.js";
6
+ import "../__chunks/22HHDS5F.js";
7
7
  import "../__chunks/4R3V3JGP.js";
8
8
  export {
9
9
  createDisclosureStore
@@ -61,7 +61,7 @@ export interface FormStoreState<T extends FormStoreValues = FormStoreValues> ext
61
61
  }
62
62
  export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues> extends CollectionStoreFunctions<FormStoreItem> {
63
63
  /**
64
- * An object containing the names of the form fields for type-safety.
64
+ * An object containing the names of the form fields for type safety.
65
65
  *
66
66
  * Live examples:
67
67
  * - [FormRadio](https://ariakit.org/examples/form-radio)
@@ -1,20 +1,20 @@
1
1
  "use client";
2
2
  import {
3
3
  createCollectionStore
4
- } from "../__chunks/MYUKSFP5.js";
4
+ } from "../__chunks/URUD7X4C.js";
5
5
  import {
6
6
  createStore,
7
7
  init,
8
8
  setup,
9
9
  throwOnConflictingProps
10
- } from "../__chunks/K6ELJFXN.js";
10
+ } from "../__chunks/R676XYVY.js";
11
11
  import {
12
12
  applyState,
13
13
  defaultValue,
14
14
  isInteger,
15
15
  isObject
16
- } from "../__chunks/I2VQ3XGR.js";
17
- import "../__chunks/DLOEKDPY.js";
16
+ } from "../__chunks/22HHDS5F.js";
17
+ import "../__chunks/RRSZHCH6.js";
18
18
  import {
19
19
  __spreadProps,
20
20
  __spreadValues
@@ -12,14 +12,16 @@ export interface HovercardStoreState extends PopoverStoreState {
12
12
  placement: PopoverStoreState["placement"];
13
13
  /**
14
14
  * The amount of time in milliseconds to wait before showing and hiding the
15
- * popover. To control the delay for showing and hiding separately, use
16
- * `showTimeout` and `hideTimeout`.
15
+ * popup. To control the delay for showing and hiding separately, use
16
+ * [`showTimeout`](https://ariakit.org/reference/hovercard-provider#showtimeout)
17
+ * and
18
+ * [`hideTimeout`](https://ariakit.org/reference/hovercard-provider#hidetimeout).
17
19
  * @default 500
18
20
  */
19
21
  timeout: number;
20
22
  /**
21
- * The amount of time in milliseconds to wait before **showing** the popover.
22
- * It defaults to the value passed to
23
+ * The amount of time in milliseconds to wait before _showing_ the popup. It
24
+ * defaults to the value passed to
23
25
  * [`timeout`](https://ariakit.org/reference/hovercard-provider#timeout).
24
26
  *
25
27
  * Live examples:
@@ -29,16 +31,18 @@ export interface HovercardStoreState extends PopoverStoreState {
29
31
  */
30
32
  showTimeout?: number;
31
33
  /**
32
- * The amount of time in milliseconds to wait before **hiding** the popover.
33
- * It defaults to the value passed to
34
+ * The amount of time in milliseconds to wait before _hiding_ the popup. It
35
+ * defaults to the value passed to
34
36
  * [`timeout`](https://ariakit.org/reference/hovercard-provider#timeout).
35
37
  *
36
38
  * Live examples:
37
39
  * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
40
+ * - [Tooltip with Framer
41
+ * Motion](https://ariakit.org/examples/tooltip-framer-motion)
38
42
  */
39
43
  hideTimeout?: number;
40
44
  /**
41
- * Whether the popover or an element inside it should be focused when it is
45
+ * Whether the popup or an element inside it should be focused when it is
42
46
  * shown.
43
47
  * @default false
44
48
  */
@@ -47,6 +51,9 @@ export interface HovercardStoreState extends PopoverStoreState {
47
51
  export interface HovercardStoreFunctions extends PopoverStoreFunctions {
48
52
  /**
49
53
  * Sets the `autoFocusOnShow` state.
54
+ *
55
+ * Live examples:
56
+ * - [Sliding Menu](https://ariakit.org/examples/menu-slide)
50
57
  */
51
58
  setAutoFocusOnShow: SetState<HovercardStoreState["autoFocusOnShow"]>;
52
59
  }