@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.
- package/CHANGELOG.md +9 -0
- package/cjs/__chunks/{MJNGPYVQ.cjs → 2RUCRSRF.cjs} +16 -16
- package/cjs/__chunks/{6BYUUR4M.cjs → 4TRESXTO.cjs} +7 -1
- package/cjs/__chunks/{AOXAROPF.cjs → 75F3RDBE.cjs} +14 -14
- package/cjs/__chunks/{SHOLYDNP.cjs → CTEQSOKZ.cjs} +2 -2
- package/cjs/__chunks/{T247D7JS.cjs → CVLMIMPT.cjs} +2 -2
- package/cjs/__chunks/{CPH45Z4I.cjs → G2CSOTWZ.cjs} +7 -7
- package/cjs/__chunks/{VZPNI7C2.cjs → I4CBIWTX.cjs} +4 -4
- package/cjs/__chunks/{6REHCF5T.cjs → LS2SNHDM.cjs} +6 -6
- package/cjs/__chunks/{UROTDZFK.cjs → R37KOEUW.cjs} +10 -10
- package/cjs/__chunks/{NNJG45OF.cjs → UGAVMSQJ.cjs} +18 -18
- package/cjs/__chunks/{LT33CJGT.cjs → VC22SYOD.cjs} +24 -21
- package/cjs/__chunks/{WPBYRKFQ.cjs → WMTGHDLE.cjs} +15 -15
- package/cjs/checkbox/checkbox-store.cjs +5 -5
- package/cjs/checkbox/checkbox-store.d.cts +5 -5
- package/cjs/checkbox/checkbox-store.d.ts +5 -5
- package/cjs/collection/collection-store.cjs +5 -5
- package/cjs/collection/collection-store.d.cts +5 -5
- package/cjs/collection/collection-store.d.ts +5 -5
- package/cjs/combobox/combobox-store.cjs +40 -40
- package/cjs/combobox/combobox-store.d.cts +26 -26
- package/cjs/combobox/combobox-store.d.ts +26 -26
- package/cjs/composite/composite-overflow-store.cjs +6 -6
- package/cjs/composite/composite-store.cjs +6 -6
- package/cjs/composite/composite-store.d.cts +62 -54
- package/cjs/composite/composite-store.d.ts +62 -54
- package/cjs/dialog/dialog-store.cjs +5 -5
- package/cjs/disclosure/disclosure-store.cjs +4 -4
- package/cjs/disclosure/disclosure-store.d.cts +22 -22
- package/cjs/disclosure/disclosure-store.d.ts +22 -22
- package/cjs/form/form-store.cjs +41 -37
- package/cjs/form/form-store.d.cts +14 -14
- package/cjs/form/form-store.d.ts +14 -14
- package/cjs/hovercard/hovercard-store.cjs +7 -7
- package/cjs/hovercard/hovercard-store.d.cts +10 -10
- package/cjs/hovercard/hovercard-store.d.ts +10 -10
- package/cjs/menu/menu-bar-store.cjs +7 -7
- package/cjs/menu/menu-store.cjs +27 -27
- package/cjs/menu/menu-store.d.cts +10 -10
- package/cjs/menu/menu-store.d.ts +10 -10
- package/cjs/menubar/menubar-store.cjs +7 -7
- package/cjs/popover/popover-store.cjs +6 -6
- package/cjs/popover/popover-store.d.cts +17 -17
- package/cjs/popover/popover-store.d.ts +17 -17
- package/cjs/radio/radio-store.cjs +9 -9
- package/cjs/radio/radio-store.d.cts +1 -1
- package/cjs/radio/radio-store.d.ts +1 -1
- package/cjs/select/select-store.cjs +32 -32
- package/cjs/select/select-store.d.cts +17 -17
- package/cjs/select/select-store.d.ts +17 -17
- package/cjs/tab/tab-store.cjs +32 -32
- package/cjs/tab/tab-store.d.cts +20 -20
- package/cjs/tab/tab-store.d.ts +20 -20
- package/cjs/tag/tag-store.cjs +16 -16
- package/cjs/tag/tag-store.d.cts +5 -5
- package/cjs/tag/tag-store.d.ts +5 -5
- package/cjs/toolbar/toolbar-store.cjs +8 -8
- package/cjs/tooltip/tooltip-store.cjs +13 -13
- package/cjs/utils/dom.cjs +2 -2
- package/cjs/utils/events.cjs +6 -6
- package/cjs/utils/focus.cjs +25 -24
- package/cjs/utils/misc.cjs +4 -2
- package/cjs/utils/misc.d.cts +4 -0
- package/cjs/utils/misc.d.ts +4 -0
- package/cjs/utils/platform.cjs +3 -3
- package/cjs/utils/store.cjs +3 -3
- package/cjs/utils/store.d.cts +1 -1
- package/cjs/utils/store.d.ts +1 -1
- package/cjs/utils/undo.cjs +2 -2
- package/esm/__chunks/{KMAUV3TY.js → 7KNZCZ55.js} +1 -1
- package/esm/__chunks/{37JWRFYW.js → G7XPWBXK.js} +3 -3
- package/esm/__chunks/{O6E4ZWCP.js → GMGLSF2B.js} +1 -1
- package/esm/__chunks/{PSMDSJUH.js → H7R2CY4Q.js} +3 -3
- package/esm/__chunks/{75BJEVSH.js → IHNLLH3I.js} +2 -2
- package/esm/__chunks/{AMRA5WUK.js → KZX46JDB.js} +11 -8
- package/esm/__chunks/{BFGNM53A.js → MJ4ZJEIM.js} +5 -5
- package/esm/__chunks/{TIQDSBWP.js → TEVO2DMI.js} +3 -3
- package/esm/__chunks/{7LM4Q2XB.js → U4NM2NCP.js} +1 -1
- package/esm/__chunks/{73UNQSFO.js → UNDE2QJS.js} +3 -3
- package/esm/__chunks/{XMCVU3LR.js → UWJK2WK2.js} +6 -0
- package/esm/__chunks/{SXKM4CGU.js → XTZ53NXG.js} +4 -4
- package/esm/checkbox/checkbox-store.d.ts +5 -5
- package/esm/checkbox/checkbox-store.js +2 -2
- package/esm/collection/collection-store.d.ts +5 -5
- package/esm/collection/collection-store.js +4 -4
- package/esm/combobox/combobox-store.d.ts +26 -26
- package/esm/combobox/combobox-store.js +9 -9
- package/esm/composite/composite-overflow-store.js +5 -5
- package/esm/composite/composite-store.d.ts +62 -54
- package/esm/composite/composite-store.js +5 -5
- package/esm/dialog/dialog-store.js +4 -4
- package/esm/disclosure/disclosure-store.d.ts +22 -22
- package/esm/disclosure/disclosure-store.js +3 -3
- package/esm/form/form-store.d.ts +14 -14
- package/esm/form/form-store.js +19 -15
- package/esm/hovercard/hovercard-store.d.ts +10 -10
- package/esm/hovercard/hovercard-store.js +6 -6
- package/esm/menu/menu-bar-store.js +6 -6
- package/esm/menu/menu-store.d.ts +10 -10
- package/esm/menu/menu-store.js +9 -9
- package/esm/menubar/menubar-store.js +6 -6
- package/esm/popover/popover-store.d.ts +17 -17
- package/esm/popover/popover-store.js +5 -5
- package/esm/radio/radio-store.d.ts +1 -1
- package/esm/radio/radio-store.js +5 -5
- package/esm/select/select-store.d.ts +17 -17
- package/esm/select/select-store.js +8 -8
- package/esm/tab/tab-store.d.ts +20 -20
- package/esm/tab/tab-store.js +5 -5
- package/esm/tag/tag-store.d.ts +5 -5
- package/esm/tag/tag-store.js +7 -7
- package/esm/toolbar/toolbar-store.js +5 -5
- package/esm/tooltip/tooltip-store.js +7 -7
- package/esm/utils/dom.js +1 -1
- package/esm/utils/events.js +4 -4
- package/esm/utils/focus.js +17 -16
- package/esm/utils/misc.d.ts +4 -0
- package/esm/utils/misc.js +3 -1
- package/esm/utils/platform.js +2 -2
- package/esm/utils/store.d.ts +1 -1
- package/esm/utils/store.js +2 -2
- package/esm/utils/undo.js +1 -1
- package/package.json +20 -21
- package/tsconfig.build.json +7 -2
- package/tsconfig.node.json +5 -0
- package/tsconfig.test.json +5 -0
|
@@ -11,32 +11,32 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
11
11
|
/**
|
|
12
12
|
* The amount of time in milliseconds to wait before showing and hiding the
|
|
13
13
|
* popup. To control the delay for showing and hiding separately, use
|
|
14
|
-
* [`showTimeout`](https://ariakit.
|
|
14
|
+
* [`showTimeout`](https://ariakit.com/reference/hovercard-provider#showtimeout)
|
|
15
15
|
* and
|
|
16
|
-
* [`hideTimeout`](https://ariakit.
|
|
16
|
+
* [`hideTimeout`](https://ariakit.com/reference/hovercard-provider#hidetimeout).
|
|
17
17
|
* @default 500
|
|
18
18
|
*/
|
|
19
19
|
timeout: number;
|
|
20
20
|
/**
|
|
21
21
|
* The amount of time in milliseconds to wait before _showing_ the popup. It
|
|
22
22
|
* defaults to the value passed to
|
|
23
|
-
* [`timeout`](https://ariakit.
|
|
23
|
+
* [`timeout`](https://ariakit.com/reference/hovercard-provider#timeout).
|
|
24
24
|
*
|
|
25
25
|
* Live examples:
|
|
26
|
-
* - [Navigation Menubar](https://ariakit.
|
|
26
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
27
27
|
* - [Submenu with
|
|
28
|
-
* Combobox](https://ariakit.
|
|
28
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
29
29
|
*/
|
|
30
30
|
showTimeout?: number;
|
|
31
31
|
/**
|
|
32
32
|
* The amount of time in milliseconds to wait before _hiding_ the popup. It
|
|
33
33
|
* defaults to the value passed to
|
|
34
|
-
* [`timeout`](https://ariakit.
|
|
34
|
+
* [`timeout`](https://ariakit.com/reference/hovercard-provider#timeout).
|
|
35
35
|
*
|
|
36
36
|
* Live examples:
|
|
37
|
-
* - [Navigation Menubar](https://ariakit.
|
|
38
|
-
* - [Tooltip with
|
|
39
|
-
* Motion](https://ariakit.
|
|
37
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
38
|
+
* - [Tooltip with
|
|
39
|
+
* Motion](https://ariakit.com/examples/tooltip-framer-motion)
|
|
40
40
|
*/
|
|
41
41
|
hideTimeout?: number;
|
|
42
42
|
/**
|
|
@@ -51,7 +51,7 @@ export interface HovercardStoreFunctions extends PopoverStoreFunctions {
|
|
|
51
51
|
* Sets the `autoFocusOnShow` state.
|
|
52
52
|
*
|
|
53
53
|
* Live examples:
|
|
54
|
-
* - [Sliding Menu](https://ariakit.
|
|
54
|
+
* - [Sliding Menu](https://ariakit.com/examples/menu-slide)
|
|
55
55
|
*/
|
|
56
56
|
setAutoFocusOnShow: SetState<HovercardStoreState["autoFocusOnShow"]>;
|
|
57
57
|
}
|
|
@@ -11,32 +11,32 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
11
11
|
/**
|
|
12
12
|
* The amount of time in milliseconds to wait before showing and hiding the
|
|
13
13
|
* popup. To control the delay for showing and hiding separately, use
|
|
14
|
-
* [`showTimeout`](https://ariakit.
|
|
14
|
+
* [`showTimeout`](https://ariakit.com/reference/hovercard-provider#showtimeout)
|
|
15
15
|
* and
|
|
16
|
-
* [`hideTimeout`](https://ariakit.
|
|
16
|
+
* [`hideTimeout`](https://ariakit.com/reference/hovercard-provider#hidetimeout).
|
|
17
17
|
* @default 500
|
|
18
18
|
*/
|
|
19
19
|
timeout: number;
|
|
20
20
|
/**
|
|
21
21
|
* The amount of time in milliseconds to wait before _showing_ the popup. It
|
|
22
22
|
* defaults to the value passed to
|
|
23
|
-
* [`timeout`](https://ariakit.
|
|
23
|
+
* [`timeout`](https://ariakit.com/reference/hovercard-provider#timeout).
|
|
24
24
|
*
|
|
25
25
|
* Live examples:
|
|
26
|
-
* - [Navigation Menubar](https://ariakit.
|
|
26
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
27
27
|
* - [Submenu with
|
|
28
|
-
* Combobox](https://ariakit.
|
|
28
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
29
29
|
*/
|
|
30
30
|
showTimeout?: number;
|
|
31
31
|
/**
|
|
32
32
|
* The amount of time in milliseconds to wait before _hiding_ the popup. It
|
|
33
33
|
* defaults to the value passed to
|
|
34
|
-
* [`timeout`](https://ariakit.
|
|
34
|
+
* [`timeout`](https://ariakit.com/reference/hovercard-provider#timeout).
|
|
35
35
|
*
|
|
36
36
|
* Live examples:
|
|
37
|
-
* - [Navigation Menubar](https://ariakit.
|
|
38
|
-
* - [Tooltip with
|
|
39
|
-
* Motion](https://ariakit.
|
|
37
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
38
|
+
* - [Tooltip with
|
|
39
|
+
* Motion](https://ariakit.com/examples/tooltip-framer-motion)
|
|
40
40
|
*/
|
|
41
41
|
hideTimeout?: number;
|
|
42
42
|
/**
|
|
@@ -51,7 +51,7 @@ export interface HovercardStoreFunctions extends PopoverStoreFunctions {
|
|
|
51
51
|
* Sets the `autoFocusOnShow` state.
|
|
52
52
|
*
|
|
53
53
|
* Live examples:
|
|
54
|
-
* - [Sliding Menu](https://ariakit.
|
|
54
|
+
* - [Sliding Menu](https://ariakit.com/examples/menu-slide)
|
|
55
55
|
*/
|
|
56
56
|
setAutoFocusOnShow: SetState<HovercardStoreState["autoFocusOnShow"]>;
|
|
57
57
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
3
|
+
var _G2CSOTWZcjs = require('../__chunks/G2CSOTWZ.cjs');
|
|
4
|
+
require('../__chunks/UGAVMSQJ.cjs');
|
|
5
5
|
require('../__chunks/GDZQUFNP.cjs');
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
9
|
-
require('../__chunks/
|
|
6
|
+
require('../__chunks/VC22SYOD.cjs');
|
|
7
|
+
require('../__chunks/I4CBIWTX.cjs');
|
|
8
|
+
require('../__chunks/WMTGHDLE.cjs');
|
|
9
|
+
require('../__chunks/4TRESXTO.cjs');
|
|
10
10
|
|
|
11
11
|
// src/menu/menu-bar-store.ts
|
|
12
12
|
function createMenuBarStore(props = {}) {
|
|
13
|
-
return
|
|
13
|
+
return _G2CSOTWZcjs.createMenubarStore.call(void 0, props);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
|
package/cjs/menu/menu-store.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
3
|
+
var _R37KOEUWcjs = require('../__chunks/R37KOEUW.cjs');
|
|
4
|
+
require('../__chunks/75F3RDBE.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _UGAVMSQJcjs = require('../__chunks/UGAVMSQJ.cjs');
|
|
8
8
|
require('../__chunks/GDZQUFNP.cjs');
|
|
9
|
-
require('../__chunks/
|
|
10
|
-
require('../__chunks/
|
|
11
|
-
require('../__chunks/
|
|
12
|
-
require('../__chunks/
|
|
9
|
+
require('../__chunks/CVLMIMPT.cjs');
|
|
10
|
+
require('../__chunks/2RUCRSRF.cjs');
|
|
11
|
+
require('../__chunks/VC22SYOD.cjs');
|
|
12
|
+
require('../__chunks/I4CBIWTX.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -18,11 +18,11 @@ require('../__chunks/VZPNI7C2.cjs');
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _WMTGHDLEcjs = require('../__chunks/WMTGHDLE.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _4TRESXTOcjs = require('../__chunks/4TRESXTO.cjs');
|
|
26
26
|
|
|
27
27
|
// src/menu/menu-store.ts
|
|
28
28
|
function createMenuStore({
|
|
@@ -32,10 +32,10 @@ function createMenuStore({
|
|
|
32
32
|
...props
|
|
33
33
|
} = {}) {
|
|
34
34
|
const parentIsMenubar = !!menubar && !parent;
|
|
35
|
-
const store =
|
|
35
|
+
const store = _WMTGHDLEcjs.mergeStore.call(void 0,
|
|
36
36
|
props.store,
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
_WMTGHDLEcjs.pick.call(void 0, parent, ["values"]),
|
|
38
|
+
_WMTGHDLEcjs.omit.call(void 0, combobox, [
|
|
39
39
|
"arrowElement",
|
|
40
40
|
"anchorElement",
|
|
41
41
|
"contentElement",
|
|
@@ -43,54 +43,54 @@ function createMenuStore({
|
|
|
43
43
|
"disclosureElement"
|
|
44
44
|
])
|
|
45
45
|
);
|
|
46
|
-
|
|
46
|
+
_WMTGHDLEcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
47
47
|
const syncState = store.getState();
|
|
48
|
-
const composite =
|
|
48
|
+
const composite = _UGAVMSQJcjs.createCompositeStore.call(void 0, {
|
|
49
49
|
...props,
|
|
50
50
|
store,
|
|
51
|
-
orientation:
|
|
51
|
+
orientation: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
52
52
|
props.orientation,
|
|
53
53
|
syncState.orientation,
|
|
54
54
|
"vertical"
|
|
55
55
|
)
|
|
56
56
|
});
|
|
57
|
-
const hovercard =
|
|
57
|
+
const hovercard = _R37KOEUWcjs.createHovercardStore.call(void 0, {
|
|
58
58
|
...props,
|
|
59
59
|
store,
|
|
60
|
-
placement:
|
|
60
|
+
placement: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
61
61
|
props.placement,
|
|
62
62
|
syncState.placement,
|
|
63
63
|
"bottom-start"
|
|
64
64
|
),
|
|
65
|
-
timeout:
|
|
65
|
+
timeout: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
66
66
|
props.timeout,
|
|
67
67
|
syncState.timeout,
|
|
68
68
|
parentIsMenubar ? 0 : 150
|
|
69
69
|
),
|
|
70
|
-
hideTimeout:
|
|
70
|
+
hideTimeout: _4TRESXTOcjs.defaultValue.call(void 0, props.hideTimeout, syncState.hideTimeout, 0)
|
|
71
71
|
});
|
|
72
72
|
const initialState = {
|
|
73
73
|
...composite.getState(),
|
|
74
74
|
...hovercard.getState(),
|
|
75
|
-
initialFocus:
|
|
76
|
-
values:
|
|
75
|
+
initialFocus: _4TRESXTOcjs.defaultValue.call(void 0, syncState.initialFocus, "container"),
|
|
76
|
+
values: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
77
77
|
props.values,
|
|
78
78
|
syncState.values,
|
|
79
79
|
props.defaultValues,
|
|
80
80
|
{}
|
|
81
81
|
)
|
|
82
82
|
};
|
|
83
|
-
const menu =
|
|
84
|
-
|
|
83
|
+
const menu = _WMTGHDLEcjs.createStore.call(void 0, initialState, composite, hovercard, store);
|
|
84
|
+
_WMTGHDLEcjs.setup.call(void 0,
|
|
85
85
|
menu,
|
|
86
|
-
() =>
|
|
86
|
+
() => _WMTGHDLEcjs.sync.call(void 0, menu, ["mounted"], (state) => {
|
|
87
87
|
if (state.mounted) return;
|
|
88
88
|
menu.setState("activeId", null);
|
|
89
89
|
})
|
|
90
90
|
);
|
|
91
|
-
|
|
91
|
+
_WMTGHDLEcjs.setup.call(void 0,
|
|
92
92
|
menu,
|
|
93
|
-
() =>
|
|
93
|
+
() => _WMTGHDLEcjs.sync.call(void 0, parent, ["orientation"], (state) => {
|
|
94
94
|
menu.setState(
|
|
95
95
|
"placement",
|
|
96
96
|
state.orientation === "vertical" ? "right-start" : "bottom-start"
|
|
@@ -116,7 +116,7 @@ function createMenuStore({
|
|
|
116
116
|
if (Array.isArray(name)) return;
|
|
117
117
|
menu.setState("values", (values) => {
|
|
118
118
|
const prevValue = values[name];
|
|
119
|
-
const nextValue =
|
|
119
|
+
const nextValue = _4TRESXTOcjs.applyState.call(void 0, value, prevValue);
|
|
120
120
|
if (nextValue === prevValue) return values;
|
|
121
121
|
return {
|
|
122
122
|
...values,
|
|
@@ -20,14 +20,14 @@ export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> ext
|
|
|
20
20
|
initialFocus: "container" | "first" | "last";
|
|
21
21
|
/**
|
|
22
22
|
* A map of names and values that will be used by the
|
|
23
|
-
* [`MenuItemCheckbox`](https://ariakit.
|
|
24
|
-
* [`MenuItemRadio`](https://ariakit.
|
|
23
|
+
* [`MenuItemCheckbox`](https://ariakit.com/reference/menu-item-checkbox) and
|
|
24
|
+
* [`MenuItemRadio`](https://ariakit.com/reference/menu-item-radio)
|
|
25
25
|
* components.
|
|
26
26
|
*
|
|
27
27
|
* Live examples:
|
|
28
|
-
* - [MenuItemCheckbox](https://ariakit.
|
|
28
|
+
* - [MenuItemCheckbox](https://ariakit.com/examples/menu-item-checkbox)
|
|
29
29
|
* - [Submenu with
|
|
30
|
-
* Combobox](https://ariakit.
|
|
30
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
31
31
|
*/
|
|
32
32
|
values: T;
|
|
33
33
|
}
|
|
@@ -37,7 +37,7 @@ export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues>
|
|
|
37
37
|
*
|
|
38
38
|
* Live examples:
|
|
39
39
|
* - [Submenu with
|
|
40
|
-
* Combobox](https://ariakit.
|
|
40
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
41
41
|
*/
|
|
42
42
|
hideAll: () => void;
|
|
43
43
|
/**
|
|
@@ -45,7 +45,7 @@ export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues>
|
|
|
45
45
|
*/
|
|
46
46
|
setInitialFocus: SetState<MenuStoreState<T>["initialFocus"]>;
|
|
47
47
|
/**
|
|
48
|
-
* Sets the [`values`](https://ariakit.
|
|
48
|
+
* Sets the [`values`](https://ariakit.com/reference/menu-provider#values)
|
|
49
49
|
* state.
|
|
50
50
|
* @example
|
|
51
51
|
* store.setValues({ watching: ["issues"] });
|
|
@@ -57,7 +57,7 @@ export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues>
|
|
|
57
57
|
*
|
|
58
58
|
* Live examples:
|
|
59
59
|
* - [Submenu with
|
|
60
|
-
* Combobox](https://ariakit.
|
|
60
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
61
61
|
* @example
|
|
62
62
|
* store.setValue("watching", ["issues"]);
|
|
63
63
|
* store.setValue("watching", (value) => [...value, "issues"]);
|
|
@@ -82,11 +82,11 @@ export interface MenuStoreOptions<T extends MenuStoreValues = MenuStoreValues> e
|
|
|
82
82
|
menubar?: MenuBarStore | null;
|
|
83
83
|
/**
|
|
84
84
|
* The default values for the
|
|
85
|
-
* [`values`](https://ariakit.
|
|
85
|
+
* [`values`](https://ariakit.com/reference/menu-provider#values) state.
|
|
86
86
|
*
|
|
87
87
|
* Live examples:
|
|
88
|
-
* - [MenuItemCheckbox](https://ariakit.
|
|
89
|
-
* - [MenuItemRadio](https://ariakit.
|
|
88
|
+
* - [MenuItemCheckbox](https://ariakit.com/examples/menu-item-checkbox)
|
|
89
|
+
* - [MenuItemRadio](https://ariakit.com/examples/menu-item-radio)
|
|
90
90
|
* @default {}
|
|
91
91
|
*/
|
|
92
92
|
defaultValues?: MenuStoreState<T>["values"];
|
package/cjs/menu/menu-store.d.ts
CHANGED
|
@@ -20,14 +20,14 @@ export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> ext
|
|
|
20
20
|
initialFocus: "container" | "first" | "last";
|
|
21
21
|
/**
|
|
22
22
|
* A map of names and values that will be used by the
|
|
23
|
-
* [`MenuItemCheckbox`](https://ariakit.
|
|
24
|
-
* [`MenuItemRadio`](https://ariakit.
|
|
23
|
+
* [`MenuItemCheckbox`](https://ariakit.com/reference/menu-item-checkbox) and
|
|
24
|
+
* [`MenuItemRadio`](https://ariakit.com/reference/menu-item-radio)
|
|
25
25
|
* components.
|
|
26
26
|
*
|
|
27
27
|
* Live examples:
|
|
28
|
-
* - [MenuItemCheckbox](https://ariakit.
|
|
28
|
+
* - [MenuItemCheckbox](https://ariakit.com/examples/menu-item-checkbox)
|
|
29
29
|
* - [Submenu with
|
|
30
|
-
* Combobox](https://ariakit.
|
|
30
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
31
31
|
*/
|
|
32
32
|
values: T;
|
|
33
33
|
}
|
|
@@ -37,7 +37,7 @@ export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues>
|
|
|
37
37
|
*
|
|
38
38
|
* Live examples:
|
|
39
39
|
* - [Submenu with
|
|
40
|
-
* Combobox](https://ariakit.
|
|
40
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
41
41
|
*/
|
|
42
42
|
hideAll: () => void;
|
|
43
43
|
/**
|
|
@@ -45,7 +45,7 @@ export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues>
|
|
|
45
45
|
*/
|
|
46
46
|
setInitialFocus: SetState<MenuStoreState<T>["initialFocus"]>;
|
|
47
47
|
/**
|
|
48
|
-
* Sets the [`values`](https://ariakit.
|
|
48
|
+
* Sets the [`values`](https://ariakit.com/reference/menu-provider#values)
|
|
49
49
|
* state.
|
|
50
50
|
* @example
|
|
51
51
|
* store.setValues({ watching: ["issues"] });
|
|
@@ -57,7 +57,7 @@ export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues>
|
|
|
57
57
|
*
|
|
58
58
|
* Live examples:
|
|
59
59
|
* - [Submenu with
|
|
60
|
-
* Combobox](https://ariakit.
|
|
60
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
61
61
|
* @example
|
|
62
62
|
* store.setValue("watching", ["issues"]);
|
|
63
63
|
* store.setValue("watching", (value) => [...value, "issues"]);
|
|
@@ -82,11 +82,11 @@ export interface MenuStoreOptions<T extends MenuStoreValues = MenuStoreValues> e
|
|
|
82
82
|
menubar?: MenuBarStore | null;
|
|
83
83
|
/**
|
|
84
84
|
* The default values for the
|
|
85
|
-
* [`values`](https://ariakit.
|
|
85
|
+
* [`values`](https://ariakit.com/reference/menu-provider#values) state.
|
|
86
86
|
*
|
|
87
87
|
* Live examples:
|
|
88
|
-
* - [MenuItemCheckbox](https://ariakit.
|
|
89
|
-
* - [MenuItemRadio](https://ariakit.
|
|
88
|
+
* - [MenuItemCheckbox](https://ariakit.com/examples/menu-item-checkbox)
|
|
89
|
+
* - [MenuItemRadio](https://ariakit.com/examples/menu-item-radio)
|
|
90
90
|
* @default {}
|
|
91
91
|
*/
|
|
92
92
|
defaultValues?: MenuStoreState<T>["values"];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
3
|
+
var _G2CSOTWZcjs = require('../__chunks/G2CSOTWZ.cjs');
|
|
4
|
+
require('../__chunks/UGAVMSQJ.cjs');
|
|
5
5
|
require('../__chunks/GDZQUFNP.cjs');
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
9
|
-
require('../__chunks/
|
|
6
|
+
require('../__chunks/VC22SYOD.cjs');
|
|
7
|
+
require('../__chunks/I4CBIWTX.cjs');
|
|
8
|
+
require('../__chunks/WMTGHDLE.cjs');
|
|
9
|
+
require('../__chunks/4TRESXTO.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.createMenubarStore =
|
|
12
|
+
exports.createMenubarStore = _G2CSOTWZcjs.createMenubarStore;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
3
|
+
var _75F3RDBEcjs = require('../__chunks/75F3RDBE.cjs');
|
|
4
|
+
require('../__chunks/CVLMIMPT.cjs');
|
|
5
|
+
require('../__chunks/2RUCRSRF.cjs');
|
|
6
|
+
require('../__chunks/WMTGHDLE.cjs');
|
|
7
|
+
require('../__chunks/4TRESXTO.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createPopoverStore =
|
|
10
|
+
exports.createPopoverStore = _75F3RDBEcjs.createPopoverStore;
|
|
@@ -12,16 +12,16 @@ export interface PopoverStoreState extends DialogStoreState {
|
|
|
12
12
|
* The anchor element.
|
|
13
13
|
*
|
|
14
14
|
* Live examples:
|
|
15
|
-
* - [Navigation Menubar](https://ariakit.
|
|
15
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
16
16
|
*/
|
|
17
17
|
anchorElement: HTMLElement | null;
|
|
18
18
|
/**
|
|
19
19
|
* The popover element that will render the placement attributes.
|
|
20
20
|
*
|
|
21
21
|
* Live examples:
|
|
22
|
-
* - [Form with Select](https://ariakit.
|
|
23
|
-
* - [Sliding Menu](https://ariakit.
|
|
24
|
-
* - [Responsive Popover](https://ariakit.
|
|
22
|
+
* - [Form with Select](https://ariakit.com/examples/form-select)
|
|
23
|
+
* - [Sliding Menu](https://ariakit.com/examples/menu-slide)
|
|
24
|
+
* - [Responsive Popover](https://ariakit.com/examples/popover-responsive)
|
|
25
25
|
*/
|
|
26
26
|
popoverElement: HTMLElement | null;
|
|
27
27
|
/**
|
|
@@ -30,12 +30,12 @@ export interface PopoverStoreState extends DialogStoreState {
|
|
|
30
30
|
arrowElement: HTMLElement | null;
|
|
31
31
|
/**
|
|
32
32
|
* The current temporary position of the popover. This might differ from the
|
|
33
|
-
* [`placement`](https://ariakit.
|
|
33
|
+
* [`placement`](https://ariakit.com/reference/popover-provider#placement)
|
|
34
34
|
* state if the popover has had to adjust its position dynamically.
|
|
35
35
|
*
|
|
36
36
|
* Live examples:
|
|
37
|
-
* - [Tooltip with
|
|
38
|
-
* Motion](https://ariakit.
|
|
37
|
+
* - [Tooltip with
|
|
38
|
+
* Motion](https://ariakit.com/examples/tooltip-framer-motion)
|
|
39
39
|
*/
|
|
40
40
|
currentPlacement: Placement;
|
|
41
41
|
/**
|
|
@@ -43,18 +43,18 @@ export interface PopoverStoreState extends DialogStoreState {
|
|
|
43
43
|
*
|
|
44
44
|
* Live examples:
|
|
45
45
|
* - [Submenu with
|
|
46
|
-
* Combobox](https://ariakit.
|
|
47
|
-
* - [Sliding Menu](https://ariakit.
|
|
48
|
-
* - [Navigation Menubar](https://ariakit.
|
|
49
|
-
* - [Selection Popover](https://ariakit.
|
|
50
|
-
* - [Standalone Popover](https://ariakit.
|
|
51
|
-
* - [Select Grid](https://ariakit.
|
|
46
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
47
|
+
* - [Sliding Menu](https://ariakit.com/examples/menu-slide)
|
|
48
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
49
|
+
* - [Selection Popover](https://ariakit.com/examples/popover-selection)
|
|
50
|
+
* - [Standalone Popover](https://ariakit.com/examples/popover-standalone)
|
|
51
|
+
* - [Select Grid](https://ariakit.com/examples/select-grid)
|
|
52
52
|
* @default "bottom"
|
|
53
53
|
*/
|
|
54
54
|
placement: Placement;
|
|
55
55
|
/**
|
|
56
56
|
* A symbol that's used to recompute the popover position when the
|
|
57
|
-
* [`render`](https://ariakit.
|
|
57
|
+
* [`render`](https://ariakit.com/reference/use-popover-store#render) method
|
|
58
58
|
* is called.
|
|
59
59
|
*/
|
|
60
60
|
rendered: symbol;
|
|
@@ -64,7 +64,7 @@ export interface PopoverStoreFunctions extends DialogStoreFunctions {
|
|
|
64
64
|
* Sets the anchor element.
|
|
65
65
|
*
|
|
66
66
|
* Live examples:
|
|
67
|
-
* - [Navigation Menubar](https://ariakit.
|
|
67
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
68
68
|
*/
|
|
69
69
|
setAnchorElement: SetState<PopoverStoreState["anchorElement"]>;
|
|
70
70
|
/**
|
|
@@ -82,8 +82,8 @@ export interface PopoverStoreFunctions extends DialogStoreFunctions {
|
|
|
82
82
|
*
|
|
83
83
|
* Live examples:
|
|
84
84
|
* - [Textarea with inline
|
|
85
|
-
* Combobox](https://ariakit.
|
|
86
|
-
* - [Selection Popover](https://ariakit.
|
|
85
|
+
* Combobox](https://ariakit.com/examples/combobox-textarea)
|
|
86
|
+
* - [Selection Popover](https://ariakit.com/examples/popover-selection)
|
|
87
87
|
*/
|
|
88
88
|
render: () => void;
|
|
89
89
|
}
|
|
@@ -12,16 +12,16 @@ export interface PopoverStoreState extends DialogStoreState {
|
|
|
12
12
|
* The anchor element.
|
|
13
13
|
*
|
|
14
14
|
* Live examples:
|
|
15
|
-
* - [Navigation Menubar](https://ariakit.
|
|
15
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
16
16
|
*/
|
|
17
17
|
anchorElement: HTMLElement | null;
|
|
18
18
|
/**
|
|
19
19
|
* The popover element that will render the placement attributes.
|
|
20
20
|
*
|
|
21
21
|
* Live examples:
|
|
22
|
-
* - [Form with Select](https://ariakit.
|
|
23
|
-
* - [Sliding Menu](https://ariakit.
|
|
24
|
-
* - [Responsive Popover](https://ariakit.
|
|
22
|
+
* - [Form with Select](https://ariakit.com/examples/form-select)
|
|
23
|
+
* - [Sliding Menu](https://ariakit.com/examples/menu-slide)
|
|
24
|
+
* - [Responsive Popover](https://ariakit.com/examples/popover-responsive)
|
|
25
25
|
*/
|
|
26
26
|
popoverElement: HTMLElement | null;
|
|
27
27
|
/**
|
|
@@ -30,12 +30,12 @@ export interface PopoverStoreState extends DialogStoreState {
|
|
|
30
30
|
arrowElement: HTMLElement | null;
|
|
31
31
|
/**
|
|
32
32
|
* The current temporary position of the popover. This might differ from the
|
|
33
|
-
* [`placement`](https://ariakit.
|
|
33
|
+
* [`placement`](https://ariakit.com/reference/popover-provider#placement)
|
|
34
34
|
* state if the popover has had to adjust its position dynamically.
|
|
35
35
|
*
|
|
36
36
|
* Live examples:
|
|
37
|
-
* - [Tooltip with
|
|
38
|
-
* Motion](https://ariakit.
|
|
37
|
+
* - [Tooltip with
|
|
38
|
+
* Motion](https://ariakit.com/examples/tooltip-framer-motion)
|
|
39
39
|
*/
|
|
40
40
|
currentPlacement: Placement;
|
|
41
41
|
/**
|
|
@@ -43,18 +43,18 @@ export interface PopoverStoreState extends DialogStoreState {
|
|
|
43
43
|
*
|
|
44
44
|
* Live examples:
|
|
45
45
|
* - [Submenu with
|
|
46
|
-
* Combobox](https://ariakit.
|
|
47
|
-
* - [Sliding Menu](https://ariakit.
|
|
48
|
-
* - [Navigation Menubar](https://ariakit.
|
|
49
|
-
* - [Selection Popover](https://ariakit.
|
|
50
|
-
* - [Standalone Popover](https://ariakit.
|
|
51
|
-
* - [Select Grid](https://ariakit.
|
|
46
|
+
* Combobox](https://ariakit.com/examples/menu-nested-combobox)
|
|
47
|
+
* - [Sliding Menu](https://ariakit.com/examples/menu-slide)
|
|
48
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
49
|
+
* - [Selection Popover](https://ariakit.com/examples/popover-selection)
|
|
50
|
+
* - [Standalone Popover](https://ariakit.com/examples/popover-standalone)
|
|
51
|
+
* - [Select Grid](https://ariakit.com/examples/select-grid)
|
|
52
52
|
* @default "bottom"
|
|
53
53
|
*/
|
|
54
54
|
placement: Placement;
|
|
55
55
|
/**
|
|
56
56
|
* A symbol that's used to recompute the popover position when the
|
|
57
|
-
* [`render`](https://ariakit.
|
|
57
|
+
* [`render`](https://ariakit.com/reference/use-popover-store#render) method
|
|
58
58
|
* is called.
|
|
59
59
|
*/
|
|
60
60
|
rendered: symbol;
|
|
@@ -64,7 +64,7 @@ export interface PopoverStoreFunctions extends DialogStoreFunctions {
|
|
|
64
64
|
* Sets the anchor element.
|
|
65
65
|
*
|
|
66
66
|
* Live examples:
|
|
67
|
-
* - [Navigation Menubar](https://ariakit.
|
|
67
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
68
68
|
*/
|
|
69
69
|
setAnchorElement: SetState<PopoverStoreState["anchorElement"]>;
|
|
70
70
|
/**
|
|
@@ -82,8 +82,8 @@ export interface PopoverStoreFunctions extends DialogStoreFunctions {
|
|
|
82
82
|
*
|
|
83
83
|
* Live examples:
|
|
84
84
|
* - [Textarea with inline
|
|
85
|
-
* Combobox](https://ariakit.
|
|
86
|
-
* - [Selection Popover](https://ariakit.
|
|
85
|
+
* Combobox](https://ariakit.com/examples/combobox-textarea)
|
|
86
|
+
* - [Selection Popover](https://ariakit.com/examples/popover-selection)
|
|
87
87
|
*/
|
|
88
88
|
render: () => void;
|
|
89
89
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _UGAVMSQJcjs = require('../__chunks/UGAVMSQJ.cjs');
|
|
4
4
|
require('../__chunks/GDZQUFNP.cjs');
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
5
|
+
require('../__chunks/VC22SYOD.cjs');
|
|
6
|
+
require('../__chunks/I4CBIWTX.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _WMTGHDLEcjs = require('../__chunks/WMTGHDLE.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _4TRESXTOcjs = require('../__chunks/4TRESXTO.cjs');
|
|
13
13
|
|
|
14
14
|
// src/radio/radio-store.ts
|
|
15
15
|
function createRadioStore({
|
|
@@ -17,20 +17,20 @@ function createRadioStore({
|
|
|
17
17
|
} = {}) {
|
|
18
18
|
var _a;
|
|
19
19
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
20
|
-
const composite =
|
|
20
|
+
const composite = _UGAVMSQJcjs.createCompositeStore.call(void 0, {
|
|
21
21
|
...props,
|
|
22
|
-
focusLoop:
|
|
22
|
+
focusLoop: _4TRESXTOcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
23
23
|
});
|
|
24
24
|
const initialState = {
|
|
25
25
|
...composite.getState(),
|
|
26
|
-
value:
|
|
26
|
+
value: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
27
27
|
props.value,
|
|
28
28
|
syncState == null ? void 0 : syncState.value,
|
|
29
29
|
props.defaultValue,
|
|
30
30
|
null
|
|
31
31
|
)
|
|
32
32
|
};
|
|
33
|
-
const radio =
|
|
33
|
+
const radio = _WMTGHDLEcjs.createStore.call(void 0, initialState, composite, props.store);
|
|
34
34
|
return {
|
|
35
35
|
...composite,
|
|
36
36
|
...radio,
|
|
@@ -16,7 +16,7 @@ export interface RadioStoreState extends CompositeStoreState {
|
|
|
16
16
|
}
|
|
17
17
|
export interface RadioStoreFunctions extends CompositeStoreFunctions {
|
|
18
18
|
/**
|
|
19
|
-
* Sets the [`value`](https://ariakit.
|
|
19
|
+
* Sets the [`value`](https://ariakit.com/reference/radio-provider#value)
|
|
20
20
|
* state.
|
|
21
21
|
* @example
|
|
22
22
|
* store.setValue("apple");
|
|
@@ -16,7 +16,7 @@ export interface RadioStoreState extends CompositeStoreState {
|
|
|
16
16
|
}
|
|
17
17
|
export interface RadioStoreFunctions extends CompositeStoreFunctions {
|
|
18
18
|
/**
|
|
19
|
-
* Sets the [`value`](https://ariakit.
|
|
19
|
+
* Sets the [`value`](https://ariakit.com/reference/radio-provider#value)
|
|
20
20
|
* state.
|
|
21
21
|
* @example
|
|
22
22
|
* store.setValue("apple");
|