@ariakit/core 0.3.10 → 0.4.0
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 +60 -0
- package/cjs/__chunks/{Y6PHIDP6.cjs → 5JEQEZFR.cjs} +12 -12
- package/cjs/__chunks/{YIUPKKEK.cjs → 7DU6YMLQ.cjs} +6 -6
- package/cjs/__chunks/{MWNFQD55.cjs → AETQC2AR.cjs} +17 -16
- package/cjs/__chunks/{5CBCKBZ2.cjs → B4LYZ4EM.cjs} +12 -12
- package/cjs/__chunks/{3UT5FE6K.cjs → EEDWPDM2.cjs} +14 -1
- package/cjs/__chunks/{YLMJBIQM.cjs → FFZYCAXA.cjs} +24 -15
- package/cjs/__chunks/{MFSCSSBJ.cjs → LTLFSC4X.cjs} +2 -2
- package/cjs/__chunks/{CWDUO5EV.cjs → SU2BSHGB.cjs} +7 -7
- package/cjs/__chunks/{HMO4CKUP.cjs → UEZLSKZ4.cjs} +10 -10
- package/cjs/__chunks/{5F4DVUNS.cjs → UKR6TQI3.cjs} +1 -2
- package/cjs/__chunks/{ZXCB7MXN.cjs → Y7KNI5NS.cjs} +17 -17
- package/cjs/checkbox/checkbox-store.cjs +5 -5
- package/cjs/collection/collection-store.cjs +5 -5
- package/cjs/combobox/combobox-store.cjs +35 -35
- package/cjs/composite/composite-overflow-store.cjs +6 -6
- package/cjs/composite/composite-store.cjs +6 -6
- package/cjs/dialog/dialog-store.cjs +5 -5
- package/cjs/disclosure/disclosure-store.cjs +4 -4
- package/cjs/disclosure/disclosure-store.d.cts +6 -2
- package/cjs/disclosure/disclosure-store.d.ts +6 -2
- package/cjs/form/form-store.cjs +24 -24
- package/cjs/form/form-store.d.cts +1 -1
- package/cjs/form/form-store.d.ts +1 -1
- package/cjs/hovercard/hovercard-store.cjs +7 -7
- package/cjs/hovercard/hovercard-store.d.cts +14 -7
- package/cjs/hovercard/hovercard-store.d.ts +14 -7
- package/cjs/menu/menu-bar-store.cjs +7 -7
- package/cjs/menu/menu-store.cjs +27 -27
- package/cjs/menu/menu-store.d.cts +16 -7
- package/cjs/menu/menu-store.d.ts +16 -7
- package/cjs/menubar/menubar-store.cjs +7 -7
- package/cjs/popover/popover-store.cjs +6 -6
- package/cjs/popover/popover-store.d.cts +31 -6
- package/cjs/popover/popover-store.d.ts +31 -6
- package/cjs/radio/radio-store.cjs +9 -9
- package/cjs/radio/radio-store.d.cts +2 -1
- package/cjs/radio/radio-store.d.ts +2 -1
- package/cjs/select/select-store.cjs +29 -29
- package/cjs/select/select-store.d.cts +2 -1
- package/cjs/select/select-store.d.ts +2 -1
- package/cjs/tab/tab-store.cjs +21 -21
- package/cjs/tab/tab-store.d.cts +5 -11
- package/cjs/tab/tab-store.d.ts +5 -11
- package/cjs/toolbar/toolbar-store.cjs +8 -8
- package/cjs/toolbar/toolbar-store.d.cts +2 -6
- package/cjs/toolbar/toolbar-store.d.ts +2 -6
- package/cjs/tooltip/tooltip-store.cjs +21 -12
- package/cjs/tooltip/tooltip-store.d.cts +6 -4
- package/cjs/tooltip/tooltip-store.d.ts +6 -4
- package/cjs/utils/dom.cjs +2 -2
- package/cjs/utils/events.cjs +5 -5
- package/cjs/utils/focus.cjs +13 -13
- 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/esm/__chunks/{I2VQ3XGR.js → 22HHDS5F.js} +13 -0
- package/esm/__chunks/{VEUNYQYR.js → 2H5K47H4.js} +3 -3
- package/esm/__chunks/{25MEC56I.js → 5RJNXXU2.js} +1 -1
- package/esm/__chunks/{QJ5CUA32.js → BRS7GKWU.js} +3 -3
- package/esm/__chunks/{AKMSZ36N.js → MFZZDIHG.js} +3 -3
- package/esm/__chunks/{UUFF4PQ6.js → PXYVPXSS.js} +3 -3
- package/esm/__chunks/{K6ELJFXN.js → R676XYVY.js} +1 -1
- package/esm/__chunks/{DLOEKDPY.js → RRSZHCH6.js} +1 -2
- package/esm/__chunks/{MYUKSFP5.js → URUD7X4C.js} +14 -5
- package/esm/__chunks/{MHPO2BXA.js → VDNATJW2.js} +1 -1
- package/esm/__chunks/{L5RYKTVQ.js → WCKXDMU7.js} +3 -2
- package/esm/checkbox/checkbox-store.js +2 -2
- package/esm/collection/collection-store.js +4 -4
- package/esm/combobox/combobox-store.js +9 -9
- package/esm/composite/composite-overflow-store.js +5 -5
- package/esm/composite/composite-store.js +5 -5
- package/esm/dialog/dialog-store.js +4 -4
- package/esm/disclosure/disclosure-store.d.ts +6 -2
- package/esm/disclosure/disclosure-store.js +3 -3
- package/esm/form/form-store.d.ts +1 -1
- package/esm/form/form-store.js +4 -4
- package/esm/hovercard/hovercard-store.d.ts +14 -7
- package/esm/hovercard/hovercard-store.js +6 -6
- package/esm/menu/menu-bar-store.js +6 -6
- package/esm/menu/menu-store.d.ts +16 -7
- package/esm/menu/menu-store.js +9 -9
- package/esm/menubar/menubar-store.js +6 -6
- package/esm/popover/popover-store.d.ts +31 -6
- package/esm/popover/popover-store.js +5 -5
- package/esm/radio/radio-store.d.ts +2 -1
- package/esm/radio/radio-store.js +5 -5
- package/esm/select/select-store.d.ts +2 -1
- package/esm/select/select-store.js +8 -8
- package/esm/tab/tab-store.d.ts +5 -11
- package/esm/tab/tab-store.js +5 -5
- package/esm/toolbar/toolbar-store.d.ts +2 -6
- package/esm/toolbar/toolbar-store.js +5 -5
- package/esm/tooltip/tooltip-store.d.ts +6 -4
- package/esm/tooltip/tooltip-store.js +15 -6
- package/esm/utils/dom.js +1 -1
- package/esm/utils/events.js +2 -2
- package/esm/utils/focus.js +1 -1
- 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.js +2 -2
- package/package.json +1 -1
|
@@ -12,14 +12,16 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
12
12
|
placement: PopoverStoreState["placement"];
|
|
13
13
|
/**
|
|
14
14
|
* The amount of time in milliseconds to wait before showing and hiding the
|
|
15
|
-
*
|
|
16
|
-
* `showTimeout`
|
|
15
|
+
* popup. To control the delay for showing and hiding separately, use
|
|
16
|
+
* [`showTimeout`](https://ariakit.org/reference/hovercard-provider#showtimeout)
|
|
17
|
+
* and
|
|
18
|
+
* [`hideTimeout`](https://ariakit.org/reference/hovercard-provider#hidetimeout).
|
|
17
19
|
* @default 500
|
|
18
20
|
*/
|
|
19
21
|
timeout: number;
|
|
20
22
|
/**
|
|
21
|
-
* The amount of time in milliseconds to wait before
|
|
22
|
-
*
|
|
23
|
+
* The amount of time in milliseconds to wait before _showing_ the popup. It
|
|
24
|
+
* defaults to the value passed to
|
|
23
25
|
* [`timeout`](https://ariakit.org/reference/hovercard-provider#timeout).
|
|
24
26
|
*
|
|
25
27
|
* Live examples:
|
|
@@ -29,16 +31,18 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
29
31
|
*/
|
|
30
32
|
showTimeout?: number;
|
|
31
33
|
/**
|
|
32
|
-
* The amount of time in milliseconds to wait before
|
|
33
|
-
*
|
|
34
|
+
* The amount of time in milliseconds to wait before _hiding_ the popup. It
|
|
35
|
+
* defaults to the value passed to
|
|
34
36
|
* [`timeout`](https://ariakit.org/reference/hovercard-provider#timeout).
|
|
35
37
|
*
|
|
36
38
|
* Live examples:
|
|
37
39
|
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
40
|
+
* - [Tooltip with Framer
|
|
41
|
+
* Motion](https://ariakit.org/examples/tooltip-framer-motion)
|
|
38
42
|
*/
|
|
39
43
|
hideTimeout?: number;
|
|
40
44
|
/**
|
|
41
|
-
* Whether the
|
|
45
|
+
* Whether the popup or an element inside it should be focused when it is
|
|
42
46
|
* shown.
|
|
43
47
|
* @default false
|
|
44
48
|
*/
|
|
@@ -47,6 +51,9 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
47
51
|
export interface HovercardStoreFunctions extends PopoverStoreFunctions {
|
|
48
52
|
/**
|
|
49
53
|
* Sets the `autoFocusOnShow` state.
|
|
54
|
+
*
|
|
55
|
+
* Live examples:
|
|
56
|
+
* - [Sliding Menu](https://ariakit.org/examples/menu-slide)
|
|
50
57
|
*/
|
|
51
58
|
setAutoFocusOnShow: SetState<HovercardStoreState["autoFocusOnShow"]>;
|
|
52
59
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
9
|
-
require('../__chunks/
|
|
4
|
+
var _SU2BSHGBcjs = require('../__chunks/SU2BSHGB.cjs');
|
|
5
|
+
require('../__chunks/Y7KNI5NS.cjs');
|
|
6
|
+
require('../__chunks/FFZYCAXA.cjs');
|
|
7
|
+
require('../__chunks/B4LYZ4EM.cjs');
|
|
8
|
+
require('../__chunks/EEDWPDM2.cjs');
|
|
9
|
+
require('../__chunks/UKR6TQI3.cjs');
|
|
10
10
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
11
11
|
require('../__chunks/AV6KTKLE.cjs');
|
|
12
12
|
|
|
13
13
|
// src/menu/menu-bar-store.ts
|
|
14
14
|
function createMenuBarStore(props = {}) {
|
|
15
|
-
return
|
|
15
|
+
return _SU2BSHGBcjs.createMenubarStore.call(void 0, props);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
|
package/cjs/menu/menu-store.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
4
|
+
var _UEZLSKZ4cjs = require('../__chunks/UEZLSKZ4.cjs');
|
|
5
|
+
require('../__chunks/5JEQEZFR.cjs');
|
|
6
|
+
require('../__chunks/LTLFSC4X.cjs');
|
|
7
|
+
require('../__chunks/AETQC2AR.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
require('../__chunks/
|
|
10
|
+
var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
|
|
11
|
+
require('../__chunks/FFZYCAXA.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -17,12 +17,12 @@ require('../__chunks/YLMJBIQM.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
25
|
-
require('../__chunks/
|
|
24
|
+
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
25
|
+
require('../__chunks/UKR6TQI3.cjs');
|
|
26
26
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
@@ -42,10 +42,10 @@ function createMenuStore(_a = {}) {
|
|
|
42
42
|
"menubar"
|
|
43
43
|
]);
|
|
44
44
|
const parentIsMenubar = !!menubar && !parent;
|
|
45
|
-
const store =
|
|
45
|
+
const store = _B4LYZ4EMcjs.mergeStore.call(void 0,
|
|
46
46
|
props.store,
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
_B4LYZ4EMcjs.pick.call(void 0, parent, ["values"]),
|
|
48
|
+
_B4LYZ4EMcjs.omit.call(void 0, combobox, [
|
|
49
49
|
"arrowElement",
|
|
50
50
|
"anchorElement",
|
|
51
51
|
"contentElement",
|
|
@@ -53,51 +53,51 @@ function createMenuStore(_a = {}) {
|
|
|
53
53
|
"disclosureElement"
|
|
54
54
|
])
|
|
55
55
|
);
|
|
56
|
-
|
|
56
|
+
_B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
57
57
|
const syncState = store.getState();
|
|
58
|
-
const composite =
|
|
58
|
+
const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
59
59
|
store,
|
|
60
|
-
orientation:
|
|
60
|
+
orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
61
61
|
props.orientation,
|
|
62
62
|
syncState.orientation,
|
|
63
63
|
"vertical"
|
|
64
64
|
)
|
|
65
65
|
}));
|
|
66
|
-
const hovercard =
|
|
66
|
+
const hovercard = _UEZLSKZ4cjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
67
67
|
store,
|
|
68
|
-
placement:
|
|
68
|
+
placement: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
69
69
|
props.placement,
|
|
70
70
|
syncState.placement,
|
|
71
71
|
"bottom-start"
|
|
72
72
|
),
|
|
73
|
-
timeout:
|
|
73
|
+
timeout: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
74
74
|
props.timeout,
|
|
75
75
|
syncState.timeout,
|
|
76
76
|
parentIsMenubar ? 0 : 150
|
|
77
77
|
),
|
|
78
|
-
hideTimeout:
|
|
78
|
+
hideTimeout: _EEDWPDM2cjs.defaultValue.call(void 0, props.hideTimeout, syncState.hideTimeout, 0)
|
|
79
79
|
}));
|
|
80
80
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), hovercard.getState()), {
|
|
81
|
-
initialFocus:
|
|
82
|
-
values:
|
|
81
|
+
initialFocus: _EEDWPDM2cjs.defaultValue.call(void 0, syncState.initialFocus, "container"),
|
|
82
|
+
values: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
83
83
|
props.values,
|
|
84
84
|
syncState.values,
|
|
85
85
|
props.defaultValues,
|
|
86
86
|
{}
|
|
87
87
|
)
|
|
88
88
|
});
|
|
89
|
-
const menu =
|
|
90
|
-
|
|
89
|
+
const menu = _B4LYZ4EMcjs.createStore.call(void 0, initialState, composite, hovercard, store);
|
|
90
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
91
91
|
menu,
|
|
92
|
-
() =>
|
|
92
|
+
() => _B4LYZ4EMcjs.sync.call(void 0, menu, ["mounted"], (state) => {
|
|
93
93
|
if (state.mounted)
|
|
94
94
|
return;
|
|
95
95
|
menu.setState("activeId", null);
|
|
96
96
|
})
|
|
97
97
|
);
|
|
98
|
-
|
|
98
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
99
99
|
menu,
|
|
100
|
-
() =>
|
|
100
|
+
() => _B4LYZ4EMcjs.sync.call(void 0, parent, ["orientation"], (state) => {
|
|
101
101
|
menu.setState(
|
|
102
102
|
"placement",
|
|
103
103
|
state.orientation === "vertical" ? "right-start" : "bottom-start"
|
|
@@ -123,7 +123,7 @@ function createMenuStore(_a = {}) {
|
|
|
123
123
|
return;
|
|
124
124
|
menu.setState("values", (values) => {
|
|
125
125
|
const prevValue = values[name];
|
|
126
|
-
const nextValue =
|
|
126
|
+
const nextValue = _EEDWPDM2cjs.applyState.call(void 0, value, prevValue);
|
|
127
127
|
if (nextValue === prevValue)
|
|
128
128
|
return values;
|
|
129
129
|
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, values), {
|
|
@@ -13,10 +13,13 @@ export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> ext
|
|
|
13
13
|
*/
|
|
14
14
|
initialFocus: "container" | "first" | "last";
|
|
15
15
|
/**
|
|
16
|
-
* A map of names and values that will be used by the
|
|
17
|
-
* `
|
|
16
|
+
* A map of names and values that will be used by the
|
|
17
|
+
* [`MenuItemCheckbox`](https://ariakit.org/reference/menu-item-checkbox) and
|
|
18
|
+
* [`MenuItemRadio`](https://ariakit.org/reference/menu-item-radio)
|
|
19
|
+
* components.
|
|
18
20
|
*
|
|
19
21
|
* Live examples:
|
|
22
|
+
* - [MenuItemCheckbox](https://ariakit.org/examples/menu-item-checkbox)
|
|
20
23
|
* - [Submenu with
|
|
21
24
|
* Combobox](https://ariakit.org/examples/menu-nested-combobox)
|
|
22
25
|
*/
|
|
@@ -42,7 +45,8 @@ export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues>
|
|
|
42
45
|
*/
|
|
43
46
|
setInitialFocus: SetState<MenuStoreState<T>["initialFocus"]>;
|
|
44
47
|
/**
|
|
45
|
-
* Sets the `values`
|
|
48
|
+
* Sets the [`values`](https://ariakit.org/reference/menu-provider#values)
|
|
49
|
+
* state.
|
|
46
50
|
* @example
|
|
47
51
|
* store.setValues({ watching: ["issues"] });
|
|
48
52
|
* store.setValues((values) => ({ ...values, watching: ["issues"] }));
|
|
@@ -68,16 +72,21 @@ export interface MenuStoreOptions<T extends MenuStoreValues = MenuStoreValues> e
|
|
|
68
72
|
*/
|
|
69
73
|
combobox?: ComboboxStore | null;
|
|
70
74
|
/**
|
|
71
|
-
* A reference to a parent menu store. This
|
|
75
|
+
* A reference to a parent menu store. This is used on nested menus.
|
|
72
76
|
*/
|
|
73
77
|
parent?: MenuStore | null;
|
|
74
78
|
/**
|
|
75
|
-
* A reference to a
|
|
76
|
-
*
|
|
79
|
+
* A reference to a menubar store. This is used when rendering menus inside a
|
|
80
|
+
* menubar.
|
|
77
81
|
*/
|
|
78
82
|
menubar?: MenuBarStore | null;
|
|
79
83
|
/**
|
|
80
|
-
* The default values for the
|
|
84
|
+
* The default values for the
|
|
85
|
+
* [`values`](https://ariakit.org/reference/menu-provider#values) state.
|
|
86
|
+
*
|
|
87
|
+
* Live examples:
|
|
88
|
+
* - [MenuItemCheckbox](https://ariakit.org/examples/menu-item-checkbox)
|
|
89
|
+
* - [MenuItemRadio](https://ariakit.org/examples/menu-item-radio)
|
|
81
90
|
* @default {}
|
|
82
91
|
*/
|
|
83
92
|
defaultValues?: MenuStoreState<T>["values"];
|
package/cjs/menu/menu-store.d.ts
CHANGED
|
@@ -13,10 +13,13 @@ export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> ext
|
|
|
13
13
|
*/
|
|
14
14
|
initialFocus: "container" | "first" | "last";
|
|
15
15
|
/**
|
|
16
|
-
* A map of names and values that will be used by the
|
|
17
|
-
* `
|
|
16
|
+
* A map of names and values that will be used by the
|
|
17
|
+
* [`MenuItemCheckbox`](https://ariakit.org/reference/menu-item-checkbox) and
|
|
18
|
+
* [`MenuItemRadio`](https://ariakit.org/reference/menu-item-radio)
|
|
19
|
+
* components.
|
|
18
20
|
*
|
|
19
21
|
* Live examples:
|
|
22
|
+
* - [MenuItemCheckbox](https://ariakit.org/examples/menu-item-checkbox)
|
|
20
23
|
* - [Submenu with
|
|
21
24
|
* Combobox](https://ariakit.org/examples/menu-nested-combobox)
|
|
22
25
|
*/
|
|
@@ -42,7 +45,8 @@ export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues>
|
|
|
42
45
|
*/
|
|
43
46
|
setInitialFocus: SetState<MenuStoreState<T>["initialFocus"]>;
|
|
44
47
|
/**
|
|
45
|
-
* Sets the `values`
|
|
48
|
+
* Sets the [`values`](https://ariakit.org/reference/menu-provider#values)
|
|
49
|
+
* state.
|
|
46
50
|
* @example
|
|
47
51
|
* store.setValues({ watching: ["issues"] });
|
|
48
52
|
* store.setValues((values) => ({ ...values, watching: ["issues"] }));
|
|
@@ -68,16 +72,21 @@ export interface MenuStoreOptions<T extends MenuStoreValues = MenuStoreValues> e
|
|
|
68
72
|
*/
|
|
69
73
|
combobox?: ComboboxStore | null;
|
|
70
74
|
/**
|
|
71
|
-
* A reference to a parent menu store. This
|
|
75
|
+
* A reference to a parent menu store. This is used on nested menus.
|
|
72
76
|
*/
|
|
73
77
|
parent?: MenuStore | null;
|
|
74
78
|
/**
|
|
75
|
-
* A reference to a
|
|
76
|
-
*
|
|
79
|
+
* A reference to a menubar store. This is used when rendering menus inside a
|
|
80
|
+
* menubar.
|
|
77
81
|
*/
|
|
78
82
|
menubar?: MenuBarStore | null;
|
|
79
83
|
/**
|
|
80
|
-
* The default values for the
|
|
84
|
+
* The default values for the
|
|
85
|
+
* [`values`](https://ariakit.org/reference/menu-provider#values) state.
|
|
86
|
+
*
|
|
87
|
+
* Live examples:
|
|
88
|
+
* - [MenuItemCheckbox](https://ariakit.org/examples/menu-item-checkbox)
|
|
89
|
+
* - [MenuItemRadio](https://ariakit.org/examples/menu-item-radio)
|
|
81
90
|
* @default {}
|
|
82
91
|
*/
|
|
83
92
|
defaultValues?: MenuStoreState<T>["values"];
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
9
|
-
require('../__chunks/
|
|
4
|
+
var _SU2BSHGBcjs = require('../__chunks/SU2BSHGB.cjs');
|
|
5
|
+
require('../__chunks/Y7KNI5NS.cjs');
|
|
6
|
+
require('../__chunks/FFZYCAXA.cjs');
|
|
7
|
+
require('../__chunks/B4LYZ4EM.cjs');
|
|
8
|
+
require('../__chunks/EEDWPDM2.cjs');
|
|
9
|
+
require('../__chunks/UKR6TQI3.cjs');
|
|
10
10
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
11
11
|
require('../__chunks/AV6KTKLE.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.createMenubarStore =
|
|
14
|
+
exports.createMenubarStore = _SU2BSHGBcjs.createMenubarStore;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
4
|
+
var _5JEQEZFRcjs = require('../__chunks/5JEQEZFR.cjs');
|
|
5
|
+
require('../__chunks/LTLFSC4X.cjs');
|
|
6
|
+
require('../__chunks/AETQC2AR.cjs');
|
|
7
|
+
require('../__chunks/B4LYZ4EM.cjs');
|
|
8
|
+
require('../__chunks/EEDWPDM2.cjs');
|
|
9
9
|
require('../__chunks/AV6KTKLE.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.createPopoverStore =
|
|
12
|
+
exports.createPopoverStore = _5JEQEZFRcjs.createPopoverStore;
|
|
@@ -10,10 +10,18 @@ export declare function createPopoverStore({ popover: otherPopover, ...props }?:
|
|
|
10
10
|
export interface PopoverStoreState extends DialogStoreState {
|
|
11
11
|
/**
|
|
12
12
|
* The anchor element.
|
|
13
|
+
*
|
|
14
|
+
* Live examples:
|
|
15
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
13
16
|
*/
|
|
14
17
|
anchorElement: HTMLElement | null;
|
|
15
18
|
/**
|
|
16
19
|
* The popover element that will render the placement attributes.
|
|
20
|
+
*
|
|
21
|
+
* Live examples:
|
|
22
|
+
* - [Form with Select](https://ariakit.org/examples/form-select)
|
|
23
|
+
* - [Sliding Menu](https://ariakit.org/examples/menu-slide)
|
|
24
|
+
* - [Responsive Popover](https://ariakit.org/examples/popover-responsive)
|
|
17
25
|
*/
|
|
18
26
|
popoverElement: HTMLElement | null;
|
|
19
27
|
/**
|
|
@@ -21,30 +29,42 @@ export interface PopoverStoreState extends DialogStoreState {
|
|
|
21
29
|
*/
|
|
22
30
|
arrowElement: HTMLElement | null;
|
|
23
31
|
/**
|
|
24
|
-
* The current temporary
|
|
25
|
-
*
|
|
26
|
-
*
|
|
32
|
+
* The current temporary position of the popover. This might differ from the
|
|
33
|
+
* [`placement`](https://ariakit.org/reference/popover-provider#placement)
|
|
34
|
+
* state if the popover has had to adjust its position dynamically.
|
|
35
|
+
*
|
|
36
|
+
* Live examples:
|
|
37
|
+
* - [Tooltip with Framer
|
|
38
|
+
* Motion](https://ariakit.org/examples/tooltip-framer-motion)
|
|
27
39
|
*/
|
|
28
40
|
currentPlacement: Placement;
|
|
29
41
|
/**
|
|
30
42
|
* The placement of the popover.
|
|
31
43
|
*
|
|
32
44
|
* Live examples:
|
|
33
|
-
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
34
45
|
* - [Submenu with
|
|
35
46
|
* Combobox](https://ariakit.org/examples/menu-nested-combobox)
|
|
47
|
+
* - [Sliding Menu](https://ariakit.org/examples/menu-slide)
|
|
48
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
49
|
+
* - [Selection Popover](https://ariakit.org/examples/popover-selection)
|
|
50
|
+
* - [Standalone Popover](https://ariakit.org/examples/popover-standalone)
|
|
51
|
+
* - [Select Grid](https://ariakit.org/examples/select-grid)
|
|
36
52
|
* @default "bottom"
|
|
37
53
|
*/
|
|
38
54
|
placement: Placement;
|
|
39
55
|
/**
|
|
40
|
-
* A symbol that's used to recompute the popover position when the
|
|
41
|
-
* method
|
|
56
|
+
* A symbol that's used to recompute the popover position when the
|
|
57
|
+
* [`render`](https://ariakit.org/reference/use-popover-store#render) method
|
|
58
|
+
* is called.
|
|
42
59
|
*/
|
|
43
60
|
rendered: symbol;
|
|
44
61
|
}
|
|
45
62
|
export interface PopoverStoreFunctions extends DialogStoreFunctions {
|
|
46
63
|
/**
|
|
47
64
|
* Sets the anchor element.
|
|
65
|
+
*
|
|
66
|
+
* Live examples:
|
|
67
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
48
68
|
*/
|
|
49
69
|
setAnchorElement: SetState<PopoverStoreState["anchorElement"]>;
|
|
50
70
|
/**
|
|
@@ -59,6 +79,11 @@ export interface PopoverStoreFunctions extends DialogStoreFunctions {
|
|
|
59
79
|
* A function that can be used to recompute the popover position. This is
|
|
60
80
|
* useful when the popover anchor changes in a way that affects the popover
|
|
61
81
|
* position.
|
|
82
|
+
*
|
|
83
|
+
* Live examples:
|
|
84
|
+
* - [Textarea with inline
|
|
85
|
+
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
86
|
+
* - [Selection Popover](https://ariakit.org/examples/popover-selection)
|
|
62
87
|
*/
|
|
63
88
|
render: () => void;
|
|
64
89
|
}
|
|
@@ -10,10 +10,18 @@ export declare function createPopoverStore({ popover: otherPopover, ...props }?:
|
|
|
10
10
|
export interface PopoverStoreState extends DialogStoreState {
|
|
11
11
|
/**
|
|
12
12
|
* The anchor element.
|
|
13
|
+
*
|
|
14
|
+
* Live examples:
|
|
15
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
13
16
|
*/
|
|
14
17
|
anchorElement: HTMLElement | null;
|
|
15
18
|
/**
|
|
16
19
|
* The popover element that will render the placement attributes.
|
|
20
|
+
*
|
|
21
|
+
* Live examples:
|
|
22
|
+
* - [Form with Select](https://ariakit.org/examples/form-select)
|
|
23
|
+
* - [Sliding Menu](https://ariakit.org/examples/menu-slide)
|
|
24
|
+
* - [Responsive Popover](https://ariakit.org/examples/popover-responsive)
|
|
17
25
|
*/
|
|
18
26
|
popoverElement: HTMLElement | null;
|
|
19
27
|
/**
|
|
@@ -21,30 +29,42 @@ export interface PopoverStoreState extends DialogStoreState {
|
|
|
21
29
|
*/
|
|
22
30
|
arrowElement: HTMLElement | null;
|
|
23
31
|
/**
|
|
24
|
-
* The current temporary
|
|
25
|
-
*
|
|
26
|
-
*
|
|
32
|
+
* The current temporary position of the popover. This might differ from the
|
|
33
|
+
* [`placement`](https://ariakit.org/reference/popover-provider#placement)
|
|
34
|
+
* state if the popover has had to adjust its position dynamically.
|
|
35
|
+
*
|
|
36
|
+
* Live examples:
|
|
37
|
+
* - [Tooltip with Framer
|
|
38
|
+
* Motion](https://ariakit.org/examples/tooltip-framer-motion)
|
|
27
39
|
*/
|
|
28
40
|
currentPlacement: Placement;
|
|
29
41
|
/**
|
|
30
42
|
* The placement of the popover.
|
|
31
43
|
*
|
|
32
44
|
* Live examples:
|
|
33
|
-
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
34
45
|
* - [Submenu with
|
|
35
46
|
* Combobox](https://ariakit.org/examples/menu-nested-combobox)
|
|
47
|
+
* - [Sliding Menu](https://ariakit.org/examples/menu-slide)
|
|
48
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
49
|
+
* - [Selection Popover](https://ariakit.org/examples/popover-selection)
|
|
50
|
+
* - [Standalone Popover](https://ariakit.org/examples/popover-standalone)
|
|
51
|
+
* - [Select Grid](https://ariakit.org/examples/select-grid)
|
|
36
52
|
* @default "bottom"
|
|
37
53
|
*/
|
|
38
54
|
placement: Placement;
|
|
39
55
|
/**
|
|
40
|
-
* A symbol that's used to recompute the popover position when the
|
|
41
|
-
* method
|
|
56
|
+
* A symbol that's used to recompute the popover position when the
|
|
57
|
+
* [`render`](https://ariakit.org/reference/use-popover-store#render) method
|
|
58
|
+
* is called.
|
|
42
59
|
*/
|
|
43
60
|
rendered: symbol;
|
|
44
61
|
}
|
|
45
62
|
export interface PopoverStoreFunctions extends DialogStoreFunctions {
|
|
46
63
|
/**
|
|
47
64
|
* Sets the anchor element.
|
|
65
|
+
*
|
|
66
|
+
* Live examples:
|
|
67
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
48
68
|
*/
|
|
49
69
|
setAnchorElement: SetState<PopoverStoreState["anchorElement"]>;
|
|
50
70
|
/**
|
|
@@ -59,6 +79,11 @@ export interface PopoverStoreFunctions extends DialogStoreFunctions {
|
|
|
59
79
|
* A function that can be used to recompute the popover position. This is
|
|
60
80
|
* useful when the popover anchor changes in a way that affects the popover
|
|
61
81
|
* position.
|
|
82
|
+
*
|
|
83
|
+
* Live examples:
|
|
84
|
+
* - [Textarea with inline
|
|
85
|
+
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
86
|
+
* - [Selection Popover](https://ariakit.org/examples/popover-selection)
|
|
62
87
|
*/
|
|
63
88
|
render: () => void;
|
|
64
89
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
4
|
+
var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
|
|
5
|
+
require('../__chunks/FFZYCAXA.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('../__chunks/
|
|
11
|
+
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
12
|
+
require('../__chunks/UKR6TQI3.cjs');
|
|
13
13
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
@@ -22,18 +22,18 @@ function createRadioStore(_a = {}) {
|
|
|
22
22
|
var props = _AV6KTKLEcjs.__objRest.call(void 0, _a, []);
|
|
23
23
|
var _a2;
|
|
24
24
|
const syncState = (_a2 = props.store) == null ? void 0 : _a2.getState();
|
|
25
|
-
const composite =
|
|
26
|
-
focusLoop:
|
|
25
|
+
const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
26
|
+
focusLoop: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
27
27
|
}));
|
|
28
28
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), {
|
|
29
|
-
value:
|
|
29
|
+
value: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
30
30
|
props.value,
|
|
31
31
|
syncState == null ? void 0 : syncState.value,
|
|
32
32
|
props.defaultValue,
|
|
33
33
|
null
|
|
34
34
|
)
|
|
35
35
|
});
|
|
36
|
-
const radio =
|
|
36
|
+
const radio = _B4LYZ4EMcjs.createStore.call(void 0, initialState, composite, props.store);
|
|
37
37
|
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite), radio), {
|
|
38
38
|
setValue: (value) => radio.setState("value", value)
|
|
39
39
|
});
|
|
@@ -18,7 +18,8 @@ export interface RadioStoreState extends CompositeStoreState {
|
|
|
18
18
|
}
|
|
19
19
|
export interface RadioStoreFunctions extends CompositeStoreFunctions {
|
|
20
20
|
/**
|
|
21
|
-
* Sets the `value`
|
|
21
|
+
* Sets the [`value`](https://ariakit.org/reference/radio-provider#value)
|
|
22
|
+
* state.
|
|
22
23
|
* @example
|
|
23
24
|
* store.setValue("apple");
|
|
24
25
|
* store.setValue((value) => value === "apple" ? "orange" : "apple");
|
|
@@ -18,7 +18,8 @@ export interface RadioStoreState extends CompositeStoreState {
|
|
|
18
18
|
}
|
|
19
19
|
export interface RadioStoreFunctions extends CompositeStoreFunctions {
|
|
20
20
|
/**
|
|
21
|
-
* Sets the `value`
|
|
21
|
+
* Sets the [`value`](https://ariakit.org/reference/radio-provider#value)
|
|
22
|
+
* state.
|
|
22
23
|
* @example
|
|
23
24
|
* store.setValue("apple");
|
|
24
25
|
* store.setValue((value) => value === "apple" ? "orange" : "apple");
|