@ariakit/core 0.4.6 → 0.4.8

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 (102) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/cjs/__chunks/{B4LYZ4EM.cjs → 3QF3ODTR.cjs} +44 -61
  3. package/cjs/__chunks/{LPDHSEHU.cjs → 7CES7GVE.cjs} +4 -8
  4. package/cjs/__chunks/{Q2WCPTYS.cjs → 7WYII4AN.cjs} +6 -12
  5. package/cjs/__chunks/{EEDWPDM2.cjs → BTUHABP4.cjs} +16 -30
  6. package/cjs/__chunks/{4W3OYRR3.cjs → CCI5VM7E.cjs} +24 -30
  7. package/cjs/__chunks/{5JEQEZFR.cjs → H6ZQSQQL.cjs} +16 -16
  8. package/cjs/__chunks/{D7M2PCAQ.cjs → KCEXELK7.cjs} +6 -7
  9. package/cjs/__chunks/{LTLFSC4X.cjs → N667HVED.cjs} +2 -2
  10. package/cjs/__chunks/{3HYNC3XA.cjs → PW36G76L.cjs} +25 -29
  11. package/cjs/__chunks/{AETQC2AR.cjs → QLWAGBAQ.cjs} +20 -22
  12. package/cjs/__chunks/{B4AKUC4S.cjs → VJAE2Y4T.cjs} +10 -10
  13. package/cjs/__chunks/XIZWLBI2.cjs +42 -0
  14. package/cjs/checkbox/checkbox-store.cjs +7 -7
  15. package/cjs/collection/collection-store.cjs +6 -6
  16. package/cjs/combobox/combobox-store.cjs +50 -56
  17. package/cjs/combobox/combobox-store.d.cts +2 -0
  18. package/cjs/combobox/combobox-store.d.ts +2 -0
  19. package/cjs/composite/composite-overflow-store.cjs +7 -7
  20. package/cjs/composite/composite-store.cjs +7 -7
  21. package/cjs/composite/composite-store.d.cts +5 -1
  22. package/cjs/composite/composite-store.d.ts +5 -1
  23. package/cjs/dialog/dialog-store.cjs +6 -6
  24. package/cjs/disclosure/disclosure-store.cjs +5 -5
  25. package/cjs/form/form-store.cjs +32 -36
  26. package/cjs/hovercard/hovercard-store.cjs +8 -8
  27. package/cjs/index.cjs +1 -1
  28. package/cjs/menu/menu-bar-store.cjs +8 -8
  29. package/cjs/menu/menu-store.cjs +37 -42
  30. package/cjs/menubar/menubar-store.cjs +8 -8
  31. package/cjs/popover/popover-store.cjs +7 -7
  32. package/cjs/radio/radio-store.cjs +13 -13
  33. package/cjs/select/select-store.cjs +49 -62
  34. package/cjs/select/select-store.d.cts +2 -0
  35. package/cjs/select/select-store.d.ts +2 -0
  36. package/cjs/tab/tab-store.cjs +49 -61
  37. package/cjs/tab/tab-store.d.cts +10 -4
  38. package/cjs/tab/tab-store.d.ts +10 -4
  39. package/cjs/tag/tag-store.cjs +23 -27
  40. package/cjs/toolbar/toolbar-store.cjs +9 -9
  41. package/cjs/tooltip/tooltip-store.cjs +15 -15
  42. package/cjs/utils/array.cjs +1 -1
  43. package/cjs/utils/dom.cjs +3 -3
  44. package/cjs/utils/events.cjs +25 -37
  45. package/cjs/utils/focus.cjs +41 -61
  46. package/cjs/utils/misc.cjs +3 -3
  47. package/cjs/utils/misc.d.cts +1 -1
  48. package/cjs/utils/misc.d.ts +1 -1
  49. package/cjs/utils/platform.cjs +4 -4
  50. package/cjs/utils/store.cjs +4 -4
  51. package/cjs/utils/undo.cjs +3 -3
  52. package/esm/__chunks/{MFZZDIHG.js → 3UYWTADI.js} +4 -4
  53. package/esm/__chunks/{EQPTKGFA.js → 6DHTHWXD.js} +10 -16
  54. package/esm/__chunks/{WCKXDMU7.js → 6E4KKOSB.js} +5 -7
  55. package/esm/__chunks/{EKIWAN6A.js → 7LM4Q2XB.js} +4 -8
  56. package/esm/__chunks/{PBSSD2DM.js → D7EIQZAU.js} +8 -12
  57. package/esm/__chunks/{BRS7GKWU.js → EACLTACN.js} +4 -4
  58. package/esm/__chunks/{R676XYVY.js → EQQLU3CG.js} +34 -51
  59. package/esm/__chunks/{I2NJJ3XW.js → HWOIWM4O.js} +6 -12
  60. package/esm/__chunks/{22HHDS5F.js → PBFD2E7P.js} +15 -29
  61. package/esm/__chunks/{P3MTNH46.js → PIWLWQMB.js} +4 -4
  62. package/esm/__chunks/{CLSHHUGK.js → US4USQPI.js} +2 -3
  63. package/esm/__chunks/{5RJNXXU2.js → YOHCVXJB.js} +1 -1
  64. package/esm/checkbox/checkbox-store.js +3 -3
  65. package/esm/collection/collection-store.js +5 -5
  66. package/esm/combobox/combobox-store.d.ts +2 -0
  67. package/esm/combobox/combobox-store.js +16 -22
  68. package/esm/composite/composite-overflow-store.js +6 -6
  69. package/esm/composite/composite-store.d.ts +5 -1
  70. package/esm/composite/composite-store.js +6 -6
  71. package/esm/dialog/dialog-store.js +5 -5
  72. package/esm/disclosure/disclosure-store.js +4 -4
  73. package/esm/form/form-store.js +9 -13
  74. package/esm/hovercard/hovercard-store.js +7 -7
  75. package/esm/index.js +1 -1
  76. package/esm/menu/menu-bar-store.js +7 -7
  77. package/esm/menu/menu-store.js +15 -20
  78. package/esm/menubar/menubar-store.js +7 -7
  79. package/esm/popover/popover-store.js +6 -6
  80. package/esm/radio/radio-store.js +6 -6
  81. package/esm/select/select-store.d.ts +2 -0
  82. package/esm/select/select-store.js +22 -35
  83. package/esm/tab/tab-store.d.ts +10 -4
  84. package/esm/tab/tab-store.js +18 -30
  85. package/esm/tag/tag-store.js +11 -15
  86. package/esm/toolbar/toolbar-store.js +6 -6
  87. package/esm/tooltip/tooltip-store.js +7 -7
  88. package/esm/utils/array.js +1 -1
  89. package/esm/utils/dom.js +2 -2
  90. package/esm/utils/events.js +20 -32
  91. package/esm/utils/focus.js +33 -53
  92. package/esm/utils/misc.d.ts +1 -1
  93. package/esm/utils/misc.js +2 -2
  94. package/esm/utils/platform.js +3 -3
  95. package/esm/utils/store.js +3 -3
  96. package/esm/utils/undo.js +2 -2
  97. package/package.json +2 -2
  98. package/readme.md +18 -0
  99. package/.eslintignore +0 -6
  100. package/cjs/__chunks/UEZLSKZ4.cjs +0 -42
  101. /package/cjs/__chunks/{AV6KTKLE.cjs → 3IVNQNIV.cjs} +0 -0
  102. /package/esm/__chunks/{4R3V3JGP.js → 3YLGPPWQ.js} +0 -0
