@ariakit/core 0.4.17 → 0.4.19

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 (126) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/cjs/__chunks/{MJNGPYVQ.cjs → 2RUCRSRF.cjs} +16 -16
  3. package/cjs/__chunks/{6BYUUR4M.cjs → 4TRESXTO.cjs} +7 -1
  4. package/cjs/__chunks/{AOXAROPF.cjs → 75F3RDBE.cjs} +14 -14
  5. package/cjs/__chunks/{SHOLYDNP.cjs → CTEQSOKZ.cjs} +2 -2
  6. package/cjs/__chunks/{T247D7JS.cjs → CVLMIMPT.cjs} +2 -2
  7. package/cjs/__chunks/{CPH45Z4I.cjs → G2CSOTWZ.cjs} +7 -7
  8. package/cjs/__chunks/{VZPNI7C2.cjs → I4CBIWTX.cjs} +4 -4
  9. package/cjs/__chunks/{6REHCF5T.cjs → LS2SNHDM.cjs} +6 -6
  10. package/cjs/__chunks/{UROTDZFK.cjs → R37KOEUW.cjs} +10 -10
  11. package/cjs/__chunks/{NNJG45OF.cjs → UGAVMSQJ.cjs} +18 -18
  12. package/cjs/__chunks/{LT33CJGT.cjs → VC22SYOD.cjs} +24 -21
  13. package/cjs/__chunks/{WPBYRKFQ.cjs → WMTGHDLE.cjs} +15 -15
  14. package/cjs/checkbox/checkbox-store.cjs +5 -5
  15. package/cjs/checkbox/checkbox-store.d.cts +5 -5
  16. package/cjs/checkbox/checkbox-store.d.ts +5 -5
  17. package/cjs/collection/collection-store.cjs +5 -5
  18. package/cjs/collection/collection-store.d.cts +5 -5
  19. package/cjs/collection/collection-store.d.ts +5 -5
  20. package/cjs/combobox/combobox-store.cjs +40 -40
  21. package/cjs/combobox/combobox-store.d.cts +26 -26
  22. package/cjs/combobox/combobox-store.d.ts +26 -26
  23. package/cjs/composite/composite-overflow-store.cjs +6 -6
  24. package/cjs/composite/composite-store.cjs +6 -6
  25. package/cjs/composite/composite-store.d.cts +62 -54
  26. package/cjs/composite/composite-store.d.ts +62 -54
  27. package/cjs/dialog/dialog-store.cjs +5 -5
  28. package/cjs/disclosure/disclosure-store.cjs +4 -4
  29. package/cjs/disclosure/disclosure-store.d.cts +22 -22
  30. package/cjs/disclosure/disclosure-store.d.ts +22 -22
  31. package/cjs/form/form-store.cjs +41 -37
  32. package/cjs/form/form-store.d.cts +14 -14
  33. package/cjs/form/form-store.d.ts +14 -14
  34. package/cjs/hovercard/hovercard-store.cjs +7 -7
  35. package/cjs/hovercard/hovercard-store.d.cts +10 -10
  36. package/cjs/hovercard/hovercard-store.d.ts +10 -10
  37. package/cjs/menu/menu-bar-store.cjs +7 -7
  38. package/cjs/menu/menu-store.cjs +27 -27
  39. package/cjs/menu/menu-store.d.cts +10 -10
  40. package/cjs/menu/menu-store.d.ts +10 -10
  41. package/cjs/menubar/menubar-store.cjs +7 -7
  42. package/cjs/popover/popover-store.cjs +6 -6
  43. package/cjs/popover/popover-store.d.cts +17 -17
  44. package/cjs/popover/popover-store.d.ts +17 -17
  45. package/cjs/radio/radio-store.cjs +9 -9
  46. package/cjs/radio/radio-store.d.cts +1 -1
  47. package/cjs/radio/radio-store.d.ts +1 -1
  48. package/cjs/select/select-store.cjs +32 -32
  49. package/cjs/select/select-store.d.cts +17 -17
  50. package/cjs/select/select-store.d.ts +17 -17
  51. package/cjs/tab/tab-store.cjs +32 -32
  52. package/cjs/tab/tab-store.d.cts +20 -20
  53. package/cjs/tab/tab-store.d.ts +20 -20
  54. package/cjs/tag/tag-store.cjs +16 -16
  55. package/cjs/tag/tag-store.d.cts +5 -5
  56. package/cjs/tag/tag-store.d.ts +5 -5
  57. package/cjs/toolbar/toolbar-store.cjs +8 -8
  58. package/cjs/tooltip/tooltip-store.cjs +13 -13
  59. package/cjs/utils/dom.cjs +2 -2
  60. package/cjs/utils/events.cjs +6 -6
  61. package/cjs/utils/focus.cjs +25 -24
  62. package/cjs/utils/misc.cjs +4 -2
  63. package/cjs/utils/misc.d.cts +4 -0
  64. package/cjs/utils/misc.d.ts +4 -0
  65. package/cjs/utils/platform.cjs +3 -3
  66. package/cjs/utils/store.cjs +3 -3
  67. package/cjs/utils/store.d.cts +1 -1
  68. package/cjs/utils/store.d.ts +1 -1
  69. package/cjs/utils/undo.cjs +2 -2
  70. package/esm/__chunks/{KMAUV3TY.js → 7KNZCZ55.js} +1 -1
  71. package/esm/__chunks/{37JWRFYW.js → G7XPWBXK.js} +3 -3
  72. package/esm/__chunks/{O6E4ZWCP.js → GMGLSF2B.js} +1 -1
  73. package/esm/__chunks/{PSMDSJUH.js → H7R2CY4Q.js} +3 -3
  74. package/esm/__chunks/{75BJEVSH.js → IHNLLH3I.js} +2 -2
  75. package/esm/__chunks/{AMRA5WUK.js → KZX46JDB.js} +11 -8
  76. package/esm/__chunks/{BFGNM53A.js → MJ4ZJEIM.js} +5 -5
  77. package/esm/__chunks/{TIQDSBWP.js → TEVO2DMI.js} +3 -3
  78. package/esm/__chunks/{7LM4Q2XB.js → U4NM2NCP.js} +1 -1
  79. package/esm/__chunks/{73UNQSFO.js → UNDE2QJS.js} +3 -3
  80. package/esm/__chunks/{XMCVU3LR.js → UWJK2WK2.js} +6 -0
  81. package/esm/__chunks/{SXKM4CGU.js → XTZ53NXG.js} +4 -4
  82. package/esm/checkbox/checkbox-store.d.ts +5 -5
  83. package/esm/checkbox/checkbox-store.js +2 -2
  84. package/esm/collection/collection-store.d.ts +5 -5
  85. package/esm/collection/collection-store.js +4 -4
  86. package/esm/combobox/combobox-store.d.ts +26 -26
  87. package/esm/combobox/combobox-store.js +9 -9
  88. package/esm/composite/composite-overflow-store.js +5 -5
  89. package/esm/composite/composite-store.d.ts +62 -54
  90. package/esm/composite/composite-store.js +5 -5
  91. package/esm/dialog/dialog-store.js +4 -4
  92. package/esm/disclosure/disclosure-store.d.ts +22 -22
  93. package/esm/disclosure/disclosure-store.js +3 -3
  94. package/esm/form/form-store.d.ts +14 -14
  95. package/esm/form/form-store.js +19 -15
  96. package/esm/hovercard/hovercard-store.d.ts +10 -10
  97. package/esm/hovercard/hovercard-store.js +6 -6
  98. package/esm/menu/menu-bar-store.js +6 -6
  99. package/esm/menu/menu-store.d.ts +10 -10
  100. package/esm/menu/menu-store.js +9 -9
  101. package/esm/menubar/menubar-store.js +6 -6
  102. package/esm/popover/popover-store.d.ts +17 -17
  103. package/esm/popover/popover-store.js +5 -5
  104. package/esm/radio/radio-store.d.ts +1 -1
  105. package/esm/radio/radio-store.js +5 -5
  106. package/esm/select/select-store.d.ts +17 -17
  107. package/esm/select/select-store.js +8 -8
  108. package/esm/tab/tab-store.d.ts +20 -20
  109. package/esm/tab/tab-store.js +5 -5
  110. package/esm/tag/tag-store.d.ts +5 -5
  111. package/esm/tag/tag-store.js +7 -7
  112. package/esm/toolbar/toolbar-store.js +5 -5
  113. package/esm/tooltip/tooltip-store.js +7 -7
  114. package/esm/utils/dom.js +1 -1
  115. package/esm/utils/events.js +4 -4
  116. package/esm/utils/focus.js +17 -16
  117. package/esm/utils/misc.d.ts +4 -0
  118. package/esm/utils/misc.js +3 -1
  119. package/esm/utils/platform.js +2 -2
  120. package/esm/utils/store.d.ts +1 -1
  121. package/esm/utils/store.js +2 -2
  122. package/esm/utils/undo.js +1 -1
  123. package/package.json +20 -21
  124. package/tsconfig.build.json +7 -2
  125. package/tsconfig.node.json +5 -0
  126. package/tsconfig.test.json +5 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @ariakit/core
