@ariakit/core 0.3.8 → 0.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/cjs/__chunks/{2UK5WUJX.cjs → 5CBCKBZ2.cjs} +0 -2
  3. package/cjs/__chunks/{3J44Z7YH.cjs → CWDUO5EV.cjs} +4 -4
  4. package/cjs/__chunks/{5SIVMOID.cjs → HMO4CKUP.cjs} +4 -4
  5. package/cjs/__chunks/{2LS4JJ4S.cjs → MFSCSSBJ.cjs} +2 -2
  6. package/cjs/__chunks/{GJFZ5ZPP.cjs → MWNFQD55.cjs} +11 -11
  7. package/cjs/__chunks/{EFIT5L4X.cjs → Y6PHIDP6.cjs} +7 -7
  8. package/cjs/__chunks/{ZQTYFYRS.cjs → YLMJBIQM.cjs} +26 -21
  9. package/cjs/__chunks/{QAZ4PF7S.cjs → ZXCB7MXN.cjs} +6 -6
  10. package/cjs/checkbox/checkbox-store.cjs +3 -3
  11. package/cjs/checkbox/checkbox-store.d.cts +5 -2
  12. package/cjs/checkbox/checkbox-store.d.ts +5 -2
  13. package/cjs/collection/collection-store.cjs +3 -3
  14. package/cjs/collection/collection-store.d.cts +11 -11
  15. package/cjs/collection/collection-store.d.ts +11 -11
  16. package/cjs/combobox/combobox-store.cjs +20 -20
  17. package/cjs/combobox/combobox-store.d.cts +5 -1
  18. package/cjs/combobox/combobox-store.d.ts +5 -1
  19. package/cjs/composite/composite-overflow-store.cjs +5 -5
  20. package/cjs/composite/composite-store.cjs +4 -4
  21. package/cjs/composite/composite-store.d.cts +134 -53
  22. package/cjs/composite/composite-store.d.ts +134 -53
  23. package/cjs/dialog/dialog-store.cjs +4 -4
  24. package/cjs/disclosure/disclosure-store.cjs +3 -3
  25. package/cjs/disclosure/disclosure-store.d.cts +33 -27
  26. package/cjs/disclosure/disclosure-store.d.ts +33 -27
  27. package/cjs/form/form-store.cjs +7 -7
  28. package/cjs/form/form-store.d.cts +34 -25
  29. package/cjs/form/form-store.d.ts +34 -25
  30. package/cjs/hovercard/hovercard-store.cjs +6 -6
  31. package/cjs/hovercard/hovercard-store.d.cts +6 -2
  32. package/cjs/hovercard/hovercard-store.d.ts +6 -2
  33. package/cjs/menu/menu-bar-store.cjs +5 -5
  34. package/cjs/menu/menu-store.cjs +18 -18
  35. package/cjs/menu/menu-store.d.cts +12 -2
  36. package/cjs/menu/menu-store.d.ts +12 -2
  37. package/cjs/menubar/menubar-store.cjs +5 -5
  38. package/cjs/popover/popover-store.cjs +5 -5
  39. package/cjs/popover/popover-store.d.cts +2 -0
  40. package/cjs/popover/popover-store.d.ts +2 -0
  41. package/cjs/radio/radio-store.cjs +5 -5
  42. package/cjs/select/select-store.cjs +18 -18
  43. package/cjs/tab/tab-store.cjs +15 -15
  44. package/cjs/tab/tab-store.d.cts +15 -4
  45. package/cjs/tab/tab-store.d.ts +15 -4
  46. package/cjs/toolbar/toolbar-store.cjs +4 -4
  47. package/cjs/tooltip/tooltip-store.cjs +7 -7
  48. package/cjs/utils/store.cjs +2 -2
  49. package/esm/__chunks/{LT2OYWRD.js → 25MEC56I.js} +1 -1
  50. package/esm/__chunks/{J6JIOWCS.js → AKMSZ36N.js} +2 -2
  51. package/esm/__chunks/{A2J4XZ5T.js → K6ELJFXN.js} +0 -2
  52. package/esm/__chunks/{NKLTHWCR.js → L5RYKTVQ.js} +1 -1
  53. package/esm/__chunks/{HMQYEBKF.js → MYUKSFP5.js} +20 -15
  54. package/esm/__chunks/{T3DVYGXI.js → QJ5CUA32.js} +2 -2
  55. package/esm/__chunks/{A2AGSVJO.js → UUFF4PQ6.js} +2 -2
  56. package/esm/__chunks/{CTZ2GQIZ.js → VEUNYQYR.js} +2 -2
  57. package/esm/checkbox/checkbox-store.d.ts +5 -2
  58. package/esm/checkbox/checkbox-store.js +1 -1
  59. package/esm/collection/collection-store.d.ts +11 -11
  60. package/esm/collection/collection-store.js +2 -2
  61. package/esm/combobox/combobox-store.d.ts +5 -1
  62. package/esm/combobox/combobox-store.js +6 -6
  63. package/esm/composite/composite-overflow-store.js +4 -4
  64. package/esm/composite/composite-store.d.ts +134 -53
  65. package/esm/composite/composite-store.js +3 -3
  66. package/esm/dialog/dialog-store.js +3 -3
  67. package/esm/disclosure/disclosure-store.d.ts +33 -27
  68. package/esm/disclosure/disclosure-store.js +2 -2
  69. package/esm/form/form-store.d.ts +34 -25
  70. package/esm/form/form-store.js +2 -2
  71. package/esm/hovercard/hovercard-store.d.ts +6 -2
  72. package/esm/hovercard/hovercard-store.js +5 -5
  73. package/esm/menu/menu-bar-store.js +4 -4
  74. package/esm/menu/menu-store.d.ts +12 -2
  75. package/esm/menu/menu-store.js +7 -7
  76. package/esm/menubar/menubar-store.js +4 -4
  77. package/esm/popover/popover-store.d.ts +2 -0
  78. package/esm/popover/popover-store.js +4 -4
  79. package/esm/radio/radio-store.js +3 -3
  80. package/esm/select/select-store.js +6 -6
  81. package/esm/tab/tab-store.d.ts +15 -4
  82. package/esm/tab/tab-store.js +3 -3
  83. package/esm/toolbar/toolbar-store.js +3 -3
  84. package/esm/tooltip/tooltip-store.js +5 -5
  85. package/esm/utils/store.js +1 -1
  86. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @ariakit/core