@@ -1,30 +1,30 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _3HYNC3XAcjs = require('../__chunks/3HYNC3XA.cjs');
5
- require('../__chunks/4W3OYRR3.cjs');
4
+ var _PW36G76Lcjs = require('../__chunks/PW36G76L.cjs');
5
+ require('../__chunks/CCI5VM7E.cjs');
6
6
  require('../__chunks/ULSPM3Y3.cjs');
7
- require('../__chunks/B4LYZ4EM.cjs');
7
+ require('../__chunks/3QF3ODTR.cjs');
8
8
 
9
9
 
10
- var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
11
- require('../__chunks/Q2WCPTYS.cjs');
10
+ var _BTUHABP4cjs = require('../__chunks/BTUHABP4.cjs');
11
+ require('../__chunks/7WYII4AN.cjs');
12
12
 
13
13
 
14
14
 
15
- var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
15
+ var _3IVNQNIVcjs = require('../__chunks/3IVNQNIV.cjs');
16
16
 
17
17
  // src/toolbar/toolbar-store.ts
18
18
  function createToolbarStore(props = {}) {
19
19
  var _a;
20
20
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
21
- return _3HYNC3XAcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
22
- orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
21
+ return _PW36G76Lcjs.createCompositeStore.call(void 0, _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, props), {
22
+ orientation: _BTUHABP4cjs.defaultValue.call(void 0,
23
23
  props.orientation,
24
24
  syncState == null ? void 0 : syncState.orientation,
25
25
  "horizontal"
26
26
  ),
27
- focusLoop: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
27
+ focusLoop: _BTUHABP4cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
28
28
  }));
29
29
  }
30
30
 
@@ -1,20 +1,20 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _UEZLSKZ4cjs = require('../__chunks/UEZLSKZ4.cjs');
5
- require('../__chunks/5JEQEZFR.cjs');
6
- require('../__chunks/LTLFSC4X.cjs');
7
- require('../__chunks/AETQC2AR.cjs');
4
+ var _XIZWLBI2cjs = require('../__chunks/XIZWLBI2.cjs');
5
+ require('../__chunks/H6ZQSQQL.cjs');
6
+ require('../__chunks/N667HVED.cjs');
7
+ require('../__chunks/QLWAGBAQ.cjs');
8
8
 
9
9
 
10
- var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
10
+ var _3QF3ODTRcjs = require('../__chunks/3QF3ODTR.cjs');
11
11
 
12
12
 
13
- var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
13
+ var _BTUHABP4cjs = require('../__chunks/BTUHABP4.cjs');
14
14
 
15
15
 
16
16
 
17
- var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
17
+ var _3IVNQNIVcjs = require('../__chunks/3IVNQNIV.cjs');
18
18
 
19
19
  // src/tooltip/tooltip-store.ts
20
20
  function createTooltipStore(props = {}) {
@@ -29,20 +29,20 @@ function createTooltipStore(props = {}) {
29
29
  }
30
30
  }
