@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
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _EFIT5L4Xcjs = require('../__chunks/EFIT5L4X.cjs');
5
- require('../__chunks/2LS4JJ4S.cjs');
6
- require('../__chunks/GJFZ5ZPP.cjs');
7
- require('../__chunks/2UK5WUJX.cjs');
4
+ var _Y6PHIDP6cjs = require('../__chunks/Y6PHIDP6.cjs');
5
+ require('../__chunks/MFSCSSBJ.cjs');
6
+ require('../__chunks/MWNFQD55.cjs');
7
+ require('../__chunks/5CBCKBZ2.cjs');
8
8
  require('../__chunks/3UT5FE6K.cjs');
9
9
  require('../__chunks/AV6KTKLE.cjs');
10
10
 
11
11
 
12
- exports.createPopoverStore = _EFIT5L4Xcjs.createPopoverStore;
12
+ exports.createPopoverStore = _Y6PHIDP6cjs.createPopoverStore;
@@ -31,6 +31,8 @@ export interface PopoverStoreState extends DialogStoreState {
31
31
  *
32
32
  * Live examples:
33
33
  * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
34
+ * - [Submenu with
35
+ * Combobox](https://ariakit.org/examples/menu-nested-combobox)
34
36
  * @default "bottom"
35
37
  */
36
38
  placement: Placement;
@@ -31,6 +31,8 @@ export interface PopoverStoreState extends DialogStoreState {
31
31
  *
32
32
  * Live examples:
33
33
  * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
34
+ * - [Submenu with
35
+ * Combobox](https://ariakit.org/examples/menu-nested-combobox)
34
36
  * @default "bottom"
35
37
  */
36
38
  placement: Placement;
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _QAZ4PF7Scjs = require('../__chunks/QAZ4PF7S.cjs');
5
- require('../__chunks/ZQTYFYRS.cjs');
4
+ var _ZXCB7MXNcjs = require('../__chunks/ZXCB7MXN.cjs');
5
+ require('../__chunks/YLMJBIQM.cjs');
6
6
 
7
7
 
8
- var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
8
+ var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
9
9
 
10
10
 
11
11
  var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
@@ -22,7 +22,7 @@ function createRadioStore(_a = {}) {
22
22
  var props = _AV6KTKLEcjs.__objRest.call(void 0, _a, []);
23
23
  var _a2;
24
24
  const syncState = (_a2 = props.store) == null ? void 0 : _a2.getState();
25
- const composite = _QAZ4PF7Scjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
25
+ const composite = _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
26
26
  focusLoop: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
27
27
  }));
28
28
  const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), {
@@ -33,7 +33,7 @@ function createRadioStore(_a = {}) {
33
33
  null
34
34
  )
35
35
  });
36
- const radio = _2UK5WUJXcjs.createStore.call(void 0, initialState, composite, props.store);
36
+ const radio = _5CBCKBZ2cjs.createStore.call(void 0, initialState, composite, props.store);
37
37
  return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite), radio), {
38
38
  setValue: (value) => radio.setState("value", value)
39
39
  });
@@ -1,13 +1,13 @@
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
 
@@ -16,7 +16,7 @@ require('../__chunks/ZQTYFYRS.cjs');
16
16
 
17
17
 
18
18
 
19
- var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
19
+ var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
20
20
 
21
21
 
22
22
  var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
@@ -37,9 +37,9 @@ function createSelectStore(_a = {}) {
37
37
  } = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, [
38
38
  "combobox"
39
39
  ]);
40
- const store = _2UK5WUJXcjs.mergeStore.call(void 0,
40
+ const store = _5CBCKBZ2cjs.mergeStore.call(void 0,
41
41
  props.store,
42
- _2UK5WUJXcjs.omit.call(void 0, combobox, [
42
+ _5CBCKBZ2cjs.omit.call(void 0, combobox, [
43
43
  "value",
44
44
  "items",
45
45
  "renderedItems",
@@ -51,9 +51,9 @@ function createSelectStore(_a = {}) {
51
51
  "disclosureElement"
52
52
  ])
53
53
  );
54
- _2UK5WUJXcjs.throwOnConflictingProps.call(void 0, props, store);
54
+ _5CBCKBZ2cjs.throwOnConflictingProps.call(void 0, props, store);
55
55
  const syncState = store.getState();
56
- const composite = _QAZ4PF7Scjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
56
+ const composite = _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
57
57
  store,
58
58
  virtualFocus: _3UT5FE6Kcjs.defaultValue.call(void 0,
59
59
  props.virtualFocus,
@@ -77,7 +77,7 @@ function createSelectStore(_a = {}) {
77
77
  "vertical"
78
78
  )
79
79
  }));
80
- const popover = _EFIT5L4Xcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
80
+ const popover = _Y6PHIDP6cjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
81
81
  store,
82
82
  placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
83
83
  props.placement,
@@ -101,10 +101,10 @@ function createSelectStore(_a = {}) {
101
101
  selectElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState.selectElement, null),
102
102
  labelElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState.labelElement, null)
103
103
  });
