@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @ariakit/core
2
2
 
3
+ ## 0.4.14
4
+
5
+ - Fixed a regression on [Hovercard](https://ariakit.org/components/hovercard) that sometimes prevented it from closing when other popups were opened.
6
+ - Fixed typings for [`onSubmit`](https://ariakit.org/reference/use-form-store#onsubmit) and [`onValidate`](https://ariakit.org/reference/use-form-store#onvalidate).
7
+ - Improved JSDocs.
8
+
9
+ ## 0.4.13
10
+
11
+ - Fixed the [`item`](https://ariakit.org/reference/use-collection-store#item) method to prevent it from returning items that have been removed from the collection store.
12
+ - Fixed the [`item`](https://ariakit.org/reference/use-menu-store#item) method when keeping different menu stores in sync.
13
+ - Added [`id`](https://ariakit.org/reference/use-composite-store#id) prop to composite stores.
14
+ - Added `sortBasedOnDOMPosition` function.
15
+ - Updated core utils.
16
+ - Improved JSDocs.
17
+
3
18
  ## 0.4.12
4
19
 
5
20
  - Fixed regression in [`focusShift`](https://ariakit.org/reference/composite-provider#focusshift).
@@ -5,9 +5,13 @@ function checkIsBrowser() {
5
5
  return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement);
6
6
  }
7
7
  function getDocument(node) {
8
- return node ? node.ownerDocument || node : document;
8
+ if (!node) return document;
9
+ if ("self" in node) return node.document;
10
+ return node.ownerDocument || document;
9
11
  }
10
12
  function getWindow(node) {
13
+ if (!node) return self;
14
+ if ("self" in node) return node.self;
11
15
  return getDocument(node).defaultView || window;
12
16
  }
13
17
  function getActiveElement(node, activeDescendant = false) {
@@ -166,6 +170,36 @@ function setSelectionRange(element, ...args) {
166
170
  element.setSelectionRange(...args);
167
171
  }
168
172
  }
173
+ function sortBasedOnDOMPosition(items, getElement) {
174
+ const pairs = items.map((item, index) => [index, item]);
175
+ let isOrderDifferent = false;
176
+ pairs.sort(([indexA, a], [indexB, b]) => {
177
+ const elementA = getElement(a);
178
+ const elementB = getElement(b);
179
+ if (elementA === elementB) return 0;
180
+ if (!elementA || !elementB) return 0;
181
+ if (isElementPreceding(elementA, elementB)) {
182
+ if (indexA > indexB) {
183
+ isOrderDifferent = true;
184
+ }
185
+ return -1;
186
+ }
187
+ if (indexA < indexB) {
188
+ isOrderDifferent = true;
189
+ }
190
+ return 1;
191
+ });
192
+ if (isOrderDifferent) {
193
+ return pairs.map(([_, item]) => item);
194
+ }
195
+ return items;
196
+ }
197
+ function isElementPreceding(a, b) {
198
+ return Boolean(
199
+ b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING
200
+ );
201
+ }
202
+
169
203
 
170
204
 
171
205
 
@@ -186,4 +220,4 @@ function setSelectionRange(element, ...args) {
186
220
 
187
221
 
188
222
 
189
- exports.canUseDOM = canUseDOM; exports.getDocument = getDocument; exports.getWindow = getWindow; exports.getActiveElement = getActiveElement; exports.contains = contains; exports.isFrame = isFrame; exports.isButton = isButton; exports.isVisible = isVisible; exports.isTextField = isTextField; exports.isTextbox = isTextbox; exports.getTextboxValue = getTextboxValue; exports.getTextboxSelection = getTextboxSelection; exports.getPopupRole = getPopupRole; exports.getPopupItemRole = getPopupItemRole; exports.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded; exports.getScrollingElement = getScrollingElement; exports.isPartiallyHidden = isPartiallyHidden; exports.setSelectionRange = setSelectionRange;
223
+ exports.canUseDOM = canUseDOM; exports.getDocument = getDocument; exports.getWindow = getWindow; exports.getActiveElement = getActiveElement; exports.contains = contains; exports.isFrame = isFrame; exports.isButton = isButton; exports.isVisible = isVisible; exports.isTextField = isTextField; exports.isTextbox = isTextbox; exports.getTextboxValue = getTextboxValue; exports.getTextboxSelection = getTextboxSelection; exports.getPopupRole = getPopupRole; exports.getPopupItemRole = getPopupItemRole; exports.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded; exports.getScrollingElement = getScrollingElement; exports.isPartiallyHidden = isPartiallyHidden; exports.setSelectionRange = setSelectionRange; exports.sortBasedOnDOMPosition = sortBasedOnDOMPosition;
@@ -183,7 +183,7 @@ function mergeStore(...stores) {
183
183
  return Object.assign(state, nextState);
184
184
  }, {});
185
185
  const store = createStore(initialState, ...stores);
186
- return store;
186
+ return Object.assign({}, ...stores, store);
187
187
  }
188
188
  function throwOnConflictingProps(props, store) {
189
189
  if (process.env.NODE_ENV === "production") return;
@@ -4,49 +4,21 @@
4
4
 
5
5
 
6
6
 
7
- var _BSLRW6E7cjs = require('./BSLRW6E7.cjs');
7
+ var _ASR6PAFNcjs = require('./ASR6PAFN.cjs');
8
8
 
9
9
 
10
10
 
11
11
  var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
12
12
 
13
13
 
14
- var _WCFMOJKVcjs = require('./WCFMOJKV.cjs');
14
+
15
+ var _726BNPQZcjs = require('./726BNPQZ.cjs');
15
16
 
16
17
 
17
18
 
18
19
  var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
19
20
 
20
21
  // src/collection/collection-store.ts
21
- function isElementPreceding(a, b) {
22
- return Boolean(
23
- b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING
24
- );
25
- }
26
- function sortBasedOnDOMPosition(items) {
27
- const pairs = items.map((item, index) => [index, item]);
28
- let isOrderDifferent = false;
29
- pairs.sort(([indexA, a], [indexB, b]) => {
30
- const elementA = a.element;
31
- const elementB = b.element;
32
- if (elementA === elementB) return 0;
33
- if (!elementA || !elementB) return 0;
34
- if (isElementPreceding(elementA, elementB)) {
35
- if (indexA > indexB) {
36
- isOrderDifferent = true;
37
- }
38
- return -1;
39
- }
40
- if (indexA < indexB) {
41
- isOrderDifferent = true;
42
- }
43
- return 1;
44
- });
45
- if (isOrderDifferent) {
46
- return pairs.map(([_, item]) => item);
47
- }
48
- return items;
49
- }
50
22
  function getCommonParent(items) {
51
23
  var _a;
52
24
  const firstItem = items.find((item) => !!item.element);
@@ -59,14 +31,14 @@ function getCommonParent(items) {
59
31
  }
60
32
  parentElement = parentElement.parentElement;
61
33
  }
62
- return _WCFMOJKVcjs.getDocument.call(void 0, parentElement).body;
34
+ return _726BNPQZcjs.getDocument.call(void 0, parentElement).body;
63
35
  }
64
36
  function getPrivateStore(store) {
65
37
  return store == null ? void 0 : store.__unstablePrivateStore;
66
38
  }
67
39
  function createCollectionStore(props = {}) {
68
40
  var _a;
69
- _BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, props.store);
41
+ _ASR6PAFNcjs.throwOnConflictingProps.call(void 0, props, props.store);
70
42
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
71
43
  const items = _MLCPLY2Pcjs.defaultValue.call(void 0,
72
44
  props.items,
@@ -80,24 +52,24 @@ function createCollectionStore(props = {}) {
80
52
  renderedItems: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
81
53
  };
82
54
  const syncPrivateStore = getPrivateStore(props.store);
83
- const privateStore = _BSLRW6E7cjs.createStore.call(void 0,
55
+ const privateStore = _ASR6PAFNcjs.createStore.call(void 0,
84
56
  { items, renderedItems: initialState.renderedItems },
85
57
  syncPrivateStore
86
58
  );
87
- const collection = _BSLRW6E7cjs.createStore.call(void 0, initialState, props.store);
59
+ const collection = _ASR6PAFNcjs.createStore.call(void 0, initialState, props.store);
88
60
  const sortItems = (renderedItems) => {
89
- const sortedItems = sortBasedOnDOMPosition(renderedItems);
61
+ const sortedItems = _726BNPQZcjs.sortBasedOnDOMPosition.call(void 0, renderedItems, (i) => i.element);
90
62
  privateStore.setState("renderedItems", sortedItems);
91
63
  collection.setState("renderedItems", sortedItems);
92
64
  };
93
- _BSLRW6E7cjs.setup.call(void 0, collection, () => _BSLRW6E7cjs.init.call(void 0, privateStore));
94
- _BSLRW6E7cjs.setup.call(void 0, privateStore, () => {
95
- return _BSLRW6E7cjs.batch.call(void 0, privateStore, ["items"], (state) => {
65
+ _ASR6PAFNcjs.setup.call(void 0, collection, () => _ASR6PAFNcjs.init.call(void 0, privateStore));
66
+ _ASR6PAFNcjs.setup.call(void 0, privateStore, () => {
67
+ return _ASR6PAFNcjs.batch.call(void 0, privateStore, ["items"], (state) => {
96
68
  collection.setState("items", state.items);
97
69
  });
98
70
  });
99
- _BSLRW6E7cjs.setup.call(void 0, privateStore, () => {
100
- return _BSLRW6E7cjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
71
+ _ASR6PAFNcjs.setup.call(void 0, privateStore, () => {
72
+ return _ASR6PAFNcjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
101
73
  let firstRun = true;
102
74
  let raf = requestAnimationFrame(() => {
103
75
  const { renderedItems } = collection.getState();
@@ -179,7 +151,7 @@ function createCollectionStore(props = {}) {
179
151
  if (!id) return null;
180
152
  let item = itemsMap.get(id);
181
153
  if (!item) {
182
- const { items: items2 } = collection.getState();
154
+ const { items: items2 } = privateStore.getState();
183
155
  item = items2.find((item2) => item2.id === id);
184
156
  if (item) {
185
157
  itemsMap.set(id, item);
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _I2G6EN27cjs = require('./I2G6EN27.cjs');
3
+ var _YMCSKJHRcjs = require('./YMCSKJHR.cjs');
4
4
 
5
5
 
6
6
 
7
7
 
8
8
 
9
- var _BSLRW6E7cjs = require('./BSLRW6E7.cjs');
9
+ var _ASR6PAFNcjs = require('./ASR6PAFN.cjs');
10
10
 
11
11
 
12
12
  var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
@@ -23,9 +23,9 @@ function createPopoverStore(_a = {}) {
23
23
  } = _b, props = _7EQBAZ46cjs.__objRest.call(void 0, _b, [
24
24
  "popover"
25
25
  ]);
26
- const store = _BSLRW6E7cjs.mergeStore.call(void 0,
26
+ const store = _ASR6PAFNcjs.mergeStore.call(void 0,
27
27
  props.store,
28
- _BSLRW6E7cjs.omit.call(void 0, otherPopover, [
28
+ _ASR6PAFNcjs.omit.call(void 0, otherPopover, [
29
29
  "arrowElement",
30
30
  "anchorElement",
31
31
  "contentElement",
@@ -33,9 +33,9 @@ function createPopoverStore(_a = {}) {
33
33
  "disclosureElement"
34
34
  ])
35
35
  );
36
- _BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, store);
36
+ _ASR6PAFNcjs.throwOnConflictingProps.call(void 0, props, store);
37
37
  const syncState = store == null ? void 0 : store.getState();
38
- const dialog = _I2G6EN27cjs.createDialogStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), { store }));
38
+ const dialog = _YMCSKJHRcjs.createDialogStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), { store }));
39
39
  const placement = _MLCPLY2Pcjs.defaultValue.call(void 0,
40
40
  props.placement,
41
41
  syncState == null ? void 0 : syncState.placement,
@@ -49,7 +49,7 @@ function createPopoverStore(_a = {}) {
49
49
  arrowElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
50
50
  rendered: Symbol("rendered")
51
51
  });
52
- const popover = _BSLRW6E7cjs.createStore.call(void 0, initialState, dialog, store);
52
+ const popover = _ASR6PAFNcjs.createStore.call(void 0, initialState, dialog, store);
53
53
  return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, dialog), popover), {
54
54
  setAnchorElement: (element) => popover.setState("anchorElement", element),
55
55
  setPopoverElement: (element) => popover.setState("popoverElement", element),
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _G2NIRMCLcjs = require('./G2NIRMCL.cjs');
3
+ var _BUEPUCQLcjs = require('./BUEPUCQL.cjs');
4
4
 
5
5
 
6
6
 
@@ -9,7 +9,7 @@ var _GDZQUFNPcjs = require('./GDZQUFNP.cjs');
9
9
 
10
10
 
11
11
 
12
- var _BSLRW6E7cjs = require('./BSLRW6E7.cjs');
12
+ var _ASR6PAFNcjs = require('./ASR6PAFN.cjs');
13
13
 
14
14
 
15
15
  var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
@@ -116,13 +116,18 @@ function verticalizeItems(items) {
116
116
  function createCompositeStore(props = {}) {
117
117
  var _a;
118
118
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
119
- const collection = _G2NIRMCLcjs.createCollectionStore.call(void 0, props);
119
+ const collection = _BUEPUCQLcjs.createCollectionStore.call(void 0, props);
120
120
  const activeId = _MLCPLY2Pcjs.defaultValue.call(void 0,
121
121
  props.activeId,
122
122
  syncState == null ? void 0 : syncState.activeId,
123
123
  props.defaultActiveId
124
124
  );
125
125
  const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, collection.getState()), {
126
+ id: _MLCPLY2Pcjs.defaultValue.call(void 0,
127
+ props.id,
128
+ syncState == null ? void 0 : syncState.id,
129
+ `id-${Math.random().toString(36).slice(2, 8)}`
130
+ ),
126
131
  activeId,
127
132
  baseElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.baseElement, null),
128
133
  includesBaseElement: _MLCPLY2Pcjs.defaultValue.call(void 0,
@@ -146,10 +151,10 @@ function createCompositeStore(props = {}) {
146
151
  focusWrap: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
147
152
  focusShift: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
148
153
  });
149
- const composite = _BSLRW6E7cjs.createStore.call(void 0, initialState, collection, props.store);
150
- _BSLRW6E7cjs.setup.call(void 0,
154
+ const composite = _ASR6PAFNcjs.createStore.call(void 0, initialState, collection, props.store);
155
+ _ASR6PAFNcjs.setup.call(void 0,
151
156
  composite,
152
- () => _BSLRW6E7cjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
157
+ () => _ASR6PAFNcjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
153
158
  composite.setState("activeId", (activeId2) => {
154
159
  var _a2;
155
160
  if (activeId2 !== void 0) return activeId2;
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _C5P5S22Jcjs = require('./C5P5S22J.cjs');
3
+ var _BVPEDDW6cjs = require('./BVPEDDW6.cjs');
4
4
 
5
5
 
6
- var _BSLRW6E7cjs = require('./BSLRW6E7.cjs');
6
+ var _ASR6PAFNcjs = require('./ASR6PAFN.cjs');
7
7
 
8
8
 
9
9
  var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
@@ -16,7 +16,7 @@ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
16
16
  function createHovercardStore(props = {}) {
17
17
  var _a;
18
18
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
19
- const popover = _C5P5S22Jcjs.createPopoverStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
19
+ const popover = _BVPEDDW6cjs.createPopoverStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
20
20
  placement: _MLCPLY2Pcjs.defaultValue.call(void 0,
21
21
  props.placement,
22
22
  syncState == null ? void 0 : syncState.placement,
@@ -30,7 +30,7 @@ function createHovercardStore(props = {}) {
30
30
  hideTimeout: _MLCPLY2Pcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
31
31
  autoFocusOnShow: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
32
32
  });
33
- const hovercard = _BSLRW6E7cjs.createStore.call(void 0, initialState, popover, props.store);
33
+ const hovercard = _ASR6PAFNcjs.createStore.call(void 0, initialState, popover, props.store);
34
34
  return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, popover), hovercard), {
35
35
  setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
36
36
  });
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _A47DWKLRcjs = require('./A47DWKLR.cjs');
3
+ var _K7YTZVWCcjs = require('./K7YTZVWC.cjs');
4
4
 
5
5
 
6
- var _BSLRW6E7cjs = require('./BSLRW6E7.cjs');
6
+ var _ASR6PAFNcjs = require('./ASR6PAFN.cjs');
7
7
 
8
8
 
9
9
  var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
@@ -16,7 +16,7 @@ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
16
16
  function createMenubarStore(props = {}) {
17
17
  var _a;
18
18
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
19
- const composite = _A47DWKLRcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
19
+ const composite = _K7YTZVWCcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
20
20
  orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
21
21
  props.orientation,
22
22
  syncState == null ? void 0 : syncState.orientation,
@@ -25,7 +25,7 @@ function createMenubarStore(props = {}) {
25
25
  focusLoop: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
26
26
  }));
27
27
  const initialState = _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite.getState());
28
- const menubar = _BSLRW6E7cjs.createStore.call(void 0, initialState, composite, props.store);
28
+ const menubar = _ASR6PAFNcjs.createStore.call(void 0, initialState, composite, props.store);
29
29
  return _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite), menubar);
30
30
  }
31
31
 
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _BSLRW6E7cjs = require('./BSLRW6E7.cjs');
9
+ var _ASR6PAFNcjs = require('./ASR6PAFN.cjs');
10
10
 
11
11
 
12
12
  var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
@@ -17,11 +17,11 @@ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
17
17
 
18
18
  // src/disclosure/disclosure-store.ts
19
19
  function createDisclosureStore(props = {}) {
20
- const store = _BSLRW6E7cjs.mergeStore.call(void 0,
20
+ const store = _ASR6PAFNcjs.mergeStore.call(void 0,
21
21
  props.store,
22
- _BSLRW6E7cjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
22
+ _ASR6PAFNcjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
23
23
  );
24
- _BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, store);
24
+ _ASR6PAFNcjs.throwOnConflictingProps.call(void 0, props, store);
25
25
  const syncState = store == null ? void 0 : store.getState();
26
26
  const open = _MLCPLY2Pcjs.defaultValue.call(void 0,
27
27
  props.open,
@@ -38,24 +38,24 @@ function createDisclosureStore(props = {}) {
38
38
  contentElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
39
39
  disclosureElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
40
40
  };
41
- const disclosure = _BSLRW6E7cjs.createStore.call(void 0, initialState, store);
42
- _BSLRW6E7cjs.setup.call(void 0,
41
+ const disclosure = _ASR6PAFNcjs.createStore.call(void 0, initialState, store);
42
+ _ASR6PAFNcjs.setup.call(void 0,
43
43
  disclosure,
44
- () => _BSLRW6E7cjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
44
+ () => _ASR6PAFNcjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
45
45
  if (state.animated) return;
46
46
  disclosure.setState("animating", false);
47
47
  })
48
48
  );
49
- _BSLRW6E7cjs.setup.call(void 0,
49
+ _ASR6PAFNcjs.setup.call(void 0,
50
50
  disclosure,
51
- () => _BSLRW6E7cjs.subscribe.call(void 0, disclosure, ["open"], () => {
51
+ () => _ASR6PAFNcjs.subscribe.call(void 0, disclosure, ["open"], () => {
52
52
  if (!disclosure.getState().animated) return;
53
53
  disclosure.setState("animating", true);
54
54
  })
55
55
  );
56
- _BSLRW6E7cjs.setup.call(void 0,
56
+ _ASR6PAFNcjs.setup.call(void 0,
57
57
  disclosure,
58
- () => _BSLRW6E7cjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
58
+ () => _ASR6PAFNcjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
59
59
  disclosure.setState("mounted", state.open || state.animating);
60
60
  })
61
61
  );
@@ -1,23 +1,23 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _WCFMOJKVcjs = require('./WCFMOJKV.cjs');
3
+ var _726BNPQZcjs = require('./726BNPQZ.cjs');
4
4
 
5
5
  // src/utils/platform.ts
6
6
  function isTouchDevice() {
7
- return _WCFMOJKVcjs.canUseDOM && !!navigator.maxTouchPoints;
7
+ return _726BNPQZcjs.canUseDOM && !!navigator.maxTouchPoints;
8
8
  }
9
9
  function isApple() {
10
- if (!_WCFMOJKVcjs.canUseDOM) return false;
10
+ if (!_726BNPQZcjs.canUseDOM) return false;
11
11
  return /mac|iphone|ipad|ipod/i.test(navigator.platform);
12
12
  }
13
13
  function isSafari() {
14
- return _WCFMOJKVcjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
14
+ return _726BNPQZcjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
15
15
  }
16
16
  function isFirefox() {
17
- return _WCFMOJKVcjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
17
+ return _726BNPQZcjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
18
18
  }
19
19
  function isMac() {
20
- return _WCFMOJKVcjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
20
+ return _726BNPQZcjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
21
21
  }
22
22
 
23
23
 
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _G2MFLTB2cjs = require('./G2MFLTB2.cjs');
3
+ var _V4YF2QA6cjs = require('./V4YF2QA6.cjs');
4
4
 
5
5
  // src/dialog/dialog-store.ts
6
6
  function createDialogStore(props = {}) {
7
- return _G2MFLTB2cjs.createDisclosureStore.call(void 0, props);
7
+ return _V4YF2QA6cjs.createDisclosureStore.call(void 0, props);
8
8
  }
9
9
 
10
10
 
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _BSLRW6E7cjs = require('../__chunks/BSLRW6E7.cjs');
4
+ var _ASR6PAFNcjs = require('../__chunks/ASR6PAFN.cjs');
5
5
 
6
6
 
7
7
  var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
@@ -13,7 +13,7 @@ var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
13
13
  // src/checkbox/checkbox-store.ts
14
14
  function createCheckboxStore(props = {}) {
15
15
  var _a;
16
- _BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, props.store);
16
+ _ASR6PAFNcjs.throwOnConflictingProps.call(void 0, props, props.store);
17
17
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
18
18
  const initialState = {
19
19
  value: _MLCPLY2Pcjs.defaultValue.call(void 0,
@@ -23,7 +23,7 @@ function createCheckboxStore(props = {}) {
23
23
  false
24
24
  )
25
25
  };
26
- const checkbox = _BSLRW6E7cjs.createStore.call(void 0, initialState, props.store);
26
+ const checkbox = _ASR6PAFNcjs.createStore.call(void 0, initialState, props.store);
27
27
  return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, checkbox), {
28
28
  setValue: (value) => checkbox.setState("value", value)
29
29
  });
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _G2NIRMCLcjs = require('../__chunks/G2NIRMCL.cjs');
4
- require('../__chunks/BSLRW6E7.cjs');
3
+ var _BUEPUCQLcjs = require('../__chunks/BUEPUCQL.cjs');
4
+ require('../__chunks/ASR6PAFN.cjs');
5
5
  require('../__chunks/MLCPLY2P.cjs');
6
- require('../__chunks/WCFMOJKV.cjs');
6
+ require('../__chunks/726BNPQZ.cjs');
7
7
  require('../__chunks/7EQBAZ46.cjs');
8
8
 
9
9
 
10
- exports.createCollectionStore = _G2NIRMCLcjs.createCollectionStore;
10
+ exports.createCollectionStore = _BUEPUCQLcjs.createCollectionStore;
@@ -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
6
 
7
7
 
8
- var _C5P5S22Jcjs = require('../__chunks/C5P5S22J.cjs');
9
- require('../__chunks/I2G6EN27.cjs');
10
- require('../__chunks/G2MFLTB2.cjs');
8
+ var _BVPEDDW6cjs = require('../__chunks/BVPEDDW6.cjs');
9
+ require('../__chunks/YMCSKJHR.cjs');
10
+ require('../__chunks/V4YF2QA6.cjs');
11
11
 
12
12
 
13
13
 
@@ -16,7 +16,7 @@ require('../__chunks/G2MFLTB2.cjs');
16
16
 
17
17
 
18
18
 
19
- var _BSLRW6E7cjs = require('../__chunks/BSLRW6E7.cjs');
19
+ var _ASR6PAFNcjs = require('../__chunks/ASR6PAFN.cjs');
20
20
 
21
21
 
22
22
 
@@ -24,8 +24,8 @@ var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
24
24
 
25
25
 
26
26
 
27
- var _TEPPO3KCcjs = require('../__chunks/TEPPO3KC.cjs');
28
- require('../__chunks/WCFMOJKV.cjs');
27
+ var _WOLZY4WCcjs = require('../__chunks/WOLZY4WC.cjs');
28
+ require('../__chunks/726BNPQZ.cjs');
29
29
 
30
30
 
31
31
 
@@ -33,15 +33,15 @@ require('../__chunks/WCFMOJKV.cjs');
33
33
  var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
34
34
 
35
35
  // src/combobox/combobox-store.ts
36
- var isTouchSafari = _TEPPO3KCcjs.isSafari.call(void 0, ) && _TEPPO3KCcjs.isTouchDevice.call(void 0, );
36
+ var isTouchSafari = _WOLZY4WCcjs.isSafari.call(void 0, ) && _WOLZY4WCcjs.isTouchDevice.call(void 0, );
37
37
  function createComboboxStore(_a = {}) {
38
38
  var _b = _a, {
39
39
  tag
40
40
  } = _b, props = _7EQBAZ46cjs.__objRest.call(void 0, _b, [
41
41
  "tag"
42
42
  ]);
43
- const store = _BSLRW6E7cjs.mergeStore.call(void 0, props.store, _BSLRW6E7cjs.pick.call(void 0, tag, ["value", "rtl"]));
44
- _BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, store);
43
+ const store = _ASR6PAFNcjs.mergeStore.call(void 0, props.store, _ASR6PAFNcjs.pick.call(void 0, tag, ["value", "rtl"]));
44
+ _ASR6PAFNcjs.throwOnConflictingProps.call(void 0, props, store);
45
45
  const tagState = tag == null ? void 0 : tag.getState();
46
46
  const syncState = store == null ? void 0 : store.getState();
47
47
  const activeId = _MLCPLY2Pcjs.defaultValue.call(void 0,
@@ -50,7 +50,7 @@ function createComboboxStore(_a = {}) {
50
50
  props.defaultActiveId,
51
51
  null
52
52
  );
53
- const composite = _A47DWKLRcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
53
+ const composite = _K7YTZVWCcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
54
54
  activeId,
55
55
  includesBaseElement: _MLCPLY2Pcjs.defaultValue.call(void 0,
56
56
  props.includesBaseElement,
@@ -70,7 +70,7 @@ function createComboboxStore(_a = {}) {
70
70
  true
71
71
  )
72
72
  }));
73
- const popover = _C5P5S22Jcjs.createPopoverStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
73
+ const popover = _BVPEDDW6cjs.createPopoverStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
74
74
  placement: _MLCPLY2Pcjs.defaultValue.call(void 0,
75
75
  props.placement,
76
76
  syncState == null ? void 0 : syncState.placement,
@@ -106,54 +106,54 @@ function createComboboxStore(_a = {}) {
106
106
  ),
107
107
  activeValue: syncState == null ? void 0 : syncState.activeValue
108
108
  });
109
- const combobox = _BSLRW6E7cjs.createStore.call(void 0, initialState, composite, popover, store);
109
+ const combobox = _ASR6PAFNcjs.createStore.call(void 0, initialState, composite, popover, store);
110
110
  if (isTouchSafari) {
111
- _BSLRW6E7cjs.setup.call(void 0,
111
+ _ASR6PAFNcjs.setup.call(void 0,
112
112
  combobox,
113
- () => _BSLRW6E7cjs.sync.call(void 0, combobox, ["virtualFocus"], () => {
113
+ () => _ASR6PAFNcjs.sync.call(void 0, combobox, ["virtualFocus"], () => {
114
114
  combobox.setState("virtualFocus", false);
115
115
  })
116
116
  );
117
117
  }
118
- _BSLRW6E7cjs.setup.call(void 0, combobox, () => {
118
+ _ASR6PAFNcjs.setup.call(void 0, combobox, () => {
119
119
  if (!tag) return;
120
120
  return _MLCPLY2Pcjs.chain.call(void 0,
121
- _BSLRW6E7cjs.sync.call(void 0, combobox, ["selectedValue"], (state) => {
121
+ _ASR6PAFNcjs.sync.call(void 0, combobox, ["selectedValue"], (state) => {
122
122
  if (!Array.isArray(state.selectedValue)) return;
123
123
  tag.setValues(state.selectedValue);
124
124
  }),
125
- _BSLRW6E7cjs.sync.call(void 0, tag, ["values"], (state) => {
125
+ _ASR6PAFNcjs.sync.call(void 0, tag, ["values"], (state) => {
126
126
  combobox.setState("selectedValue", state.values);
127
127
  })
128
128
  );
129
129
  });
130
- _BSLRW6E7cjs.setup.call(void 0,
130
+ _ASR6PAFNcjs.setup.call(void 0,
131
131
  combobox,
132
- () => _BSLRW6E7cjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
132
+ () => _ASR6PAFNcjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
133
133
  if (!state.resetValueOnHide) return;
134
134
  if (state.mounted) return;
135
135
  combobox.setState("value", value);
136
136
  })
137
137
  );
138
- _BSLRW6E7cjs.setup.call(void 0,
138
+ _ASR6PAFNcjs.setup.call(void 0,
139
139
  combobox,
140
- () => _BSLRW6E7cjs.sync.call(void 0, combobox, ["open"], (state) => {
140
+ () => _ASR6PAFNcjs.sync.call(void 0, combobox, ["open"], (state) => {
141
141
  if (state.open) return;
142
142
  combobox.setState("activeId", activeId);
143
143
  combobox.setState("moves", 0);
144
144
  })
145
145
  );
146
- _BSLRW6E7cjs.setup.call(void 0,
146
+ _ASR6PAFNcjs.setup.call(void 0,
147
147
  combobox,
148
- () => _BSLRW6E7cjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
148
+ () => _ASR6PAFNcjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
149
149
  if (state.moves === prevState.moves) {
150
150
  combobox.setState("activeValue", void 0);
151
151
  }
152
152
  })
153
153
  );
154
- _BSLRW6E7cjs.setup.call(void 0,
154
+ _ASR6PAFNcjs.setup.call(void 0,
155
155
  combobox,
156
- () => _BSLRW6E7cjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
156
+ () => _ASR6PAFNcjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
157
157
  if (state.moves === prev.moves) return;
158
158
  const { activeId: activeId2 } = combobox.getState();
159
159
  const activeItem = composite.item(activeId2);