@ariakit/react-core 0.1.3 → 0.1.5

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 (191) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/cjs/__chunks/{NYVIJAIX.cjs → 3CPBCP3F.cjs} +2 -2
  3. package/cjs/__chunks/{FSEBHZVD.cjs → 63KDRM7J.cjs} +4 -4
  4. package/cjs/__chunks/{WYGT6WVD.cjs → BJ6S3SB5.cjs} +16 -16
  5. package/cjs/__chunks/{IYRMREW7.cjs → BX3HGZ7I.cjs} +5 -5
  6. package/cjs/__chunks/{CMHDB7LY.cjs → CP6M4POZ.cjs} +2 -2
  7. package/cjs/__chunks/{YITIRUCT.cjs → DH774RHH.cjs} +2 -2
  8. package/cjs/__chunks/{ND6THRTE.cjs → EQUPHBKX.cjs} +4 -4
  9. package/cjs/__chunks/{RG6JXX7T.cjs → EZLBMRYS.cjs} +13 -13
  10. package/cjs/__chunks/{H5Z2A5K2.cjs → FJEN5XPE.cjs} +5 -5
  11. package/cjs/__chunks/{HJTX27PU.cjs → GSMEXLDS.cjs} +43 -22
  12. package/cjs/__chunks/{KIZFPB5R.cjs → J3TNGZSO.cjs} +5 -5
  13. package/cjs/__chunks/{5LMWS5O4.cjs → KPYDIKOY.cjs} +3 -3
  14. package/cjs/__chunks/{IVRU7X3P.cjs → KUXCWMWW.cjs} +9 -1
  15. package/cjs/__chunks/{XKBGBOWQ.cjs → MWKUZW4E.cjs} +2 -0
  16. package/cjs/__chunks/{3QEUUQVB.cjs → NKZKDBAR.cjs} +0 -4
  17. package/cjs/__chunks/OKPDB2ZM.cjs +44 -0
  18. package/cjs/__chunks/{ABU7PK6G.cjs → PZ72QR7P.cjs} +2 -2
  19. package/cjs/__chunks/{7HZT2AAH.cjs → SGWCIO3J.cjs} +2 -2
  20. package/cjs/__chunks/{F6IOE5QT.cjs → TQ3ZXPQL.cjs} +3 -3
  21. package/cjs/__chunks/{TIVUAJD3.cjs → TZBXRN4U.cjs} +13 -13
  22. package/cjs/__chunks/{T4TB3AAZ.cjs → UK7WFIG4.cjs} +22 -14
  23. package/cjs/__chunks/{LH4INSYS.cjs → UYAQKYEJ.cjs} +2 -2
  24. package/cjs/__chunks/{QRBTWQPI.cjs → YTLECYPS.cjs} +8 -10
  25. package/cjs/__chunks/{NJHMO3XK.cjs → Z5OM7SNB.cjs} +3 -3
  26. package/cjs/__chunks/{KWHAB2F2.cjs → ZDO3DQPW.cjs} +1 -2
  27. package/cjs/__chunks/{3RC6Q4WI.cjs → ZS4MDBUW.cjs} +2 -2
  28. package/cjs/checkbox/checkbox-store.cjs +3 -3
  29. package/cjs/checkbox/checkbox.cjs +3 -3
  30. package/cjs/collection/collection-item.cjs +2 -2
  31. package/cjs/collection/collection-store.cjs +3 -3
  32. package/cjs/combobox/combobox-item.cjs +4 -3
  33. package/cjs/combobox/combobox-popover.cjs +9 -10
  34. package/cjs/combobox/combobox-store.cjs +12 -12
  35. package/cjs/combobox/combobox.cjs +20 -8
  36. package/cjs/composite/composite-container.cjs +3 -3
  37. package/cjs/composite/composite-item.cjs +4 -3
  38. package/cjs/composite/composite-overflow-disclosure.cjs +4 -3
  39. package/cjs/composite/composite-overflow-store.cjs +7 -7
  40. package/cjs/composite/composite-overflow.cjs +9 -10
  41. package/cjs/composite/composite-store.cjs +4 -4
  42. package/cjs/dialog/dialog-store.cjs +4 -4
  43. package/cjs/dialog/dialog.cjs +8 -9
  44. package/cjs/dialog/utils/disable-tree-outside.cjs +7 -0
  45. package/cjs/dialog/utils/disable-tree-outside.d.ts +3 -0
  46. package/cjs/dialog/utils/use-champion-dialog.cjs +2 -2
  47. package/cjs/dialog/utils/use-hide-on-interact-outside.cjs +2 -2
  48. package/cjs/dialog/utils/use-nested-dialogs.cjs +2 -2
  49. package/cjs/dialog/utils/use-prevent-body-scroll.cjs +3 -3
  50. package/cjs/disclosure/disclosure-store.cjs +3 -3
  51. package/cjs/form/form-checkbox.cjs +8 -8
  52. package/cjs/form/form-description.cjs +2 -2
  53. package/cjs/form/form-error.cjs +2 -2
  54. package/cjs/form/form-field.cjs +3 -3
  55. package/cjs/form/form-input.cjs +3 -3
  56. package/cjs/form/form-label.cjs +2 -2
  57. package/cjs/form/form-push.cjs +2 -2
  58. package/cjs/form/form-radio.cjs +7 -7
  59. package/cjs/form/form-store.cjs +28 -17
  60. package/cjs/hovercard/hovercard-store.cjs +6 -6
  61. package/cjs/hovercard/hovercard.cjs +10 -11
  62. package/cjs/menu/menu-bar-store.cjs +6 -6
  63. package/cjs/menu/menu-button.cjs +2 -2
  64. package/cjs/menu/menu-item-checkbox.cjs +10 -10
  65. package/cjs/menu/menu-item-radio.cjs +8 -8
  66. package/cjs/menu/menu-item.cjs +5 -5
  67. package/cjs/menu/menu-list.cjs +3 -3
  68. package/cjs/menu/menu-store.cjs +14 -14
  69. package/cjs/menu/menu.cjs +13 -14
  70. package/cjs/popover/popover-store.cjs +5 -5
  71. package/cjs/popover/popover.cjs +9 -10
  72. package/cjs/portal/portal.cjs +2 -2
  73. package/cjs/radio/radio-store.cjs +7 -7
  74. package/cjs/radio/radio.cjs +5 -5
  75. package/cjs/select/select-item.cjs +4 -3
  76. package/cjs/select/select-popover.cjs +9 -10
  77. package/cjs/select/select-store.cjs +12 -12
  78. package/cjs/tab/tab-panel.cjs +5 -5
  79. package/cjs/tab/tab-store.cjs +9 -9
  80. package/cjs/tab/tab.cjs +4 -3
  81. package/cjs/toolbar/toolbar-container.cjs +7 -7
  82. package/cjs/toolbar/toolbar-input.cjs +5 -4
  83. package/cjs/toolbar/toolbar-item.cjs +5 -4
  84. package/cjs/toolbar/toolbar-store.cjs +6 -6
  85. package/cjs/tooltip/tooltip-store.cjs +7 -7
  86. package/cjs/tooltip/tooltip.cjs +2 -2
  87. package/cjs/tsconfig.build.tsbuildinfo +1 -1
  88. package/cjs/utils/store.cjs +2 -2
  89. package/dialog/utils/disable-tree-outside/package.json +7 -0
  90. package/esm/__chunks/{WOX4XCVH.js → 2EEVGFEH.js} +1 -1
  91. package/esm/__chunks/{56XURSTF.js → 36HCAR3M.js} +1 -1
  92. package/esm/__chunks/{IACKFX3D.js → 7VB6U7Y2.js} +1 -1
  93. package/esm/__chunks/{HLAXMBLL.js → ARIIJA3Z.js} +3 -1
  94. package/esm/__chunks/{RFLPDFU5.js → CDHQAO3X.js} +7 -9
  95. package/esm/__chunks/{ZVCQYVEV.js → FD7UP2TJ.js} +3 -4
  96. package/esm/__chunks/{QCGEDLZG.js → GLAECEAR.js} +1 -1
  97. package/esm/__chunks/{4RNONDN5.js → GM2BWWHD.js} +1 -1
  98. package/esm/__chunks/{LFCJQX2O.js → GWYHKM6Q.js} +1 -1
  99. package/esm/__chunks/{EJZ6BVXG.js → IIX2NU6T.js} +22 -14
  100. package/esm/__chunks/{47TE2UD5.js → JCOAGXR2.js} +2 -2
  101. package/esm/__chunks/{PAZURDJA.js → JIT55CHU.js} +39 -18
  102. package/esm/__chunks/{WHN4PCW7.js → JOV72LYK.js} +12 -12
  103. package/esm/__chunks/{YDNX3N4B.js → KTHONFWV.js} +3 -3
  104. package/esm/__chunks/{4STD3S2Y.js → LBUPFIVF.js} +2 -2
  105. package/esm/__chunks/{6DAEYZ43.js → LTH56VDS.js} +3 -3
  106. package/esm/__chunks/{RSJJ72ZD.js → M6QENKOT.js} +2 -2
  107. package/esm/__chunks/{HRNQJHNJ.js → MAJ5ZZ2S.js} +1 -1
  108. package/esm/__chunks/{3OSYJZM5.js → MPZ7PKON.js} +9 -1
  109. package/esm/__chunks/{OGTE6FGV.js → ND76WTDR.js} +2 -2
  110. package/esm/__chunks/{XQPXGTBO.js → NY7SYLNQ.js} +1 -1
  111. package/esm/__chunks/{OJNRBQKS.js → ON2AV7GH.js} +1 -5
  112. package/esm/__chunks/{CWHDUB4A.js → P4W76ES3.js} +1 -1
  113. package/esm/__chunks/X3J57OQT.js +44 -0
  114. package/esm/__chunks/{OXIHLN45.js → YHRHKO5B.js} +1 -1
  115. package/esm/__chunks/{2EP53RLR.js → ZCEPUYV7.js} +2 -2
  116. package/esm/checkbox/checkbox-store.js +2 -2
  117. package/esm/checkbox/checkbox.js +2 -2
  118. package/esm/collection/collection-item.js +1 -1
  119. package/esm/collection/collection-store.js +2 -2
  120. package/esm/combobox/combobox-item.js +3 -2
  121. package/esm/combobox/combobox-popover.js +8 -9
  122. package/esm/combobox/combobox-store.js +6 -6
  123. package/esm/combobox/combobox.js +20 -8
  124. package/esm/composite/composite-container.js +2 -2
  125. package/esm/composite/composite-item.js +3 -2
  126. package/esm/composite/composite-overflow-disclosure.js +3 -2
  127. package/esm/composite/composite-overflow-store.js +4 -4
  128. package/esm/composite/composite-overflow.js +8 -9
  129. package/esm/composite/composite-store.js +3 -3
  130. package/esm/dialog/dialog-store.js +3 -3
  131. package/esm/dialog/dialog.js +7 -8
  132. package/esm/dialog/utils/disable-tree-outside.d.ts +3 -0
  133. package/esm/dialog/utils/disable-tree-outside.js +7 -0
  134. package/esm/dialog/utils/use-champion-dialog.js +1 -1
  135. package/esm/dialog/utils/use-hide-on-interact-outside.js +1 -1
  136. package/esm/dialog/utils/use-nested-dialogs.js +1 -1
  137. package/esm/dialog/utils/use-prevent-body-scroll.js +2 -2
  138. package/esm/disclosure/disclosure-store.js +2 -2
  139. package/esm/form/form-checkbox.js +7 -7
  140. package/esm/form/form-description.js +1 -1
  141. package/esm/form/form-error.js +1 -1
  142. package/esm/form/form-field.js +2 -2
  143. package/esm/form/form-input.js +2 -2
  144. package/esm/form/form-label.js +1 -1
  145. package/esm/form/form-push.js +1 -1
  146. package/esm/form/form-radio.js +5 -5
  147. package/esm/form/form-store.js +24 -13
  148. package/esm/hovercard/hovercard-store.js +5 -5
  149. package/esm/hovercard/hovercard.js +9 -10
  150. package/esm/menu/menu-bar-store.js +3 -3
  151. package/esm/menu/menu-button.js +1 -1
  152. package/esm/menu/menu-item-checkbox.js +9 -9
  153. package/esm/menu/menu-item-radio.js +6 -6
  154. package/esm/menu/menu-item.js +4 -4
  155. package/esm/menu/menu-list.js +2 -2
  156. package/esm/menu/menu-store.js +7 -7
  157. package/esm/menu/menu.js +11 -12
  158. package/esm/popover/popover-store.js +4 -4
  159. package/esm/popover/popover.js +8 -9
  160. package/esm/portal/portal.js +1 -1
  161. package/esm/radio/radio-store.js +3 -3
  162. package/esm/radio/radio.js +4 -4
  163. package/esm/select/select-item.js +3 -2
  164. package/esm/select/select-popover.js +8 -9
  165. package/esm/select/select-store.js +6 -6
  166. package/esm/tab/tab-panel.js +3 -3
  167. package/esm/tab/tab-store.js +3 -3
  168. package/esm/tab/tab.js +3 -2
  169. package/esm/toolbar/toolbar-container.js +5 -5
  170. package/esm/toolbar/toolbar-input.js +4 -3
  171. package/esm/toolbar/toolbar-item.js +4 -3
  172. package/esm/toolbar/toolbar-store.js +3 -3
  173. package/esm/tooltip/tooltip-store.js +4 -4
  174. package/esm/tooltip/tooltip.js +1 -1
  175. package/esm/tsconfig.build.tsbuildinfo +1 -1
  176. package/esm/utils/store.js +1 -1
  177. package/package.json +5 -9
  178. package/cjs/__chunks/ORRE4SVW.cjs +0 -31
  179. package/cjs/__chunks/RDNP4FTV.cjs +0 -30
  180. package/cjs/dialog/utils/disable-pointer-events-outside.cjs +0 -7
  181. package/cjs/dialog/utils/disable-pointer-events-outside.d.ts +0 -3
  182. package/cjs/dialog/utils/use-focus-on-child-unmount.cjs +0 -6
  183. package/cjs/dialog/utils/use-focus-on-child-unmount.d.ts +0 -6
  184. package/dialog/utils/disable-pointer-events-outside/package.json +0 -7
  185. package/dialog/utils/use-focus-on-child-unmount/package.json +0 -7
  186. package/esm/__chunks/547F7FFZ.js +0 -30
  187. package/esm/__chunks/WO2RXMKK.js +0 -31
  188. package/esm/dialog/utils/disable-pointer-events-outside.d.ts +0 -3
  189. package/esm/dialog/utils/disable-pointer-events-outside.js +0 -7
  190. package/esm/dialog/utils/use-focus-on-child-unmount.d.ts +0 -6
  191. package/esm/dialog/utils/use-focus-on-child-unmount.js +0 -6