31
31
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
32
- const hovercard = _UEZLSKZ4cjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
33
- placement: _EEDWPDM2cjs.defaultValue.call(void 0,
32
+ const hovercard = _XIZWLBI2cjs.createHovercardStore.call(void 0, _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, props), {
33
+ placement: _BTUHABP4cjs.defaultValue.call(void 0,
34
34
  props.placement,
35
35
  syncState == null ? void 0 : syncState.placement,
36
36
  "top"
37
37
  ),
38
- hideTimeout: _EEDWPDM2cjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0)
38
+ hideTimeout: _BTUHABP4cjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0)
39
39
  }));
40
- const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, hovercard.getState()), {
41
- type: _EEDWPDM2cjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
42
- skipTimeout: _EEDWPDM2cjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
40
+ const initialState = _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, hovercard.getState()), {
41
+ type: _BTUHABP4cjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
42
+ skipTimeout: _BTUHABP4cjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
43
43
  });
44
- const tooltip = _B4LYZ4EMcjs.createStore.call(void 0, initialState, hovercard, props.store);
45
- return _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, hovercard), tooltip);
44
+ const tooltip = _3QF3ODTRcjs.createStore.call(void 0, initialState, hovercard, props.store);
45
+ return _3IVNQNIVcjs.__spreadValues.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, hovercard), tooltip);
46
46
  }
47
47
 
48
48
 
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
  var _ULSPM3Y3cjs = require('../__chunks/ULSPM3Y3.cjs');
8
- require('../__chunks/AV6KTKLE.cjs');
8
+ require('../__chunks/3IVNQNIV.cjs');
9
9
 
10
10
 
11
11
 
package/cjs/utils/dom.cjs CHANGED
@@ -18,8 +18,8 @@
18
18
 
19
19
 
20
20
 
21
- var _Q2WCPTYScjs = require('../__chunks/Q2WCPTYS.cjs');
22
- require('../__chunks/AV6KTKLE.cjs');
21
+ var _7WYII4ANcjs = require('../__chunks/7WYII4AN.cjs');
22
+ require('../__chunks/3IVNQNIV.cjs');
23
23
 
24
24
 
25
25
 
@@ -39,4 +39,4 @@ require('../__chunks/AV6KTKLE.cjs');
39
39
 
40
40
 
41
41
 
42
- exports.canUseDOM = _Q2WCPTYScjs.canUseDOM; exports.contains = _Q2WCPTYScjs.contains; exports.getActiveElement = _Q2WCPTYScjs.getActiveElement; exports.getDocument = _Q2WCPTYScjs.getDocument; exports.getPopupItemRole = _Q2WCPTYScjs.getPopupItemRole; exports.getPopupRole = _Q2WCPTYScjs.getPopupRole; exports.getScrollingElement = _Q2WCPTYScjs.getScrollingElement; exports.getTextboxSelection = _Q2WCPTYScjs.getTextboxSelection; exports.getTextboxValue = _Q2WCPTYScjs.getTextboxValue; exports.getWindow = _Q2WCPTYScjs.getWindow; exports.isButton = _Q2WCPTYScjs.isButton; exports.isFrame = _Q2WCPTYScjs.isFrame; exports.isPartiallyHidden = _Q2WCPTYScjs.isPartiallyHidden; exports.isTextField = _Q2WCPTYScjs.isTextField; exports.isTextbox = _Q2WCPTYScjs.isTextbox; exports.isVisible = _Q2WCPTYScjs.isVisible; exports.scrollIntoViewIfNeeded = _Q2WCPTYScjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _Q2WCPTYScjs.setSelectionRange;
42
+ exports.canUseDOM = _7WYII4ANcjs.canUseDOM; exports.contains = _7WYII4ANcjs.contains; exports.getActiveElement = _7WYII4ANcjs.getActiveElement; exports.getDocument = _7WYII4ANcjs.getDocument; exports.getPopupItemRole = _7WYII4ANcjs.getPopupItemRole; exports.getPopupRole = _7WYII4ANcjs.getPopupRole; exports.getScrollingElement = _7WYII4ANcjs.getScrollingElement; exports.getTextboxSelection = _7WYII4ANcjs.getTextboxSelection; exports.getTextboxValue = _7WYII4ANcjs.getTextboxValue; exports.getWindow = _7WYII4ANcjs.getWindow; exports.isButton = _7WYII4ANcjs.isButton; exports.isFrame = _7WYII4ANcjs.isFrame; exports.isPartiallyHidden = _7WYII4ANcjs.isPartiallyHidden; exports.isTextField = _7WYII4ANcjs.isTextField; exports.isTextbox = _7WYII4ANcjs.isTextbox; exports.isVisible = _7WYII4ANcjs.isVisible; exports.scrollIntoViewIfNeeded = _7WYII4ANcjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _7WYII4ANcjs.setSelectionRange;
@@ -1,19 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _D7M2PCAQcjs = require('../__chunks/D7M2PCAQ.cjs');
4
+ var _KCEXELK7cjs = require('../__chunks/KCEXELK7.cjs');
5
5
 
6
6
 
7
- var _Q2WCPTYScjs = require('../__chunks/Q2WCPTYS.cjs');
7
+ var _7WYII4ANcjs = require('../__chunks/7WYII4AN.cjs');
8
8
 
