@ariakit/core 0.4.15 → 0.4.17

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 (98) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/cjs/__chunks/{MLCPLY2P.cjs → 6BYUUR4M.cjs} +2 -6
  3. package/cjs/__chunks/{WOLZY4WC.cjs → 6REHCF5T.cjs} +6 -6
  4. package/cjs/__chunks/AOXAROPF.cjs +59 -0
  5. package/cjs/__chunks/CPH45Z4I.cjs +36 -0
  6. package/cjs/__chunks/{MNBBM5CR.cjs → LT33CJGT.cjs} +20 -23
  7. package/cjs/__chunks/{V4YF2QA6.cjs → MJNGPYVQ.cjs} +19 -22
  8. package/cjs/__chunks/{RNIVVQWX.cjs → NNJG45OF.cjs} +28 -28
  9. package/cjs/__chunks/{YMCSKJHR.cjs → T247D7JS.cjs} +2 -2
  10. package/cjs/__chunks/UROTDZFK.cjs +41 -0
  11. package/cjs/__chunks/{726BNPQZ.cjs → VZPNI7C2.cjs} +1 -1
  12. package/cjs/__chunks/{ASR6PAFN.cjs → WPBYRKFQ.cjs} +20 -22
  13. package/cjs/checkbox/checkbox-store.cjs +8 -11
  14. package/cjs/checkbox/checkbox-store.d.cts +1 -1
  15. package/cjs/checkbox/checkbox-store.d.ts +1 -1
  16. package/cjs/collection/collection-store.cjs +5 -6
  17. package/cjs/combobox/combobox-store.cjs +57 -57
  18. package/cjs/combobox/combobox-store.d.cts +1 -1
  19. package/cjs/combobox/combobox-store.d.ts +1 -1
  20. package/cjs/composite/composite-overflow-store.cjs +6 -7
  21. package/cjs/composite/composite-store.cjs +6 -7
  22. package/cjs/dialog/dialog-store.cjs +5 -6
  23. package/cjs/disclosure/disclosure-store.cjs +4 -5
  24. package/cjs/form/form-store.cjs +34 -35
  25. package/cjs/hovercard/hovercard-store.cjs +7 -8
  26. package/cjs/index.cjs +1 -3
  27. package/cjs/menu/menu-bar-store.cjs +7 -8
  28. package/cjs/menu/menu-store.cjs +49 -50
  29. package/cjs/menu/menu-store.d.cts +1 -1
  30. package/cjs/menu/menu-store.d.ts +1 -1
  31. package/cjs/menubar/menubar-store.cjs +7 -8
  32. package/cjs/popover/popover-store.cjs +6 -7
  33. package/cjs/radio/radio-store.cjs +23 -23
  34. package/cjs/select/select-store.cjs +49 -49
  35. package/cjs/select/select-store.d.cts +1 -1
  36. package/cjs/select/select-store.d.ts +1 -1
  37. package/cjs/tab/tab-store.cjs +47 -51
  38. package/cjs/tag/tag-store.cjs +21 -22
  39. package/cjs/toolbar/toolbar-store.cjs +10 -13
  40. package/cjs/tooltip/tooltip-store.cjs +20 -19
  41. package/cjs/utils/array.cjs +0 -1
  42. package/cjs/utils/dom.cjs +2 -3
  43. package/cjs/utils/events.cjs +7 -11
  44. package/cjs/utils/focus.cjs +11 -14
  45. package/cjs/utils/misc.cjs +2 -3
  46. package/cjs/utils/platform.cjs +3 -4
  47. package/cjs/utils/store.cjs +3 -4
  48. package/cjs/utils/undo.cjs +0 -1
  49. package/esm/__chunks/{DTR5TSDJ.js → 37JWRFYW.js} +1 -1
  50. package/esm/__chunks/{2CHYBBFH.js → 73UNQSFO.js} +13 -13
  51. package/esm/__chunks/{RCQ5P4YE.js → 75BJEVSH.js} +5 -8
  52. package/esm/__chunks/{EO4GVUA4.js → AMRA5WUK.js} +7 -10
  53. package/esm/__chunks/{ME2CUF3F.js → BFGNM53A.js} +15 -19
  54. package/esm/__chunks/{FZZ2AVHF.js → KMAUV3TY.js} +1 -1
  55. package/esm/__chunks/{QAGXQEUG.js → O6E4ZWCP.js} +1 -1
  56. package/esm/__chunks/{PQ5AROUB.js → PSMDSJUH.js} +13 -11
  57. package/esm/__chunks/{BCALMBPZ.js → SXKM4CGU.js} +9 -11
  58. package/esm/__chunks/{JTLIIJ4U.js → TIQDSBWP.js} +13 -13
  59. package/esm/__chunks/{PBFD2E7P.js → XMCVU3LR.js} +1 -4
  60. package/esm/checkbox/checkbox-store.d.ts +1 -1
  61. package/esm/checkbox/checkbox-store.js +5 -8
  62. package/esm/collection/collection-store.js +4 -5
  63. package/esm/combobox/combobox-store.d.ts +1 -1
  64. package/esm/combobox/combobox-store.js +28 -28
  65. package/esm/composite/composite-overflow-store.js +5 -6
  66. package/esm/composite/composite-store.js +5 -6
  67. package/esm/dialog/dialog-store.js +4 -5
  68. package/esm/disclosure/disclosure-store.js +3 -4
  69. package/esm/form/form-store.js +12 -13
  70. package/esm/hovercard/hovercard-store.js +6 -7
  71. package/esm/index.js +0 -1
  72. package/esm/menu/menu-bar-store.js +6 -7
  73. package/esm/menu/menu-store.d.ts +1 -1
  74. package/esm/menu/menu-store.js +33 -34
  75. package/esm/menubar/menubar-store.js +6 -7
  76. package/esm/popover/popover-store.js +5 -6
  77. package/esm/radio/radio-store.js +20 -20
  78. package/esm/select/select-store.d.ts +1 -1
  79. package/esm/select/select-store.js +27 -27
  80. package/esm/tab/tab-store.js +21 -25
  81. package/esm/tag/tag-store.js +12 -13
  82. package/esm/toolbar/toolbar-store.js +8 -11
  83. package/esm/tooltip/tooltip-store.js +16 -15
  84. package/esm/utils/array.js +0 -1
  85. package/esm/utils/dom.js +1 -2
  86. package/esm/utils/events.js +4 -8
  87. package/esm/utils/focus.js +2 -5
  88. package/esm/utils/misc.js +1 -2
  89. package/esm/utils/platform.js +2 -3
  90. package/esm/utils/store.js +2 -3
  91. package/esm/utils/undo.js +0 -1
  92. package/license +1 -1
  93. package/package.json +1 -1
  94. package/cjs/__chunks/7EQBAZ46.cjs +0 -37
  95. package/cjs/__chunks/BVPEDDW6.cjs +0 -63
  96. package/cjs/__chunks/CEJUJMDW.cjs +0 -34
  97. package/cjs/__chunks/RL7DKHOF.cjs +0 -41
  98. package/esm/__chunks/3YLGPPWQ.js +0 -38
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @ariakit/core
2
2
 