@@ -1,31 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/dialog/utils/use-focus-on-child-unmount.ts
2
- var _react = require('react');
3
- var _dom = require('@ariakit/core/utils/dom');
4
- function useFocusOnChildUnmount(store) {
5
- const open = store.useState("open");
6
- const contentElement = store.useState("contentElement");
7
- _react.useEffect.call(void 0, () => {
8
- if (!open)
9
- return;
10
- const dialog = contentElement;
11
- if (!dialog)
12
- return;
13
- const observer = new MutationObserver(([mutation]) => {
14
- if (!mutation)
15
- return;
16
- if (mutation.target !== dialog)
17
- return;
18
- const document = _dom.getDocument.call(void 0, dialog);
19
- const activeElement = _dom.getActiveElement.call(void 0, dialog);
20
- if (activeElement === document.body) {
21
- dialog.focus();
22
- }
23
- });
24
- observer.observe(dialog, { childList: true, subtree: true });
25
- return () => observer.disconnect();
26
- }, [open, contentElement]);
27
- }
28
-
29
-
30
-
31
- exports.useFocusOnChildUnmount = useFocusOnChildUnmount;
@@ -1,30 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
-
3
- var _YHG3KGFWcjs = require('./YHG3KGFW.cjs');
4
-
5
- // src/dialog/utils/disable-pointer-events-outside.ts
6
- var _misc = require('@ariakit/core/utils/misc');
7
- function disableElement(element) {
8
- if (!("style" in element))
9
- return _misc.noop;
10
- const previousPointerEvents = element.style.pointerEvents;
11
- element.style.pointerEvents = "none";
12
- const enableElement = () => {
13
- element.style.pointerEvents = _nullishCoalesce(previousPointerEvents, () => ( ""));
14
- };
15
- return enableElement;
16
- }
17
- function disablePointerEventsOutside(...elements) {
18
- const cleanups = [];
19
- _YHG3KGFWcjs.walkTreeOutside.call(void 0, elements, (element) => {
20
- cleanups.unshift(disableElement(element));
21
- });
22
- const restorePointerEvents = () => {
23
- cleanups.forEach((fn) => fn());
24
- };
25
- return restorePointerEvents;
26
- }
27
-
28
-
29
-
30
- exports.disablePointerEventsOutside = disablePointerEventsOutside;
@@ -1,7 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _RDNP4FTVcjs = require('../../__chunks/RDNP4FTV.cjs');
4
- require('../../__chunks/YHG3KGFW.cjs');
5
-
6
-
7
- exports.disablePointerEventsOutside = _RDNP4FTVcjs.disablePointerEventsOutside;
@@ -1,3 +0,0 @@
1
- type Elements = Array<Element | null>;
2
- export declare function disablePointerEventsOutside(...elements: Elements): () => void;
3
- export {};
@@ -1,6 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _ORRE4SVWcjs = require('../../__chunks/ORRE4SVW.cjs');
4
-
5
-
6
- exports.useFocusOnChildUnmount = _ORRE4SVWcjs.useFocusOnChildUnmount;
@@ -1,6 +0,0 @@
1
- import type { DialogStore } from "../dialog-store.js";
2
- /**
3
- * When the focused child gets removed from the DOM, we make sure to move focus
4
- * to the dialog.
5
- */
6
- export declare function useFocusOnChildUnmount(store: DialogStore): void;
@@ -1,7 +0,0 @@
1
- {
2
- "name": "@ariakit/react-core/dialog/utils/disable-pointer-events-outside",
3
- "private": true,
4
- "sideEffects": false,
5
- "main": "../../../cjs/dialog/utils/disable-pointer-events-outside",
6
- "module": "../../../esm/dialog/utils/disable-pointer-events-outside"
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "name": "@ariakit/react-core/dialog/utils/use-focus-on-child-unmount",
3
- "private": true,
4
- "sideEffects": false,
5
- "main": "../../../cjs/dialog/utils/use-focus-on-child-unmount",
6
- "module": "../../../esm/dialog/utils/use-focus-on-child-unmount"
7
- }
@@ -1,30 +0,0 @@
1
- import {
2
- walkTreeOutside
3
- } from "./HVXLVRRR.js";
4
-
5
- // src/dialog/utils/disable-pointer-events-outside.ts
6
- import { noop } from "@ariakit/core/utils/misc";
7
- function disableElement(element) {
8
- if (!("style" in element))
9
- return noop;
10
- const previousPointerEvents = element.style.pointerEvents;
11
- element.style.pointerEvents = "none";
12
- const enableElement = () => {
13
- element.style.pointerEvents = previousPointerEvents ?? "";
14
- };
15
- return enableElement;
16
- }
17
- function disablePointerEventsOutside(...elements) {
18
- const cleanups = [];
19
- walkTreeOutside(elements, (element) => {
20
- cleanups.unshift(disableElement(element));
21
- });
22
- const restorePointerEvents = () => {
23
- cleanups.forEach((fn) => fn());
24
- };
25
- return restorePointerEvents;
26
- }
27
-
28
- export {
29
- disablePointerEventsOutside
30
- };
@@ -1,31 +0,0 @@
1
- // src/dialog/utils/use-focus-on-child-unmount.ts
2
- import { useEffect } from "react";
3
- import { getActiveElement, getDocument } from "@ariakit/core/utils/dom";
4
- function useFocusOnChildUnmount(store) {
5
- const open = store.useState("open");
6
- const contentElement = store.useState("contentElement");
7
- useEffect(() => {
8
- if (!open)
9
- return;
10
- const dialog = contentElement;
11
- if (!dialog)
12
- return;
13
- const observer = new MutationObserver(([mutation]) => {
14
- if (!mutation)
15
- return;
16
- if (mutation.target !== dialog)
17
- return;
18
- const document = getDocument(dialog);
19
- const activeElement = getActiveElement(dialog);
20
- if (activeElement === document.body) {
21
- dialog.focus();
22
- }
23
- });
24
- observer.observe(dialog, { childList: true, subtree: true });
25
- return () => observer.disconnect();
26
- }, [open, contentElement]);
27
- }
28
-
29
- export {
30
- useFocusOnChildUnmount
31
- };
@@ -1,3 +0,0 @@
1
- type Elements = Array<Element | null>;
2
- export declare function disablePointerEventsOutside(...elements: Elements): () => void;
3
- export {};
@@ -1,7 +0,0 @@
1
- import {
2
- disablePointerEventsOutside
3
- } from "../../__chunks/547F7FFZ.js";
4
- import "../../__chunks/HVXLVRRR.js";
5
- export {
6
- disablePointerEventsOutside
7
- };
@@ -1,6 +0,0 @@
1
- import type { DialogStore } from "../dialog-store.js";
2
- /**
3
- * When the focused child gets removed from the DOM, we make sure to move focus
4
- * to the dialog.
5
- */
6
- export declare function useFocusOnChildUnmount(store: DialogStore): void;
@@ -1,6 +0,0 @@
1
- import {
2
- useFocusOnChildUnmount
3
- } from "../../__chunks/WO2RXMKK.js";
4
- export {
5
- useFocusOnChildUnmount
6
- };