104
- const select = _2UK5WUJXcjs.createStore.call(void 0, initialState, composite, popover, store);
105
- _2UK5WUJXcjs.setup.call(void 0,
104
+ const select = _5CBCKBZ2cjs.createStore.call(void 0, initialState, composite, popover, store);
105
+ _5CBCKBZ2cjs.setup.call(void 0,
106
106
  select,
107
- () => _2UK5WUJXcjs.sync.call(void 0, select, ["value", "items"], (state) => {
107
+ () => _5CBCKBZ2cjs.sync.call(void 0, select, ["value", "items"], (state) => {
108
108
  if (state.value !== initialValue)
109
109
  return;
110
110
  if (!state.items.length)
@@ -117,9 +117,9 @@ function createSelectStore(_a = {}) {
117
117
  select.setState("value", item.value);
118
118
  })
119
119
  );
120
- _2UK5WUJXcjs.setup.call(void 0,
120
+ _5CBCKBZ2cjs.setup.call(void 0,
121
121
  select,
122
- () => _2UK5WUJXcjs.sync.call(void 0, select, ["mounted", "items", "value"], (state) => {
122
+ () => _5CBCKBZ2cjs.sync.call(void 0, select, ["mounted", "items", "value"], (state) => {
123
123
  if (combobox)
124
124
  return;
125
125
  if (state.mounted)
@@ -136,9 +136,9 @@ function createSelectStore(_a = {}) {
136
136
  select.setState("activeId", item.id);
137
137
  })
138
138
  );
139
- _2UK5WUJXcjs.setup.call(void 0,
139
+ _5CBCKBZ2cjs.setup.call(void 0,
140
140
  select,
141
- () => _2UK5WUJXcjs.batch.call(void 0, select, ["setValueOnMove", "moves"], (state) => {
141
+ () => _5CBCKBZ2cjs.batch.call(void 0, select, ["setValueOnMove", "moves"], (state) => {
142
142
  const { mounted, value, activeId } = select.getState();
143
143
  if (!state.setValueOnMove && mounted)
144
144
  return;
@@ -1,16 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _QAZ4PF7Scjs = require('../__chunks/QAZ4PF7S.cjs');
4
+ var _ZXCB7MXNcjs = require('../__chunks/ZXCB7MXN.cjs');
5
5
 
6
6
 
7
- var _ZQTYFYRScjs = require('../__chunks/ZQTYFYRS.cjs');
7
+ var _YLMJBIQMcjs = require('../__chunks/YLMJBIQM.cjs');
8
8
 
9
9
 
10
10
 
11
11
 
12
12
 
13
- var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
13
+ var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
14
14
 
15
15
 
16
16
  var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
@@ -25,7 +25,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
25
25
  function createTabStore(props = {}) {
26
26
  var _a;
27
27
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
28
- const composite = _QAZ4PF7Scjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
28
+ const composite = _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
29
29
  orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
30
30
  props.orientation,
31
31
  syncState == null ? void 0 : syncState.orientation,
@@ -33,7 +33,7 @@ function createTabStore(props = {}) {
33
33
  ),
34
34
  focusLoop: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
35
35
  }));
36
- const panels = _ZQTYFYRScjs.createCollectionStore.call(void 0, );
36
+ const panels = _YLMJBIQMcjs.createCollectionStore.call(void 0, );
37
37
  const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), {
38
38
  selectedId: _3UT5FE6Kcjs.defaultValue.call(void 0,
39
39
  props.selectedId,
@@ -47,10 +47,10 @@ function createTabStore(props = {}) {
47
47
  true
48
48
  )
49
49
  });
50
- const tab = _2UK5WUJXcjs.createStore.call(void 0, initialState, composite, props.store);
51
- _2UK5WUJXcjs.setup.call(void 0,
50
+ const tab = _5CBCKBZ2cjs.createStore.call(void 0, initialState, composite, props.store);
51
+ _5CBCKBZ2cjs.setup.call(void 0,
52
52
  tab,
53
- () => _2UK5WUJXcjs.sync.call(void 0, tab, ["moves"], () => {
53
+ () => _5CBCKBZ2cjs.sync.call(void 0, tab, ["moves"], () => {
54
54
  const { activeId, selectOnMove } = tab.getState();
55
55
  if (!selectOnMove)
56
56
  return;
@@ -66,17 +66,17 @@ function createTabStore(props = {}) {
66
66
  tab.setState("selectedId", tabItem.id);
67
67
  })
68
68
  );
69
- _2UK5WUJXcjs.setup.call(void 0,
69
+ _5CBCKBZ2cjs.setup.call(void 0,
70
70
  tab,
71
- () => _2UK5WUJXcjs.batch.call(void 0,
71
+ () => _5CBCKBZ2cjs.batch.call(void 0,
72
72
  tab,
73
73
  ["selectedId"],
74
74
  (state) => tab.setState("activeId", state.selectedId)
75
75
  )
76
76
  );
77
- _2UK5WUJXcjs.setup.call(void 0,
77
+ _5CBCKBZ2cjs.setup.call(void 0,
78
78
  tab,
79
- () => _2UK5WUJXcjs.sync.call(void 0, tab, ["selectedId", "renderedItems"], (state) => {
79
+ () => _5CBCKBZ2cjs.sync.call(void 0, tab, ["selectedId", "renderedItems"], (state) => {
80
80
  if (state.selectedId !== void 0)
81
81
  return;
82
82
  const { activeId, renderedItems } = tab.getState();
@@ -91,13 +91,13 @@ function createTabStore(props = {}) {
91
91
  }
92
92
  })
93
93
  );
94
- _2UK5WUJXcjs.setup.call(void 0,
94
+ _5CBCKBZ2cjs.setup.call(void 0,
95
95
  tab,
96
- () => _2UK5WUJXcjs.sync.call(void 0, tab, ["renderedItems"], (state) => {
96
+ () => _5CBCKBZ2cjs.sync.call(void 0, tab, ["renderedItems"], (state) => {
97
97
  const tabs = state.renderedItems;
98
98
  if (!tabs.length)
99
99
  return;
100
- return _2UK5WUJXcjs.sync.call(void 0, panels, ["renderedItems"], (state2) => {
100
+ return _5CBCKBZ2cjs.sync.call(void 0, panels, ["renderedItems"], (state2) => {
101
101
  const items = state2.renderedItems;
102
102
  const hasOrphanPanels = items.some((panel) => !panel.tabId);
103
103
  if (!hasOrphanPanels)
@@ -24,6 +24,7 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
24
24
  *
25
25
  * Live examples:
26
26
  * - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
27
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
27
28
  */
28
29
  selectedId: TabStoreState["activeId"];
29
30
  /**
@@ -38,8 +39,11 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
38
39
  }
39
40
  export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem> {
40
41
  /**
41
- * Sets the `selectedId` state without moving focus. If you want to move focus,
42
- * use the `select` function instead.
42
+ * Sets the
43
+ * [`selectedId`](https://ariakit.org/reference/tab-provider#selectedid) state
44
+ * without moving focus. If you want to move focus, use the
45
+ * [`select`](https://ariakit.org/reference/use-tab-store#select) function
46
+ * instead.
43
47
  *
44
48
  * Live examples:
45
49
  * - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
@@ -60,9 +64,13 @@ export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem>
60
64
  panels: CollectionStore<TabStorePanel>;
61
65
  /**
62
66
  * Selects the tab for the given id and moves focus to it. If you want to set
63
- * the `selectedId` state without moving focus, use the `setSelectedId`
67
+ * the [`selectedId`](https://ariakit.org/reference/tab-provider#selectedid)
68
+ * state without moving focus, use the
69
+ * [`setSelectedId`](https://ariakit.org/reference/use-tab-store#setselectedid-1)
64
70
  * function instead.
65
- * @param id The id of the tab to select.
71
+ *
72
+ * Live examples:
73
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
66
74
  * @example
67
75
  * // Selects the tab with id "tab-1"
68
76
  * store.select("tab-1");
@@ -77,6 +85,9 @@ export interface TabStoreOptions extends StoreOptions<TabStoreState, "orientatio
77
85
  /**
78
86
  * The id of the tab whose panel is currently visible. If it's `undefined`, it
79
87
  * will be automatically set to the first enabled tab.
88
+ *
89
+ * Live examples:
90
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
80
91
  */
81
92
  defaultSelectedId?: TabStoreState["selectedId"];
82
93
  }
@@ -24,6 +24,7 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
24
24
  *
25
25
  * Live examples:
26
26
  * - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
27
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
27
28
  */
28
29
  selectedId: TabStoreState["activeId"];
29
30
  /**
@@ -38,8 +39,11 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
38
39
  }
39
40
  export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem> {
40
41
  /**
41
- * Sets the `selectedId` state without moving focus. If you want to move focus,
42
- * use the `select` function instead.
42
+ * Sets the
43
+ * [`selectedId`](https://ariakit.org/reference/tab-provider#selectedid) state
44
+ * without moving focus. If you want to move focus, use the
45
+ * [`select`](https://ariakit.org/reference/use-tab-store#select) function
46
+ * instead.
43
47
  *
44
48
  * Live examples:
45
49
  * - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
@@ -60,9 +64,13 @@ export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem>
60
64
  panels: CollectionStore<TabStorePanel>;
61
65
  /**
62
66
  * Selects the tab for the given id and moves focus to it. If you want to set
63
- * the `selectedId` state without moving focus, use the `setSelectedId`
67
+ * the [`selectedId`](https://ariakit.org/reference/tab-provider#selectedid)
68
+ * state without moving focus, use the
69
+ * [`setSelectedId`](https://ariakit.org/reference/use-tab-store#setselectedid-1)
64
70
  * function instead.
65
- * @param id The id of the tab to select.
71
+ *
72
+ * Live examples:
73
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
66
74
  * @example
67
75
  * // Selects the tab with id "tab-1"
68
76
  * store.select("tab-1");
@@ -77,6 +85,9 @@ export interface TabStoreOptions extends StoreOptions<TabStoreState, "orientatio
77
85
  /**
78
86
  * The id of the tab whose panel is currently visible. If it's `undefined`, it
79
87
  * will be automatically set to the first enabled tab.
88
+ *
89
+ * Live examples:
90
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
80
91
  */
81
92
  defaultSelectedId?: TabStoreState["selectedId"];
82
93
  }
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _QAZ4PF7Scjs = require('../__chunks/QAZ4PF7S.cjs');
5
- require('../__chunks/ZQTYFYRS.cjs');
6
- require('../__chunks/2UK5WUJX.cjs');
4
+ var _ZXCB7MXNcjs = require('../__chunks/ZXCB7MXN.cjs');
5
+ require('../__chunks/YLMJBIQM.cjs');
6
+ require('../__chunks/5CBCKBZ2.cjs');
7
7
 
8
8
 
9
9
  var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
@@ -18,7 +18,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
18
18
  function createToolbarStore(props = {}) {
19
19
  var _a;
20
20
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
21
- return _QAZ4PF7Scjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
21
+ return _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
22
22
  orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
23
23
  props.orientation,
24
24
  syncState == null ? void 0 : syncState.orientation,
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _5SIVMOIDcjs = require('../__chunks/5SIVMOID.cjs');
5
- require('../__chunks/EFIT5L4X.cjs');
6
- require('../__chunks/2LS4JJ4S.cjs');
7
- require('../__chunks/GJFZ5ZPP.cjs');
4
+ var _HMO4CKUPcjs = require('../__chunks/HMO4CKUP.cjs');
5
+ require('../__chunks/Y6PHIDP6.cjs');
6
+ require('../__chunks/MFSCSSBJ.cjs');
7
+ require('../__chunks/MWNFQD55.cjs');
8
8
 
9
9
 
10
- var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
10
+ var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
11
11
 
12
12
 
13
13
  var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
@@ -20,7 +20,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
20
20
  function createTooltipStore(props = {}) {
21
21
  var _a;
22
22
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
23
- const hovercard = _5SIVMOIDcjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
23
+ const hovercard = _HMO4CKUPcjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
24
24
  placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
25
25
  props.placement,
26
26
  syncState == null ? void 0 : syncState.placement,
@@ -32,7 +32,7 @@ function createTooltipStore(props = {}) {
32
32
  type: _3UT5FE6Kcjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
33
33
  skipTimeout: _3UT5FE6Kcjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
34
34
  });
35
- const tooltip = _2UK5WUJXcjs.createStore.call(void 0, initialState, hovercard, props.store);
35
+ const tooltip = _5CBCKBZ2cjs.createStore.call(void 0, initialState, hovercard, props.store);
36
36
  return _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, hovercard), tooltip);
37
37
  }
38
38
 
@@ -10,7 +10,7 @@
10
10
 
11
11
 
12
12
 
13
- var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
13
+ var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
14
14
  require('../__chunks/3UT5FE6K.cjs');
15
15
  require('../__chunks/AV6KTKLE.cjs');
16
16
 
@@ -24,4 +24,4 @@ require('../__chunks/AV6KTKLE.cjs');
24
24
 
25
25
 
26
26
 
27
- exports.batch = _2UK5WUJXcjs.batch; exports.createStore = _2UK5WUJXcjs.createStore; exports.init = _2UK5WUJXcjs.init; exports.mergeStore = _2UK5WUJXcjs.mergeStore; exports.omit = _2UK5WUJXcjs.omit; exports.pick = _2UK5WUJXcjs.pick; exports.setup = _2UK5WUJXcjs.setup; exports.subscribe = _2UK5WUJXcjs.subscribe; exports.sync = _2UK5WUJXcjs.sync; exports.throwOnConflictingProps = _2UK5WUJXcjs.throwOnConflictingProps;
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;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  createDisclosureStore
4
- } from "./NKLTHWCR.js";
4
+ } from "./L5RYKTVQ.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
  createDialogStore
4
- } from "./LT2OYWRD.js";
4
+ } from "./25MEC56I.js";
5
5
  import {
6
6
  createStore,
7
7
  mergeStore,
8
8
  omit,
9
9
  throwOnConflictingProps
10
- } from "./A2J4XZ5T.js";
10
+ } from "./K6ELJFXN.js";
11
11
  import {
12
12
  defaultValue
13
13
  } from "./I2VQ3XGR.js";
@@ -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 noop;
42
40
  const initialized = instances.size;
43
41
  const instance = Symbol();
44
42
  instances.add(instance);
@@ -7,7 +7,7 @@ import {
7
7
  subscribe,
8
8
  sync,
9
9
  throwOnConflictingProps
10
- } from "./A2J4XZ5T.js";
10
+ } from "./K6ELJFXN.js";
11
11
  import {
12
12
  defaultValue
13
13
  } from "./I2VQ3XGR.js";
@@ -5,7 +5,7 @@ import {
5
5
  init,
6
6
  setup,
7
7
  throwOnConflictingProps
8
- } from "./A2J4XZ5T.js";
8
+ } from "./K6ELJFXN.js";
9
9
  import {
10
10
  chain,
11
11
  defaultValue
@@ -88,34 +88,39 @@ function createCollectionStore(props = {}) {
88
88
  syncPrivateStore
89
89
  );
90
90
  const collection = createStore(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);
91
+ const sortItems = (renderedItems) => {
92
+ const sortedItems = sortBasedOnDOMPosition(renderedItems);
93
+ privateStore.setState("renderedItems", sortedItems);
94
+ collection.setState("renderedItems", sortedItems);
96
95
  };
97
96
  setup(collection, () => init(privateStore));
98
97
  setup(privateStore, () => {
99
98
  return batch(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,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  createPopoverStore
4
- } from "./J6JIOWCS.js";
4
+ } from "./AKMSZ36N.js";
5
5
  import {
6
6
  createStore
7
- } from "./A2J4XZ5T.js";
7
+ } from "./K6ELJFXN.js";
8
8
  import {
9
9
  defaultValue
10
10
  } from "./I2VQ3XGR.js";
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  createCompositeStore
4
- } from "./CTZ2GQIZ.js";
4
+ } from "./VEUNYQYR.js";
5
5
  import {
6
6
  createStore
7
- } from "./A2J4XZ5T.js";
7
+ } from "./K6ELJFXN.js";
8
8
  import {
9
9
  defaultValue
10
10
  } from "./I2VQ3XGR.js";
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import {
3
3
  createCollectionStore
4
- } from "./HMQYEBKF.js";
4
+ } from "./MYUKSFP5.js";
5
5
  import {
6
6
  createStore,
7
7
  setup,
8
8
  sync
9
- } from "./A2J4XZ5T.js";
9
+ } from "./K6ELJFXN.js";
10
10
  import {
11
11
  defaultValue
12
12
  } from "./I2VQ3XGR.js";
@@ -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)
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  createStore,
4
4
  throwOnConflictingProps
5
- } from "../__chunks/A2J4XZ5T.js";
5
+ } from "../__chunks/K6ELJFXN.js";
6
6
  import {
7
7
  defaultValue
8
8
  } from "../__chunks/I2VQ3XGR.js";