@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.
- package/CHANGELOG.md +28 -0
- package/cjs/__chunks/{NYVIJAIX.cjs → 3CPBCP3F.cjs} +2 -2
- package/cjs/__chunks/{FSEBHZVD.cjs → 63KDRM7J.cjs} +4 -4
- package/cjs/__chunks/{WYGT6WVD.cjs → BJ6S3SB5.cjs} +16 -16
- package/cjs/__chunks/{IYRMREW7.cjs → BX3HGZ7I.cjs} +5 -5
- package/cjs/__chunks/{CMHDB7LY.cjs → CP6M4POZ.cjs} +2 -2
- package/cjs/__chunks/{YITIRUCT.cjs → DH774RHH.cjs} +2 -2
- package/cjs/__chunks/{ND6THRTE.cjs → EQUPHBKX.cjs} +4 -4
- package/cjs/__chunks/{RG6JXX7T.cjs → EZLBMRYS.cjs} +13 -13
- package/cjs/__chunks/{H5Z2A5K2.cjs → FJEN5XPE.cjs} +5 -5
- package/cjs/__chunks/{HJTX27PU.cjs → GSMEXLDS.cjs} +43 -22
- package/cjs/__chunks/{KIZFPB5R.cjs → J3TNGZSO.cjs} +5 -5
- package/cjs/__chunks/{5LMWS5O4.cjs → KPYDIKOY.cjs} +3 -3
- package/cjs/__chunks/{IVRU7X3P.cjs → KUXCWMWW.cjs} +9 -1
- package/cjs/__chunks/{XKBGBOWQ.cjs → MWKUZW4E.cjs} +2 -0
- package/cjs/__chunks/{3QEUUQVB.cjs → NKZKDBAR.cjs} +0 -4
- package/cjs/__chunks/OKPDB2ZM.cjs +44 -0
- package/cjs/__chunks/{ABU7PK6G.cjs → PZ72QR7P.cjs} +2 -2
- package/cjs/__chunks/{7HZT2AAH.cjs → SGWCIO3J.cjs} +2 -2
- package/cjs/__chunks/{F6IOE5QT.cjs → TQ3ZXPQL.cjs} +3 -3
- package/cjs/__chunks/{TIVUAJD3.cjs → TZBXRN4U.cjs} +13 -13
- package/cjs/__chunks/{T4TB3AAZ.cjs → UK7WFIG4.cjs} +22 -14
- package/cjs/__chunks/{LH4INSYS.cjs → UYAQKYEJ.cjs} +2 -2
- package/cjs/__chunks/{QRBTWQPI.cjs → YTLECYPS.cjs} +8 -10
- package/cjs/__chunks/{NJHMO3XK.cjs → Z5OM7SNB.cjs} +3 -3
- package/cjs/__chunks/{KWHAB2F2.cjs → ZDO3DQPW.cjs} +1 -2
- package/cjs/__chunks/{3RC6Q4WI.cjs → ZS4MDBUW.cjs} +2 -2
- package/cjs/checkbox/checkbox-store.cjs +3 -3
- package/cjs/checkbox/checkbox.cjs +3 -3
- package/cjs/collection/collection-item.cjs +2 -2
- package/cjs/collection/collection-store.cjs +3 -3
- package/cjs/combobox/combobox-item.cjs +4 -3
- package/cjs/combobox/combobox-popover.cjs +9 -10
- package/cjs/combobox/combobox-store.cjs +12 -12
- package/cjs/combobox/combobox.cjs +20 -8
- package/cjs/composite/composite-container.cjs +3 -3
- package/cjs/composite/composite-item.cjs +4 -3
- package/cjs/composite/composite-overflow-disclosure.cjs +4 -3
- package/cjs/composite/composite-overflow-store.cjs +7 -7
- package/cjs/composite/composite-overflow.cjs +9 -10
- package/cjs/composite/composite-store.cjs +4 -4
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/dialog/dialog.cjs +8 -9
- package/cjs/dialog/utils/disable-tree-outside.cjs +7 -0
- package/cjs/dialog/utils/disable-tree-outside.d.ts +3 -0
- package/cjs/dialog/utils/use-champion-dialog.cjs +2 -2
- package/cjs/dialog/utils/use-hide-on-interact-outside.cjs +2 -2
- package/cjs/dialog/utils/use-nested-dialogs.cjs +2 -2
- package/cjs/dialog/utils/use-prevent-body-scroll.cjs +3 -3
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/form/form-checkbox.cjs +8 -8
- package/cjs/form/form-description.cjs +2 -2
- package/cjs/form/form-error.cjs +2 -2
- package/cjs/form/form-field.cjs +3 -3
- package/cjs/form/form-input.cjs +3 -3
- package/cjs/form/form-label.cjs +2 -2
- package/cjs/form/form-push.cjs +2 -2
- package/cjs/form/form-radio.cjs +7 -7
- package/cjs/form/form-store.cjs +28 -17
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/hovercard/hovercard.cjs +10 -11
- package/cjs/menu/menu-bar-store.cjs +6 -6
- package/cjs/menu/menu-button.cjs +2 -2
- package/cjs/menu/menu-item-checkbox.cjs +10 -10
- package/cjs/menu/menu-item-radio.cjs +8 -8
- package/cjs/menu/menu-item.cjs +5 -5
- package/cjs/menu/menu-list.cjs +3 -3
- package/cjs/menu/menu-store.cjs +14 -14
- package/cjs/menu/menu.cjs +13 -14
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/popover/popover.cjs +9 -10
- package/cjs/portal/portal.cjs +2 -2
- package/cjs/radio/radio-store.cjs +7 -7
- package/cjs/radio/radio.cjs +5 -5
- package/cjs/select/select-item.cjs +4 -3
- package/cjs/select/select-popover.cjs +9 -10
- package/cjs/select/select-store.cjs +12 -12
- package/cjs/tab/tab-panel.cjs +5 -5
- package/cjs/tab/tab-store.cjs +9 -9
- package/cjs/tab/tab.cjs +4 -3
- package/cjs/toolbar/toolbar-container.cjs +7 -7
- package/cjs/toolbar/toolbar-input.cjs +5 -4
- package/cjs/toolbar/toolbar-item.cjs +5 -4
- package/cjs/toolbar/toolbar-store.cjs +6 -6
- package/cjs/tooltip/tooltip-store.cjs +7 -7
- package/cjs/tooltip/tooltip.cjs +2 -2
- package/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/cjs/utils/store.cjs +2 -2
- package/dialog/utils/disable-tree-outside/package.json +7 -0
- package/esm/__chunks/{WOX4XCVH.js → 2EEVGFEH.js} +1 -1
- package/esm/__chunks/{56XURSTF.js → 36HCAR3M.js} +1 -1
- package/esm/__chunks/{IACKFX3D.js → 7VB6U7Y2.js} +1 -1
- package/esm/__chunks/{HLAXMBLL.js → ARIIJA3Z.js} +3 -1
- package/esm/__chunks/{RFLPDFU5.js → CDHQAO3X.js} +7 -9
- package/esm/__chunks/{ZVCQYVEV.js → FD7UP2TJ.js} +3 -4
- package/esm/__chunks/{QCGEDLZG.js → GLAECEAR.js} +1 -1
- package/esm/__chunks/{4RNONDN5.js → GM2BWWHD.js} +1 -1
- package/esm/__chunks/{LFCJQX2O.js → GWYHKM6Q.js} +1 -1
- package/esm/__chunks/{EJZ6BVXG.js → IIX2NU6T.js} +22 -14
- package/esm/__chunks/{47TE2UD5.js → JCOAGXR2.js} +2 -2
- package/esm/__chunks/{PAZURDJA.js → JIT55CHU.js} +39 -18
- package/esm/__chunks/{WHN4PCW7.js → JOV72LYK.js} +12 -12
- package/esm/__chunks/{YDNX3N4B.js → KTHONFWV.js} +3 -3
- package/esm/__chunks/{4STD3S2Y.js → LBUPFIVF.js} +2 -2
- package/esm/__chunks/{6DAEYZ43.js → LTH56VDS.js} +3 -3
- package/esm/__chunks/{RSJJ72ZD.js → M6QENKOT.js} +2 -2
- package/esm/__chunks/{HRNQJHNJ.js → MAJ5ZZ2S.js} +1 -1
- package/esm/__chunks/{3OSYJZM5.js → MPZ7PKON.js} +9 -1
- package/esm/__chunks/{OGTE6FGV.js → ND76WTDR.js} +2 -2
- package/esm/__chunks/{XQPXGTBO.js → NY7SYLNQ.js} +1 -1
- package/esm/__chunks/{OJNRBQKS.js → ON2AV7GH.js} +1 -5
- package/esm/__chunks/{CWHDUB4A.js → P4W76ES3.js} +1 -1
- package/esm/__chunks/X3J57OQT.js +44 -0
- package/esm/__chunks/{OXIHLN45.js → YHRHKO5B.js} +1 -1
- package/esm/__chunks/{2EP53RLR.js → ZCEPUYV7.js} +2 -2
- package/esm/checkbox/checkbox-store.js +2 -2
- package/esm/checkbox/checkbox.js +2 -2
- package/esm/collection/collection-item.js +1 -1
- package/esm/collection/collection-store.js +2 -2
- package/esm/combobox/combobox-item.js +3 -2
- package/esm/combobox/combobox-popover.js +8 -9
- package/esm/combobox/combobox-store.js +6 -6
- package/esm/combobox/combobox.js +20 -8
- package/esm/composite/composite-container.js +2 -2
- package/esm/composite/composite-item.js +3 -2
- package/esm/composite/composite-overflow-disclosure.js +3 -2
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-overflow.js +8 -9
- package/esm/composite/composite-store.js +3 -3
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/dialog/dialog.js +7 -8
- package/esm/dialog/utils/disable-tree-outside.d.ts +3 -0
- package/esm/dialog/utils/disable-tree-outside.js +7 -0
- package/esm/dialog/utils/use-champion-dialog.js +1 -1
- package/esm/dialog/utils/use-hide-on-interact-outside.js +1 -1
- package/esm/dialog/utils/use-nested-dialogs.js +1 -1
- package/esm/dialog/utils/use-prevent-body-scroll.js +2 -2
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/form/form-checkbox.js +7 -7
- package/esm/form/form-description.js +1 -1
- package/esm/form/form-error.js +1 -1
- package/esm/form/form-field.js +2 -2
- package/esm/form/form-input.js +2 -2
- package/esm/form/form-label.js +1 -1
- package/esm/form/form-push.js +1 -1
- package/esm/form/form-radio.js +5 -5
- package/esm/form/form-store.js +24 -13
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/hovercard/hovercard.js +9 -10
- package/esm/menu/menu-bar-store.js +3 -3
- package/esm/menu/menu-button.js +1 -1
- package/esm/menu/menu-item-checkbox.js +9 -9
- package/esm/menu/menu-item-radio.js +6 -6
- package/esm/menu/menu-item.js +4 -4
- package/esm/menu/menu-list.js +2 -2
- package/esm/menu/menu-store.js +7 -7
- package/esm/menu/menu.js +11 -12
- package/esm/popover/popover-store.js +4 -4
- package/esm/popover/popover.js +8 -9
- package/esm/portal/portal.js +1 -1
- package/esm/radio/radio-store.js +3 -3
- package/esm/radio/radio.js +4 -4
- package/esm/select/select-item.js +3 -2
- package/esm/select/select-popover.js +8 -9
- package/esm/select/select-store.js +6 -6
- package/esm/tab/tab-panel.js +3 -3
- package/esm/tab/tab-store.js +3 -3
- package/esm/tab/tab.js +3 -2
- package/esm/toolbar/toolbar-container.js +5 -5
- package/esm/toolbar/toolbar-input.js +4 -3
- package/esm/toolbar/toolbar-item.js +4 -3
- package/esm/toolbar/toolbar-store.js +3 -3
- package/esm/tooltip/tooltip-store.js +4 -4
- package/esm/tooltip/tooltip.js +1 -1
- package/esm/tsconfig.build.tsbuildinfo +1 -1
- package/esm/utils/store.js +1 -1
- package/package.json +5 -9
- package/cjs/__chunks/ORRE4SVW.cjs +0 -31
- package/cjs/__chunks/RDNP4FTV.cjs +0 -30
- package/cjs/dialog/utils/disable-pointer-events-outside.cjs +0 -7
- package/cjs/dialog/utils/disable-pointer-events-outside.d.ts +0 -3
- package/cjs/dialog/utils/use-focus-on-child-unmount.cjs +0 -6
- package/cjs/dialog/utils/use-focus-on-child-unmount.d.ts +0 -6
- package/dialog/utils/disable-pointer-events-outside/package.json +0 -7
- package/dialog/utils/use-focus-on-child-unmount/package.json +0 -7
- package/esm/__chunks/547F7FFZ.js +0 -30
- package/esm/__chunks/WO2RXMKK.js +0 -31
- package/esm/dialog/utils/disable-pointer-events-outside.d.ts +0 -3
- package/esm/dialog/utils/disable-pointer-events-outside.js +0 -7
- package/esm/dialog/utils/use-focus-on-child-unmount.d.ts +0 -6
- 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;
|
package/esm/__chunks/547F7FFZ.js
DELETED
|
@@ -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
|
-
};
|
package/esm/__chunks/WO2RXMKK.js
DELETED
|
@@ -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
|
-
};
|