3
+ ## 0.4.17
4
+
5
+ - Updated packages to target ES2018 (previously ES2017).
6
+
7
+ ## 0.4.16
8
+
9
+ - Updated `Array` types to `ReadonlyArray` for better compatibility.
10
+
3
11
  ## 0.4.15
4
12
 
5
13
  - Fixed `valid` state not updating on [Form](https://ariakit.org/components/form).
@@ -1,8 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
4
-
5
- // src/utils/misc.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/misc.ts
6
2
  function noop(..._) {
7
3
  }
8
4
  function shallowEqual(a, b) {
@@ -73,7 +69,7 @@ function normalizeString(str) {
73
69
  return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
74
70
  }
75
71
  function omit(object, keys) {
76
- const result = _7EQBAZ46cjs.__spreadValues.call(void 0, {}, object);
72
+ const result = { ...object };
77
73
  for (const key of keys) {
78
74
  if (hasOwnProperty(result, key)) {
79
75
  delete result[key];
@@ -1,23 +1,23 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _726BNPQZcjs = require('./726BNPQZ.cjs');
3
+ var _VZPNI7C2cjs = require('./VZPNI7C2.cjs');
4
4
 
5
5
  // src/utils/platform.ts
6
6
  function isTouchDevice() {
7
- return _726BNPQZcjs.canUseDOM && !!navigator.maxTouchPoints;
7
+ return _VZPNI7C2cjs.canUseDOM && !!navigator.maxTouchPoints;
8
8
  }
9
9
  function isApple() {
10
- if (!_726BNPQZcjs.canUseDOM) return false;
10
+ if (!_VZPNI7C2cjs.canUseDOM) return false;
11
11
  return /mac|iphone|ipad|ipod/i.test(navigator.platform);
12
12
  }
13
13
  function isSafari() {
14
- return _726BNPQZcjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
14
+ return _VZPNI7C2cjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
15
15
  }
16
16
  function isFirefox() {
17
- return _726BNPQZcjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
17
+ return _VZPNI7C2cjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
18
18
  }
19
19
  function isMac() {
20
- return _726BNPQZcjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
20
+ return _VZPNI7C2cjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
21
21
  }
22
22
 
23
23
 
@@ -0,0 +1,59 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _T247D7JScjs = require('./T247D7JS.cjs');
4
+
5
+
6
+
7
+
8
+
9
+ var _WPBYRKFQcjs = require('./WPBYRKFQ.cjs');
10
+
11
+
12
+ var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
13
+
14
+ // src/popover/popover-store.ts
15
+ function createPopoverStore({
16
+ popover: otherPopover,
17
+ ...props
18
+ } = {}) {
19
+ const store = _WPBYRKFQcjs.mergeStore.call(void 0,
20
+ props.store,
21
+ _WPBYRKFQcjs.omit.call(void 0, otherPopover, [
22
+ "arrowElement",
23
+ "anchorElement",
24
+ "contentElement",
25
+ "popoverElement",
26
+ "disclosureElement"
27
+ ])
28
+ );
29
+ _WPBYRKFQcjs.throwOnConflictingProps.call(void 0, props, store);
30
+ const syncState = store == null ? void 0 : store.getState();
31
+ const dialog = _T247D7JScjs.createDialogStore.call(void 0, { ...props, store });
32
+ const placement = _6BYUUR4Mcjs.defaultValue.call(void 0,
33
+ props.placement,
34
+ syncState == null ? void 0 : syncState.placement,
35
+ "bottom"
36
+ );
37
+ const initialState = {
38
+ ...dialog.getState(),
39
+ placement,
40
+ currentPlacement: placement,
41
+ anchorElement: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.anchorElement, null),
42
+ popoverElement: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.popoverElement, null),
43
+ arrowElement: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
44
+ rendered: Symbol("rendered")
45
+ };
46
+ const popover = _WPBYRKFQcjs.createStore.call(void 0, initialState, dialog, store);
47
+ return {
48
+ ...dialog,
49
+ ...popover,
50
+ setAnchorElement: (element) => popover.setState("anchorElement", element),
51
+ setPopoverElement: (element) => popover.setState("popoverElement", element),
52
+ setArrowElement: (element) => popover.setState("arrowElement", element),
53
+ render: () => popover.setState("rendered", Symbol("rendered"))
54
+ };
55
+ }
56
+
57
+
58
+
59
+ exports.createPopoverStore = createPopoverStore;
@@ -0,0 +1,36 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _NNJG45OFcjs = require('./NNJG45OF.cjs');
4
+
5
+
6
+ var _WPBYRKFQcjs = require('./WPBYRKFQ.cjs');
7
+
8
+
9
+ var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
10
+
11
+ // src/menubar/menubar-store.ts
12
+ function createMenubarStore(props = {}) {
13
+ var _a;
14
+ const syncState = (_a = props.store) == null ? void 0 : _a.getState();
15
+ const composite = _NNJG45OFcjs.createCompositeStore.call(void 0, {
16
+ ...props,
17
+ orientation: _6BYUUR4Mcjs.defaultValue.call(void 0,
18
+ props.orientation,
19
+ syncState == null ? void 0 : syncState.orientation,
20
+ "horizontal"
21
+ ),
22
+ focusLoop: _6BYUUR4Mcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
23
+ });
24
+ const initialState = {
25
+ ...composite.getState()
26
+ };
27
+ const menubar = _WPBYRKFQcjs.createStore.call(void 0, initialState, composite, props.store);
28
+ return {
29
+ ...composite,
30
+ ...menubar
31
+ };
32
+ }
33
+
34
+
35
+
36
+ exports.createMenubarStore = createMenubarStore;
@@ -1,22 +1,18 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _726BNPQZcjs = require('./726BNPQZ.cjs');
4
+ var _VZPNI7C2cjs = require('./VZPNI7C2.cjs');
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
10
 
11
- var _ASR6PAFNcjs = require('./ASR6PAFN.cjs');
11
+ var _WPBYRKFQcjs = require('./WPBYRKFQ.cjs');
12
12
 
13
13
 
14
14
 
15
- var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
16
-
17
-
18
-
19
- var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
15
+ var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
20
16
 
21
17
  // src/collection/collection-store.ts
22
18
  function getCommonParent(items) {
@@ -31,16 +27,16 @@ function getCommonParent(items) {
31
27
  }
32
28
  parentElement = parentElement.parentElement;
33
29
  }
34
- return _726BNPQZcjs.getDocument.call(void 0, parentElement).body;
30
+ return _VZPNI7C2cjs.getDocument.call(void 0, parentElement).body;
35
31
  }
36
32
  function getPrivateStore(store) {
37
33
  return store == null ? void 0 : store.__unstablePrivateStore;
38
34
  }
39
35
  function createCollectionStore(props = {}) {
40
36
  var _a;
41
- _ASR6PAFNcjs.throwOnConflictingProps.call(void 0, props, props.store);
37
+ _WPBYRKFQcjs.throwOnConflictingProps.call(void 0, props, props.store);
42
38
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
43
- const items = _MLCPLY2Pcjs.defaultValue.call(void 0,
39
+ const items = _6BYUUR4Mcjs.defaultValue.call(void 0,
44
40
  props.items,
45
41
  syncState == null ? void 0 : syncState.items,
46
42
  props.defaultItems,
@@ -49,27 +45,27 @@ function createCollectionStore(props = {}) {
49
45
  const itemsMap = new Map(items.map((item) => [item.id, item]));
50
46
  const initialState = {
51
47
  items,
52
- renderedItems: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
48
+ renderedItems: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
53
49
  };
54
50
  const syncPrivateStore = getPrivateStore(props.store);
55
- const privateStore = _ASR6PAFNcjs.createStore.call(void 0,
51
+ const privateStore = _WPBYRKFQcjs.createStore.call(void 0,
56
52
  { items, renderedItems: initialState.renderedItems },
57
53
  syncPrivateStore
58
54
  );
59
- const collection = _ASR6PAFNcjs.createStore.call(void 0, initialState, props.store);
55
+ const collection = _WPBYRKFQcjs.createStore.call(void 0, initialState, props.store);
60
56
  const sortItems = (renderedItems) => {
61
- const sortedItems = _726BNPQZcjs.sortBasedOnDOMPosition.call(void 0, renderedItems, (i) => i.element);
57
+ const sortedItems = _VZPNI7C2cjs.sortBasedOnDOMPosition.call(void 0, renderedItems, (i) => i.element);
62
58
  privateStore.setState("renderedItems", sortedItems);
63
59
  collection.setState("renderedItems", sortedItems);
64
60
  };
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) => {
61
+ _WPBYRKFQcjs.setup.call(void 0, collection, () => _WPBYRKFQcjs.init.call(void 0, privateStore));
62
+ _WPBYRKFQcjs.setup.call(void 0, privateStore, () => {
63
+ return _WPBYRKFQcjs.batch.call(void 0, privateStore, ["items"], (state) => {
68
64
  collection.setState("items", state.items);
69
65
  });
70
66
  });
71
- _ASR6PAFNcjs.setup.call(void 0, privateStore, () => {
72
- return _ASR6PAFNcjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
67
+ _WPBYRKFQcjs.setup.call(void 0, privateStore, () => {
68
+ return _WPBYRKFQcjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
73
69
  let firstRun = true;
74
70
  let raf = requestAnimationFrame(() => {
75
71
  const { renderedItems } = collection.getState();
@@ -106,7 +102,7 @@ function createCollectionStore(props = {}) {
106
102
  const nextItems = items2.slice();
107
103
  if (index !== -1) {
108
104
  prevItem = items2[index];
109
- const nextItem = _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, prevItem), item);
105
+ const nextItem = { ...prevItem, ...item };
110
106
  nextItems[index] = nextItem;
111
107
  itemsMap.set(item.id, nextItem);
112
108
  } else {
@@ -138,9 +134,10 @@ function createCollectionStore(props = {}) {
138
134
  (getItems) => privateStore.setState("items", getItems),
139
135
  true
140
136
  );
141
- return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, collection), {
137
+ return {
138
+ ...collection,
142
139
  registerItem,
143
- renderItem: (item) => _MLCPLY2Pcjs.chain.call(void 0,
140
+ renderItem: (item) => _6BYUUR4Mcjs.chain.call(void 0,
144
141
  registerItem(item),
145
142
  mergeItem(
146
143
  item,
@@ -161,7 +158,7 @@ function createCollectionStore(props = {}) {
161
158
  },
162
159
  // @ts-expect-error Internal
163
160
  __unstablePrivateStore: privateStore
164
- });
161
+ };
165
162
  }
166
163
 
167
164
 
@@ -6,60 +6,57 @@
6
6
 
7
7
 
8
8
 
9
- var _ASR6PAFNcjs = require('./ASR6PAFN.cjs');
9
+ var _WPBYRKFQcjs = require('./WPBYRKFQ.cjs');
10
10
 
11
11
 
12
- var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
13
-
14
-
15
-
16
- var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
12
+ var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
17
13
 
18
14
  // src/disclosure/disclosure-store.ts
19
15
  function createDisclosureStore(props = {}) {
20
- const store = _ASR6PAFNcjs.mergeStore.call(void 0,
16
+ const store = _WPBYRKFQcjs.mergeStore.call(void 0,
21
17
  props.store,
22
- _ASR6PAFNcjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
18
+ _WPBYRKFQcjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
23
19
  );
24
- _ASR6PAFNcjs.throwOnConflictingProps.call(void 0, props, store);
20
+ _WPBYRKFQcjs.throwOnConflictingProps.call(void 0, props, store);
25
21
  const syncState = store == null ? void 0 : store.getState();
26
- const open = _MLCPLY2Pcjs.defaultValue.call(void 0,
22
+ const open = _6BYUUR4Mcjs.defaultValue.call(void 0,
27
23
  props.open,
28
24
  syncState == null ? void 0 : syncState.open,
29
25
  props.defaultOpen,
30
26
  false
31
27
  );
32
- const animated = _MLCPLY2Pcjs.defaultValue.call(void 0, props.animated, syncState == null ? void 0 : syncState.animated, false);
28
+ const animated = _6BYUUR4Mcjs.defaultValue.call(void 0, props.animated, syncState == null ? void 0 : syncState.animated, false);
33
29
  const initialState = {
34
30
  open,
35
31
  animated,
36
32
  animating: !!animated && open,
37
33
  mounted: open,
38
- contentElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
39
- disclosureElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
34
+ contentElement: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
35
+ disclosureElement: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
40
36
  };
41
- const disclosure = _ASR6PAFNcjs.createStore.call(void 0, initialState, store);
42
- _ASR6PAFNcjs.setup.call(void 0,
37
+ const disclosure = _WPBYRKFQcjs.createStore.call(void 0, initialState, store);
38
+ _WPBYRKFQcjs.setup.call(void 0,
43
39
  disclosure,
44
- () => _ASR6PAFNcjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
40
+ () => _WPBYRKFQcjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
45
41
  if (state.animated) return;
46
42
  disclosure.setState("animating", false);
47
43
  })
48
44
  );
49
- _ASR6PAFNcjs.setup.call(void 0,
45
+ _WPBYRKFQcjs.setup.call(void 0,
50
46
  disclosure,
51
- () => _ASR6PAFNcjs.subscribe.call(void 0, disclosure, ["open"], () => {
47
+ () => _WPBYRKFQcjs.subscribe.call(void 0, disclosure, ["open"], () => {
52
48
  if (!disclosure.getState().animated) return;
53
49
  disclosure.setState("animating", true);
54
50
  })
55
51
  );
56
- _ASR6PAFNcjs.setup.call(void 0,
52
+ _WPBYRKFQcjs.setup.call(void 0,
57
53
  disclosure,
58
- () => _ASR6PAFNcjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
54
+ () => _WPBYRKFQcjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
59
55
  disclosure.setState("mounted", state.open || state.animating);
60
56
  })
61
57
  );
62
- return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, disclosure), {
58
+ return {
59
+ ...disclosure,
63
60
  disclosure: props.disclosure,
64
61
  setOpen: (value) => disclosure.setState("open", value),
65
62
  show: () => disclosure.setState("open", true),
@@ -68,7 +65,7 @@ function createDisclosureStore(props = {}) {
68
65
  stopAnimation: () => disclosure.setState("animating", false),
69
66
  setContentElement: (value) => disclosure.setState("contentElement", value),
70
67
  setDisclosureElement: (value) => disclosure.setState("disclosureElement", value)
71
- });
68
+ };
72
69
  }
73
70
 
74
71
 
@@ -4,19 +4,15 @@
4
4
  var _GDZQUFNPcjs = require('./GDZQUFNP.cjs');
5
5
 
6
6
 
7
- var _MNBBM5CRcjs = require('./MNBBM5CR.cjs');
7
+ var _LT33CJGTcjs = require('./LT33CJGT.cjs');
8
8
 
9
9
 
10
10
 
11
11
 
12
- var _ASR6PAFNcjs = require('./ASR6PAFN.cjs');
12
+ var _WPBYRKFQcjs = require('./WPBYRKFQ.cjs');
13
13
 
14
14
 
15
- var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
16
-
17
-
18
-
19
- var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
15
+ var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
20
16
 
21
17
  // src/composite/composite-store.ts
22
18
  var NULL_ITEM = { id: null };
@@ -100,14 +96,15 @@ function verticalizeItems(items) {
100
96
  for (const row of rows) {
101
97
  const item = row[i];
102
98
  if (item) {
103
- verticalized.push(_7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, item), {
99
+ verticalized.push({
100
+ ...item,
104
101
  // If there's no rowId, it means that it's not a grid composite, but
105
102
  // a single row instead. So, instead of verticalizing it, that is,
106
103
  // assigning a different rowId based on the column index, we keep it
107
104
  // undefined so they will be part of the same row. This is useful
108
105
  // when using up/down on one-dimensional composites.
109
106
  rowId: item.rowId ? `${i}` : void 0
110
- }));
107
+ });
111
108
  }
112
109
  }
113
110
  }
@@ -116,45 +113,46 @@ function verticalizeItems(items) {
116
113
  function createCompositeStore(props = {}) {
117
114
  var _a;
118
115
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
119
- const collection = _MNBBM5CRcjs.createCollectionStore.call(void 0, props);
120
- const activeId = _MLCPLY2Pcjs.defaultValue.call(void 0,
116
+ const collection = _LT33CJGTcjs.createCollectionStore.call(void 0, props);
117
+ const activeId = _6BYUUR4Mcjs.defaultValue.call(void 0,
121
118
  props.activeId,
122
119
  syncState == null ? void 0 : syncState.activeId,
123
120
  props.defaultActiveId
124
121
  );
125
- const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, collection.getState()), {
126
- id: _MLCPLY2Pcjs.defaultValue.call(void 0,
122
+ const initialState = {
123
+ ...collection.getState(),
124
+ id: _6BYUUR4Mcjs.defaultValue.call(void 0,
127
125
  props.id,
128
126
  syncState == null ? void 0 : syncState.id,
129
127
  `id-${Math.random().toString(36).slice(2, 8)}`
130
128
  ),
131
129
  activeId,
132
- baseElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.baseElement, null),
133
- includesBaseElement: _MLCPLY2Pcjs.defaultValue.call(void 0,
130
+ baseElement: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.baseElement, null),
131
+ includesBaseElement: _6BYUUR4Mcjs.defaultValue.call(void 0,
134
132
  props.includesBaseElement,
135
133
  syncState == null ? void 0 : syncState.includesBaseElement,
136
134
  activeId === null
137
135
  ),
138
- moves: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.moves, 0),
139
- orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
136
+ moves: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.moves, 0),
137
+ orientation: _6BYUUR4Mcjs.defaultValue.call(void 0,
140
138
  props.orientation,
141
139
  syncState == null ? void 0 : syncState.orientation,
142
140
  "both"
143
141
  ),
144
- rtl: _MLCPLY2Pcjs.defaultValue.call(void 0, props.rtl, syncState == null ? void 0 : syncState.rtl, false),
145
- virtualFocus: _MLCPLY2Pcjs.defaultValue.call(void 0,
142
+ rtl: _6BYUUR4Mcjs.defaultValue.call(void 0, props.rtl, syncState == null ? void 0 : syncState.rtl, false),
143
+ virtualFocus: _6BYUUR4Mcjs.defaultValue.call(void 0,
146
144
  props.virtualFocus,
147
145
  syncState == null ? void 0 : syncState.virtualFocus,
148
146
  false
149
147
  ),
150
- focusLoop: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
151
- focusWrap: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
152
- focusShift: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
153
- });
154
- const composite = _ASR6PAFNcjs.createStore.call(void 0, initialState, collection, props.store);
155
- _ASR6PAFNcjs.setup.call(void 0,
148
+ focusLoop: _6BYUUR4Mcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
149
+ focusWrap: _6BYUUR4Mcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
150
+ focusShift: _6BYUUR4Mcjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
151
+ };
152
+ const composite = _WPBYRKFQcjs.createStore.call(void 0, initialState, collection, props.store);
153
+ _WPBYRKFQcjs.setup.call(void 0,
156
154
  composite,
157
- () => _ASR6PAFNcjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
155
+ () => _WPBYRKFQcjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
158
156
  composite.setState("activeId", (activeId2) => {
159
157
  var _a2;
160
158
  if (activeId2 !== void 0) return activeId2;
@@ -230,7 +228,9 @@ function createCompositeStore(props = {}) {
230
228
  }
231
229
  return nextItem == null ? void 0 : nextItem.id;
232
230
  };
233
- return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, collection), composite), {
231
+ return {
232
+ ...collection,
233
+ ...composite,
234
234
  setBaseElement: (element) => composite.setState("baseElement", element),
235
235
  setActiveId: (id) => composite.setState("activeId", id),
236
236
  move: (id) => {
@@ -270,7 +270,7 @@ function createCompositeStore(props = {}) {
270
270
  }
271
271
  return getNextId("up", options);
272
272
  }
273
- });
273
+ };
274
274
  }
275
275
 
276
276
 
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _V4YF2QA6cjs = require('./V4YF2QA6.cjs');
3
+ var _MJNGPYVQcjs = require('./MJNGPYVQ.cjs');
4
4
 
5
5
  // src/dialog/dialog-store.ts
6
6
  function createDialogStore(props = {}) {
7
- return _V4YF2QA6cjs.createDisclosureStore.call(void 0, props);
7
+ return _MJNGPYVQcjs.createDisclosureStore.call(void 0, props);
8
8
  }
9
9
 
10
10
 
@@ -0,0 +1,41 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _AOXAROPFcjs = require('./AOXAROPF.cjs');
4
+
5
+
6
+ var _WPBYRKFQcjs = require('./WPBYRKFQ.cjs');
7
+
8
+
9
+ var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
10
+
11
+ // src/hovercard/hovercard-store.ts
12
+ function createHovercardStore(props = {}) {
13
+ var _a;
14
+ const syncState = (_a = props.store) == null ? void 0 : _a.getState();
15
+ const popover = _AOXAROPFcjs.createPopoverStore.call(void 0, {
16
+ ...props,
17
+ placement: _6BYUUR4Mcjs.defaultValue.call(void 0,
18
+ props.placement,
19
+ syncState == null ? void 0 : syncState.placement,
20
+ "bottom"
21
+ )
22
+ });
23
+ const timeout = _6BYUUR4Mcjs.defaultValue.call(void 0, props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
24
+ const initialState = {
25
+ ...popover.getState(),
26
+ timeout,
27
+ showTimeout: _6BYUUR4Mcjs.defaultValue.call(void 0, props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
28
+ hideTimeout: _6BYUUR4Mcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
29
+ autoFocusOnShow: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
30
+ };
31
+ const hovercard = _WPBYRKFQcjs.createStore.call(void 0, initialState, popover, props.store);
32
+ return {
33
+ ...popover,
34
+ ...hovercard,
35
+ setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
36
+ };
37
+ }
38
+
39
+
40
+
41
+ exports.createHovercardStore = createHovercardStore;
@@ -70,7 +70,7 @@ function isTextField(element) {
70
70
  const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null;
71
71
  const isTextArea = element.tagName === "TEXTAREA";
72
72
  return isTextInput || isTextArea || false;
73
- } catch (error) {
73
+ } catch (_error) {
74
74
  return false;
75
75
  }
76
76
  }
@@ -7,23 +7,19 @@
7
7
 
8
8
 
9
9
 
10
- var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
11
-
12
-
13
-
14
- var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
10
+ var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
15
11
 
16
12
  // src/utils/store.ts
17
13
  function getInternal(store, key) {
18
14
  const internals = store.__unstableInternals;
19
- _MLCPLY2Pcjs.invariant.call(void 0, internals, "Invalid store");
15
+ _6BYUUR4Mcjs.invariant.call(void 0, internals, "Invalid store");
20
16
  return internals[key];
21
17
  }
22
18
  function createStore(initialState, ...stores) {
23
19
  let state = initialState;
24
20
  let prevStateBatch = state;
25
21
  let lastUpdate = Symbol();
26
- let destroy = _MLCPLY2Pcjs.noop;
22
+ let destroy = _6BYUUR4Mcjs.noop;
27
23
  const instances = /* @__PURE__ */ new Set();
28
24
  const updatedKeys = /* @__PURE__ */ new Set();
29
25
  const setups = /* @__PURE__ */ new Set();
@@ -45,13 +41,13 @@ function createStore(initialState, ...stores) {
45
41
  destroy();
46
42
  };
47
43
  if (initialized) return maybeDestroy;
48
- const desyncs = _MLCPLY2Pcjs.getKeys.call(void 0, state).map(
49
- (key) => _MLCPLY2Pcjs.chain.call(void 0,
44
+ const desyncs = _6BYUUR4Mcjs.getKeys.call(void 0, state).map(
45
+ (key) => _6BYUUR4Mcjs.chain.call(void 0,
50
46
  ...stores.map((store) => {
51
47
  var _a;
52
48
  const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store);
53
49
  if (!storeState) return;
54
- if (!_MLCPLY2Pcjs.hasOwnProperty.call(void 0, storeState, key)) return;
50
+ if (!_6BYUUR4Mcjs.hasOwnProperty.call(void 0, storeState, key)) return;
55
51
  return sync(store, [key], (state2) => {
56
52
  setState(
57
53
  key,
@@ -69,7 +65,7 @@ function createStore(initialState, ...stores) {
69
65
  teardowns.push(setup2());
70
66
  }
71
67
  const cleanups = stores.map(init);
72
- destroy = _MLCPLY2Pcjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups);
68
+ destroy = _6BYUUR4Mcjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups);
73
69
  return maybeDestroy;
74
70
  };
75
71
  const sub = (keys, listener, set = listeners) => {
@@ -92,13 +88,13 @@ function createStore(initialState, ...stores) {
92
88
  disposables.set(listener, listener(state, prevStateBatch));
93
89
  return sub(keys, listener, batchListeners);
94
90
  };
95
- const storePick = (keys) => createStore(_MLCPLY2Pcjs.pick.call(void 0, state, keys), finalStore);
96
- const storeOmit = (keys) => createStore(_MLCPLY2Pcjs.omit.call(void 0, state, keys), finalStore);
91
+ const storePick = (keys) => createStore(_6BYUUR4Mcjs.pick.call(void 0, state, keys), finalStore);
92
+ const storeOmit = (keys) => createStore(_6BYUUR4Mcjs.omit.call(void 0, state, keys), finalStore);
97
93
  const getState = () => state;
98
94
  const setState = (key, value, fromStores = false) => {
99
95
  var _a;
100
- if (!_MLCPLY2Pcjs.hasOwnProperty.call(void 0, state, key)) return;
101
- const nextValue = _MLCPLY2Pcjs.applyState.call(void 0, value, state[key]);
96
+ if (!_6BYUUR4Mcjs.hasOwnProperty.call(void 0, state, key)) return;
97
+ const nextValue = _6BYUUR4Mcjs.applyState.call(void 0, value, state[key]);
102
98
  if (nextValue === state[key]) return;
103
99
  if (!fromStores) {
104
100
  for (const store of stores) {
@@ -106,7 +102,7 @@ function createStore(initialState, ...stores) {
106
102
  }
107
103
  }
108
104
  const prevState = state;
109
- state = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, state), { [key]: nextValue });
105
+ state = { ...state, [key]: nextValue };
110
106
  const thisUpdate = Symbol();
111
107
  lastUpdate = thisUpdate;
112
108
  updatedKeys.add(key);
@@ -176,12 +172,14 @@ function pick2(store, ...args) {
176
172
  return getInternal(store, "pick")(...args);
177
173
  }
178
174
  function mergeStore(...stores) {
179
- const initialState = stores.reduce((state, store2) => {
180
- var _a;
175
+ var _a;
176
+ const initialState = {};
177
+ for (const store2 of stores) {
181
178
  const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2);
182
- if (!nextState) return state;
183
- return Object.assign(state, nextState);
184
- }, {});
179
+ if (nextState) {
180
+ Object.assign(initialState, nextState);
181
+ }
182
+ }
185
183
  const store = createStore(initialState, ...stores);
186
184
  return Object.assign({}, ...stores, store);
187
185
  }
@@ -196,7 +194,7 @@ function throwOnConflictingProps(props, store) {
196
194
  if (!defaultKeys.length) return;
197
195
  const storeState = store.getState();
198
196
  const conflictingProps = defaultKeys.filter(
199
- (key) => _MLCPLY2Pcjs.hasOwnProperty.call(void 0, storeState, key)
197
+ (key) => _6BYUUR4Mcjs.hasOwnProperty.call(void 0, storeState, key)
200
198
  );
201
199
  if (!conflictingProps.length) return;
202
200
  throw new Error(