@ariakit/react-core 0.2.15 → 0.2.17
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 +22 -0
- package/cjs/__chunks/{GHDSJPDP.cjs → 2CBM6TG2.cjs} +9 -1
- package/cjs/__chunks/{7AY74MRV.cjs → 2GAPZOO5.cjs} +2 -2
- package/cjs/__chunks/{4ALK6CLY.cjs → 3ALHBZ3R.cjs} +2 -2
- package/cjs/__chunks/{PJQOOE4T.cjs → 4ZIMX233.cjs} +6 -8
- package/cjs/__chunks/{XE2DJMCI.cjs → 6BAHKJ5K.cjs} +14 -20
- package/cjs/__chunks/{RO6U6W2X.cjs → 6XUE2BI4.cjs} +7 -7
- package/cjs/__chunks/{B4KY2VS7.cjs → ATSMFQCO.cjs} +3 -3
- package/cjs/__chunks/{IIT6ECXG.cjs → BOBM73LT.cjs} +8 -8
- package/cjs/__chunks/{COQS7NEY.cjs → BPAMJRUF.cjs} +2 -2
- package/cjs/__chunks/{GJDDV2DB.cjs → CRKIULUL.cjs} +13 -13
- package/cjs/__chunks/{AGHEZ6QM.cjs → DZGTHAPX.cjs} +2 -2
- package/cjs/__chunks/{KAIRFV3B.cjs → EHQTSSAA.cjs} +4 -4
- package/cjs/__chunks/{SIVNE3PR.cjs → ETK4FMZH.cjs} +12 -12
- package/cjs/__chunks/{YBLCB5MM.cjs → HOHFF2K6.cjs} +5 -5
- package/cjs/__chunks/{VXMYNJ4Z.cjs → KCH72A7J.cjs} +2 -2
- package/cjs/__chunks/{GYMLYZWR.cjs → LRB2BIFR.cjs} +3 -3
- package/cjs/__chunks/{RS6F2A54.cjs → MNRJXH5I.cjs} +4 -4
- package/cjs/__chunks/{HV7BPIPP.cjs → MNUCM2FP.cjs} +7 -7
- package/cjs/__chunks/{MEIHBPXG.cjs → MPGRRS75.cjs} +32 -26
- package/cjs/__chunks/{VBRBBWCP.cjs → NH6Q6YSM.cjs} +2 -2
- package/cjs/__chunks/{UQ677BGW.cjs → OJKRJ6N2.cjs} +6 -6
- package/cjs/__chunks/{ZC54XMTA.cjs → OVOYNBFC.cjs} +4 -4
- package/cjs/__chunks/{LHLJ5HWH.cjs → RYHFE3BI.cjs} +2 -2
- package/cjs/__chunks/{2BUZEL3H.cjs → TUSNAJ32.cjs} +2 -2
- package/cjs/__chunks/{5PVFQNEK.cjs → ZK5KHSMP.cjs} +10 -10
- 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-renderer.cjs +3 -3
- package/cjs/collection/collection-store.cjs +3 -3
- package/cjs/combobox/combobox-item.cjs +4 -4
- package/cjs/combobox/combobox-popover.cjs +7 -7
- package/cjs/combobox/combobox-store.cjs +11 -11
- package/cjs/combobox/combobox.cjs +3 -3
- package/cjs/command/command.d.ts +18 -5
- package/cjs/composite/composite-container.cjs +3 -3
- package/cjs/composite/composite-item.cjs +4 -4
- package/cjs/composite/composite-overflow-disclosure.cjs +7 -6
- package/cjs/composite/composite-overflow-store.cjs +7 -7
- package/cjs/composite/composite-overflow.cjs +7 -7
- package/cjs/composite/composite-renderer.cjs +4 -4
- package/cjs/composite/composite-store.cjs +4 -4
- package/cjs/dialog/dialog-backdrop.cjs +4 -4
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/dialog/dialog.cjs +6 -6
- package/cjs/dialog/utils/use-nested-dialogs.cjs +2 -2
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/focusable/focusable.d.ts +52 -13
- 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 +8 -8
- package/cjs/hovercard/hovercard-anchor.cjs +2 -2
- package/cjs/hovercard/hovercard-disclosure.cjs +12 -14
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/hovercard/hovercard.cjs +8 -8
- package/cjs/menu/menu-bar-store.cjs +6 -6
- package/cjs/menu/menu-button.cjs +9 -6
- package/cjs/menu/menu-item-checkbox.cjs +9 -9
- package/cjs/menu/menu-item-radio.cjs +7 -7
- package/cjs/menu/menu-item.cjs +5 -5
- package/cjs/menu/menu-list.cjs +3 -3
- package/cjs/menu/menu-store.cjs +13 -13
- package/cjs/menu/menu.cjs +10 -10
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/popover/popover.cjs +7 -7
- package/cjs/radio/radio-store.cjs +7 -7
- package/cjs/radio/radio.cjs +5 -5
- package/cjs/select/select-item.cjs +4 -4
- package/cjs/select/select-popover.cjs +7 -7
- package/cjs/select/select-renderer.cjs +7 -7
- package/cjs/select/select-store.cjs +11 -11
- package/cjs/tab/tab-panel.cjs +5 -5
- package/cjs/tab/tab-store.cjs +9 -9
- package/cjs/tab/tab.cjs +4 -4
- package/cjs/toolbar/toolbar-container.cjs +7 -7
- package/cjs/toolbar/toolbar-input.cjs +5 -5
- package/cjs/toolbar/toolbar-item.cjs +5 -5
- package/cjs/toolbar/toolbar-store.cjs +6 -6
- package/cjs/tooltip/tooltip-anchor.cjs +22 -28
- package/cjs/tooltip/tooltip-store.cjs +10 -10
- package/cjs/tooltip/tooltip.cjs +8 -8
- package/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/cjs/utils/store.cjs +2 -2
- package/esm/__chunks/{ID2DTD7Z.js → 24II2LYU.js} +5 -7
- package/esm/__chunks/{JWSYWSCR.js → 3CJV7UYE.js} +1 -1
- package/esm/__chunks/{SPTQP5I5.js → 3PKTK2K7.js} +2 -2
- package/esm/__chunks/{H3BU75TA.js → 5IZLNERH.js} +1 -1
- package/esm/__chunks/{QHXLY5NM.js → 5QHNNZNE.js} +1 -1
- package/esm/__chunks/{4LTL37RB.js → 6TMY6IFR.js} +1 -1
- package/esm/__chunks/{36V3RYFS.js → 7KULBIZY.js} +2 -2
- package/esm/__chunks/{I6WUAEGK.js → DITMA5PJ.js} +2 -2
- package/esm/__chunks/{VVJJXZ6R.js → FVD2NJZN.js} +2 -2
- package/esm/__chunks/{JHKKFNCJ.js → K5MSER23.js} +1 -1
- package/esm/__chunks/{ISVIGIQD.js → KME3EPVS.js} +1 -1
- package/esm/__chunks/{74BBE733.js → LDICFO4C.js} +2 -2
- package/esm/__chunks/{QLIKSQTQ.js → ONFAHVST.js} +1 -1
- package/esm/__chunks/{XEEFNNEM.js → P2MU7N5N.js} +1 -1
- package/esm/__chunks/{XE25NQP3.js → P4CYWFUE.js} +1 -1
- package/esm/__chunks/{MXMUDZTV.js → P63NRZ4A.js} +31 -25
- package/esm/__chunks/{OEA63YXU.js → PLOINBVB.js} +14 -20
- package/esm/__chunks/{WNGYZL6A.js → RS7KBRGA.js} +1 -1
- package/esm/__chunks/{JJW3R5IK.js → SWJ5EOOS.js} +1 -1
- package/esm/__chunks/{BIPBU2AE.js → SZIMOWLA.js} +5 -5
- package/esm/__chunks/{OJNIJGF2.js → UVKFBOMX.js} +2 -2
- package/esm/__chunks/{HGFTMLQ7.js → VFNGSUSF.js} +13 -13
- package/esm/__chunks/{RRY7OZXM.js → WC3GK4CL.js} +2 -2
- package/esm/__chunks/{JFQ4TNZX.js → XADDW7ND.js} +2 -2
- package/esm/__chunks/{I3PXTXPI.js → Y5XLHDDM.js} +9 -1
- 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-renderer.js +2 -2
- package/esm/collection/collection-store.js +2 -2
- package/esm/combobox/combobox-item.js +3 -3
- package/esm/combobox/combobox-popover.js +6 -6
- package/esm/combobox/combobox-store.js +6 -6
- package/esm/combobox/combobox.js +3 -3
- package/esm/command/command.d.ts +18 -5
- package/esm/composite/composite-container.js +2 -2
- package/esm/composite/composite-item.js +3 -3
- package/esm/composite/composite-overflow-disclosure.js +6 -5
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-overflow.js +6 -6
- package/esm/composite/composite-renderer.js +3 -3
- package/esm/composite/composite-store.js +3 -3
- package/esm/dialog/dialog-backdrop.js +3 -3
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/dialog/dialog.js +5 -5
- package/esm/dialog/utils/use-nested-dialogs.js +1 -1
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/focusable/focusable.d.ts +52 -13
- package/esm/form/form-checkbox.js +5 -5
- 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 +2 -2
- package/esm/hovercard/hovercard-anchor.js +1 -1
- package/esm/hovercard/hovercard-disclosure.js +12 -14
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/hovercard/hovercard.js +7 -7
- package/esm/menu/menu-bar-store.js +3 -3
- package/esm/menu/menu-button.js +7 -4
- package/esm/menu/menu-item-checkbox.js +6 -6
- package/esm/menu/menu-item-radio.js +5 -5
- 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 +8 -8
- package/esm/popover/popover-store.js +4 -4
- package/esm/popover/popover.js +6 -6
- package/esm/radio/radio-store.js +3 -3
- package/esm/radio/radio.js +4 -4
- package/esm/select/select-item.js +3 -3
- package/esm/select/select-popover.js +6 -6
- package/esm/select/select-renderer.js +3 -3
- 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 -3
- package/esm/toolbar/toolbar-container.js +5 -5
- package/esm/toolbar/toolbar-input.js +4 -4
- package/esm/toolbar/toolbar-item.js +4 -4
- package/esm/toolbar/toolbar-store.js +3 -3
- package/esm/tooltip/tooltip-anchor.js +22 -28
- package/esm/tooltip/tooltip-store.js +5 -5
- package/esm/tooltip/tooltip.js +7 -7
- package/esm/tsconfig.build.tsbuildinfo +1 -1
- package/esm/utils/store.js +1 -1
- package/package.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDialogStoreOptions,
|
|
3
3
|
useDialogStoreProps
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./WC3GK4CL.js";
|
|
5
5
|
import {
|
|
6
6
|
useStore,
|
|
7
7
|
useStoreProps
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./P63NRZ4A.js";
|
|
9
9
|
import {
|
|
10
10
|
__spreadValues
|
|
11
11
|
} from "./PNRLI7OV.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCollectionStoreOptions,
|
|
3
3
|
useCollectionStoreProps
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./RS7KBRGA.js";
|
|
5
5
|
import {
|
|
6
6
|
useStore,
|
|
7
7
|
useStoreProps
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./P63NRZ4A.js";
|
|
9
9
|
import {
|
|
10
10
|
__spreadValues
|
|
11
11
|
} from "./PNRLI7OV.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCollectionRendererItemId,
|
|
3
3
|
useCollectionRenderer
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./ONFAHVST.js";
|
|
5
5
|
import {
|
|
6
6
|
CompositeContext
|
|
7
7
|
} from "./WJ37OVG2.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./NQJBHION.js";
|
|
12
12
|
import {
|
|
13
13
|
useStoreState
|
|
14
|
-
} from "./
|
|
14
|
+
} from "./P63NRZ4A.js";
|
|
15
15
|
import {
|
|
16
16
|
useId
|
|
17
17
|
} from "./J7Q2EO23.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./P4RGQGTG.js";
|
|
4
4
|
import {
|
|
5
5
|
useCollectionItem
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./VFNGSUSF.js";
|
|
7
7
|
import {
|
|
8
8
|
focusSilently,
|
|
9
9
|
getEnabledItem,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./NQJBHION.js";
|
|
22
22
|
import {
|
|
23
23
|
useStoreState
|
|
24
|
-
} from "./
|
|
24
|
+
} from "./P63NRZ4A.js";
|
|
25
25
|
import {
|
|
26
26
|
useBooleanEvent,
|
|
27
27
|
useEvent,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usePopoverStoreOptions,
|
|
3
3
|
usePopoverStoreProps
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./3PKTK2K7.js";
|
|
5
5
|
import {
|
|
6
6
|
useStore,
|
|
7
7
|
useStoreProps
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./P63NRZ4A.js";
|
|
9
9
|
import {
|
|
10
10
|
__spreadValues
|
|
11
11
|
} from "./PNRLI7OV.js";
|
|
@@ -9,10 +9,12 @@ import {
|
|
|
9
9
|
} from "./PNRLI7OV.js";
|
|
10
10
|
|
|
11
11
|
// src/utils/store.tsx
|
|
12
|
-
import
|
|
12
|
+
import * as React from "react";
|
|
13
13
|
import { hasOwnProperty, identity } from "@ariakit/core/utils/misc";
|
|
14
|
+
import { batch, init, subscribe, sync } from "@ariakit/core/utils/store";
|
|
14
15
|
import { flushSync } from "react-dom";
|
|
15
|
-
import
|
|
16
|
+
import useSyncExternalStoreExports from "use-sync-external-store/shim/index.js";
|
|
17
|
+
var { useSyncExternalStore } = useSyncExternalStoreExports;
|
|
16
18
|
var noopSubscribe = () => () => {
|
|
17
19
|
};
|
|
18
20
|
var inFlushSyncContext = false;
|
|
@@ -38,6 +40,14 @@ function safeFlushSync(fn, canFlushSync = true) {
|
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
function useStoreState(store, keyOrSelector = identity) {
|
|
43
|
+
const storeSubscribe = React.useCallback(
|
|
44
|
+
(callback) => {
|
|
45
|
+
if (!store)
|
|
46
|
+
return noopSubscribe();
|
|
47
|
+
return subscribe(store, null, callback);
|
|
48
|
+
},
|
|
49
|
+
[store]
|
|
50
|
+
);
|
|
41
51
|
const getSnapshot = () => {
|
|
42
52
|
if (!store)
|
|
43
53
|
return;
|
|
@@ -52,11 +62,7 @@ function useStoreState(store, keyOrSelector = identity) {
|
|
|
52
62
|
return;
|
|
53
63
|
return state[key];
|
|
54
64
|
};
|
|
55
|
-
return useSyncExternalStore(
|
|
56
|
-
(store == null ? void 0 : store.subscribe) || noopSubscribe,
|
|
57
|
-
getSnapshot,
|
|
58
|
-
getSnapshot
|
|
59
|
-
);
|
|
65
|
+
return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot);
|
|
60
66
|
}
|
|
61
67
|
function useStoreProps(store, props, key, setKey) {
|
|
62
68
|
const value = hasOwnProperty(props, key) ? props[key] : void 0;
|
|
@@ -69,36 +75,36 @@ function useStoreProps(store, props, key, setKey) {
|
|
|
69
75
|
queueMicrotask(() => {
|
|
70
76
|
canFlushSync = true;
|
|
71
77
|
});
|
|
72
|
-
return
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
[key]
|
|
84
|
-
);
|
|
78
|
+
return sync(store, [key], (state, prev) => {
|
|
79
|
+
const { value: value2, setValue } = propsRef.current;
|
|
80
|
+
if (!setValue)
|
|
81
|
+
return;
|
|
82
|
+
if (state[key] === prev[key])
|
|
83
|
+
return;
|
|
84
|
+
if (state[key] === value2)
|
|
85
|
+
return;
|
|
86
|
+
safeFlushSync(() => setValue(state[key]), canFlushSync);
|
|
87
|
+
});
|
|
85
88
|
}, [store, key]);
|
|
86
89
|
useSafeLayoutEffect(() => {
|
|
87
|
-
return store
|
|
90
|
+
return batch(store, [key], () => {
|
|
88
91
|
if (value === void 0)
|
|
89
92
|
return;
|
|
90
93
|
store.setState(key, value);
|
|
91
|
-
}
|
|
94
|
+
});
|
|
92
95
|
}, [store, key, value]);
|
|
93
96
|
}
|
|
94
97
|
function useStore(createStore) {
|
|
95
98
|
const store = useLazyValue(createStore);
|
|
96
|
-
useSafeLayoutEffect(() =>
|
|
97
|
-
const useState = useCallback(
|
|
99
|
+
useSafeLayoutEffect(() => init(store), [store]);
|
|
100
|
+
const useState = React.useCallback(
|
|
98
101
|
(keyOrSelector) => useStoreState(store, keyOrSelector),
|
|
99
102
|
[store]
|
|
100
103
|
);
|
|
101
|
-
return useMemo(
|
|
104
|
+
return React.useMemo(
|
|
105
|
+
() => __spreadProps(__spreadValues({}, store), { useState }),
|
|
106
|
+
[store, useState]
|
|
107
|
+
);
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
export {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
useState
|
|
12
12
|
} from "react";
|
|
13
13
|
import { chain } from "@ariakit/core/utils/misc";
|
|
14
|
+
import { sync } from "@ariakit/core/utils/store";
|
|
14
15
|
import { jsx } from "react/jsx-runtime";
|
|
15
16
|
var NestedDialogsContext = createContext({});
|
|
16
17
|
function useNestedDialogs(store) {
|
|
@@ -27,28 +28,21 @@ function useNestedDialogs(store) {
|
|
|
27
28
|
[context]
|
|
28
29
|
);
|
|
29
30
|
useSafeLayoutEffect(() => {
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
["open", "contentElement"]
|
|
40
|
-
);
|
|
31
|
+
return sync(store, ["open", "contentElement"], (state) => {
|
|
32
|
+
var _a;
|
|
33
|
+
if (!state.open)
|
|
34
|
+
return;
|
|
35
|
+
if (!state.contentElement)
|
|
36
|
+
return;
|
|
37
|
+
return (_a = context.add) == null ? void 0 : _a.call(context, store);
|
|
38
|
+
});
|
|
41
39
|
}, [store, context]);
|
|
42
40
|
useSafeLayoutEffect(() => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
store.hide();
|
|
49
|
-
},
|
|
50
|
-
["open"]
|
|
51
|
-
);
|
|
41
|
+
return sync(context.store, ["open"], (state) => {
|
|
42
|
+
if (state.open)
|
|
43
|
+
return;
|
|
44
|
+
store.hide();
|
|
45
|
+
});
|
|
52
46
|
}, [context, store]);
|
|
53
47
|
const providerValue = useMemo(() => ({ store, add }), [store, add]);
|
|
54
48
|
const wrapElement = useCallback(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DialogBackdrop
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./5IZLNERH.js";
|
|
4
4
|
import {
|
|
5
5
|
disableTreeOutside
|
|
6
6
|
} from "./NHPU54IO.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./3LAWLNOX.js";
|
|
13
13
|
import {
|
|
14
14
|
useNestedDialogs
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./PLOINBVB.js";
|
|
16
16
|
import {
|
|
17
17
|
useHideOnInteractOutside
|
|
18
18
|
} from "./E5XSMSHD.js";
|
|
@@ -166,7 +166,7 @@ var useDialog = createHook(
|
|
|
166
166
|
if (dialog && contains(dialog, activeElement))
|
|
167
167
|
return;
|
|
168
168
|
store.setDisclosureElement(activeElement);
|
|
169
|
-
}, [open]);
|
|
169
|
+
}, [open, store]);
|
|
170
170
|
if (isSafariBrowser) {
|
|
171
171
|
useEffect(() => {
|
|
172
172
|
if (!mounted)
|
|
@@ -194,7 +194,7 @@ var useDialog = createHook(
|
|
|
194
194
|
return () => {
|
|
195
195
|
disclosureElement.removeEventListener("mousedown", onMouseDown);
|
|
196
196
|
};
|
|
197
|
-
}, [mounted]);
|
|
197
|
+
}, [mounted, store]);
|
|
198
198
|
}
|
|
199
199
|
const shouldDisableAccessibilityTree = modal || // Usually, we only want to disable the accessibility tree outside if the
|
|
200
200
|
// dialog is a modal. But the Portal component can't preserve the tab
|
|
@@ -405,7 +405,7 @@ var useDialog = createHook(
|
|
|
405
405
|
store.hide();
|
|
406
406
|
};
|
|
407
407
|
return addGlobalEventListener("keydown", onKeyDown);
|
|
408
|
-
}, [mounted, domReady, hideOnEscapeProp]);
|
|
408
|
+
}, [mounted, domReady, store, hideOnEscapeProp]);
|
|
409
409
|
props = useWrapElement(
|
|
410
410
|
props,
|
|
411
411
|
(element) => /* @__PURE__ */ jsx(HeadingLevel, { level: modal ? 1 : void 0, children: element }),
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./6I2PARRP.js";
|
|
4
4
|
import {
|
|
5
5
|
useCompositeItem
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./FVD2NJZN.js";
|
|
7
7
|
import {
|
|
8
8
|
createElement,
|
|
9
9
|
createHook,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./NQJBHION.js";
|
|
12
12
|
import {
|
|
13
13
|
useStoreState
|
|
14
|
-
} from "./
|
|
14
|
+
} from "./P63NRZ4A.js";
|
|
15
15
|
import {
|
|
16
16
|
useEvent,
|
|
17
17
|
useId,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./PNRLI7OV.js";
|
|
18
18
|
|
|
19
19
|
// src/collection/collection-item.ts
|
|
20
|
-
import {
|
|
20
|
+
import { useContext, useEffect, useRef } from "react";
|
|
21
21
|
import { identity } from "@ariakit/core/utils/misc";
|
|
22
22
|
var useCollectionItem = createHook(
|
|
23
23
|
(_a) => {
|
|
@@ -36,18 +36,18 @@ var useCollectionItem = createHook(
|
|
|
36
36
|
const context = useContext(CollectionContext);
|
|
37
37
|
store = store || context;
|
|
38
38
|
const id = useId(props.id);
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
);
|
|
39
|
+
const ref = useRef(element);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
const element2 = ref.current;
|
|
42
|
+
if (!id)
|
|
43
|
+
return;
|
|
44
|
+
if (!element2)
|
|
45
|
+
return;
|
|
46
|
+
if (!shouldRegisterItem)
|
|
47
|
+
return;
|
|
48
|
+
const item = getItem({ id, element: element2 });
|
|
49
|
+
return store == null ? void 0 : store.renderItem(item);
|
|
50
|
+
}, [id, shouldRegisterItem, getItem, store]);
|
|
51
51
|
props = __spreadProps(__spreadValues({}, props), {
|
|
52
52
|
ref: useMergeRefs(ref, props.ref)
|
|
53
53
|
});
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./W5P7IKOU.js";
|
|
11
11
|
import {
|
|
12
12
|
useCompositeItem
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./FVD2NJZN.js";
|
|
14
14
|
import {
|
|
15
15
|
createElement,
|
|
16
16
|
createHook,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./NQJBHION.js";
|
|
19
19
|
import {
|
|
20
20
|
useStoreState
|
|
21
|
-
} from "./
|
|
21
|
+
} from "./P63NRZ4A.js";
|
|
22
22
|
import {
|
|
23
23
|
useBooleanEvent,
|
|
24
24
|
useEvent
|
|
@@ -24,6 +24,7 @@ import { addGlobalEventListener } from "@ariakit/core/utils/events";
|
|
|
24
24
|
var useHovercardAnchor = createHook(
|
|
25
25
|
(_a) => {
|
|
26
26
|
var _b = _a, { store, showOnHover = true } = _b, props = __objRest(_b, ["store", "showOnHover"]);
|
|
27
|
+
const mounted = store.useState("mounted");
|
|
27
28
|
const disabled = props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
|
|
28
29
|
const showTimeoutRef = useRef(0);
|
|
29
30
|
useEffect(() => () => window.clearTimeout(showTimeoutRef.current), []);
|
|
@@ -66,7 +67,14 @@ var useHovercardAnchor = createHook(
|
|
|
66
67
|
}
|
|
67
68
|
);
|
|
68
69
|
props = __spreadProps(__spreadValues({}, props), {
|
|
69
|
-
ref: useMergeRefs(
|
|
70
|
+
ref: useMergeRefs(
|
|
71
|
+
store.setAnchorElement,
|
|
72
|
+
// We need to set the anchor element as the hovercard disclosure
|
|
73
|
+
// disclosure element only when the hovercard is shown so it doesn't get
|
|
74
|
+
// assigned an arbitrary element by the dialog component.
|
|
75
|
+
mounted ? store.setDisclosureElement : void 0,
|
|
76
|
+
props.ref
|
|
77
|
+
),
|
|
70
78
|
onMouseMove
|
|
71
79
|
});
|
|
72
80
|
props = useFocusable(props);
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
useCheckboxStore,
|
|
3
3
|
useCheckboxStoreOptions,
|
|
4
4
|
useCheckboxStoreProps
|
|
5
|
-
} from "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
5
|
+
} from "../__chunks/6TMY6IFR.js";
|
|
6
|
+
import "../__chunks/P63NRZ4A.js";
|
|
7
7
|
import "../__chunks/J7Q2EO23.js";
|
|
8
8
|
import "../__chunks/CP3U4HPL.js";
|
|
9
9
|
import "../__chunks/PNRLI7OV.js";
|
package/esm/checkbox/checkbox.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Checkbox,
|
|
3
3
|
useCheckbox
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/3CJV7UYE.js";
|
|
5
5
|
import "../__chunks/M5KYRTQG.js";
|
|
6
6
|
import "../__chunks/P4RGQGTG.js";
|
|
7
7
|
import "../__chunks/MYID4V27.js";
|
|
8
8
|
import "../__chunks/BMLNRUFQ.js";
|
|
9
9
|
import "../__chunks/NQJBHION.js";
|
|
10
|
-
import "../__chunks/
|
|
10
|
+
import "../__chunks/P63NRZ4A.js";
|
|
11
11
|
import "../__chunks/J7Q2EO23.js";
|
|
12
12
|
import "../__chunks/CP3U4HPL.js";
|
|
13
13
|
import "../__chunks/PNRLI7OV.js";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
getCollectionRendererItem,
|
|
4
4
|
getCollectionRendererItemId,
|
|
5
5
|
useCollectionRenderer
|
|
6
|
-
} from "../__chunks/
|
|
6
|
+
} from "../__chunks/ONFAHVST.js";
|
|
7
7
|
import "../__chunks/T3DJZG63.js";
|
|
8
8
|
import "../__chunks/NQJBHION.js";
|
|
9
|
-
import "../__chunks/
|
|
9
|
+
import "../__chunks/P63NRZ4A.js";
|
|
10
10
|
import "../__chunks/J7Q2EO23.js";
|
|
11
11
|
import "../__chunks/CP3U4HPL.js";
|
|
12
12
|
import "../__chunks/PNRLI7OV.js";
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
useCollectionStore,
|
|
3
3
|
useCollectionStoreOptions,
|
|
4
4
|
useCollectionStoreProps
|
|
5
|
-
} from "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
5
|
+
} from "../__chunks/RS7KBRGA.js";
|
|
6
|
+
import "../__chunks/P63NRZ4A.js";
|
|
7
7
|
import "../__chunks/J7Q2EO23.js";
|
|
8
8
|
import "../__chunks/CP3U4HPL.js";
|
|
9
9
|
import "../__chunks/PNRLI7OV.js";
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
} from "../__chunks/W5P7IKOU.js";
|
|
8
8
|
import {
|
|
9
9
|
useCompositeItem
|
|
10
|
-
} from "../__chunks/
|
|
10
|
+
} from "../__chunks/FVD2NJZN.js";
|
|
11
11
|
import "../__chunks/P4RGQGTG.js";
|
|
12
|
-
import "../__chunks/
|
|
12
|
+
import "../__chunks/VFNGSUSF.js";
|
|
13
13
|
import "../__chunks/T3DJZG63.js";
|
|
14
14
|
import "../__chunks/OXPV2NBK.js";
|
|
15
15
|
import "../__chunks/WJ37OVG2.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
createHook,
|
|
21
21
|
createMemoComponent
|
|
22
22
|
} from "../__chunks/NQJBHION.js";
|
|
23
|
-
import "../__chunks/
|
|
23
|
+
import "../__chunks/P63NRZ4A.js";
|
|
24
24
|
import {
|
|
25
25
|
useBooleanEvent,
|
|
26
26
|
useEvent,
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
import "../__chunks/5VGBBGF5.js";
|
|
5
5
|
import {
|
|
6
6
|
usePopover
|
|
7
|
-
} from "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
9
|
-
import "../__chunks/
|
|
7
|
+
} from "../__chunks/K5MSER23.js";
|
|
8
|
+
import "../__chunks/SZIMOWLA.js";
|
|
9
|
+
import "../__chunks/5IZLNERH.js";
|
|
10
10
|
import "../__chunks/NHPU54IO.js";
|
|
11
11
|
import "../__chunks/GDORSOK6.js";
|
|
12
12
|
import "../__chunks/3LAWLNOX.js";
|
|
13
13
|
import "../__chunks/CJI67A3R.js";
|
|
14
|
-
import "../__chunks/
|
|
14
|
+
import "../__chunks/PLOINBVB.js";
|
|
15
15
|
import "../__chunks/E5XSMSHD.js";
|
|
16
16
|
import "../__chunks/LEBYH5FW.js";
|
|
17
17
|
import "../__chunks/IXXFVVA2.js";
|
|
@@ -38,8 +38,8 @@ import {
|
|
|
38
38
|
createElement,
|
|
39
39
|
createHook
|
|
40
40
|
} from "../__chunks/NQJBHION.js";
|
|
41
|
-
import "../__chunks/
|
|
42
|
-
import "../__chunks/
|
|
41
|
+
import "../__chunks/SWJ5EOOS.js";
|
|
42
|
+
import "../__chunks/P63NRZ4A.js";
|
|
43
43
|
import "../__chunks/J7Q2EO23.js";
|
|
44
44
|
import "../__chunks/CP3U4HPL.js";
|
|
45
45
|
import {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCompositeStoreOptions,
|
|
3
3
|
useCompositeStoreProps
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/7KULBIZY.js";
|
|
5
|
+
import "../__chunks/RS7KBRGA.js";
|
|
6
6
|
import {
|
|
7
7
|
usePopoverStoreOptions,
|
|
8
8
|
usePopoverStoreProps
|
|
9
|
-
} from "../__chunks/
|
|
10
|
-
import "../__chunks/
|
|
11
|
-
import "../__chunks/
|
|
9
|
+
} from "../__chunks/3PKTK2K7.js";
|
|
10
|
+
import "../__chunks/WC3GK4CL.js";
|
|
11
|
+
import "../__chunks/SWJ5EOOS.js";
|
|
12
12
|
import {
|
|
13
13
|
useStore,
|
|
14
14
|
useStoreProps
|
|
15
|
-
} from "../__chunks/
|
|
15
|
+
} from "../__chunks/P63NRZ4A.js";
|
|
16
16
|
import "../__chunks/J7Q2EO23.js";
|
|
17
17
|
import "../__chunks/CP3U4HPL.js";
|
|
18
18
|
import {
|