@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
@@ -1,22 +1,22 @@
1
1
  "use client";
2
2
  import {
3
3
  UndoManager
4
- } from "../__chunks/7LM4Q2XB.js";
4
+ } from "../__chunks/U4NM2NCP.js";
5
5
  import {
6
6
  createCompositeStore
7
- } from "../__chunks/73UNQSFO.js";
7
+ } from "../__chunks/UNDE2QJS.js";
8
8
  import "../__chunks/7PRQYBBV.js";
9
- import "../__chunks/AMRA5WUK.js";
10
- import "../__chunks/37JWRFYW.js";
9
+ import "../__chunks/KZX46JDB.js";
10
+ import "../__chunks/G7XPWBXK.js";
11
11
  import {
12
12
  createStore,
13
13
  setup,
14
14
  sync
15
- } from "../__chunks/SXKM4CGU.js";
15
+ } from "../__chunks/XTZ53NXG.js";
16
16
  import {
17
17
  applyState,
18
18
  defaultValue
19
- } from "../__chunks/XMCVU3LR.js";
19
+ } from "../__chunks/UWJK2WK2.js";
20
20
 
21
21
  // src/tag/tag-store.ts
22
22
  function createTagStore(props = {}) {
@@ -46,7 +46,7 @@ function createTagStore(props = {}) {
46
46
  );
47
47
  const setValues = (values) => {
48
48
  const { values: previousValues } = tag.getState();
49
- UndoManager.execute(() => {
49
+ void UndoManager.execute(() => {
50
50
  let changed = true;
51
51
  tag.setState("values", (prev) => {
52
52
  const next = applyState(values, prev);
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import {
3
3
  createCompositeStore
4
- } from "../__chunks/73UNQSFO.js";
4
+ } from "../__chunks/UNDE2QJS.js";
5
5
  import "../__chunks/7PRQYBBV.js";
6
- import "../__chunks/AMRA5WUK.js";
7
- import "../__chunks/37JWRFYW.js";
8
- import "../__chunks/SXKM4CGU.js";
6
+ import "../__chunks/KZX46JDB.js";
7
+ import "../__chunks/G7XPWBXK.js";
8
+ import "../__chunks/XTZ53NXG.js";
9
9
  import {
10
10
  defaultValue
11
- } from "../__chunks/XMCVU3LR.js";
11
+ } from "../__chunks/UWJK2WK2.js";
12
12
 
13
13
  // src/toolbar/toolbar-store.ts
14
14
  function createToolbarStore(props = {}) {
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import {
3
3
  createHovercardStore
4
- } from "../__chunks/TIQDSBWP.js";
5
- import "../__chunks/BFGNM53A.js";
6
- import "../__chunks/KMAUV3TY.js";
7
- import "../__chunks/75BJEVSH.js";
4
+ } from "../__chunks/TEVO2DMI.js";
5
+ import "../__chunks/MJ4ZJEIM.js";
6
+ import "../__chunks/7KNZCZ55.js";
7
+ import "../__chunks/IHNLLH3I.js";
8
8
  import {
9
9
  createStore
10
- } from "../__chunks/SXKM4CGU.js";
10
+ } from "../__chunks/XTZ53NXG.js";
11
11
  import {
12
12
  defaultValue
13
- } from "../__chunks/XMCVU3LR.js";
13
+ } from "../__chunks/UWJK2WK2.js";
14
14
 
15
15
  // src/tooltip/tooltip-store.ts
16
16
  function createTooltipStore(props = {}) {
@@ -20,7 +20,7 @@ function createTooltipStore(props = {}) {
20
20
  console.warn(
21
21
  "The `type` option on the tooltip store is deprecated.",
22
22
  "Render a visually hidden label or use the `aria-label` or `aria-labelledby` attributes on the anchor element instead.",
23
- "See https://ariakit.org/components/tooltip#tooltip-anchors-must-have-accessible-names"
23
+ "See https://ariakit.com/components/tooltip#tooltip-anchors-must-have-accessible-names"
24
24
  );
25
25
  }
26
26
  }
package/esm/utils/dom.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  scrollIntoViewIfNeeded,
20
20
  setSelectionRange,
21
21
  sortBasedOnDOMPosition
22
- } from "../__chunks/37JWRFYW.js";
22
+ } from "../__chunks/G7XPWBXK.js";
23
23
  export {
24
24
  canUseDOM,
25
25
  contains,
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  isApple
4
- } from "../__chunks/O6E4ZWCP.js";
4
+ } from "../__chunks/GMGLSF2B.js";
5
5
  import {
6
6
  contains
7
- } from "../__chunks/37JWRFYW.js";
7
+ } from "../__chunks/G7XPWBXK.js";
8
8
 