9
9
 
10
10
 
11
- var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
11
+ var _3IVNQNIVcjs = require('../__chunks/3IVNQNIV.cjs');
12
12
 
13
13
  // src/utils/events.ts
14
14
  function isPortalEvent(event) {
15
15
  return Boolean(
16
- event.currentTarget && !_Q2WCPTYScjs.contains.call(void 0, event.currentTarget, event.target)
16
+ event.currentTarget && !_7WYII4ANcjs.contains.call(void 0, event.currentTarget, event.target)
17
17
  );
18
18
  }
19
19
  function isSelfTarget(event) {
@@ -21,35 +21,24 @@ function isSelfTarget(event) {
21
21
  }
22
22
  function isOpeningInNewTab(event) {
23
23
  const element = event.currentTarget;
24
- if (!element)
25
- return false;
26
- const isAppleDevice = _D7M2PCAQcjs.isApple.call(void 0, );
27
- if (isAppleDevice && !event.metaKey)
28
- return false;
29
- if (!isAppleDevice && !event.ctrlKey)
30
- return false;
24
+ if (!element) return false;
25
+ const isAppleDevice = _KCEXELK7cjs.isApple.call(void 0, );
26
+ if (isAppleDevice && !event.metaKey) return false;
27
+ if (!isAppleDevice && !event.ctrlKey) return false;
31
28
  const tagName = element.tagName.toLowerCase();
32
- if (tagName === "a")
33
- return true;
34
- if (tagName === "button" && element.type === "submit")
35
- return true;
36
- if (tagName === "input" && element.type === "submit")
37
- return true;
29
+ if (tagName === "a") return true;
30
+ if (tagName === "button" && element.type === "submit") return true;
31
+ if (tagName === "input" && element.type === "submit") return true;
38
32
  return false;
39
33
  }
40
34
  function isDownloading(event) {
41
35
  const element = event.currentTarget;
42
- if (!element)
43
- return false;
36
+ if (!element) return false;
44
37
  const tagName = element.tagName.toLowerCase();
45
- if (!event.altKey)
46
- return false;
47
- if (tagName === "a")
48
- return true;
49
- if (tagName === "button" && element.type === "submit")
50
- return true;
51
- if (tagName === "input" && element.type === "submit")
52
- return true;
38
+ if (!event.altKey) return false;
39
+ if (tagName === "a") return true;
40
+ if (tagName === "button" && element.type === "submit") return true;
41
+ if (tagName === "input" && element.type === "submit") return true;
53
42
  return false;
54
43
  }
55
44
  function fireEvent(element, type, eventInit) {
@@ -59,14 +48,14 @@ function fireEvent(element, type, eventInit) {
59
48
  function fireBlurEvent(element, eventInit) {
60
49
  const event = new FocusEvent("blur", eventInit);
61
50
  const defaultAllowed = element.dispatchEvent(event);
62
- const bubbleInit = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, eventInit), { bubbles: true });
51
+ const bubbleInit = _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, eventInit), { bubbles: true });
63
52
  element.dispatchEvent(new FocusEvent("focusout", bubbleInit));
64
53
  return defaultAllowed;
65
54
  }
66
55
  function fireFocusEvent(element, eventInit) {
67
56
  const event = new FocusEvent("focus", eventInit);
68
57
  const defaultAllowed = element.dispatchEvent(event);
69
- const bubbleInit = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, eventInit), { bubbles: true });
58
+ const bubbleInit = _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, eventInit), { bubbles: true });
70
59
  element.dispatchEvent(new FocusEvent("focusin", bubbleInit));
71
60
  return defaultAllowed;
72
61
  }
@@ -81,16 +70,13 @@ function fireClickEvent(element, eventInit) {
81
70
  function isFocusEventOutside(event, container) {
82
71
  const containerElement = container || event.currentTarget;
83
72
  const relatedTarget = event.relatedTarget;
84
- return !relatedTarget || !_Q2WCPTYScjs.contains.call(void 0, containerElement, relatedTarget);
73
+ return !relatedTarget || !_7WYII4ANcjs.contains.call(void 0, containerElement, relatedTarget);
85
74
  }
86
75
  function getInputType(event) {
87
76
  const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event;
88
- if (!nativeEvent)
89
- return;
90
- if (!("inputType" in nativeEvent))
91
- return;
92
- if (typeof nativeEvent.inputType !== "string")
93
- return;
77
+ if (!nativeEvent) return;
78
+ if (!("inputType" in nativeEvent)) return;
79
+ if (typeof nativeEvent.inputType !== "string") return;
94
80
  return nativeEvent.inputType;
95
81
  }
96
82
  function queueBeforeEvent(element, type, callback, timeout) {
@@ -127,7 +113,9 @@ function addGlobalEventListener(type, listener, options, scope = window) {
127
113
  scope.document.removeEventListener(type, listener, options);
128
114
  } catch (e) {
129
115
  }
130
- children.forEach((remove) => remove());
116
+ for (const remove of children) {
117
+ remove();
118
+ }
131
119
  };
132
120
  return removeEventListener;
133
121
  }
@@ -4,55 +4,39 @@
4
4
 
5
5
 
6
6
 
