@ariakit/core 0.4.12 → 0.4.14

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 (79) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/cjs/__chunks/{WCFMOJKV.cjs → 726BNPQZ.cjs} +36 -2
  3. package/cjs/__chunks/{BSLRW6E7.cjs → ASR6PAFN.cjs} +1 -1
  4. package/cjs/__chunks/{G2NIRMCL.cjs → BUEPUCQL.cjs} +14 -42
  5. package/cjs/__chunks/{C5P5S22J.cjs → BVPEDDW6.cjs} +7 -7
  6. package/cjs/__chunks/{A47DWKLR.cjs → K7YTZVWC.cjs} +11 -6
  7. package/cjs/__chunks/{LSC6QXJ7.cjs → RL7DKHOF.cjs} +4 -4
  8. package/cjs/__chunks/{FGGZELG7.cjs → TFI7KVZO.cjs} +4 -4
  9. package/cjs/__chunks/{G2MFLTB2.cjs → V4YF2QA6.cjs} +11 -11
  10. package/cjs/__chunks/{TEPPO3KC.cjs → WOLZY4WC.cjs} +6 -6
  11. package/cjs/__chunks/{I2G6EN27.cjs → YMCSKJHR.cjs} +2 -2
  12. package/cjs/checkbox/checkbox-store.cjs +3 -3
  13. package/cjs/collection/collection-store.cjs +4 -4
  14. package/cjs/combobox/combobox-store.cjs +27 -27
  15. package/cjs/composite/composite-overflow-store.cjs +5 -5
  16. package/cjs/composite/composite-store.cjs +5 -5
  17. package/cjs/composite/composite-store.d.cts +7 -1
  18. package/cjs/composite/composite-store.d.ts +7 -1
  19. package/cjs/dialog/dialog-store.cjs +4 -4
  20. package/cjs/disclosure/disclosure-store.cjs +3 -3
  21. package/cjs/form/form-store.cjs +8 -8
  22. package/cjs/form/form-store.d.cts +2 -2
  23. package/cjs/form/form-store.d.ts +2 -2
  24. package/cjs/hovercard/hovercard-store.cjs +6 -6
  25. package/cjs/menu/menu-bar-store.cjs +6 -6
  26. package/cjs/menu/menu-store.cjs +19 -19
  27. package/cjs/menubar/menubar-store.cjs +6 -6
  28. package/cjs/popover/popover-store.cjs +5 -5
  29. package/cjs/radio/radio-store.cjs +6 -6
  30. package/cjs/select/select-store.cjs +21 -21
  31. package/cjs/tab/tab-store.cjs +24 -24
  32. package/cjs/tag/tag-store.cjs +8 -8
  33. package/cjs/toolbar/toolbar-store.cjs +5 -5
  34. package/cjs/tooltip/tooltip-store.cjs +7 -7
  35. package/cjs/utils/dom.cjs +4 -2
  36. package/cjs/utils/dom.d.cts +6 -2
  37. package/cjs/utils/dom.d.ts +6 -2
  38. package/cjs/utils/events.cjs +5 -5
  39. package/cjs/utils/focus.cjs +10 -10
  40. package/cjs/utils/platform.cjs +3 -3
  41. package/cjs/utils/store.cjs +2 -2
  42. package/esm/__chunks/{S22RJCNX.js → 7HRRFUKQ.js} +2 -2
  43. package/esm/__chunks/{IJ6VFLJG.js → AJZ4BYF3.js} +7 -2
  44. package/esm/__chunks/{EQQLU3CG.js → BCALMBPZ.js} +1 -1
  45. package/esm/__chunks/{7DTP4AQO.js → CYQWQL4J.js} +6 -34
  46. package/esm/__chunks/{PQP5VPTV.js → DTR5TSDJ.js} +36 -2
  47. package/esm/__chunks/{YOHCVXJB.js → FZZ2AVHF.js} +1 -1
  48. package/esm/__chunks/{EACLTACN.js → JTLIIJ4U.js} +2 -2
  49. package/esm/__chunks/{3UYWTADI.js → ME2CUF3F.js} +2 -2
  50. package/esm/__chunks/{3VBK76MS.js → QAGXQEUG.js} +1 -1
  51. package/esm/__chunks/{6E4KKOSB.js → RCQ5P4YE.js} +1 -1
  52. package/esm/checkbox/checkbox-store.js +1 -1
  53. package/esm/collection/collection-store.js +3 -3
  54. package/esm/combobox/combobox-store.js +8 -8
  55. package/esm/composite/composite-overflow-store.js +4 -4
  56. package/esm/composite/composite-store.d.ts +7 -1
  57. package/esm/composite/composite-store.js +4 -4
  58. package/esm/dialog/dialog-store.js +3 -3
  59. package/esm/disclosure/disclosure-store.js +2 -2
  60. package/esm/form/form-store.d.ts +2 -2
  61. package/esm/form/form-store.js +3 -3
  62. package/esm/hovercard/hovercard-store.js +5 -5
  63. package/esm/menu/menu-bar-store.js +5 -5
  64. package/esm/menu/menu-store.js +8 -8
  65. package/esm/menubar/menubar-store.js +5 -5
  66. package/esm/popover/popover-store.js +4 -4
  67. package/esm/radio/radio-store.js +4 -4
  68. package/esm/select/select-store.js +7 -7
  69. package/esm/tab/tab-store.js +4 -4
  70. package/esm/tag/tag-store.js +4 -4
  71. package/esm/toolbar/toolbar-store.js +4 -4
  72. package/esm/tooltip/tooltip-store.js +5 -5
  73. package/esm/utils/dom.d.ts +6 -2
  74. package/esm/utils/dom.js +5 -3
  75. package/esm/utils/events.js +2 -2
  76. package/esm/utils/focus.js +1 -1
  77. package/esm/utils/platform.js +2 -2
  78. package/esm/utils/store.js +1 -1
  79. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _A47DWKLRcjs = require('../__chunks/A47DWKLR.cjs');