9
9
  // src/utils/events.ts
10
10
  function isPortalEvent(event) {
@@ -102,12 +102,12 @@ function addGlobalEventListener(type, listener, options, scope = window) {
102
102
  for (const frame of Array.from(scope.frames)) {
103
103
  children.push(addGlobalEventListener(type, listener, options, frame));
104
104
  }
105
- } catch (e) {
105
+ } catch {
106
106
  }
107
107
  const removeEventListener = () => {
108
108
  try {
109
109
  scope.document.removeEventListener(type, listener, options);
110
- } catch (e) {
110
+ } catch {
111
111
  }
112
112
  for (const remove of children) {
113
113
  remove();
@@ -4,7 +4,7 @@ import {
4
4
  getActiveElement,
5
5
  isFrame,
6
6
  isVisible
7
- } from "../__chunks/37JWRFYW.js";
7
+ } from "../__chunks/G7XPWBXK.js";
8
8
 
9
9
  // src/utils/focus.ts
10
10
  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'])";
@@ -45,10 +45,11 @@ function getAllFocusableIn(container, includeContainer) {
45
45
  }
46
46
  const focusableElements = elements.filter(isFocusable);
47
47
  focusableElements.forEach((element, i) => {
48
- if (isFrame(element) && element.contentDocument) {
49
- const frameBody = element.contentDocument.body;
50
- focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
51
- }
48
+ var _a;
49
+ if (!isFrame(element)) return;
50
+ const frameBody = (_a = element.contentDocument) == null ? void 0 : _a.body;
51
+ if (!frameBody) return;
52
+ focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
52
53
  });
53
54
  return focusableElements;
54
55
  }
@@ -71,15 +72,16 @@ function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
71
72
  tabbableElements.unshift(container);
72
73
  }
73
74
  tabbableElements.forEach((element, i) => {
74
- if (isFrame(element) && element.contentDocument) {
75
- const frameBody = element.contentDocument.body;
76
- const allFrameTabbable = getAllTabbableIn(
77
- frameBody,
78
- false,
79
- fallbackToFocusable
80
- );
81
- tabbableElements.splice(i, 1, ...allFrameTabbable);
82
- }
75
+ var _a;
76
+ if (!isFrame(element)) return;
77
+ const frameBody = (_a = element.contentDocument) == null ? void 0 : _a.body;
78
+ if (!frameBody) return;
79
+ const allFrameTabbable = getAllTabbableIn(
80
+ frameBody,
81
+ false,
82
+ fallbackToFocusable
83
+ );
84
+ tabbableElements.splice(i, 1, ...allFrameTabbable);
83
85
  });
84
86
  if (!tabbableElements.length && fallbackToFocusable) {
85
87
  return elements;
@@ -171,8 +173,7 @@ function focusIfNeeded(element) {
171
173
  }
172
174
  }
173
175
  function disableFocus(element) {
174
- var _a;
175
- const currentTabindex = (_a = element.getAttribute("tabindex")) != null ? _a : "";
176
+ const currentTabindex = element.getAttribute("tabindex") ?? "";
176
177
  element.setAttribute("data-tabindex", currentTabindex);
177
178
  element.setAttribute("tabindex", "-1");
178
179
  }
@@ -113,6 +113,10 @@ export declare function disabledFromProps(props: {
113
113
  disabled?: boolean;
114
114
  "aria-disabled"?: boolean | "true" | "false";
115
115
  }): boolean;
116
+ /**
117
+ * Checks whether something is disabled or not based on its DOM attributes.
118
+ */
119
+ export declare function disabledFromElement(element: Element): boolean;
116
120
  /**
117
121
  * Removes undefined values from an object.
118
122
  */
package/esm/utils/misc.js CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  chain,
7
7
  cx,
8
8
  defaultValue,
9
+ disabledFromElement,
9
10
  disabledFromProps,
10
11
  getKeys,
11
12
  hasOwnProperty,