7
- var _Q2WCPTYScjs = require('../__chunks/Q2WCPTYS.cjs');
7
+ var _7WYII4ANcjs = require('../__chunks/7WYII4AN.cjs');
8
8
 
9
9
 
10
- var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
10
+ var _3IVNQNIVcjs = require('../__chunks/3IVNQNIV.cjs');
11
11
 
12
12
  // src/utils/focus.ts
13
13
  var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
14
14
  function hasNegativeTabIndex(element) {
15
- const tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10);
15
+ const tabIndex = Number.parseInt(element.getAttribute("tabindex") || "0", 10);
16
16
  return tabIndex < 0;
17
17
  }
18
18
  function isFocusable(element) {
19
- if (!element.matches(selector))
20
- return false;
21
- if (!_Q2WCPTYScjs.isVisible.call(void 0, element))
22
- return false;
23
- if (element.closest("[inert]"))
24
- return false;
19
+ if (!element.matches(selector)) return false;
20
+ if (!_7WYII4ANcjs.isVisible.call(void 0, element)) return false;
21
+ if (element.closest("[inert]")) return false;
25
22
  return true;
26
23
  }
27
24
  function isTabbable(element) {
28
- if (!isFocusable(element))
29
- return false;
30
- if (hasNegativeTabIndex(element))
31
- return false;
32
- if (!("form" in element))
33
- return true;
34
- if (!element.form)
35
- return true;
36
- if (element.checked)
37
- return true;
38
- if (element.type !== "radio")
39
- return true;
25
+ if (!isFocusable(element)) return false;
26
+ if (hasNegativeTabIndex(element)) return false;
27
+ if (!("form" in element)) return true;
28
+ if (!element.form) return true;
29
+ if (element.checked) return true;
30
+ if (element.type !== "radio") return true;
40
31
  const radioGroup = element.form.elements.namedItem(element.name);
41
- if (!radioGroup)
42
- return true;
43
- if (!("length" in radioGroup))
44
- return true;
45
- const activeElement = _Q2WCPTYScjs.getActiveElement.call(void 0, element);
46
- if (!activeElement)
47
- return true;
48
- if (activeElement === element)
49
- return true;
50
- if (!("form" in activeElement))
51
- return true;
52
- if (activeElement.form !== element.form)
53
- return true;
54
- if (activeElement.name !== element.name)
55
- return true;
32
+ if (!radioGroup) return true;
33
+ if (!("length" in radioGroup)) return true;
34
+ const activeElement = _7WYII4ANcjs.getActiveElement.call(void 0, element);
35
+ if (!activeElement) return true;
36
+ if (activeElement === element) return true;
37
+ if (!("form" in activeElement)) return true;
38
+ if (activeElement.form !== element.form) return true;
39
+ if (activeElement.name !== element.name) return true;
56
40
  return false;
57
41
  }