3
+ var _K7YTZVWCcjs = require('../__chunks/K7YTZVWC.cjs');
4
4
 
5
5
 
6
- var _G2NIRMCLcjs = require('../__chunks/G2NIRMCL.cjs');
6
+ var _BUEPUCQLcjs = require('../__chunks/BUEPUCQL.cjs');
7
7
  require('../__chunks/GDZQUFNP.cjs');
8
8
 
9
9
 
@@ -12,12 +12,12 @@ require('../__chunks/GDZQUFNP.cjs');
12
12
 
13
13
 
14
14
 
15
- var _BSLRW6E7cjs = require('../__chunks/BSLRW6E7.cjs');
15
+ var _ASR6PAFNcjs = require('../__chunks/ASR6PAFN.cjs');
16
16
 
17
17
 
18
18
 
19
19
  var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
20
- require('../__chunks/WCFMOJKV.cjs');
20
+ require('../__chunks/726BNPQZ.cjs');
21
21
 
22
22
 
23
23
 
@@ -45,13 +45,13 @@ function createTabStore(_a = {}) {
45
45
  "focusShift",
46
46
  "focusWrap"
47
47
  ];
48
- const store = _BSLRW6E7cjs.mergeStore.call(void 0,
48
+ const store = _ASR6PAFNcjs.mergeStore.call(void 0,
49
49
  props.store,
50
- _BSLRW6E7cjs.omit.call(void 0, parentComposite, independentKeys),
51
- _BSLRW6E7cjs.omit.call(void 0, combobox, independentKeys)
50
+ _ASR6PAFNcjs.omit.call(void 0, parentComposite, independentKeys),
51
+ _ASR6PAFNcjs.omit.call(void 0, combobox, independentKeys)
52
52
  );
53
53
  const syncState = store == null ? void 0 : store.getState();
54
- const composite = _A47DWKLRcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
54
+ const composite = _K7YTZVWCcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
55
55
  store,
56
56
  // We need to explicitly set the default value of `includesBaseElement` to
57
57
  // `false` since we don't want the composite store to default it to `true`
@@ -69,7 +69,7 @@ function createTabStore(_a = {}) {
69
69
  ),
70
70
  focusLoop: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
71
71
  }));
72
- const panels = _G2NIRMCLcjs.createCollectionStore.call(void 0, );
72
+ const panels = _BUEPUCQLcjs.createCollectionStore.call(void 0, );
73
73
  const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite.getState()), {
74
74
  selectedId: _MLCPLY2Pcjs.defaultValue.call(void 0,
75
75
  props.selectedId,
@@ -82,10 +82,10 @@ function createTabStore(_a = {}) {
82
82
  true
83
83
  )
84
84
  });