2
2
 
3
+ ## 0.3.10
4
+
5
+ - Fixed [`CompositeItem`](https://ariakit.org/reference/composite-item) triggering blur on focus.
6
+ - Improved JSDocs.
7
+
8
+ ## 0.3.9
9
+
10
+ - Fixed `Maximum update depth exceeded` warning when rendering multiple collection items on the page.
11
+ - Improved JSDocs.
12
+
3
13
  ## 0.3.8
4
14
 
5
15
  - Fixed [`CollectionItem`](https://ariakit.org/reference/collection-item) elements getting out of order when composing stores.
@@ -37,8 +37,6 @@ function createStore(initialState, ...stores) {
37
37
  return () => setups.delete(callback);
38
38
  };
39
39
  const storeInit = () => {
40
- if (!stores.length)
41
- return _3UT5FE6Kcjs.noop;
42
40
  const initialized = instances.size;
43
41
  const instance = Symbol();
44
42
  instances.add(instance);
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _QAZ4PF7Scjs = require('./QAZ4PF7S.cjs');
4
+ var _ZXCB7MXNcjs = require('./ZXCB7MXN.cjs');
5
5
 
6
6
 
7
- var _2UK5WUJXcjs = require('./2UK5WUJX.cjs');
7
+ var _5CBCKBZ2cjs = require('./5CBCKBZ2.cjs');
8
8
 
9
9
 
10
10
  var _3UT5FE6Kcjs = require('./3UT5FE6K.cjs');
@@ -17,7 +17,7 @@ var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
17
17
  function createMenubarStore(props = {}) {
18
18
  var _a;
19
19
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
20
- const composite = _QAZ4PF7Scjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
20
+ const composite = _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
21
21
  orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
22
22
  props.orientation,
23
23
  syncState == null ? void 0 : syncState.orientation,
@@ -26,7 +26,7 @@ function createMenubarStore(props = {}) {
26
26
  focusLoop: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
27
27
  }));
28
28
  const initialState = _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState());
29
- const menubar = _2UK5WUJXcjs.createStore.call(void 0, initialState, composite, props.store);
29
+ const menubar = _5CBCKBZ2cjs.createStore.call(void 0, initialState, composite, props.store);
30
30
  return _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite), menubar);
31
31
  }
32
32
 
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _EFIT5L4Xcjs = require('./EFIT5L4X.cjs');
4
+ var _Y6PHIDP6cjs = require('./Y6PHIDP6.cjs');
5
5
 
6
6
 
7
- var _2UK5WUJXcjs = require('./2UK5WUJX.cjs');
7
+ var _5CBCKBZ2cjs = require('./5CBCKBZ2.cjs');
8
8
 
9
9
 
10
10
  var _3UT5FE6Kcjs = require('./3UT5FE6K.cjs');