2
2
 
3
+ ## 0.4.19
4
+
5
+ - Added `disabledFromElement` to `@ariakit/core/utils/misc`.
6
+ - Fixed [`formStore.setError()`](https://ariakit.org/reference/use-form-store#seterror) and [`formStore.setFieldTouched()`](https://ariakit.org/reference/use-form-store#setfieldtouched) failing to set values on nested array field paths such as `items.0.name`.
7
+
8
+ ## 0.4.18
9
+
10
+ - Fixed an error when trying to reach focusable elements within iframes.
11
+
3
12
  ## 0.4.17
4
13
 
5
14
  - Updated packages to target ES2018 (previously ES2017).
@@ -6,52 +6,52 @@
6
6
 
7
7
 
8
8
 
9
- var _WPBYRKFQcjs = require('./WPBYRKFQ.cjs');
9
+ var _WMTGHDLEcjs = require('./WMTGHDLE.cjs');
10
10
 
11
11
 
12
- var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
12
+ var _4TRESXTOcjs = require('./4TRESXTO.cjs');
13
13
 
14
14
  // src/disclosure/disclosure-store.ts
15
15
  function createDisclosureStore(props = {}) {
16
- const store = _WPBYRKFQcjs.mergeStore.call(void 0,
16
+ const store = _WMTGHDLEcjs.mergeStore.call(void 0,
17
17
  props.store,
18
- _WPBYRKFQcjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
18
+ _WMTGHDLEcjs.omit.call(void 0, props.disclosure, ["contentElement", "disclosureElement"])
19
19
  );
20
- _WPBYRKFQcjs.throwOnConflictingProps.call(void 0, props, store);
20
+ _WMTGHDLEcjs.throwOnConflictingProps.call(void 0, props, store);
21
21
  const syncState = store == null ? void 0 : store.getState();
22
- const open = _6BYUUR4Mcjs.defaultValue.call(void 0,
22
+ const open = _4TRESXTOcjs.defaultValue.call(void 0,
23
23
  props.open,
24
24
  syncState == null ? void 0 : syncState.open,
25
25
  props.defaultOpen,
26
26
  false
27
27
  );
28
- const animated = _6BYUUR4Mcjs.defaultValue.call(void 0, props.animated, syncState == null ? void 0 : syncState.animated, false);
28
+ const animated = _4TRESXTOcjs.defaultValue.call(void 0, props.animated, syncState == null ? void 0 : syncState.animated, false);
29
29
  const initialState = {
30
30
  open,
31
31
  animated,
32
32
  animating: !!animated && open,
33
33
  mounted: open,
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)
34
+ contentElement: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.contentElement, null),
35
+ disclosureElement: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.disclosureElement, null)
36
36
  };
37
- const disclosure = _WPBYRKFQcjs.createStore.call(void 0, initialState, store);
38
- _WPBYRKFQcjs.setup.call(void 0,
37
+ const disclosure = _WMTGHDLEcjs.createStore.call(void 0, initialState, store);
38
+ _WMTGHDLEcjs.setup.call(void 0,
39
39
  disclosure,
40
- () => _WPBYRKFQcjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
40
+ () => _WMTGHDLEcjs.sync.call(void 0, disclosure, ["animated", "animating"], (state) => {
41
41
  if (state.animated) return;
42
42
  disclosure.setState("animating", false);
43
43
  })
44
44
  );
45
- _WPBYRKFQcjs.setup.call(void 0,
45
+ _WMTGHDLEcjs.setup.call(void 0,
46
46
  disclosure,
47
- () => _WPBYRKFQcjs.subscribe.call(void 0, disclosure, ["open"], () => {
47
+ () => _WMTGHDLEcjs.subscribe.call(void 0, disclosure, ["open"], () => {
48
48
  if (!disclosure.getState().animated) return;
49
49
  disclosure.setState("animating", true);
50
50
  })
51
51
  );
52
- _WPBYRKFQcjs.setup.call(void 0,
52
+ _WMTGHDLEcjs.setup.call(void 0,
53
53
  disclosure,
54
- () => _WPBYRKFQcjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
54
+ () => _WMTGHDLEcjs.sync.call(void 0, disclosure, ["open", "animating"], (state) => {
55
55
  disclosure.setState("mounted", state.open || state.animating);
56
56
  })
57
57
  );
@@ -115,6 +115,11 @@ function isFalsyBooleanCallback(booleanOrCallback, ...args) {
115
115
  function disabledFromProps(props) {
116
116
  return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
117
117
  }
118
+ function disabledFromElement(element) {
119
+ if (element.getAttribute("aria-disabled") === "true") return true;
120
+ if ("disabled" in element && element.disabled === true) return true;
121
+ return false;
122
+ }
118
123
  function removeUndefinedValues(obj) {
119
124
  const result = {};
120
125
  for (const key in obj) {
@@ -153,4 +158,5 @@ function defaultValue(...values) {
153
158
 
154
159
 
155
160
 
156
- exports.noop = noop; exports.shallowEqual = shallowEqual; exports.applyState = applyState; exports.isObject = isObject; exports.isEmpty = isEmpty; exports.isInteger = isInteger; exports.hasOwnProperty = hasOwnProperty; exports.chain = chain; exports.cx = cx; exports.normalizeString = normalizeString; exports.omit = omit; exports.pick = pick; exports.identity = identity; exports.beforePaint = beforePaint; exports.afterPaint = afterPaint; exports.invariant = invariant; exports.getKeys = getKeys; exports.isFalsyBooleanCallback = isFalsyBooleanCallback; exports.disabledFromProps = disabledFromProps; exports.removeUndefinedValues = removeUndefinedValues; exports.defaultValue = defaultValue;
161
+
162
+ exports.noop = noop; exports.shallowEqual = shallowEqual; exports.applyState = applyState; exports.isObject = isObject; exports.isEmpty = isEmpty; exports.isInteger = isInteger; exports.hasOwnProperty = hasOwnProperty; exports.chain = chain; exports.cx = cx; exports.normalizeString = normalizeString; exports.omit = omit; exports.pick = pick; exports.identity = identity; exports.beforePaint = beforePaint; exports.afterPaint = afterPaint; exports.invariant = invariant; exports.getKeys = getKeys; exports.isFalsyBooleanCallback = isFalsyBooleanCallback; exports.disabledFromProps = disabledFromProps; exports.disabledFromElement = disabledFromElement; exports.removeUndefinedValues = removeUndefinedValues; exports.defaultValue = defaultValue;
@@ -1,24 +1,24 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _T247D7JScjs = require('./T247D7JS.cjs');
3
+ var _CVLMIMPTcjs = require('./CVLMIMPT.cjs');
4
4
 
5
5
 
6
6
 
7
7
 
8
8
 
9
- var _WPBYRKFQcjs = require('./WPBYRKFQ.cjs');
9
+ var _WMTGHDLEcjs = require('./WMTGHDLE.cjs');
10
10
 
11
11
 
12
- var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
12
+ var _4TRESXTOcjs = require('./4TRESXTO.cjs');
13
13
 
14
14
  // src/popover/popover-store.ts
15
15
  function createPopoverStore({
16
16
  popover: otherPopover,
17
17
  ...props
18
18
  } = {}) {
19
- const store = _WPBYRKFQcjs.mergeStore.call(void 0,
19
+ const store = _WMTGHDLEcjs.mergeStore.call(void 0,
20
20
  props.store,
21
- _WPBYRKFQcjs.omit.call(void 0, otherPopover, [
21
+ _WMTGHDLEcjs.omit.call(void 0, otherPopover, [
22
22
  "arrowElement",
23
23
  "anchorElement",
24
24
  "contentElement",
@@ -26,10 +26,10 @@ function createPopoverStore({
26
26
  "disclosureElement"
27
27
  ])
28
28
  );
29
- _WPBYRKFQcjs.throwOnConflictingProps.call(void 0, props, store);
29
+ _WMTGHDLEcjs.throwOnConflictingProps.call(void 0, props, store);
30
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,
31
+ const dialog = _CVLMIMPTcjs.createDialogStore.call(void 0, { ...props, store });
32
+ const placement = _4TRESXTOcjs.defaultValue.call(void 0,
33
33
  props.placement,
34
34
  syncState == null ? void 0 : syncState.placement,
35
35
  "bottom"
@@ -38,19 +38,19 @@ function createPopoverStore({
38
38
  ...dialog.getState(),
39
39
  placement,
40
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")
41
+ anchorElement: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.anchorElement, null),
42
+ popoverElement: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.popoverElement, null),
43
+ arrowElement: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.arrowElement, null),
44
+ rendered: /* @__PURE__ */ Symbol("rendered")
45
45
  };
46
- const popover = _WPBYRKFQcjs.createStore.call(void 0, initialState, dialog, store);
46
+ const popover = _WMTGHDLEcjs.createStore.call(void 0, initialState, dialog, store);
47
47
  return {
48
48
  ...dialog,
49
49
  ...popover,
50
50
  setAnchorElement: (element) => popover.setState("anchorElement", element),
51
51
  setPopoverElement: (element) => popover.setState("popoverElement", element),
52
52
  setArrowElement: (element) => popover.setState("arrowElement", element),
53
- render: () => popover.setState("rendered", Symbol("rendered"))
53
+ render: () => popover.setState("rendered", /* @__PURE__ */ Symbol("rendered"))
54
54
  };
55
55
  }
56
56
 
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/undo.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/utils/undo.ts
2
2
  function createUndoCallback(callback) {
3
3
  return async () => {
4
4
  const redo = await (callback == null ? void 0 : callback());
@@ -35,7 +35,7 @@ function createUndoManager({
35
35
  undoStack.shift();
36
36
  }
37
37
  const sameGroup = group === currentGroup;
38
- currentGroup = group != null ? group : null;
38
+ currentGroup = _nullishCoalesce(group, () => ( null));
39
39
  const nextIndex = sameGroup ? Math.max(0, undoStack.length - 1) : undoStack.length;
40
40
  const undoCallback = await callback();
41
41
  if (!undoCallback) return;
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _MJNGPYVQcjs = require('./MJNGPYVQ.cjs');
3
+ var _2RUCRSRFcjs = require('./2RUCRSRF.cjs');
4
4
 
5
5
  // src/dialog/dialog-store.ts
6
6
  function createDialogStore(props = {}) {
7
- return _MJNGPYVQcjs.createDisclosureStore.call(void 0, props);
7
+ return _2RUCRSRFcjs.createDisclosureStore.call(void 0, props);
8
8
  }
9
9
 
10
10
 
@@ -1,30 +1,30 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _NNJG45OFcjs = require('./NNJG45OF.cjs');
3
+ var _UGAVMSQJcjs = require('./UGAVMSQJ.cjs');
4
4
 
5
5
 
6
- var _WPBYRKFQcjs = require('./WPBYRKFQ.cjs');
6
+ var _WMTGHDLEcjs = require('./WMTGHDLE.cjs');
7
7
 
8
8
 
9
- var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
9
+ var _4TRESXTOcjs = require('./4TRESXTO.cjs');
10
10
 
11
11
  // src/menubar/menubar-store.ts
12
12
  function createMenubarStore(props = {}) {
13
13
  var _a;
14
14
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
15
- const composite = _NNJG45OFcjs.createCompositeStore.call(void 0, {
15
+ const composite = _UGAVMSQJcjs.createCompositeStore.call(void 0, {
16
16
  ...props,
17
- orientation: _6BYUUR4Mcjs.defaultValue.call(void 0,
17
+ orientation: _4TRESXTOcjs.defaultValue.call(void 0,
18
18
  props.orientation,
19
19
  syncState == null ? void 0 : syncState.orientation,
20
20
  "horizontal"
21
21
  ),
22
- focusLoop: _6BYUUR4Mcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
22
+ focusLoop: _4TRESXTOcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
23
23
  });
24
24
  const initialState = {
25
25
  ...composite.getState()
26
26
  };
27
- const menubar = _WPBYRKFQcjs.createStore.call(void 0, initialState, composite, props.store);
27
+ const menubar = _WMTGHDLEcjs.createStore.call(void 0, initialState, composite, props.store);
28
28
  return {
29
29
  ...composite,
30
30
  ...menubar
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/dom.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/utils/dom.ts
2
2
  var canUseDOM = checkIsBrowser();
3
3
  function checkIsBrowser() {
4
4
  var _a;
@@ -15,11 +15,12 @@ function getWindow(node) {
15
15
  return getDocument(node).defaultView || window;
16
16
  }
17
17
  function getActiveElement(node, activeDescendant = false) {
18
+ var _a;
18
19
  const { activeElement } = getDocument(node);
19
20
  if (!(activeElement == null ? void 0 : activeElement.nodeName)) {
20
21
  return null;
21
22
  }
22
- if (isFrame(activeElement) && activeElement.contentDocument) {
23
+ if (isFrame(activeElement) && ((_a = activeElement.contentDocument) == null ? void 0 : _a.body)) {
23
24
  return getActiveElement(
24
25
  activeElement.contentDocument.body,
25
26
  activeDescendant
@@ -117,7 +118,6 @@ function getPopupRole(element, fallback) {
117
118
  return fallback;
118
119
  }
119
120
  function getPopupItemRole(element, fallback) {
120
- var _a;
121
121
  const itemRoleByPopupRole = {
122
122
  menu: "menuitem",
123
123
  listbox: "option",
@@ -126,7 +126,7 @@ function getPopupItemRole(element, fallback) {
126
126
  const popupRole = getPopupRole(element);
127
127
  if (!popupRole) return fallback;
128
128
  const key = popupRole;
129
- return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback;
129
+ return _nullishCoalesce(itemRoleByPopupRole[key], () => ( fallback));
130
130
  }
131
131
  function scrollIntoViewIfNeeded(element, arg) {
132
132
  if (isPartiallyHidden(element) && "scrollIntoView" in element) {
@@ -1,23 +1,23 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _VZPNI7C2cjs = require('./VZPNI7C2.cjs');
3
+ var _I4CBIWTXcjs = require('./I4CBIWTX.cjs');
4
4
 
5
5
  // src/utils/platform.ts
6
6
  function isTouchDevice() {
7
- return _VZPNI7C2cjs.canUseDOM && !!navigator.maxTouchPoints;
7
+ return _I4CBIWTXcjs.canUseDOM && !!navigator.maxTouchPoints;
8
8
  }
9
9
  function isApple() {
10
- if (!_VZPNI7C2cjs.canUseDOM) return false;
10
+ if (!_I4CBIWTXcjs.canUseDOM) return false;
11
11
  return /mac|iphone|ipad|ipod/i.test(navigator.platform);
12
12
  }
13
13
  function isSafari() {
14
- return _VZPNI7C2cjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
14
+ return _I4CBIWTXcjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
15
15
  }
16
16
  function isFirefox() {
17
- return _VZPNI7C2cjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
17
+ return _I4CBIWTXcjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
18
18
  }
19
19
  function isMac() {
20
- return _VZPNI7C2cjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
20
+ return _I4CBIWTXcjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
21
21
  }
22
22
 
23
23
 
@@ -1,34 +1,34 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _AOXAROPFcjs = require('./AOXAROPF.cjs');
3
+ var _75F3RDBEcjs = require('./75F3RDBE.cjs');
4
4
 
5
5
 
6
- var _WPBYRKFQcjs = require('./WPBYRKFQ.cjs');
6
+ var _WMTGHDLEcjs = require('./WMTGHDLE.cjs');
7
7
 
8
8
 
9
- var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
9
+ var _4TRESXTOcjs = require('./4TRESXTO.cjs');
10
10
 
11
11
  // src/hovercard/hovercard-store.ts
12
12
  function createHovercardStore(props = {}) {
13
13
  var _a;
14
14
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
15
- const popover = _AOXAROPFcjs.createPopoverStore.call(void 0, {
15
+ const popover = _75F3RDBEcjs.createPopoverStore.call(void 0, {
16
16
  ...props,
17
- placement: _6BYUUR4Mcjs.defaultValue.call(void 0,
17
+ placement: _4TRESXTOcjs.defaultValue.call(void 0,
18
18
  props.placement,
19
19
  syncState == null ? void 0 : syncState.placement,
20
20
  "bottom"
21
21
  )
22
22
  });
23
- const timeout = _6BYUUR4Mcjs.defaultValue.call(void 0, props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
23
+ const timeout = _4TRESXTOcjs.defaultValue.call(void 0, props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
24
24
  const initialState = {
25
25
  ...popover.getState(),
26
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)
27
+ showTimeout: _4TRESXTOcjs.defaultValue.call(void 0, props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
28
+ hideTimeout: _4TRESXTOcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
29
+ autoFocusOnShow: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
30
30
  };
31
- const hovercard = _WPBYRKFQcjs.createStore.call(void 0, initialState, popover, props.store);
31
+ const hovercard = _WMTGHDLEcjs.createStore.call(void 0, initialState, popover, props.store);
32
32
  return {
33
33
  ...popover,
34
34
  ...hovercard,
@@ -4,15 +4,15 @@
4
4
  var _GDZQUFNPcjs = require('./GDZQUFNP.cjs');
5
5
 
6
6
 
7
- var _LT33CJGTcjs = require('./LT33CJGT.cjs');
7
+ var _VC22SYODcjs = require('./VC22SYOD.cjs');
8
8
 
9
9
 
10
10
 
11
11
 
12
- var _WPBYRKFQcjs = require('./WPBYRKFQ.cjs');
12
+ var _WMTGHDLEcjs = require('./WMTGHDLE.cjs');
13
13
 
14
14
 
15
- var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
15
+ var _4TRESXTOcjs = require('./4TRESXTO.cjs');
16
16
 
17
17
  // src/composite/composite-store.ts
18
18
  var NULL_ITEM = { id: null };
@@ -113,46 +113,46 @@ function verticalizeItems(items) {
113
113
  function createCompositeStore(props = {}) {
114
114
  var _a;
115
115
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
116
- const collection = _LT33CJGTcjs.createCollectionStore.call(void 0, props);
117
- const activeId = _6BYUUR4Mcjs.defaultValue.call(void 0,
116
+ const collection = _VC22SYODcjs.createCollectionStore.call(void 0, props);
117
+ const activeId = _4TRESXTOcjs.defaultValue.call(void 0,
118
118
  props.activeId,
119
119
  syncState == null ? void 0 : syncState.activeId,
120
120
  props.defaultActiveId
121
121
  );
122
122
  const initialState = {
123
123
  ...collection.getState(),
124
- id: _6BYUUR4Mcjs.defaultValue.call(void 0,
124
+ id: _4TRESXTOcjs.defaultValue.call(void 0,
125
125
  props.id,
126
126
  syncState == null ? void 0 : syncState.id,
127
127
  `id-${Math.random().toString(36).slice(2, 8)}`
128
128
  ),
129
129
  activeId,
130
- baseElement: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.baseElement, null),
131
- includesBaseElement: _6BYUUR4Mcjs.defaultValue.call(void 0,
130
+ baseElement: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.baseElement, null),
131
+ includesBaseElement: _4TRESXTOcjs.defaultValue.call(void 0,
132
132
  props.includesBaseElement,
133
133
  syncState == null ? void 0 : syncState.includesBaseElement,
134
134
  activeId === null
135
135
  ),
136
- moves: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.moves, 0),
137
- orientation: _6BYUUR4Mcjs.defaultValue.call(void 0,
136
+ moves: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.moves, 0),
137
+ orientation: _4TRESXTOcjs.defaultValue.call(void 0,
138
138
  props.orientation,
139
139
  syncState == null ? void 0 : syncState.orientation,
140
140
  "both"
141
141
  ),
142
- rtl: _6BYUUR4Mcjs.defaultValue.call(void 0, props.rtl, syncState == null ? void 0 : syncState.rtl, false),
143
- virtualFocus: _6BYUUR4Mcjs.defaultValue.call(void 0,
142
+ rtl: _4TRESXTOcjs.defaultValue.call(void 0, props.rtl, syncState == null ? void 0 : syncState.rtl, false),
143
+ virtualFocus: _4TRESXTOcjs.defaultValue.call(void 0,
144
144
  props.virtualFocus,
145
145
  syncState == null ? void 0 : syncState.virtualFocus,
146
146
  false
147
147
  ),
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)
148
+ focusLoop: _4TRESXTOcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
149
+ focusWrap: _4TRESXTOcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
150
+ focusShift: _4TRESXTOcjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
151
151
  };
152
- const composite = _WPBYRKFQcjs.createStore.call(void 0, initialState, collection, props.store);
153
- _WPBYRKFQcjs.setup.call(void 0,
152
+ const composite = _WMTGHDLEcjs.createStore.call(void 0, initialState, collection, props.store);
153
+ _WMTGHDLEcjs.setup.call(void 0,
154
154
  composite,
155
- () => _WPBYRKFQcjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
155
+ () => _WMTGHDLEcjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
156
156
  composite.setState("activeId", (activeId2) => {
157
157
  var _a2;
158
158
  if (activeId2 !== void 0) return activeId2;
@@ -1,42 +1,45 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _VZPNI7C2cjs = require('./VZPNI7C2.cjs');
4
+ var _I4CBIWTXcjs = require('./I4CBIWTX.cjs');
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
10
 
11
- var _WPBYRKFQcjs = require('./WPBYRKFQ.cjs');
11
+ var _WMTGHDLEcjs = require('./WMTGHDLE.cjs');
12
12
 
13
13
 
14
14
 
15
- var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
15
+ var _4TRESXTOcjs = require('./4TRESXTO.cjs');
16
16
 
17
17
  // src/collection/collection-store.ts
18
18
  function getCommonParent(items) {
19
- var _a;
19
+ var _a, _b;
20
20
  const firstItem = items.find((item) => !!item.element);
21
- const lastItem = [...items].reverse().find((item) => !!item.element);
22
- let parentElement = (_a = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _a.parentElement;
23
- while (parentElement && (lastItem == null ? void 0 : lastItem.element)) {
21
+ const lastElement = (_a = [...items].reverse().find((item) => !!item.element)) == null ? void 0 : _a.element;
22
+ let parentElement = (_b = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _b.parentElement;
23
+ if (!lastElement) {
24
+ return _I4CBIWTXcjs.getDocument.call(void 0, parentElement).body;
25
+ }
26
+ while (parentElement) {
24
27
  const parent = parentElement;
25
- if (lastItem && parent.contains(lastItem.element)) {
28
+ if (parent.contains(lastElement)) {
26
29
  return parentElement;
27
30
  }
28
31
  parentElement = parentElement.parentElement;
29
32
  }
30
- return _VZPNI7C2cjs.getDocument.call(void 0, parentElement).body;
33
+ return _I4CBIWTXcjs.getDocument.call(void 0, parentElement).body;
31
34
  }
32
35
  function getPrivateStore(store) {
33
36
  return store == null ? void 0 : store.__unstablePrivateStore;
34
37
  }
35
38
  function createCollectionStore(props = {}) {
36
39
  var _a;
37
- _WPBYRKFQcjs.throwOnConflictingProps.call(void 0, props, props.store);
40
+ _WMTGHDLEcjs.throwOnConflictingProps.call(void 0, props, props.store);
38
41
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
39
- const items = _6BYUUR4Mcjs.defaultValue.call(void 0,
42
+ const items = _4TRESXTOcjs.defaultValue.call(void 0,
40
43
  props.items,
41
44
  syncState == null ? void 0 : syncState.items,
42
45
  props.defaultItems,
@@ -45,27 +48,27 @@ function createCollectionStore(props = {}) {
45
48
  const itemsMap = new Map(items.map((item) => [item.id, item]));
46
49
  const initialState = {
47
50
  items,
48
- renderedItems: _6BYUUR4Mcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
51
+ renderedItems: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.renderedItems, [])
49
52
  };
50
53
  const syncPrivateStore = getPrivateStore(props.store);
51
- const privateStore = _WPBYRKFQcjs.createStore.call(void 0,
54
+ const privateStore = _WMTGHDLEcjs.createStore.call(void 0,
52
55
  { items, renderedItems: initialState.renderedItems },
53
56
  syncPrivateStore
54
57
  );
55
- const collection = _WPBYRKFQcjs.createStore.call(void 0, initialState, props.store);
58
+ const collection = _WMTGHDLEcjs.createStore.call(void 0, initialState, props.store);
56
59
  const sortItems = (renderedItems) => {
57
- const sortedItems = _VZPNI7C2cjs.sortBasedOnDOMPosition.call(void 0, renderedItems, (i) => i.element);
60
+ const sortedItems = _I4CBIWTXcjs.sortBasedOnDOMPosition.call(void 0, renderedItems, (i) => i.element);
58
61
  privateStore.setState("renderedItems", sortedItems);
59
62
  collection.setState("renderedItems", sortedItems);
60
63
  };
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) => {
64
+ _WMTGHDLEcjs.setup.call(void 0, collection, () => _WMTGHDLEcjs.init.call(void 0, privateStore));
65
+ _WMTGHDLEcjs.setup.call(void 0, privateStore, () => {
66
+ return _WMTGHDLEcjs.batch.call(void 0, privateStore, ["items"], (state) => {
64
67
  collection.setState("items", state.items);
65
68
  });
66
69
  });
67
- _WPBYRKFQcjs.setup.call(void 0, privateStore, () => {
68
- return _WPBYRKFQcjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
70
+ _WMTGHDLEcjs.setup.call(void 0, privateStore, () => {
71
+ return _WMTGHDLEcjs.batch.call(void 0, privateStore, ["renderedItems"], (state) => {
69
72
  let firstRun = true;
70
73
  let raf = requestAnimationFrame(() => {
71
74
  const { renderedItems } = collection.getState();
@@ -137,7 +140,7 @@ function createCollectionStore(props = {}) {
137
140
  return {
138
141
  ...collection,
139
142
  registerItem,
140
- renderItem: (item) => _6BYUUR4Mcjs.chain.call(void 0,
143
+ renderItem: (item) => _4TRESXTOcjs.chain.call(void 0,
141
144
  registerItem(item),
142
145
  mergeItem(
143
146
  item,
@@ -7,19 +7,19 @@
7
7
 
8
8
 
9
9
 
10
- var _6BYUUR4Mcjs = require('./6BYUUR4M.cjs');
10
+ var _4TRESXTOcjs = require('./4TRESXTO.cjs');
11
11
 
12
12
  // src/utils/store.ts
13
13
  function getInternal(store, key) {
14
14
  const internals = store.__unstableInternals;
15
- _6BYUUR4Mcjs.invariant.call(void 0, internals, "Invalid store");
15
+ _4TRESXTOcjs.invariant.call(void 0, internals, "Invalid store");
16
16
  return internals[key];
17
17
  }
18
18
  function createStore(initialState, ...stores) {
19
19
  let state = initialState;
20
20
  let prevStateBatch = state;
21
- let lastUpdate = Symbol();
22
- let destroy = _6BYUUR4Mcjs.noop;
21
+ let lastUpdate = /* @__PURE__ */ Symbol();
22
+ let destroy = _4TRESXTOcjs.noop;
23
23
  const instances = /* @__PURE__ */ new Set();
24
24
  const updatedKeys = /* @__PURE__ */ new Set();
25
25
  const setups = /* @__PURE__ */ new Set();
@@ -33,7 +33,7 @@ function createStore(initialState, ...stores) {
33
33
  };
34
34
  const storeInit = () => {
35
35
  const initialized = instances.size;
36
- const instance = Symbol();
36
+ const instance = /* @__PURE__ */ Symbol();
37
37
  instances.add(instance);
38
38
  const maybeDestroy = () => {
39
39
  instances.delete(instance);
@@ -41,13 +41,13 @@ function createStore(initialState, ...stores) {
41
41
  destroy();
42
42
  };
43
43
  if (initialized) return maybeDestroy;
44
- const desyncs = _6BYUUR4Mcjs.getKeys.call(void 0, state).map(
45
- (key) => _6BYUUR4Mcjs.chain.call(void 0,
44
+ const desyncs = _4TRESXTOcjs.getKeys.call(void 0, state).map(
45
+ (key) => _4TRESXTOcjs.chain.call(void 0,
46
46
  ...stores.map((store) => {
47
47
  var _a;
48
48
  const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store);
49
49
  if (!storeState) return;
50
- if (!_6BYUUR4Mcjs.hasOwnProperty.call(void 0, storeState, key)) return;
50
+ if (!_4TRESXTOcjs.hasOwnProperty.call(void 0, storeState, key)) return;
51
51
  return sync(store, [key], (state2) => {
52
52
  setState(
53
53
  key,
@@ -65,7 +65,7 @@ function createStore(initialState, ...stores) {
65
65
  teardowns.push(setup2());
66
66
  }
67
67
  const cleanups = stores.map(init);
68
- destroy = _6BYUUR4Mcjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups);
68
+ destroy = _4TRESXTOcjs.chain.call(void 0, ...desyncs, ...teardowns, ...cleanups);
69
69
  return maybeDestroy;
70
70
  };
71
71
  const sub = (keys, listener, set = listeners) => {
@@ -88,13 +88,13 @@ function createStore(initialState, ...stores) {
88
88
  disposables.set(listener, listener(state, prevStateBatch));
89
89
  return sub(keys, listener, batchListeners);
90
90
  };
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);
91
+ const storePick = (keys) => createStore(_4TRESXTOcjs.pick.call(void 0, state, keys), finalStore);
92
+ const storeOmit = (keys) => createStore(_4TRESXTOcjs.omit.call(void 0, state, keys), finalStore);
93
93
  const getState = () => state;
94
94
  const setState = (key, value, fromStores = false) => {
95
95
  var _a;
96
- if (!_6BYUUR4Mcjs.hasOwnProperty.call(void 0, state, key)) return;
97
- const nextValue = _6BYUUR4Mcjs.applyState.call(void 0, value, state[key]);
96
+ if (!_4TRESXTOcjs.hasOwnProperty.call(void 0, state, key)) return;
97
+ const nextValue = _4TRESXTOcjs.applyState.call(void 0, value, state[key]);
98
98
  if (nextValue === state[key]) return;
99
99
  if (!fromStores) {
100
100
  for (const store of stores) {
@@ -103,7 +103,7 @@ function createStore(initialState, ...stores) {
103
103
  }
104
104
  const prevState = state;
105
105
  state = { ...state, [key]: nextValue };
106
- const thisUpdate = Symbol();
106
+ const thisUpdate = /* @__PURE__ */ Symbol();
107
107
  lastUpdate = thisUpdate;
108
108
  updatedKeys.add(key);
109
109
  const run = (listener, prev, uKeys) => {
@@ -194,7 +194,7 @@ function throwOnConflictingProps(props, store) {
194
194
  if (!defaultKeys.length) return;
195
195
  const storeState = store.getState();
196
196
  const conflictingProps = defaultKeys.filter(
197
- (key) => _6BYUUR4Mcjs.hasOwnProperty.call(void 0, storeState, key)
197
+ (key) => _4TRESXTOcjs.hasOwnProperty.call(void 0, storeState, key)
198
198
  );
199
199
  if (!conflictingProps.length) return;
200
200
  throw new Error(