85
- const tab = _BSLRW6E7cjs.createStore.call(void 0, initialState, composite, store);
86
- _BSLRW6E7cjs.setup.call(void 0,
85
+ const tab = _ASR6PAFNcjs.createStore.call(void 0, initialState, composite, store);
86
+ _ASR6PAFNcjs.setup.call(void 0,
87
87
  tab,
88
- () => _BSLRW6E7cjs.sync.call(void 0, tab, ["moves"], () => {
88
+ () => _ASR6PAFNcjs.sync.call(void 0, tab, ["moves"], () => {
89
89
  const { activeId, selectOnMove } = tab.getState();
90
90
  if (!selectOnMove) return;
91
91
  if (!activeId) return;
@@ -97,9 +97,9 @@ function createTabStore(_a = {}) {
97
97
  })
98
98
  );
99
99
  let syncActiveId = true;
100
- _BSLRW6E7cjs.setup.call(void 0,
100
+ _ASR6PAFNcjs.setup.call(void 0,
101
101
  tab,
102
- () => _BSLRW6E7cjs.batch.call(void 0, tab, ["selectedId"], (state, prev) => {
102
+ () => _ASR6PAFNcjs.batch.call(void 0, tab, ["selectedId"], (state, prev) => {
103
103
  if (!syncActiveId) {
104
104
  syncActiveId = true;
105
105
  return;
@@ -108,9 +108,9 @@ function createTabStore(_a = {}) {
108
108
  tab.setState("activeId", state.selectedId);
109
109
  })
110
110
  );
111
- _BSLRW6E7cjs.setup.call(void 0,
111
+ _ASR6PAFNcjs.setup.call(void 0,
112
112
  tab,
113
- () => _BSLRW6E7cjs.sync.call(void 0, tab, ["selectedId", "renderedItems"], (state) => {
113
+ () => _ASR6PAFNcjs.sync.call(void 0, tab, ["selectedId", "renderedItems"], (state) => {
114
114
  if (state.selectedId !== void 0) return;
115
115
  const { activeId, renderedItems } = tab.getState();
116
116
  const tabItem = composite.item(activeId);
@@ -124,12 +124,12 @@ function createTabStore(_a = {}) {
124
124
  }
125
125
  })
126
126
  );
127
- _BSLRW6E7cjs.setup.call(void 0,
127
+ _ASR6PAFNcjs.setup.call(void 0,
128
128
  tab,
129
- () => _BSLRW6E7cjs.sync.call(void 0, tab, ["renderedItems"], (state) => {
129
+ () => _ASR6PAFNcjs.sync.call(void 0, tab, ["renderedItems"], (state) => {
130
130
  const tabs = state.renderedItems;
131
131
  if (!tabs.length) return;
132
- return _BSLRW6E7cjs.sync.call(void 0, panels, ["renderedItems"], (state2) => {
132
+ return _ASR6PAFNcjs.sync.call(void 0, panels, ["renderedItems"], (state2) => {
133
133
  const items = state2.renderedItems;
134
134
  const hasOrphanPanels = items.some((panel) => !panel.tabId);
135
135
  if (!hasOrphanPanels) return;
@@ -143,7 +143,7 @@ function createTabStore(_a = {}) {
143
143
  })
144
144
  );
145
145
  let selectedIdFromSelectedValue = null;
146
- _BSLRW6E7cjs.setup.call(void 0, tab, () => {
146
+ _ASR6PAFNcjs.setup.call(void 0, tab, () => {
147
147
  const backupSelectedId = () => {
148
148
  selectedIdFromSelectedValue = tab.getState().selectedId;
149
149
  };
@@ -153,14 +153,14 @@ function createTabStore(_a = {}) {
153
153
  };
154
154
  if (parentComposite && "setSelectElement" in parentComposite) {
155
155
  return _MLCPLY2Pcjs.chain.call(void 0,
156
- _BSLRW6E7cjs.sync.call(void 0, parentComposite, ["value"], backupSelectedId),
157
- _BSLRW6E7cjs.sync.call(void 0, parentComposite, ["mounted"], restoreSelectedId)
156
+ _ASR6PAFNcjs.sync.call(void 0, parentComposite, ["value"], backupSelectedId),
157
+ _ASR6PAFNcjs.sync.call(void 0, parentComposite, ["mounted"], restoreSelectedId)
158
158
  );
159
159
  }
160
160
  if (!combobox) return;
161
161
  return _MLCPLY2Pcjs.chain.call(void 0,
162
- _BSLRW6E7cjs.sync.call(void 0, combobox, ["selectedValue"], backupSelectedId),
163
- _BSLRW6E7cjs.sync.call(void 0, combobox, ["mounted"], restoreSelectedId)
162
+ _ASR6PAFNcjs.sync.call(void 0, combobox, ["selectedValue"], backupSelectedId),
163
+ _ASR6PAFNcjs.sync.call(void 0, combobox, ["mounted"], restoreSelectedId)
164
164
  );
165
165
  });
166
166
  return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite), tab), {
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _A47DWKLRcjs = require('../__chunks/A47DWKLR.cjs');
4
- require('../__chunks/G2NIRMCL.cjs');
3
+ var _K7YTZVWCcjs = require('../__chunks/K7YTZVWC.cjs');
4
+ require('../__chunks/BUEPUCQL.cjs');
5
5
  require('../__chunks/GDZQUFNP.cjs');
6
6
 
7
7
 
@@ -10,12 +10,12 @@ var _SHOLYDNPcjs = require('../__chunks/SHOLYDNP.cjs');
10
10
 
11
11
 
12
12
 
13
- var _BSLRW6E7cjs = require('../__chunks/BSLRW6E7.cjs');
13
+ var _ASR6PAFNcjs = require('../__chunks/ASR6PAFN.cjs');
14
14
 
15
15
 
16
16
 
17
17
  var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
18
- require('../__chunks/WCFMOJKV.cjs');
18
+ require('../__chunks/726BNPQZ.cjs');
19
19
 
20
20
 
21
21
 
@@ -25,7 +25,7 @@ var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
25
25
  function createTagStore(props = {}) {
26
26
  var _a;
27
27
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
28
- const composite = _A47DWKLRcjs.createCompositeStore.call(void 0, props);
28
+ const composite = _K7YTZVWCcjs.createCompositeStore.call(void 0, props);
29
29
  const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite.getState()), {
30
30
  inputElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.inputElement, null),
31
31
  labelElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.labelElement, null),
@@ -37,10 +37,10 @@ function createTagStore(props = {}) {
37
37
  []
38
38
  )
39
39
  });
40
- const tag = _BSLRW6E7cjs.createStore.call(void 0, initialState, composite, props.store);
41
- _BSLRW6E7cjs.setup.call(void 0,
40
+ const tag = _ASR6PAFNcjs.createStore.call(void 0, initialState, composite, props.store);
41
+ _ASR6PAFNcjs.setup.call(void 0,
42
42
  tag,
43
- () => _BSLRW6E7cjs.sync.call(void 0, tag, ["inputElement", "activeId"], (state) => {
43
+ () => _ASR6PAFNcjs.sync.call(void 0, tag, ["inputElement", "activeId"], (state) => {
44
44
  if (!state.inputElement) return;
45
45
  if (state.activeId !== void 0) return;
46
46
  tag.setState("activeId", state.inputElement.id);
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _A47DWKLRcjs = require('../__chunks/A47DWKLR.cjs');
4
- require('../__chunks/G2NIRMCL.cjs');
3
+ var _K7YTZVWCcjs = require('../__chunks/K7YTZVWC.cjs');
4
+ require('../__chunks/BUEPUCQL.cjs');
5
5
  require('../__chunks/GDZQUFNP.cjs');
6
- require('../__chunks/BSLRW6E7.cjs');
6
+ require('../__chunks/ASR6PAFN.cjs');
7
7
 
8
8
 
9
9
  var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
10
- require('../__chunks/WCFMOJKV.cjs');
10
+ require('../__chunks/726BNPQZ.cjs');
11
11
 
12
12
 
13
13
 
@@ -17,7 +17,7 @@ var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
17
17
  function createToolbarStore(props = {}) {
18
18
  var _a;
19
19
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
20
- return _A47DWKLRcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
20
+ return _K7YTZVWCcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
21
21
  orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
22
22
  props.orientation,
23
23
  syncState == null ? void 0 : syncState.orientation,
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _LSC6QXJ7cjs = require('../__chunks/LSC6QXJ7.cjs');
4
- require('../__chunks/C5P5S22J.cjs');
5
- require('../__chunks/I2G6EN27.cjs');
6
- require('../__chunks/G2MFLTB2.cjs');
3
+ var _RL7DKHOFcjs = require('../__chunks/RL7DKHOF.cjs');
4
+ require('../__chunks/BVPEDDW6.cjs');
5
+ require('../__chunks/YMCSKJHR.cjs');
6
+ require('../__chunks/V4YF2QA6.cjs');
7
7
 
8
8
 
9
- var _BSLRW6E7cjs = require('../__chunks/BSLRW6E7.cjs');
9
+ var _ASR6PAFNcjs = require('../__chunks/ASR6PAFN.cjs');
10
10
 
11
11
 
12
12
  var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
@@ -28,7 +28,7 @@ function createTooltipStore(props = {}) {
28
28
  }
29
29
  }
30
30
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
31
- const hovercard = _LSC6QXJ7cjs.createHovercardStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
31
+ const hovercard = _RL7DKHOFcjs.createHovercardStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
32
32
  placement: _MLCPLY2Pcjs.defaultValue.call(void 0,
33
33
  props.placement,
34
34
  syncState == null ? void 0 : syncState.placement,
@@ -40,7 +40,7 @@ function createTooltipStore(props = {}) {
40
40
  type: _MLCPLY2Pcjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
41
41
  skipTimeout: _MLCPLY2Pcjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
42
42
  });
43
- const tooltip = _BSLRW6E7cjs.createStore.call(void 0, initialState, hovercard, props.store);
43
+ const tooltip = _ASR6PAFNcjs.createStore.call(void 0, initialState, hovercard, props.store);
44
44
  return _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, hovercard), tooltip);
45
45
  }
46
46
 
package/cjs/utils/dom.cjs CHANGED
@@ -17,7 +17,8 @@
17
17
 
18
18
 
19
19
 
20
- var _WCFMOJKVcjs = require('../__chunks/WCFMOJKV.cjs');
20
+
21
+ var _726BNPQZcjs = require('../__chunks/726BNPQZ.cjs');
21
22
  require('../__chunks/7EQBAZ46.cjs');
22
23
 
23
24
 
@@ -38,4 +39,5 @@ require('../__chunks/7EQBAZ46.cjs');
38
39
 
39
40
 
40
41
 
41
- exports.canUseDOM = _WCFMOJKVcjs.canUseDOM; exports.contains = _WCFMOJKVcjs.contains; exports.getActiveElement = _WCFMOJKVcjs.getActiveElement; exports.getDocument = _WCFMOJKVcjs.getDocument; exports.getPopupItemRole = _WCFMOJKVcjs.getPopupItemRole; exports.getPopupRole = _WCFMOJKVcjs.getPopupRole; exports.getScrollingElement = _WCFMOJKVcjs.getScrollingElement; exports.getTextboxSelection = _WCFMOJKVcjs.getTextboxSelection; exports.getTextboxValue = _WCFMOJKVcjs.getTextboxValue; exports.getWindow = _WCFMOJKVcjs.getWindow; exports.isButton = _WCFMOJKVcjs.isButton; exports.isFrame = _WCFMOJKVcjs.isFrame; exports.isPartiallyHidden = _WCFMOJKVcjs.isPartiallyHidden; exports.isTextField = _WCFMOJKVcjs.isTextField; exports.isTextbox = _WCFMOJKVcjs.isTextbox; exports.isVisible = _WCFMOJKVcjs.isVisible; exports.scrollIntoViewIfNeeded = _WCFMOJKVcjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _WCFMOJKVcjs.setSelectionRange;
42
+
43
+ exports.canUseDOM = _726BNPQZcjs.canUseDOM; exports.contains = _726BNPQZcjs.contains; exports.getActiveElement = _726BNPQZcjs.getActiveElement; exports.getDocument = _726BNPQZcjs.getDocument; exports.getPopupItemRole = _726BNPQZcjs.getPopupItemRole; exports.getPopupRole = _726BNPQZcjs.getPopupRole; exports.getScrollingElement = _726BNPQZcjs.getScrollingElement; exports.getTextboxSelection = _726BNPQZcjs.getTextboxSelection; exports.getTextboxValue = _726BNPQZcjs.getTextboxValue; exports.getWindow = _726BNPQZcjs.getWindow; exports.isButton = _726BNPQZcjs.isButton; exports.isFrame = _726BNPQZcjs.isFrame; exports.isPartiallyHidden = _726BNPQZcjs.isPartiallyHidden; exports.isTextField = _726BNPQZcjs.isTextField; exports.isTextbox = _726BNPQZcjs.isTextbox; exports.isVisible = _726BNPQZcjs.isVisible; exports.scrollIntoViewIfNeeded = _726BNPQZcjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _726BNPQZcjs.setSelectionRange; exports.sortBasedOnDOMPosition = _726BNPQZcjs.sortBasedOnDOMPosition;
@@ -9,11 +9,11 @@ export declare const canUseDOM: boolean;
9
9
  /**
10
10
  * Returns `element.ownerDocument || document`.
11
11
  */
12
- export declare function getDocument(node?: Node | null): Document;
12
+ export declare function getDocument(node?: Window | Document | Node | null): Document;
13
13
  /**
14
14
  * Returns `element.ownerDocument.defaultView || window`.
15
15
  */
16
- export declare function getWindow(node?: Node | null): Window;
16
+ export declare function getWindow(node?: Window | Document | Node | null): Window;
17
17
  /**
18
18
  * Returns `element.ownerDocument.activeElement`.
19
19
  */
@@ -106,3 +106,7 @@ export declare function isPartiallyHidden(element: Element): boolean;
106
106
  * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
107
107
  */
108
108
  export declare function setSelectionRange(element: HTMLInputElement | HTMLTextAreaElement, ...args: Parameters<typeof HTMLInputElement.prototype.setSelectionRange>): void;
109
+ /**
110
+ * Sort the items based on their DOM position.
111
+ */
112
+ export declare function sortBasedOnDOMPosition<T>(items: T[], getElement: (item: T) => Element | null | undefined): T[];
@@ -9,11 +9,11 @@ export declare const canUseDOM: boolean;
9
9
  /**
10
10
  * Returns `element.ownerDocument || document`.
11
11
  */
12
- export declare function getDocument(node?: Node | null): Document;
12
+ export declare function getDocument(node?: Window | Document | Node | null): Document;
13
13
  /**
14
14
  * Returns `element.ownerDocument.defaultView || window`.
15
15
  */
16
- export declare function getWindow(node?: Node | null): Window;
16
+ export declare function getWindow(node?: Window | Document | Node | null): Window;
17
17
  /**
18
18
  * Returns `element.ownerDocument.activeElement`.
19
19
  */
@@ -106,3 +106,7 @@ export declare function isPartiallyHidden(element: Element): boolean;
106
106
  * https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
107
107
  */
108
108
  export declare function setSelectionRange(element: HTMLInputElement | HTMLTextAreaElement, ...args: Parameters<typeof HTMLInputElement.prototype.setSelectionRange>): void;
109
+ /**
110
+ * Sort the items based on their DOM position.
111
+ */
112
+ export declare function sortBasedOnDOMPosition<T>(items: T[], getElement: (item: T) => Element | null | undefined): T[];
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _TEPPO3KCcjs = require('../__chunks/TEPPO3KC.cjs');
3
+ var _WOLZY4WCcjs = require('../__chunks/WOLZY4WC.cjs');
4
4
 
5
5
 
6
- var _WCFMOJKVcjs = require('../__chunks/WCFMOJKV.cjs');
6
+ var _726BNPQZcjs = require('../__chunks/726BNPQZ.cjs');
7
7
 
8
8
 
9
9
 
@@ -12,7 +12,7 @@ var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
12
12
  // src/utils/events.ts
13
13
  function isPortalEvent(event) {
14
14
  return Boolean(
15
- event.currentTarget && !_WCFMOJKVcjs.contains.call(void 0, event.currentTarget, event.target)
15
+ event.currentTarget && !_726BNPQZcjs.contains.call(void 0, event.currentTarget, event.target)
16
16
  );
17
17
  }
18
18
  function isSelfTarget(event) {
@@ -21,7 +21,7 @@ function isSelfTarget(event) {
21
21
  function isOpeningInNewTab(event) {
22
22
  const element = event.currentTarget;
23
23
  if (!element) return false;
24
- const isAppleDevice = _TEPPO3KCcjs.isApple.call(void 0, );
24
+ const isAppleDevice = _WOLZY4WCcjs.isApple.call(void 0, );
25
25
  if (isAppleDevice && !event.metaKey) return false;
26
26
  if (!isAppleDevice && !event.ctrlKey) return false;
27
27
  const tagName = element.tagName.toLowerCase();
@@ -69,7 +69,7 @@ function fireClickEvent(element, eventInit) {
69
69
  function isFocusEventOutside(event, container) {
70
70
  const containerElement = container || event.currentTarget;
71
71
  const relatedTarget = event.relatedTarget;
72
- return !relatedTarget || !_WCFMOJKVcjs.contains.call(void 0, containerElement, relatedTarget);
72
+ return !relatedTarget || !_726BNPQZcjs.contains.call(void 0, containerElement, relatedTarget);
73
73
  }
74
74
  function getInputType(event) {
75
75
  const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event;
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _WCFMOJKVcjs = require('../__chunks/WCFMOJKV.cjs');
6
+ var _726BNPQZcjs = require('../__chunks/726BNPQZ.cjs');
7
7
 
8
8
 
9
9
  var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
@@ -16,7 +16,7 @@ function hasNegativeTabIndex(element) {
16
16
  }
17
17
  function isFocusable(element) {
18
18
  if (!element.matches(selector)) return false;
19
- if (!_WCFMOJKVcjs.isVisible.call(void 0, element)) return false;
19
+ if (!_726BNPQZcjs.isVisible.call(void 0, element)) return false;
20
20
  if (element.closest("[inert]")) return false;
21
21
  return true;
22
22
  }
@@ -30,7 +30,7 @@ function isTabbable(element) {
30
30
  const radioGroup = element.form.elements.namedItem(element.name);
31
31
  if (!radioGroup) return true;
32
32
  if (!("length" in radioGroup)) return true;
33
- const activeElement = _WCFMOJKVcjs.getActiveElement.call(void 0, element);
33
+ const activeElement = _726BNPQZcjs.getActiveElement.call(void 0, element);
34
34
  if (!activeElement) return true;
35
35
  if (activeElement === element) return true;
36
36
  if (!("form" in activeElement)) return true;
@@ -47,7 +47,7 @@ function getAllFocusableIn(container, includeContainer) {
47
47
  }
48
48
  const focusableElements = elements.filter(isFocusable);
49
49
  focusableElements.forEach((element, i) => {
50
- if (_WCFMOJKVcjs.isFrame.call(void 0, element) && element.contentDocument) {
50
+ if (_726BNPQZcjs.isFrame.call(void 0, element) && element.contentDocument) {
51
51
  const frameBody = element.contentDocument.body;
52
52
  focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
53
53
  }
@@ -73,7 +73,7 @@ function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
73
73
  tabbableElements.unshift(container);
74
74
  }
75
75
  tabbableElements.forEach((element, i) => {
76
- if (_WCFMOJKVcjs.isFrame.call(void 0, element) && element.contentDocument) {
76
+ if (_726BNPQZcjs.isFrame.call(void 0, element) && element.contentDocument) {
77
77
  const frameBody = element.contentDocument.body;
78
78
  const allFrameTabbable = getAllTabbableIn(
79
79
  frameBody,
@@ -114,7 +114,7 @@ function getLastTabbable(fallbackToFocusable) {
114
114
  return getLastTabbableIn(document.body, false, fallbackToFocusable);
115
115
  }
116
116
  function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) {
117
- const activeElement = _WCFMOJKVcjs.getActiveElement.call(void 0, container);
117
+ const activeElement = _726BNPQZcjs.getActiveElement.call(void 0, container);
118
118
  const allFocusable = getAllFocusableIn(container, includeContainer);
119
119
  const activeIndex = allFocusable.indexOf(activeElement);
120
120
  const nextFocusableElements = allFocusable.slice(activeIndex + 1);
@@ -129,7 +129,7 @@ function getNextTabbable(fallbackToFirst, fallbackToFocusable) {
129
129
  );
130
130
  }
131
131
  function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) {
132
- const activeElement = _WCFMOJKVcjs.getActiveElement.call(void 0, container);
132
+ const activeElement = _726BNPQZcjs.getActiveElement.call(void 0, container);
133
133
  const allFocusable = getAllFocusableIn(container, includeContainer).reverse();
134
134
  const activeIndex = allFocusable.indexOf(activeElement);
135
135
  const previousFocusableElements = allFocusable.slice(activeIndex + 1);
@@ -150,7 +150,7 @@ function getClosestFocusable(element) {
150
150
  return element || null;
151
151
  }
152
152
  function hasFocus(element) {
153
- const activeElement = _WCFMOJKVcjs.getActiveElement.call(void 0, element);
153
+ const activeElement = _726BNPQZcjs.getActiveElement.call(void 0, element);
154
154
  if (!activeElement) return false;
155
155
  if (activeElement === element) return true;
156
156
  const activeDescendant = activeElement.getAttribute("aria-activedescendant");
@@ -158,9 +158,9 @@ function hasFocus(element) {
158
158
  return activeDescendant === element.id;
159
159
  }
160
160
  function hasFocusWithin(element) {
161
- const activeElement = _WCFMOJKVcjs.getActiveElement.call(void 0, element);
161
+ const activeElement = _726BNPQZcjs.getActiveElement.call(void 0, element);
162
162
  if (!activeElement) return false;
163
- if (_WCFMOJKVcjs.contains.call(void 0, element, activeElement)) return true;
163
+ if (_726BNPQZcjs.contains.call(void 0, element, activeElement)) return true;
164
164
  const activeDescendant = activeElement.getAttribute("aria-activedescendant");
165
165
  if (!activeDescendant) return false;
166
166
  if (!("id" in element)) return false;
@@ -4,8 +4,8 @@
4
4
 
5
5
 
6
6
 
7
- var _TEPPO3KCcjs = require('../__chunks/TEPPO3KC.cjs');
8
- require('../__chunks/WCFMOJKV.cjs');
7
+ var _WOLZY4WCcjs = require('../__chunks/WOLZY4WC.cjs');
8
+ require('../__chunks/726BNPQZ.cjs');
9
9
  require('../__chunks/7EQBAZ46.cjs');
10
10
 
11
11
 
@@ -13,4 +13,4 @@ require('../__chunks/7EQBAZ46.cjs');
13
13
 
14
14
 
15
15
 
16
- exports.isApple = _TEPPO3KCcjs.isApple; exports.isFirefox = _TEPPO3KCcjs.isFirefox; exports.isMac = _TEPPO3KCcjs.isMac; exports.isSafari = _TEPPO3KCcjs.isSafari; exports.isTouchDevice = _TEPPO3KCcjs.isTouchDevice;
16
+ exports.isApple = _WOLZY4WCcjs.isApple; exports.isFirefox = _WOLZY4WCcjs.isFirefox; exports.isMac = _WOLZY4WCcjs.isMac; exports.isSafari = _WOLZY4WCcjs.isSafari; exports.isTouchDevice = _WOLZY4WCcjs.isTouchDevice;
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
 
12
- var _BSLRW6E7cjs = require('../__chunks/BSLRW6E7.cjs');
12
+ var _ASR6PAFNcjs = require('../__chunks/ASR6PAFN.cjs');
13
13
  require('../__chunks/MLCPLY2P.cjs');
14
14
  require('../__chunks/7EQBAZ46.cjs');
15
15
 
@@ -23,4 +23,4 @@ require('../__chunks/7EQBAZ46.cjs');
23
23
 
24
24
 
25
25
 
26
- exports.batch = _BSLRW6E7cjs.batch; exports.createStore = _BSLRW6E7cjs.createStore; exports.init = _BSLRW6E7cjs.init; exports.mergeStore = _BSLRW6E7cjs.mergeStore; exports.omit = _BSLRW6E7cjs.omit; exports.pick = _BSLRW6E7cjs.pick; exports.setup = _BSLRW6E7cjs.setup; exports.subscribe = _BSLRW6E7cjs.subscribe; exports.sync = _BSLRW6E7cjs.sync; exports.throwOnConflictingProps = _BSLRW6E7cjs.throwOnConflictingProps;
26
+ exports.batch = _ASR6PAFNcjs.batch; exports.createStore = _ASR6PAFNcjs.createStore; exports.init = _ASR6PAFNcjs.init; exports.mergeStore = _ASR6PAFNcjs.mergeStore; exports.omit = _ASR6PAFNcjs.omit; exports.pick = _ASR6PAFNcjs.pick; exports.setup = _ASR6PAFNcjs.setup; exports.subscribe = _ASR6PAFNcjs.subscribe; exports.sync = _ASR6PAFNcjs.sync; exports.throwOnConflictingProps = _ASR6PAFNcjs.throwOnConflictingProps;
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  createCompositeStore
4
- } from "./IJ6VFLJG.js";
4
+ } from "./AJZ4BYF3.js";
5
5
  import {
6
6
  createStore
7
- } from "./EQQLU3CG.js";
7
+ } from "./BCALMBPZ.js";
8
8
  import {
9
9
  defaultValue
10
10
  } from "./PBFD2E7P.js";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  createCollectionStore
4
- } from "./7DTP4AQO.js";
4
+ } from "./CYQWQL4J.js";
5
5
  import {
6
6
  flatten2DArray,
7
7
  reverseArray
@@ -10,7 +10,7 @@ import {
10
10
  createStore,
11
11
  setup,
12
12
  sync
13
- } from "./EQQLU3CG.js";
13
+ } from "./BCALMBPZ.js";
14
14
  import {
15
15
  defaultValue
16
16
  } from "./PBFD2E7P.js";
@@ -124,6 +124,11 @@ function createCompositeStore(props = {}) {
124
124
  props.defaultActiveId
125
125
  );
126
126
  const initialState = __spreadProps(__spreadValues({}, collection.getState()), {
127
+ id: defaultValue(
128
+ props.id,
129
+ syncState == null ? void 0 : syncState.id,
130
+ `id-${Math.random().toString(36).slice(2, 8)}`
131
+ ),
127
132
  activeId,
128
133
  baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null),
129
134
  includesBaseElement: defaultValue(
@@ -184,7 +184,7 @@ function mergeStore(...stores) {
184
184
  return Object.assign(state, nextState);
185
185
  }, {});
186
186
  const store = createStore(initialState, ...stores);
187
- return store;
187
+ return Object.assign({}, ...stores, store);
188
188
  }
189
189
  function throwOnConflictingProps(props, store) {
190
190
  if (process.env.NODE_ENV === "production") return;
@@ -5,49 +5,21 @@ import {
5
5
  init,
6
6
  setup,
7
7
  throwOnConflictingProps
8
- } from "./EQQLU3CG.js";
8
+ } from "./BCALMBPZ.js";
9
9
  import {
10
10
  chain,
11
11
  defaultValue
12
12
  } from "./PBFD2E7P.js";
13
13
  import {
14
- getDocument
15
- } from "./PQP5VPTV.js";
14
+ getDocument,
15
+ sortBasedOnDOMPosition
16
+ } from "./DTR5TSDJ.js";
16
17
  import {
17
18
  __spreadProps,
18
19
  __spreadValues
19
20
  } from "./3YLGPPWQ.js";
20
21
 
21
22
  // src/collection/collection-store.ts
22
- function isElementPreceding(a, b) {
23
- return Boolean(
24
- b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING
25
- );
26
- }
27
- function sortBasedOnDOMPosition(items) {
28
- const pairs = items.map((item, index) => [index, item]);
29
- let isOrderDifferent = false;
30
- pairs.sort(([indexA, a], [indexB, b]) => {
31
- const elementA = a.element;
32
- const elementB = b.element;
33
- if (elementA === elementB) return 0;
34
- if (!elementA || !elementB) return 0;
35
- if (isElementPreceding(elementA, elementB)) {
36
- if (indexA > indexB) {
37
- isOrderDifferent = true;
38
- }
39
- return -1;
40
- }
41
- if (indexA < indexB) {
42
- isOrderDifferent = true;
43
- }
44
- return 1;
45
- });
46
- if (isOrderDifferent) {
47
- return pairs.map(([_, item]) => item);
48
- }
49
- return items;
50
- }
51
23
  function getCommonParent(items) {
52
24
  var _a;
53
25
  const firstItem = items.find((item) => !!item.element);
@@ -87,7 +59,7 @@ function createCollectionStore(props = {}) {
87
59
  );
88
60
  const collection = createStore(initialState, props.store);
89
61
  const sortItems = (renderedItems) => {
90
- const sortedItems = sortBasedOnDOMPosition(renderedItems);
62
+ const sortedItems = sortBasedOnDOMPosition(renderedItems, (i) => i.element);
91
63
  privateStore.setState("renderedItems", sortedItems);
92
64
  collection.setState("renderedItems", sortedItems);
93
65
  };
@@ -180,7 +152,7 @@ function createCollectionStore(props = {}) {
180
152
  if (!id) return null;
181
153
  let item = itemsMap.get(id);
182
154
  if (!item) {
183
- const { items: items2 } = collection.getState();
155
+ const { items: items2 } = privateStore.getState();
184
156
  item = items2.find((item2) => item2.id === id);
185
157
  if (item) {
186
158
  itemsMap.set(id, item);
@@ -7,9 +7,13 @@ function checkIsBrowser() {
7
7
  return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement);
8
8
  }
9
9
  function getDocument(node) {
10
- return node ? node.ownerDocument || node : document;
10
+ if (!node) return document;
11
+ if ("self" in node) return node.document;
12
+ return node.ownerDocument || document;
11
13
  }
12
14
  function getWindow(node) {
15
+ if (!node) return self;
16
+ if ("self" in node) return node.self;
13
17
  return getDocument(node).defaultView || window;
14
18
  }
15
19
  function getActiveElement(node, activeDescendant = false) {
@@ -168,6 +172,35 @@ function setSelectionRange(element, ...args) {
168
172
  element.setSelectionRange(...args);
169
173
  }
170
174
  }
175
+ function sortBasedOnDOMPosition(items, getElement) {
176
+ const pairs = items.map((item, index) => [index, item]);
177
+ let isOrderDifferent = false;
178
+ pairs.sort(([indexA, a], [indexB, b]) => {
179
+ const elementA = getElement(a);
180
+ const elementB = getElement(b);
181
+ if (elementA === elementB) return 0;
182
+ if (!elementA || !elementB) return 0;
183
+ if (isElementPreceding(elementA, elementB)) {
184
+ if (indexA > indexB) {
185
+ isOrderDifferent = true;
186
+ }
187
+ return -1;
188
+ }
189
+ if (indexA < indexB) {
190
+ isOrderDifferent = true;
191
+ }
192
+ return 1;
193
+ });
194
+ if (isOrderDifferent) {
195
+ return pairs.map(([_, item]) => item);
196
+ }
197
+ return items;
198
+ }
199
+ function isElementPreceding(a, b) {
200
+ return Boolean(
201
+ b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING
202
+ );
203
+ }
171
204
 
172
205
  export {
173
206
  canUseDOM,
@@ -187,5 +220,6 @@ export {
187
220
  scrollIntoViewIfNeeded,
188
221
  getScrollingElement,
189
222
  isPartiallyHidden,
190
- setSelectionRange
223
+ setSelectionRange,
224
+ sortBasedOnDOMPosition
191
225
  };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  createDisclosureStore
4
- } from "./6E4KKOSB.js";
4
+ } from "./RCQ5P4YE.js";
5
5
 
6
6
  // src/dialog/dialog-store.ts
7
7
  function createDialogStore(props = {}) {