@@ -17,7 +17,7 @@ var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
17
17
  function createHovercardStore(props = {}) {
18
18
  var _a;
19
19
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
20
- const popover = _EFIT5L4Xcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
20
+ const popover = _Y6PHIDP6cjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
21
21
  placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
22
22
  props.placement,
23
23
  syncState == null ? void 0 : syncState.placement,
@@ -31,7 +31,7 @@ function createHovercardStore(props = {}) {
31
31
  hideTimeout: _3UT5FE6Kcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
32
32
  autoFocusOnShow: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
33
33
  });
34
- const hovercard = _2UK5WUJXcjs.createStore.call(void 0, initialState, popover, props.store);
34
+ const hovercard = _5CBCKBZ2cjs.createStore.call(void 0, initialState, popover, props.store);
35
35
  return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover), hovercard), {
36
36
  setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
37
37
  });
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _GJFZ5ZPPcjs = require('./GJFZ5ZPP.cjs');
4
+ var _MWNFQD55cjs = require('./MWNFQD55.cjs');
5
5
 
6
6
  // src/dialog/dialog-store.ts
7
7
  function createDialogStore(props = {}) {
8
- return _GJFZ5ZPPcjs.createDisclosureStore.call(void 0, props);
8
+ return _MWNFQD55cjs.createDisclosureStore.call(void 0, props);
9
9
  }
10
10
 
11
11
 
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
 
10
- var _2UK5WUJXcjs = require('./2UK5WUJX.cjs');
10
+ var _5CBCKBZ2cjs = require('./5CBCKBZ2.cjs');
11
11
 
12
12
 
13
13
  var _3UT5FE6Kcjs = require('./3UT5FE6K.cjs');
@@ -18,11 +18,11 @@ var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
18
18
 
19
19
  // src/disclosure/disclosure-store.ts