58
42
  function getAllFocusableIn(container, includeContainer) {
@@ -64,7 +48,7 @@ function getAllFocusableIn(container, includeContainer) {
64
48
  }
65
49
  const focusableElements = elements.filter(isFocusable);
66
50
  focusableElements.forEach((element, i) => {
67
- if (_Q2WCPTYScjs.isFrame.call(void 0, element) && element.contentDocument) {
51
+ if (_7WYII4ANcjs.isFrame.call(void 0, element) && element.contentDocument) {
68
52
  const frameBody = element.contentDocument.body;
69
53
  focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
70
54
  }
@@ -90,7 +74,7 @@ function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
90
74
  tabbableElements.unshift(container);
91
75
  }
92
76
  tabbableElements.forEach((element, i) => {
93
- if (_Q2WCPTYScjs.isFrame.call(void 0, element) && element.contentDocument) {
77
+ if (_7WYII4ANcjs.isFrame.call(void 0, element) && element.contentDocument) {
94
78
  const frameBody = element.contentDocument.body;
95
79
  const allFrameTabbable = getAllTabbableIn(
96
80
  frameBody,
@@ -131,7 +115,7 @@ function getLastTabbable(fallbackToFocusable) {
131
115
  return getLastTabbableIn(document.body, false, fallbackToFocusable);
132
116
  }
133
117
  function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) {
134
- const activeElement = _Q2WCPTYScjs.getActiveElement.call(void 0, container);
118
+ const activeElement = _7WYII4ANcjs.getActiveElement.call(void 0, container);
135
119
  const allFocusable = getAllFocusableIn(container, includeContainer);
136
120
  const activeIndex = allFocusable.indexOf(activeElement);
137
121
  const nextFocusableElements = allFocusable.slice(activeIndex + 1);
@@ -146,7 +130,7 @@ function getNextTabbable(fallbackToFirst, fallbackToFocusable) {
146
130
  );
147
131
  }
148
132
  function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) {
149
- const activeElement = _Q2WCPTYScjs.getActiveElement.call(void 0, container);
133
+ const activeElement = _7WYII4ANcjs.getActiveElement.call(void 0, container);
150
134
  const allFocusable = getAllFocusableIn(container, includeContainer).reverse();
151
135
  const activeIndex = allFocusable.indexOf(activeElement);
152
136
  const previousFocusableElements = allFocusable.slice(activeIndex + 1);
@@ -167,29 +151,21 @@ function getClosestFocusable(element) {
167
151
  return element || null;
168
152
  }
169
153
  function hasFocus(element) {
170
- const activeElement = _Q2WCPTYScjs.getActiveElement.call(void 0, element);
171
- if (!activeElement)
172
- return false;
173
- if (activeElement === element)
174
- return true;
154
+ const activeElement = _7WYII4ANcjs.getActiveElement.call(void 0, element);
155
+ if (!activeElement) return false;
156
+ if (activeElement === element) return true;
175
157
  const activeDescendant = activeElement.getAttribute("aria-activedescendant");
176
- if (!activeDescendant)
177
- return false;
158
+ if (!activeDescendant) return false;
178
159
  return activeDescendant === element.id;
179
160
  }
180
161
  function hasFocusWithin(element) {
181
- const activeElement = _Q2WCPTYScjs.getActiveElement.call(void 0, element);
182
- if (!activeElement)
183
- return false;
184
- if (_Q2WCPTYScjs.contains.call(void 0, element, activeElement))
185
- return true;
162
+ const activeElement = _7WYII4ANcjs.getActiveElement.call(void 0, element);
163
+ if (!activeElement) return false;
164
+ if (_7WYII4ANcjs.contains.call(void 0, element, activeElement)) return true;
186
165
  const activeDescendant = activeElement.getAttribute("aria-activedescendant");
187
- if (!activeDescendant)
188
- return false;
189
- if (!("id" in element))
190
- return false;
191
- if (activeDescendant === element.id)
192
- return true;
166
+ if (!activeDescendant) return false;
167
+ if (!("id" in element)) return false;
168
+ if (activeDescendant === element.id) return true;
193
169
  return !!element.querySelector(`#${CSS.escape(activeDescendant)}`);
194
170
  }
195
171
  function focusIfNeeded(element) {
@@ -205,7 +181,9 @@ function disableFocus(element) {
205
181
  }
206
182
  function disableFocusIn(container, includeContainer) {
207
183
  const tabbableElements = getAllTabbableIn(container, includeContainer);
208
- tabbableElements.forEach(disableFocus);
184
+ for (const element of tabbableElements) {
185
+ disableFocus(element);
186
+ }
209
187
  }
210
188
  function restoreFocusIn(container) {
211
189
  const elements = container.querySelectorAll("[data-tabindex]");
@@ -221,14 +199,16 @@ function restoreFocusIn(container) {
221
199
  if (container.hasAttribute("data-tabindex")) {
222
200
  restoreTabIndex(container);
223
201
  }
224
- elements.forEach(restoreTabIndex);
202
+ for (const element of elements) {
203
+ restoreTabIndex(element);
204
+ }
225
205
  }
226
206
  function focusIntoView(element, options) {
227
207
  if (!("scrollIntoView" in element)) {
228
208
  element.focus();
229
209
  } else {
230
210
  element.focus({ preventScroll: true });
231
- element.scrollIntoView(_AV6KTKLEcjs.__spreadValues.call(void 0, { block: "nearest", inline: "nearest" }, options));
211
+ element.scrollIntoView(_3IVNQNIVcjs.__spreadValues.call(void 0, { block: "nearest", inline: "nearest" }, options));
232
212
  }
233
213
  }
234
214
 
@@ -21,8 +21,8 @@
21
21
 
22
22
 
23
23
 
24
- var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
25
- require('../__chunks/AV6KTKLE.cjs');
24
+ var _BTUHABP4cjs = require('../__chunks/BTUHABP4.cjs');
25
+ require('../__chunks/3IVNQNIV.cjs');
26
26
 
27
27
 
28
28
 
@@ -45,4 +45,4 @@ require('../__chunks/AV6KTKLE.cjs');
45
45
 
46
46
 
47
47
 
48
- exports.afterPaint = _EEDWPDM2cjs.afterPaint; exports.applyState = _EEDWPDM2cjs.applyState; exports.beforePaint = _EEDWPDM2cjs.beforePaint; exports.chain = _EEDWPDM2cjs.chain; exports.cx = _EEDWPDM2cjs.cx; exports.defaultValue = _EEDWPDM2cjs.defaultValue; exports.disabledFromProps = _EEDWPDM2cjs.disabledFromProps; exports.getKeys = _EEDWPDM2cjs.getKeys; exports.hasOwnProperty = _EEDWPDM2cjs.hasOwnProperty; exports.identity = _EEDWPDM2cjs.identity; exports.invariant = _EEDWPDM2cjs.invariant; exports.isEmpty = _EEDWPDM2cjs.isEmpty; exports.isFalsyBooleanCallback = _EEDWPDM2cjs.isFalsyBooleanCallback; exports.isInteger = _EEDWPDM2cjs.isInteger; exports.isObject = _EEDWPDM2cjs.isObject; exports.noop = _EEDWPDM2cjs.noop; exports.normalizeString = _EEDWPDM2cjs.normalizeString; exports.omit = _EEDWPDM2cjs.omit; exports.pick = _EEDWPDM2cjs.pick; exports.removeUndefinedValues = _EEDWPDM2cjs.removeUndefinedValues; exports.shallowEqual = _EEDWPDM2cjs.shallowEqual;
48
+ exports.afterPaint = _BTUHABP4cjs.afterPaint; exports.applyState = _BTUHABP4cjs.applyState; exports.beforePaint = _BTUHABP4cjs.beforePaint; exports.chain = _BTUHABP4cjs.chain; exports.cx = _BTUHABP4cjs.cx; exports.defaultValue = _BTUHABP4cjs.defaultValue; exports.disabledFromProps = _BTUHABP4cjs.disabledFromProps; exports.getKeys = _BTUHABP4cjs.getKeys; exports.hasOwnProperty = _BTUHABP4cjs.hasOwnProperty; exports.identity = _BTUHABP4cjs.identity; exports.invariant = _BTUHABP4cjs.invariant; exports.isEmpty = _BTUHABP4cjs.isEmpty; exports.isFalsyBooleanCallback = _BTUHABP4cjs.isFalsyBooleanCallback; exports.isInteger = _BTUHABP4cjs.isInteger; exports.isObject = _BTUHABP4cjs.isObject; exports.noop = _BTUHABP4cjs.noop; exports.normalizeString = _BTUHABP4cjs.normalizeString; exports.omit = _BTUHABP4cjs.omit; exports.pick = _BTUHABP4cjs.pick; exports.removeUndefinedValues = _BTUHABP4cjs.removeUndefinedValues; exports.shallowEqual = _BTUHABP4cjs.shallowEqual;
@@ -99,7 +99,7 @@ export declare function invariant(condition: any, message?: string | boolean): a
99
99
  /**
100
100
  * Similar to `Object.keys` but returns a type-safe array of keys.
101
101
  */
102
- export declare function getKeys<T extends object>(obj: T): (keyof T)[];
102
+ export declare function getKeys<T extends object>(obj: T): Array<keyof T>;
103
103
  /**
104
104
  * Checks whether a boolean event prop (e.g., hideOnInteractOutside) was
105
105
  * intentionally set to false, either with a boolean value or a callback that
@@ -99,7 +99,7 @@ export declare function invariant(condition: any, message?: string | boolean): a
99
99
  /**
100
100
  * Similar to `Object.keys` but returns a type-safe array of keys.
101
101
  */
102
- export declare function getKeys<T extends object>(obj: T): (keyof T)[];
102
+ export declare function getKeys<T extends object>(obj: T): Array<keyof T>;
103
103
  /**
104
104
  * Checks whether a boolean event prop (e.g., hideOnInteractOutside) was
105
105
  * intentionally set to false, either with a boolean value or a callback that
@@ -5,13 +5,13 @@
5
5
 
6
6
 
7
7
 
8
- var _D7M2PCAQcjs = require('../__chunks/D7M2PCAQ.cjs');
9
- require('../__chunks/Q2WCPTYS.cjs');
10
- require('../__chunks/AV6KTKLE.cjs');
8
+ var _KCEXELK7cjs = require('../__chunks/KCEXELK7.cjs');
9
+ require('../__chunks/7WYII4AN.cjs');
10
+ require('../__chunks/3IVNQNIV.cjs');
11
11
 
12
12
 
13
13
 
14
14
 
15
15
 
16
16
 
17
- exports.isApple = _D7M2PCAQcjs.isApple; exports.isFirefox = _D7M2PCAQcjs.isFirefox; exports.isMac = _D7M2PCAQcjs.isMac; exports.isSafari = _D7M2PCAQcjs.isSafari; exports.isTouchDevice = _D7M2PCAQcjs.isTouchDevice;
17
+ exports.isApple = _KCEXELK7cjs.isApple; exports.isFirefox = _KCEXELK7cjs.isFirefox; exports.isMac = _KCEXELK7cjs.isMac; exports.isSafari = _KCEXELK7cjs.isSafari; exports.isTouchDevice = _KCEXELK7cjs.isTouchDevice;
@@ -10,9 +10,9 @@
10
10
 
11
11
 
12
12
 
13
- var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
14
- require('../__chunks/EEDWPDM2.cjs');
15
- require('../__chunks/AV6KTKLE.cjs');
13
+ var _3QF3ODTRcjs = require('../__chunks/3QF3ODTR.cjs');
14
+ require('../__chunks/BTUHABP4.cjs');
15
+ require('../__chunks/3IVNQNIV.cjs');
16
16
 
17
17
 
18
18
 
@@ -24,4 +24,4 @@ require('../__chunks/AV6KTKLE.cjs');
24
24
 
25
25
 
26
26
 
27
- exports.batch = _B4LYZ4EMcjs.batch; exports.createStore = _B4LYZ4EMcjs.createStore; exports.init = _B4LYZ4EMcjs.init; exports.mergeStore = _B4LYZ4EMcjs.mergeStore; exports.omit = _B4LYZ4EMcjs.omit; exports.pick = _B4LYZ4EMcjs.pick; exports.setup = _B4LYZ4EMcjs.setup; exports.subscribe = _B4LYZ4EMcjs.subscribe; exports.sync = _B4LYZ4EMcjs.sync; exports.throwOnConflictingProps = _B4LYZ4EMcjs.throwOnConflictingProps;
27
+ exports.batch = _3QF3ODTRcjs.batch; exports.createStore = _3QF3ODTRcjs.createStore; exports.init = _3QF3ODTRcjs.init; exports.mergeStore = _3QF3ODTRcjs.mergeStore; exports.omit = _3QF3ODTRcjs.omit; exports.pick = _3QF3ODTRcjs.pick; exports.setup = _3QF3ODTRcjs.setup; exports.subscribe = _3QF3ODTRcjs.subscribe; exports.sync = _3QF3ODTRcjs.sync; exports.throwOnConflictingProps = _3QF3ODTRcjs.throwOnConflictingProps;
@@ -2,9 +2,9 @@
2
2
 
3
3
 
4
4
 
5
- var _LPDHSEHUcjs = require('../__chunks/LPDHSEHU.cjs');
6
- require('../__chunks/AV6KTKLE.cjs');
5
+ var _7CES7GVEcjs = require('../__chunks/7CES7GVE.cjs');
6
+ require('../__chunks/3IVNQNIV.cjs');
7
7
 
8
8
 
9
9
 
10
- exports.UndoManager = _LPDHSEHUcjs.UndoManager; exports.createUndoManager = _LPDHSEHUcjs.createUndoManager;
10
+ exports.UndoManager = _7CES7GVEcjs.UndoManager; exports.createUndoManager = _7CES7GVEcjs.createUndoManager;
@@ -1,21 +1,21 @@
1
1
  "use client";
2
2
  import {
3
3
  createDialogStore
4
- } from "./5RJNXXU2.js";
4
+ } from "./YOHCVXJB.js";
5
5
  import {
6
6
  createStore,
7
7
  mergeStore,
8
8
  omit,
9
9
  throwOnConflictingProps
10
- } from "./R676XYVY.js";
10
+ } from "./EQQLU3CG.js";
11
11
  import {
12
12
  defaultValue
13
- } from "./22HHDS5F.js";
13
+ } from "./PBFD2E7P.js";
14
14
  import {
15
15
  __objRest,
16
16
  __spreadProps,
17
17
  __spreadValues
18
- } from "./4R3V3JGP.js";
18
+ } from "./3YLGPPWQ.js";
19
19
 
20
20
  // src/popover/popover-store.ts
21
21
  function createPopoverStore(_a = {}) {
@@ -5,18 +5,18 @@ import {
5
5
  init,
6
6
  setup,
7
7
  throwOnConflictingProps
8
- } from "./R676XYVY.js";
8
+ } from "./EQQLU3CG.js";
9
9
  import {
10
10
  chain,
11
11
  defaultValue
12
- } from "./22HHDS5F.js";
12
+ } from "./PBFD2E7P.js";
13
13
  import {
14
14
  getDocument
15
- } from "./I2NJJ3XW.js";
15
+ } from "./HWOIWM4O.js";
16
16
  import {
17
17
  __spreadProps,
18
18
  __spreadValues
19
- } from "./4R3V3JGP.js";
19
+ } from "./3YLGPPWQ.js";
20
20
 
21
21
  // src/collection/collection-store.ts
22
22
  function isElementPreceding(a, b) {
@@ -30,10 +30,8 @@ function sortBasedOnDOMPosition(items) {
30
30
  pairs.sort(([indexA, a], [indexB, b]) => {
31
31
  const elementA = a.element;
32
32
  const elementB = b.element;
33
- if (elementA === elementB)
34
- return 0;
35
- if (!elementA || !elementB)
36
- return 0;
33
+ if (elementA === elementB) return 0;
34
+ if (!elementA || !elementB) return 0;
37
35
  if (isElementPreceding(elementA, elementB)) {
38
36
  if (indexA > indexB) {
39
37
  isOrderDifferent = true;
@@ -104,8 +102,7 @@ function createCollectionStore(props = {}) {
104
102
  let firstRun = true;
105
103
  let raf = requestAnimationFrame(() => {
106
104
  const { renderedItems } = collection.getState();
107
- if (state.renderedItems === renderedItems)
108
- return;
105
+ if (state.renderedItems === renderedItems) return;
109
106
  sortItems(state.renderedItems);
110
107
  });
111
108
  if (typeof IntersectionObserver !== "function") {
@@ -122,8 +119,7 @@ function createCollectionStore(props = {}) {
122
119
  const root = getCommonParent(state.renderedItems);
123
120
  const observer = new IntersectionObserver(ioCallback, { root });
124
121
  for (const item of state.renderedItems) {
125
- if (!item.element)
126
- continue;
122
+ if (!item.element) continue;
127
123
  observer.observe(item.element);
128
124
  }
129
125
  return () => {
@@ -157,8 +153,7 @@ function createCollectionStore(props = {}) {
157
153
  return items2.filter(({ id }) => id !== item.id);
158
154
  }
159
155
  const index = items2.findIndex(({ id }) => id === item.id);
160
- if (index === -1)
161
- return items2;
156
+ if (index === -1) return items2;
162
157
  const nextItems = items2.slice();
163
158
  nextItems[index] = prevItem;
164
159
  itemsMap.set(item.id, prevItem);
@@ -182,8 +177,7 @@ function createCollectionStore(props = {}) {
182
177
  )
183
178
  ),
184
179
  item: (id) => {
185
- if (!id)
186
- return null;
180
+ if (!id) return null;
187
181
  let item = itemsMap.get(id);
188
182
  if (!item) {
189
183
  const { items: items2 } = collection.getState();