@@ -21,7 +22,7 @@ import {
21
22
  pick,
22
23
  removeUndefinedValues,
23
24
  shallowEqual
24
- } from "../__chunks/XMCVU3LR.js";
25
+ } from "../__chunks/UWJK2WK2.js";
25
26
  export {
26
27
  afterPaint,
27
28
  applyState,
@@ -29,6 +30,7 @@ export {
29
30
  chain,
30
31
  cx,
31
32
  defaultValue,
33
+ disabledFromElement,
32
34
  disabledFromProps,
33
35
  getKeys,
34
36
  hasOwnProperty,
@@ -5,8 +5,8 @@ import {
5
5
  isMac,
6
6
  isSafari,
7
7
  isTouchDevice
8
- } from "../__chunks/O6E4ZWCP.js";
9
- import "../__chunks/37JWRFYW.js";
8
+ } from "../__chunks/GMGLSF2B.js";
9
+ import "../__chunks/G7XPWBXK.js";
10
10
  export {
11
11
  isApple,
12
12
  isFirefox,
@@ -48,7 +48,7 @@ export interface StoreProps<S extends State = State> {
48
48
  * Another store object that will be kept in sync with the original store.
49
49
  *
50
50
  * Live examples:
51
- * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
51
+ * - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
52
52
  */
53
53
  store?: Store<Partial<S>>;
54
54
  }
@@ -10,8 +10,8 @@ import {
10
10
  subscribe,
11
11
  sync,
12
12
  throwOnConflictingProps
13
- } from "../__chunks/SXKM4CGU.js";
14
- import "../__chunks/XMCVU3LR.js";
13
+ } from "../__chunks/XTZ53NXG.js";
14
+ import "../__chunks/UWJK2WK2.js";
15
15
  export {
16
16
  batch,
17
17
  createStore,
package/esm/utils/undo.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  UndoManager,
4
4
  createUndoManager
5
- } from "../__chunks/7LM4Q2XB.js";
5
+ } from "../__chunks/U4NM2NCP.js";
6
6
  export {
7
7
  UndoManager,
8
8
  createUndoManager
package/package.json CHANGED
@@ -1,33 +1,28 @@
1
1
  {
2
2
  "name": "@ariakit/core",
3
- "version": "0.4.17",
3
+ "version": "0.4.19",
4
4
  "description": "Ariakit core",
5
- "sideEffects": false,
5
+ "keywords": [
6
+ "ariakit",
7
+ "core"
8
+ ],
9
+ "homepage": "https://ariakit.com",
6
10
  "license": "MIT",
7
- "homepage": "https://ariakit.org",
8
- "type": "module",
9
- "main": "cjs/index.cjs",
10
- "module": "esm/index.js",
11
- "types": "cjs/index.d.ts",
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/ariakit/ariakit.git",
15
- "directory": "packages/ariakit-core"
16
- },
17
11
  "author": {
18
12
  "name": "Diego Haz",
19
13
  "email": "hazdiego@gmail.com",
20
14
  "url": "https://github.com/diegohaz"
21
15
  },
22
- "scripts": {
23
- "lint": "biome check .",
24
- "build": "node ../../scripts/build/build.js",
25
- "clean": "node ../../scripts/build/clean.js"
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/ariakit/ariakit.git",
19
+ "directory": "packages/ariakit-core"
26
20
  },
27
- "keywords": [
28
- "ariakit",
29
- "core"
30
- ],
21
+ "type": "module",
22
+ "sideEffects": false,
23
+ "main": "cjs/index.cjs",
24
+ "module": "esm/index.js",
25
+ "types": "cjs/index.d.ts",
31
26
  "exports": {
32
27
  ".": {
33
28
  "import": "./esm/index.js",
@@ -240,5 +235,9 @@
240
235
  }
241
236
  },
242
237
  "./package.json": "./package.json"
238
+ },
239
+ "scripts": {
240
+ "build": "node ../../scripts/build/build.js",
241
+ "clean": "node ../../scripts/build/clean.js"
243
242
  }
244
- }
243
+ }
@@ -1,4 +1,9 @@
1
1
  {
2
- "extends": "../../tsconfig.json",
3
- "include": ["src"]
2
+ "extends": "../../tsconfig.node.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "rootDir": "src"
6
+ },
7
+ "include": ["src"],
8
+ "exclude": []
4
9
  }
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "../../tsconfig.node.json",
3
+ "include": ["src"],
4
+ "exclude": ["**/*test.ts"]
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "../../tsconfig.test.json",
3
+ "include": ["**/*test.ts"],
4
+ "exclude": []
5
+ }