20
20
  function createDisclosureStore(props = {}) {
21
- const store = _2UK5WUJXcjs.mergeStore.call(void 0,
21
+ const store = _5CBCKBZ2cjs.mergeStore.call(void 0,
22
22
  props.store,
23
- _2UK5WUJXcjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
23
+ _5CBCKBZ2cjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
24
24
  );
25
- _2UK5WUJXcjs.throwOnConflictingProps.call(void 0, props, store);
25
+ _5CBCKBZ2cjs.throwOnConflictingProps.call(void 0, props, store);
26
26
  const syncState = store == null ? void 0 : store.getState();
27
27
  const open = _3UT5FE6Kcjs.defaultValue.call(void 0,
28
28
  props.open,
@@ -39,26 +39,26 @@ function createDisclosureStore(props = {}) {
39
39
  contentElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
40
40
  disclosureElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
41
41
  };
42
- const disclosure = _2UK5WUJXcjs.createStore.call(void 0, initialState, store);
43
- _2UK5WUJXcjs.setup.call(void 0,
42
+ const disclosure = _5CBCKBZ2cjs.createStore.call(void 0, initialState, store);
43
+ _5CBCKBZ2cjs.setup.call(void 0,
44
44
  disclosure,
45
- () => _2UK5WUJXcjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
45
+ () => _5CBCKBZ2cjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
46
46
  if (state.animated)
47
47
  return;
48
48
  disclosure.setState("animating", false);
49
49
  })
50
50
  );
51
- _2UK5WUJXcjs.setup.call(void 0,
51
+ _5CBCKBZ2cjs.setup.call(void 0,
52
52
  disclosure,
53
- () => _2UK5WUJXcjs.subscribe.call(void 0, disclosure, ["open"], () => {
53
+ () => _5CBCKBZ2cjs.subscribe.call(void 0, disclosure, ["open"], () => {
54
54
  if (!disclosure.getState().animated)
55
55
  return;
56
56
  disclosure.setState("animating", true);
57
57
  })
58
58
  );
59
- _2UK5WUJXcjs.setup.call(void 0,
59
+ _5CBCKBZ2cjs.setup.call(void 0,
60
60
  disclosure,
61
- () => _2UK5WUJXcjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
61
+ () => _5CBCKBZ2cjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
62
62
  disclosure.setState("mounted", state.open || state.animating);
63
63
  })
64
64
  );
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _2LS4JJ4Scjs = require('./2LS4JJ4S.cjs');
4
+ var _MFSCSSBJcjs = require('./MFSCSSBJ.cjs');
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _2UK5WUJXcjs = require('./2UK5WUJX.cjs');
10
+ var _5CBCKBZ2cjs = require('./5CBCKBZ2.cjs');
11
11
 
12
12
 
13
13
  var _3UT5FE6Kcjs = require('./3UT5FE6K.cjs');
@@ -24,9 +24,9 @@ function createPopoverStore(_a = {}) {
24
24
  } = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, [
25
25
  "popover"
26
26
  ]);
27
- const store = _2UK5WUJXcjs.mergeStore.call(void 0,
27
+ const store = _5CBCKBZ2cjs.mergeStore.call(void 0,
28
28
  props.store,
29
- _2UK5WUJXcjs.omit.call(void 0, otherPopover, [
29
+ _5CBCKBZ2cjs.omit.call(void 0, otherPopover, [
30
30
  "arrowElement",
31
31
  "anchorElement",
32
32
  "contentElement",
@@ -34,9 +34,9 @@ function createPopoverStore(_a = {}) {
34
34
  "disclosureElement"
35
35
  ])
36
36
  );
37
- _2UK5WUJXcjs.throwOnConflictingProps.call(void 0, props, store);
37
+ _5CBCKBZ2cjs.throwOnConflictingProps.call(void 0, props, store);
38
38
  const syncState = store == null ? void 0 : store.getState();
39
- const dialog = _2LS4JJ4Scjs.createDialogStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), { store }));
39
+ const dialog = _MFSCSSBJcjs.createDialogStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), { store }));
40
40
  const placement = _3UT5FE6Kcjs.defaultValue.call(void 0,
41
41
  props.placement,
42
42
  syncState == null ? void 0 : syncState.placement,
@@ -50,7 +50,7 @@ function createPopoverStore(_a = {}) {
50
50
  arrowElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
51
51
  rendered: Symbol("rendered")
52
52
  });
53
- const popover = _2UK5WUJXcjs.createStore.call(void 0, initialState, dialog, store);
53
+ const popover = _5CBCKBZ2cjs.createStore.call(void 0, initialState, dialog, store);
54
54
  return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, dialog), popover), {
55
55
  setAnchorElement: (element) => popover.setState("anchorElement", element),
56
56
  setPopoverElement: (element) => popover.setState("popoverElement", element),
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var _2UK5WUJXcjs = require('./2UK5WUJX.cjs');
8
+ var _5CBCKBZ2cjs = require('./5CBCKBZ2.cjs');
9
9
 
10
10
 
11
11
 
@@ -69,7 +69,7 @@ function getPrivateStore(store) {
69
69
  }
70
70
  function createCollectionStore(props = {}) {
71
71
  var _a;
72
- _2UK5WUJXcjs.throwOnConflictingProps.call(void 0, props, props.store);
72
+ _5CBCKBZ2cjs.throwOnConflictingProps.call(void 0, props, props.store);
73
73
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
74
74
  const items = _3UT5FE6Kcjs.defaultValue.call(void 0,
75
75
  props.items,
@@ -83,39 +83,44 @@ function createCollectionStore(props = {}) {
83
83
  renderedItems: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
84
84
  };
85
85
  const syncPrivateStore = getPrivateStore(props.store);
86
- const privateStore = _2UK5WUJXcjs.createStore.call(void 0,
86
+ const privateStore = _5CBCKBZ2cjs.createStore.call(void 0,
87
87
  { renderedItems: initialState.renderedItems },
88
88
  syncPrivateStore
89
89
  );
90
- const collection = _2UK5WUJXcjs.createStore.call(void 0, initialState, props.store);
91
- const sortItems = () => {
92
- const state = privateStore.getState();
93
- const renderedItems = sortBasedOnDOMPosition(state.renderedItems);
94
- privateStore.setState("renderedItems", renderedItems);
95
- collection.setState("renderedItems", renderedItems);
90
+ const collection = _5CBCKBZ2cjs.createStore.call(void 0, initialState, props.store);
91
+ const sortItems = (renderedItems) => {
92
+ const sortedItems = sortBasedOnDOMPosition(renderedItems);
93
+ privateStore.setState("renderedItems", sortedItems);
94
+ collection.setState("renderedItems", sortedItems);
96
95
  };
97
- _2UK5WUJXcjs.setup.call(void 0, collection, () => _2UK5WUJXcjs.init.call(void 0, privateStore));
98
- _2UK5WUJXcjs.setup.call(void 0, privateStore, () => {
99
- return _2UK5WUJXcjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
96
+ _5CBCKBZ2cjs.setup.call(void 0, collection, () => _5CBCKBZ2cjs.init.call(void 0, privateStore));
97
+ _5CBCKBZ2cjs.setup.call(void 0, privateStore, () => {
98
+ return _5CBCKBZ2cjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
100
99
  let firstRun = true;
101
- let raf = requestAnimationFrame(sortItems);
102
- if (typeof IntersectionObserver !== "function")
103
- return;
104
- const callback = () => {
100
+ let raf = requestAnimationFrame(() => {
101
+ const { renderedItems } = collection.getState();
102
+ if (state.renderedItems === renderedItems)
103
+ return;
104
+ sortItems(state.renderedItems);
105
+ });
106
+ if (typeof IntersectionObserver !== "function") {
107
+ return () => cancelAnimationFrame(raf);
108
+ }
109
+ const ioCallback = () => {
105
110
  if (firstRun) {
106
111
  firstRun = false;
107
112
  return;
108
113
  }
109
114
  cancelAnimationFrame(raf);
110
- raf = requestAnimationFrame(sortItems);
115
+ raf = requestAnimationFrame(() => sortItems(state.renderedItems));
111
116
  };
112
117
  const root = getCommonParent(state.renderedItems);
113
- const observer = new IntersectionObserver(callback, { root });
114
- state.renderedItems.forEach((item) => {
118
+ const observer = new IntersectionObserver(ioCallback, { root });
119
+ for (const item of state.renderedItems) {
115
120
  if (!item.element)
116
- return;
121
+ continue;
117
122
  observer.observe(item.element);
118
- });
123
+ }
119
124
  return () => {
120
125
  cancelAnimationFrame(raf);
121
126
  observer.disconnect();
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _ZQTYFYRScjs = require('./ZQTYFYRS.cjs');
4
+ var _YLMJBIQMcjs = require('./YLMJBIQM.cjs');
5
5
 
6
6
 
7
7
 
8
8
 
9
- var _2UK5WUJXcjs = require('./2UK5WUJX.cjs');
9
+ var _5CBCKBZ2cjs = require('./5CBCKBZ2.cjs');
10
10
 
11
11
 
12
12
  var _3UT5FE6Kcjs = require('./3UT5FE6K.cjs');
@@ -124,7 +124,7 @@ function verticalizeItems(items) {
124
124
  function createCompositeStore(props = {}) {
125
125
  var _a;
126
126
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
127
- const collection = _ZQTYFYRScjs.createCollectionStore.call(void 0, props);
127
+ const collection = _YLMJBIQMcjs.createCollectionStore.call(void 0, props);
128
128
  const activeId = _3UT5FE6Kcjs.defaultValue.call(void 0,
129
129
  props.activeId,
130
130
  syncState == null ? void 0 : syncState.activeId,
@@ -154,10 +154,10 @@ function createCompositeStore(props = {}) {
154
154
  focusWrap: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
155
155
  focusShift: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
156
156
  });
157
- const composite = _2UK5WUJXcjs.createStore.call(void 0, initialState, collection, props.store);
158
- _2UK5WUJXcjs.setup.call(void 0,
157
+ const composite = _5CBCKBZ2cjs.createStore.call(void 0, initialState, collection, props.store);
158
+ _5CBCKBZ2cjs.setup.call(void 0,
159
159
  composite,
160
- () => _2UK5WUJXcjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
160
+ () => _5CBCKBZ2cjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
161
161
  composite.setState("activeId", (activeId2) => {
162
162
  var _a2;
163
163
  if (activeId2 !== void 0)
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
5
+ var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
6
6
 
7
7
 
8
8
  var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
@@ -14,7 +14,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
14
14
  // src/checkbox/checkbox-store.ts
15
15
  function createCheckboxStore(props = {}) {
16
16
  var _a;
17
- _2UK5WUJXcjs.throwOnConflictingProps.call(void 0, props, props.store);
17
+ _5CBCKBZ2cjs.throwOnConflictingProps.call(void 0, props, props.store);
18
18
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
19
19
  const initialState = {
20
20
  value: _3UT5FE6Kcjs.defaultValue.call(void 0,
@@ -24,7 +24,7 @@ function createCheckboxStore(props = {}) {
24
24
  false
25
25
  )
26
26
  };
27
- const checkbox = _2UK5WUJXcjs.createStore.call(void 0, initialState, props.store);
27
+ const checkbox = _5CBCKBZ2cjs.createStore.call(void 0, initialState, props.store);
28
28
  return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, checkbox), {
29
29
  setValue: (value) => checkbox.setState("value", value)
30
30
  });
@@ -17,7 +17,8 @@ export interface CheckboxStoreState<T extends CheckboxStoreValue = CheckboxStore
17
17
  }
18
18
  export interface CheckboxStoreFunctions<T extends CheckboxStoreValue = CheckboxStoreValue> {
19
19
  /**
20
- * Sets the `value` state.
20
+ * Sets the [`value`](https://ariakit.org/reference/checkbox-provider#value)
21
+ * state.
21
22
  * @example
22
23
  * store.setValue(true);
23
24
  * store.setValue((value) => !value);
@@ -26,7 +27,9 @@ export interface CheckboxStoreFunctions<T extends CheckboxStoreValue = CheckboxS
26
27
  }
27
28
  export interface CheckboxStoreOptions<T extends CheckboxStoreValue = CheckboxStoreValue> extends StoreOptions<CheckboxStoreState<T>, "value"> {
28
29
  /**
29
- * The default value of the checkbox.
30
+ * The default
31
+ * [`value`](https://ariakit.org/reference/checkbox-provider#value) state of
32
+ * the checkbox.
30
33
  *
31
34
  * Live examples:
32
35
  * - [Custom Checkbox](https://ariakit.org/examples/checkbox-custom)
@@ -17,7 +17,8 @@ export interface CheckboxStoreState<T extends CheckboxStoreValue = CheckboxStore
17
17
  }
18
18
  export interface CheckboxStoreFunctions<T extends CheckboxStoreValue = CheckboxStoreValue> {
19
19
  /**
20
- * Sets the `value` state.
20
+ * Sets the [`value`](https://ariakit.org/reference/checkbox-provider#value)
21
+ * state.
21
22
  * @example
22
23
  * store.setValue(true);
23
24
  * store.setValue((value) => !value);
@@ -26,7 +27,9 @@ export interface CheckboxStoreFunctions<T extends CheckboxStoreValue = CheckboxS
26
27
  }
27
28
  export interface CheckboxStoreOptions<T extends CheckboxStoreValue = CheckboxStoreValue> extends StoreOptions<CheckboxStoreState<T>, "value"> {
28
29
  /**
29
- * The default value of the checkbox.
30
+ * The default
31
+ * [`value`](https://ariakit.org/reference/checkbox-provider#value) state of
32
+ * the checkbox.
30
33
  *
31
34
  * Live examples:
32
35
  * - [Custom Checkbox](https://ariakit.org/examples/checkbox-custom)
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _ZQTYFYRScjs = require('../__chunks/ZQTYFYRS.cjs');
5
- require('../__chunks/2UK5WUJX.cjs');
4
+ var _YLMJBIQMcjs = require('../__chunks/YLMJBIQM.cjs');
5
+ require('../__chunks/5CBCKBZ2.cjs');
6
6
  require('../__chunks/3UT5FE6K.cjs');
7
7
  require('../__chunks/5F4DVUNS.cjs');
8
8
  require('../__chunks/AV6KTKLE.cjs');
9
9
 
10
10
 
11
- exports.createCollectionStore = _ZQTYFYRScjs.createCollectionStore;
11
+ exports.createCollectionStore = _YLMJBIQMcjs.createCollectionStore;
@@ -16,16 +16,18 @@ export interface CollectionStoreItem {
16
16
  }
17
17
  export interface CollectionStoreState<T extends CollectionStoreItem = CollectionStoreItem> {
18
18
  /**
19
- * Lists all the items with their meta data. This state is automatically
20
- * updated when an item is registered or unregistered with the `registerItem`
19
+ * Lists all items along with their metadata. This state is automatically
20
+ * updated when an item is registered or unregistered using the
21
+ * [`registerItem`](https://ariakit.org/reference/use-collection-store#registeritem)
21
22
  * function.
22
23
  */
23
24
  items: T[];
24
25
  /**
25
- * Lists all the items that are currently rendered. This state is
26
- * automatically updated when an item is rendered or unrendered with the
27
- * `renderItem` function. This state is also automatically sorted based on
28
- * their DOM position.
26
+ * Lists all items, along with their metadata, in the exact order they appear in
27
+ * the DOM. This state is automatically updated when an item is rendered or
28
+ * unmounted using the
29
+ * [`renderItem`](https://ariakit.org/reference/use-collection-store#renderitem)
30
+ * function.
29
31
  */
30
32
  renderedItems: T[];
31
33
  }
@@ -33,7 +35,6 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
33
35
  /**
34
36
  * Registers an item in the collection. This function returns a cleanup
35
37
  * function that unregisters the item.
36
- * @param item The item to register.
37
38
  * @example
38
39
  * const unregisterItem = store.registerItem({ id: "item-1" });
39
40
  * // on cleanup
@@ -42,8 +43,7 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
42
43
  registerItem: BivariantCallback<(item: T) => () => void>;
43
44
  /**
44
45
  * Renders an item in the collection. This function returns a cleanup function
45
- * that unrenders the item.
46
- * @param item The item to render.
46
+ * that unmounts the item.
47
47
  * @example
48
48
  * const unrenderItem = store.renderItem({ id: "item-1" });
49
49
  * // on cleanup
@@ -52,7 +52,6 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
52
52
  renderItem: BivariantCallback<(item: T) => () => void>;
53
53
  /**
54
54
  * Gets an item by its id.
55
- * @param id The id of the item.
56
55
  * @example
57
56
  * const item = store.item("item-1");
58
57
  */
@@ -60,7 +59,8 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
60
59
  }
61
60
  export interface CollectionStoreOptions<T extends CollectionStoreItem = CollectionStoreItem> extends StoreOptions<CollectionStoreState<T>, "items"> {
62
61
  /**
63
- * The defaut value for the `items` state.
62
+ * The defaut value for the
63
+ * [`items`](https://ariakit.org/reference/collection-provider#items) state.
64
64
  * @default []
65
65
  */
66
66
  defaultItems?: CollectionStoreState<T>["items"];
@@ -16,16 +16,18 @@ export interface CollectionStoreItem {
16
16
  }
17
17
  export interface CollectionStoreState<T extends CollectionStoreItem = CollectionStoreItem> {
18
18
  /**
19
- * Lists all the items with their meta data. This state is automatically
20
- * updated when an item is registered or unregistered with the `registerItem`
19
+ * Lists all items along with their metadata. This state is automatically
20
+ * updated when an item is registered or unregistered using the
21
+ * [`registerItem`](https://ariakit.org/reference/use-collection-store#registeritem)
21
22
  * function.
22
23
  */
23
24
  items: T[];
24
25
  /**
25
- * Lists all the items that are currently rendered. This state is
26
- * automatically updated when an item is rendered or unrendered with the
27
- * `renderItem` function. This state is also automatically sorted based on
28
- * their DOM position.
26
+ * Lists all items, along with their metadata, in the exact order they appear in
27
+ * the DOM. This state is automatically updated when an item is rendered or
28
+ * unmounted using the
29
+ * [`renderItem`](https://ariakit.org/reference/use-collection-store#renderitem)
30
+ * function.
29
31
  */
30
32
  renderedItems: T[];
31
33
  }
@@ -33,7 +35,6 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
33
35
  /**
34
36
  * Registers an item in the collection. This function returns a cleanup
35
37
  * function that unregisters the item.
36
- * @param item The item to register.
37
38
  * @example
38
39
  * const unregisterItem = store.registerItem({ id: "item-1" });
39
40
  * // on cleanup
@@ -42,8 +43,7 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
42
43
  registerItem: BivariantCallback<(item: T) => () => void>;
43
44
  /**
44
45
  * Renders an item in the collection. This function returns a cleanup function
45
- * that unrenders the item.
46
- * @param item The item to render.
46
+ * that unmounts the item.
47
47
  * @example
48
48
  * const unrenderItem = store.renderItem({ id: "item-1" });
49
49
  * // on cleanup
@@ -52,7 +52,6 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
52
52
  renderItem: BivariantCallback<(item: T) => () => void>;
53
53
  /**
54
54
  * Gets an item by its id.
55
- * @param id The id of the item.
56
55
  * @example
57
56
  * const item = store.item("item-1");
58
57
  */
@@ -60,7 +59,8 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
60
59
  }
61
60
  export interface CollectionStoreOptions<T extends CollectionStoreItem = CollectionStoreItem> extends StoreOptions<CollectionStoreState<T>, "items"> {
62
61
  /**
63
- * The defaut value for the `items` state.
62
+ * The defaut value for the
63
+ * [`items`](https://ariakit.org/reference/collection-provider#items) state.
64
64
  * @default []
65
65
  */
66
66
  defaultItems?: CollectionStoreState<T>["items"];
@@ -1,20 +1,20 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _EFIT5L4Xcjs = require('../__chunks/EFIT5L4X.cjs');
5
- require('../__chunks/2LS4JJ4S.cjs');
6
- require('../__chunks/GJFZ5ZPP.cjs');
4
+ var _Y6PHIDP6cjs = require('../__chunks/Y6PHIDP6.cjs');
5
+ require('../__chunks/MFSCSSBJ.cjs');
6
+ require('../__chunks/MWNFQD55.cjs');
7
7
 
8
8
 
9
- var _QAZ4PF7Scjs = require('../__chunks/QAZ4PF7S.cjs');
10
- require('../__chunks/ZQTYFYRS.cjs');
9
+ var _ZXCB7MXNcjs = require('../__chunks/ZXCB7MXN.cjs');
10
+ require('../__chunks/YLMJBIQM.cjs');
11
11
 
12
12
 
13
13
 
14
14
 
15
15
 
16
16
 
17
- var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
17
+ var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
18
18
 
19
19
 
20
20
  var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
@@ -33,7 +33,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
33
33
  var isSafariOnMobile = _YIUPKKEKcjs.isSafari.call(void 0, ) && _YIUPKKEKcjs.isTouchDevice.call(void 0, );
34
34
  function createComboboxStore(props = {}) {
35
35
  var _a;
36
- _2UK5WUJXcjs.throwOnConflictingProps.call(void 0, props, props.store);
36
+ _5CBCKBZ2cjs.throwOnConflictingProps.call(void 0, props, props.store);
37
37
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
38
38
  const activeId = _3UT5FE6Kcjs.defaultValue.call(void 0,
39
39
  props.activeId,
@@ -41,7 +41,7 @@ function createComboboxStore(props = {}) {
41
41
  props.defaultActiveId,
42
42
  null
43
43
  );
44
- const composite = _QAZ4PF7Scjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
44
+ const composite = _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
45
45
  activeId,
46
46
  includesBaseElement: _3UT5FE6Kcjs.defaultValue.call(void 0,
47
47
  props.includesBaseElement,
@@ -61,7 +61,7 @@ function createComboboxStore(props = {}) {
61
61
  !isSafariOnMobile
62
62
  )
63
63
  }));
64
- const popover = _EFIT5L4Xcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
64
+ const popover = _Y6PHIDP6cjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
65
65
  placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
66
66
  props.placement,
67
67
  syncState == null ? void 0 : syncState.placement,
@@ -96,10 +96,10 @@ function createComboboxStore(props = {}) {
96
96
  ),
97
97
  activeValue: syncState == null ? void 0 : syncState.activeValue
98
98
  });
99
- const combobox = _2UK5WUJXcjs.createStore.call(void 0, initialState, composite, popover, props.store);
100
- _2UK5WUJXcjs.setup.call(void 0,
99
+ const combobox = _5CBCKBZ2cjs.createStore.call(void 0, initialState, composite, popover, props.store);
100
+ _5CBCKBZ2cjs.setup.call(void 0,
101
101
  combobox,
102
- () => _2UK5WUJXcjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
102
+ () => _5CBCKBZ2cjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
103
103
  if (!state.resetValueOnHide)
104
104
  return;
105
105
  if (state.mounted)
@@ -107,34 +107,34 @@ function createComboboxStore(props = {}) {
107
107
  combobox.setState("value", value);
108
108
  })
109
109
  );
110
- _2UK5WUJXcjs.setup.call(void 0,
110
+ _5CBCKBZ2cjs.setup.call(void 0,
111
111
  combobox,
112
- () => _2UK5WUJXcjs.sync.call(void 0, combobox, ["resetValueOnSelect", "selectedValue"], (state) => {
112
+ () => _5CBCKBZ2cjs.sync.call(void 0, combobox, ["resetValueOnSelect", "selectedValue"], (state) => {
113
113
  if (!state.resetValueOnSelect)
114
114
  return;
115
115
  combobox.setState("value", value);
116
116
  })
117
117
  );
118
- _2UK5WUJXcjs.setup.call(void 0,
118
+ _5CBCKBZ2cjs.setup.call(void 0,
119
119
  combobox,
120
- () => _2UK5WUJXcjs.batch.call(void 0, combobox, ["mounted"], (state) => {
120
+ () => _5CBCKBZ2cjs.batch.call(void 0, combobox, ["mounted"], (state) => {
121
121
  if (state.mounted)
122
122
  return;
123
123
  combobox.setState("activeId", activeId);
124
124
  combobox.setState("moves", 0);
125
125
  })
126
126
  );
127
- _2UK5WUJXcjs.setup.call(void 0,
127
+ _5CBCKBZ2cjs.setup.call(void 0,
128
128
  combobox,
129
- () => _2UK5WUJXcjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
129
+ () => _5CBCKBZ2cjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
130
130
  if (state.moves === prevState.moves) {
131
131
  combobox.setState("activeValue", void 0);
132
132
  }
133
133
  })
134
134
  );
135
- _2UK5WUJXcjs.setup.call(void 0,
135
+ _5CBCKBZ2cjs.setup.call(void 0,
136
136
  combobox,
137
- () => _2UK5WUJXcjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
137
+ () => _5CBCKBZ2cjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
138
138
  if (state.moves === prev.moves)
139
139
  return;
140
140
  const { activeId: activeId2 } = combobox.getState();