@ariakit/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 +16 -0
- package/cjs/__chunks/{QYB6XH64.cjs → 27ZAGOYG.cjs} +17 -13
- package/cjs/__chunks/6455U47T.cjs +37 -0
- package/cjs/__chunks/{ZPOXPO2L.cjs → 6SPJEESB.cjs} +33 -21
- package/cjs/__chunks/{2YFRPUZP.cjs → DBHIHK7C.cjs} +6 -6
- package/cjs/__chunks/{W5IHD6VG.cjs → EUJ6NNA6.cjs} +56 -43
- package/cjs/__chunks/{4DQ3OTE7.cjs → FXEBKN6G.cjs} +22 -17
- package/cjs/__chunks/{ZJEEK57E.cjs → HEFJPUYD.cjs} +2 -2
- package/cjs/__chunks/LBTLD2RB.cjs +58 -0
- package/cjs/__chunks/{QNEPGQLL.cjs → M6ZA7XUP.cjs} +6 -2
- package/cjs/__chunks/{HLVPXX7H.cjs → SDBF6KIY.cjs} +107 -107
- package/cjs/__chunks/{OFNGELMA.cjs → ZNW4LSWU.cjs} +8 -6
- package/cjs/checkbox/checkbox-store.cjs +14 -10
- package/cjs/checkbox/checkbox-store.d.ts +7 -0
- package/cjs/collection/collection-store.cjs +6 -5
- package/cjs/combobox/combobox-store.cjs +49 -48
- package/cjs/combobox/combobox-store.d.ts +24 -0
- package/cjs/composite/composite-overflow-store.cjs +7 -6
- package/cjs/composite/composite-store.cjs +7 -6
- package/cjs/composite/composite-store.d.ts +38 -34
- package/cjs/dialog/dialog-store.cjs +6 -5
- package/cjs/disclosure/disclosure-store.cjs +5 -4
- package/cjs/disclosure/disclosure-store.d.ts +36 -6
- package/cjs/form/form-store.cjs +38 -35
- package/cjs/hovercard/hovercard-store.cjs +8 -7
- package/cjs/index.cjs +3 -1
- package/cjs/menu/menu-bar-store.cjs +17 -13
- package/cjs/menu/menu-store.cjs +41 -43
- package/cjs/popover/popover-store.cjs +7 -6
- package/cjs/radio/radio-store.cjs +25 -24
- package/cjs/select/select-store.cjs +42 -42
- package/cjs/select/select-store.d.ts +16 -0
- package/cjs/tab/tab-store.cjs +29 -28
- package/cjs/tab/tab-store.d.ts +9 -0
- package/cjs/toolbar/toolbar-store.cjs +17 -13
- package/cjs/tooltip/tooltip-store.cjs +24 -25
- package/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/cjs/utils/array.cjs +1 -0
- package/cjs/utils/dom.cjs +3 -2
- package/cjs/utils/events.cjs +14 -9
- package/cjs/utils/focus.cjs +24 -14
- package/cjs/utils/misc.cjs +3 -2
- package/cjs/utils/platform.cjs +4 -3
- package/cjs/utils/store.cjs +4 -3
- package/esm/__chunks/4BKCJXBM.js +37 -0
- package/esm/__chunks/AHZW5LR4.js +58 -0
- package/esm/__chunks/{NA5BK7DD.js → BOKMNDR7.js} +22 -10
- package/esm/__chunks/{6PEWNRTN.js → CUW3E24J.js} +100 -100
- package/esm/__chunks/{WFGVC6LE.js → EWHSN7GO.js} +17 -12
- package/esm/__chunks/{4T5RHRE5.js → MNNKHNLW.js} +1 -1
- package/esm/__chunks/{UVCATTRC.js → N6JW4ITM.js} +7 -5
- package/esm/__chunks/{RMD7SNCC.js → NWU4GBZ6.js} +5 -1
- package/esm/__chunks/{X7MJ3FB5.js → R6VHFWTV.js} +49 -36
- package/esm/__chunks/{DXA3K2FY.js → TFBCK4JB.js} +1 -1
- package/esm/__chunks/{IOAGNCXX.js → ZV2GEGPL.js} +14 -10
- package/esm/checkbox/checkbox-store.d.ts +7 -0
- package/esm/checkbox/checkbox-store.js +11 -7
- package/esm/collection/collection-store.js +5 -4
- package/esm/combobox/combobox-store.d.ts +24 -0
- package/esm/combobox/combobox-store.js +34 -33
- package/esm/composite/composite-overflow-store.js +6 -5
- package/esm/composite/composite-store.d.ts +38 -34
- package/esm/composite/composite-store.js +6 -5
- package/esm/dialog/dialog-store.js +5 -4
- package/esm/disclosure/disclosure-store.d.ts +36 -6
- package/esm/disclosure/disclosure-store.js +4 -3
- package/esm/form/form-store.js +24 -21
- package/esm/hovercard/hovercard-store.js +7 -6
- package/esm/index.js +2 -0
- package/esm/menu/menu-bar-store.js +15 -11
- package/esm/menu/menu-store.js +31 -33
- package/esm/popover/popover-store.js +6 -5
- package/esm/radio/radio-store.js +22 -21
- package/esm/select/select-store.d.ts +16 -0
- package/esm/select/select-store.js +29 -29
- package/esm/tab/tab-store.d.ts +9 -0
- package/esm/tab/tab-store.js +23 -22
- package/esm/toolbar/toolbar-store.js +15 -11
- package/esm/tooltip/tooltip-store.js +20 -21
- package/esm/tsconfig.build.tsbuildinfo +1 -1
- package/esm/utils/array.js +1 -0
- package/esm/utils/dom.js +2 -1
- package/esm/utils/events.js +10 -5
- package/esm/utils/focus.js +14 -4
- package/esm/utils/misc.js +2 -1
- package/esm/utils/platform.js +3 -2
- package/esm/utils/store.js +3 -2
- package/package.json +1 -1
- package/cjs/__chunks/DQHU5K4Q.cjs +0 -57
- package/esm/__chunks/6HMPWUDT.js +0 -57
|
@@ -1,44 +1,52 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
3
|
+
var _SDBF6KIYcjs = require('../__chunks/SDBF6KIY.cjs');
|
|
4
|
+
require('../__chunks/HEFJPUYD.cjs');
|
|
5
|
+
require('../__chunks/27ZAGOYG.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../__chunks/
|
|
8
|
+
var _EUJ6NNA6cjs = require('../__chunks/EUJ6NNA6.cjs');
|
|
9
|
+
require('../__chunks/FXEBKN6G.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _6SPJEESBcjs = require('../__chunks/6SPJEESB.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _M6ZA7XUPcjs = require('../__chunks/M6ZA7XUP.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
21
|
-
require('../__chunks/
|
|
20
|
+
var _DBHIHK7Ccjs = require('../__chunks/DBHIHK7C.cjs');
|
|
21
|
+
require('../__chunks/ZNW4LSWU.cjs');
|
|
22
22
|
require('../__chunks/GDZQUFNP.cjs');
|
|
23
23
|
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var _6455U47Tcjs = require('../__chunks/6455U47T.cjs');
|
|
28
|
+
|
|
24
29
|
// src/combobox/combobox-store.ts
|
|
25
|
-
var isSafariOnMobile =
|
|
26
|
-
function createComboboxStore({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} =
|
|
31
|
-
|
|
30
|
+
var isSafariOnMobile = _DBHIHK7Ccjs.isSafari.call(void 0, ) && _DBHIHK7Ccjs.isTouchDevice.call(void 0, );
|
|
31
|
+
function createComboboxStore(_a = {}) {
|
|
32
|
+
var _b = _a, {
|
|
33
|
+
menu,
|
|
34
|
+
select
|
|
35
|
+
} = _b, props = _6455U47Tcjs.__objRest.call(void 0, _b, [
|
|
36
|
+
"menu",
|
|
37
|
+
"select"
|
|
38
|
+
]);
|
|
39
|
+
const store = _6SPJEESBcjs.mergeStore.call(void 0,
|
|
32
40
|
props.store,
|
|
33
|
-
|
|
41
|
+
menu == null ? void 0 : menu.omit(
|
|
34
42
|
"baseElement",
|
|
35
43
|
"arrowElement",
|
|
36
44
|
"anchorElement",
|
|
37
45
|
"contentElement",
|
|
38
46
|
"popoverElement",
|
|
39
47
|
"disclosureElement"
|
|
40
|
-
)
|
|
41
|
-
|
|
48
|
+
),
|
|
49
|
+
select == null ? void 0 : select.omit(
|
|
42
50
|
"value",
|
|
43
51
|
"items",
|
|
44
52
|
"renderedItems",
|
|
@@ -48,64 +56,60 @@ function createComboboxStore({
|
|
|
48
56
|
"contentElement",
|
|
49
57
|
"popoverElement",
|
|
50
58
|
"disclosureElement"
|
|
51
|
-
)
|
|
59
|
+
)
|
|
52
60
|
);
|
|
53
61
|
const syncState = store.getState();
|
|
54
|
-
const activeId =
|
|
62
|
+
const activeId = _M6ZA7XUPcjs.defaultValue.call(void 0,
|
|
55
63
|
props.activeId,
|
|
56
64
|
syncState.activeId,
|
|
57
65
|
props.defaultActiveId,
|
|
58
66
|
null
|
|
59
67
|
);
|
|
60
|
-
const composite =
|
|
61
|
-
...props,
|
|
68
|
+
const composite = _EUJ6NNA6cjs.createCompositeStore.call(void 0, _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, props), {
|
|
62
69
|
store,
|
|
63
70
|
activeId,
|
|
64
|
-
includesBaseElement:
|
|
71
|
+
includesBaseElement: _M6ZA7XUPcjs.defaultValue.call(void 0,
|
|
65
72
|
props.includesBaseElement,
|
|
66
73
|
syncState.includesBaseElement,
|
|
67
74
|
true
|
|
68
75
|
),
|
|
69
|
-
orientation:
|
|
76
|
+
orientation: _M6ZA7XUPcjs.defaultValue.call(void 0,
|
|
70
77
|
props.orientation,
|
|
71
78
|
syncState.orientation,
|
|
72
79
|
"vertical"
|
|
73
80
|
),
|
|
74
|
-
focusLoop:
|
|
75
|
-
focusWrap:
|
|
76
|
-
virtualFocus:
|
|
81
|
+
focusLoop: _M6ZA7XUPcjs.defaultValue.call(void 0, props.focusLoop, syncState.focusLoop, true),
|
|
82
|
+
focusWrap: _M6ZA7XUPcjs.defaultValue.call(void 0, props.focusWrap, syncState.focusWrap, true),
|
|
83
|
+
virtualFocus: _M6ZA7XUPcjs.defaultValue.call(void 0,
|
|
77
84
|
props.virtualFocus,
|
|
78
|
-
|
|
85
|
+
syncState == null ? void 0 : syncState.virtualFocus,
|
|
79
86
|
!isSafariOnMobile
|
|
80
87
|
)
|
|
81
|
-
});
|
|
82
|
-
const popover =
|
|
83
|
-
...props,
|
|
88
|
+
}));
|
|
89
|
+
const popover = _SDBF6KIYcjs.createPopoverStore.call(void 0, _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, props), {
|
|
84
90
|
store,
|
|
85
|
-
placement:
|
|
91
|
+
placement: _M6ZA7XUPcjs.defaultValue.call(void 0,
|
|
86
92
|
props.placement,
|
|
87
93
|
syncState.placement,
|
|
88
94
|
"bottom-start"
|
|
89
95
|
)
|
|
90
|
-
});
|
|
91
|
-
const initialValue =
|
|
96
|
+
}));
|
|
97
|
+
const initialValue = _M6ZA7XUPcjs.defaultValue.call(void 0,
|
|
92
98
|
props.value,
|
|
93
99
|
syncState.value,
|
|
94
100
|
props.defaultValue,
|
|
95
101
|
""
|
|
96
102
|
);
|
|
97
|
-
const initialState = {
|
|
98
|
-
...composite.getState(),
|
|
99
|
-
...popover.getState(),
|
|
103
|
+
const initialState = _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, composite.getState()), popover.getState()), {
|
|
100
104
|
value: initialValue,
|
|
101
|
-
resetValueOnHide:
|
|
105
|
+
resetValueOnHide: _M6ZA7XUPcjs.defaultValue.call(void 0,
|
|
102
106
|
props.resetValueOnHide,
|
|
103
107
|
syncState.resetValueOnHide,
|
|
104
108
|
false
|
|
105
109
|
),
|
|
106
110
|
activeValue: syncState.activeValue
|
|
107
|
-
};
|
|
108
|
-
const combobox =
|
|
111
|
+
});
|
|
112
|
+
const combobox = _6SPJEESBcjs.createStore.call(void 0, initialState, composite, popover, store);
|
|
109
113
|
combobox.setup(
|
|
110
114
|
() => combobox.sync(
|
|
111
115
|
(state) => {
|
|
@@ -146,17 +150,14 @@ function createComboboxStore({
|
|
|
146
150
|
return;
|
|
147
151
|
const { activeId: activeId2 } = combobox.getState();
|
|
148
152
|
const activeItem = composite.item(activeId2);
|
|
149
|
-
combobox.setState("activeValue",
|
|
153
|
+
combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
|
|
150
154
|
},
|
|
151
155
|
["moves", "renderedItems"]
|
|
152
156
|
)
|
|
153
157
|
);
|
|
154
|
-
return {
|
|
155
|
-
...popover,
|
|
156
|
-
...composite,
|
|
157
|
-
...combobox,
|
|
158
|
+
return _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, popover), composite), combobox), {
|
|
158
159
|
setValue: (value) => combobox.setState("value", value)
|
|
159
|
-
};
|
|
160
|
+
});
|
|
160
161
|
}
|
|
161
162
|
|
|
162
163
|
|
|
@@ -19,6 +19,15 @@ export interface ComboboxStoreState extends CompositeStoreState<Item>, PopoverSt
|
|
|
19
19
|
includesBaseElement: boolean;
|
|
20
20
|
/**
|
|
21
21
|
* The input value.
|
|
22
|
+
*
|
|
23
|
+
* Live examples:
|
|
24
|
+
* - [ComboboxGroup](https://ariakit.org/examples/combobox-group)
|
|
25
|
+
* - [Combobox with links](https://ariakit.org/examples/combobox-links)
|
|
26
|
+
* - [Filterable Combobox](https://ariakit.org/examples/combobox-matches)
|
|
27
|
+
* - [Multi-selectable
|
|
28
|
+
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
29
|
+
* - [Textarea with inline
|
|
30
|
+
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
22
31
|
*/
|
|
23
32
|
value: string;
|
|
24
33
|
/**
|
|
@@ -27,12 +36,23 @@ export interface ComboboxStoreState extends CompositeStoreState<Item>, PopoverSt
|
|
|
27
36
|
activeValue: string | undefined;
|
|
28
37
|
/**
|
|
29
38
|
* Whether to reset the value when the combobox popover is hidden.
|
|
39
|
+
*
|
|
40
|
+
* Live examples:
|
|
41
|
+
* - [Multi-selectable
|
|
42
|
+
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
43
|
+
* @default false
|
|
30
44
|
*/
|
|
31
45
|
resetValueOnHide: boolean;
|
|
32
46
|
}
|
|
33
47
|
export interface ComboboxStoreFunctions extends CompositeStoreFunctions<Item>, PopoverStoreFunctions {
|
|
34
48
|
/**
|
|
35
49
|
* Sets the `value` state.
|
|
50
|
+
*
|
|
51
|
+
* Live examples:
|
|
52
|
+
* - [Multi-selectable
|
|
53
|
+
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
54
|
+
* - [Textarea with inline
|
|
55
|
+
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
36
56
|
* @example
|
|
37
57
|
* store.setValue("Hello world");
|
|
38
58
|
* store.setValue((value) => value + "!");
|
|
@@ -58,6 +78,10 @@ export interface ComboboxStoreOptions extends StoreOptions<ComboboxStoreState, "
|
|
|
58
78
|
select?: SelectStore;
|
|
59
79
|
/**
|
|
60
80
|
* The combobox initial value.
|
|
81
|
+
*
|
|
82
|
+
* Live examples:
|
|
83
|
+
* - [Multi-selectable
|
|
84
|
+
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
61
85
|
* @default ""
|
|
62
86
|
*/
|
|
63
87
|
defaultValue?: ComboboxStoreState["value"];
|
|
@@ -1,14 +1,15 @@
|
|
|
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 _SDBF6KIYcjs = require('../__chunks/SDBF6KIY.cjs');
|
|
4
|
+
require('../__chunks/HEFJPUYD.cjs');
|
|
5
|
+
require('../__chunks/27ZAGOYG.cjs');
|
|
6
|
+
require('../__chunks/6SPJEESB.cjs');
|
|
7
|
+
require('../__chunks/M6ZA7XUP.cjs');
|
|
8
|
+
require('../__chunks/6455U47T.cjs');
|
|
8
9
|
|
|
9
10
|
// src/composite/composite-overflow-store.ts
|
|
10
11
|
function createCompositeOverflowStore(props = {}) {
|
|
11
|
-
return
|
|
12
|
+
return _SDBF6KIYcjs.createPopoverStore.call(void 0, props);
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
|
|
@@ -1,11 +1,12 @@
|
|
|
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 _EUJ6NNA6cjs = require('../__chunks/EUJ6NNA6.cjs');
|
|
4
|
+
require('../__chunks/FXEBKN6G.cjs');
|
|
5
|
+
require('../__chunks/6SPJEESB.cjs');
|
|
6
|
+
require('../__chunks/M6ZA7XUP.cjs');
|
|
7
|
+
require('../__chunks/ZNW4LSWU.cjs');
|
|
8
8
|
require('../__chunks/GDZQUFNP.cjs');
|
|
9
|
+
require('../__chunks/6455U47T.cjs');
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
exports.createCompositeStore =
|
|
12
|
+
exports.createCompositeStore = _EUJ6NNA6cjs.createCompositeStore;
|
|
@@ -25,6 +25,10 @@ export interface CompositeStoreState<T extends Item = Item> extends CollectionSt
|
|
|
25
25
|
* tabindex](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex).
|
|
26
26
|
* DOM focus will remain on the composite element while its items receive
|
|
27
27
|
* virtual focus.
|
|
28
|
+
*
|
|
29
|
+
* Live examples:
|
|
30
|
+
* - [Multi-selectable
|
|
31
|
+
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
28
32
|
* @default false
|
|
29
33
|
*/
|
|
30
34
|
virtualFocus: boolean;
|
|
@@ -32,9 +36,9 @@ export interface CompositeStoreState<T extends Item = Item> extends CollectionSt
|
|
|
32
36
|
* Defines the orientation of the composite widget. If the composite has a
|
|
33
37
|
* single row or column (one-dimensional), the `orientation` value determines
|
|
34
38
|
* which arrow keys can be used to move focus:
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
39
|
+
* - `both`: all arrow keys work.
|
|
40
|
+
* - `horizontal`: only left and right arrow keys work.
|
|
41
|
+
* - `vertical`: only up and down arrow keys work.
|
|
38
42
|
*
|
|
39
43
|
* It doesn't have any effect on two-dimensional composites.
|
|
40
44
|
* @default "both"
|
|
@@ -52,27 +56,27 @@ export interface CompositeStoreState<T extends Item = Item> extends CollectionSt
|
|
|
52
56
|
* composite widget.
|
|
53
57
|
*
|
|
54
58
|
* On one-dimensional composites:
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
59
|
+
* - `true` loops from the last item to the first item and vice-versa.
|
|
60
|
+
* - `horizontal` loops only if `orientation` is `horizontal` or not set.
|
|
61
|
+
* - `vertical` loops only if `orientation` is `vertical` or not set.
|
|
62
|
+
* - If `includesBaseElement` is set to `true` (or `activeId` is initially set
|
|
63
|
+
* to `null`), the composite element will be focused in between the last and
|
|
64
|
+
* first items.
|
|
61
65
|
*
|
|
62
66
|
* On two-dimensional composites (when using `CompositeRow`):
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
67
|
+
* - `true` loops from the last row/column item to the first item in the same
|
|
68
|
+
* row/column and vice-versa. If it's the last item in the last row, it
|
|
69
|
+
* moves to the first item in the first row and vice-versa.
|
|
70
|
+
* - `horizontal` loops only from the last row item to the first item in the
|
|
71
|
+
* same row.
|
|
72
|
+
* - `vertical` loops only from the last column item to the first item in the
|
|
73
|
+
* column row.
|
|
74
|
+
* - If `includesBaseElement` is set to `true` (or `activeId` is initially set
|
|
75
|
+
* to `null`), vertical loop will have no effect as moving down from the
|
|
76
|
+
* last row or up from the first row will focus the composite element.
|
|
77
|
+
* - If `focusWrap` matches the value of `focusLoop`, it'll wrap between the
|
|
78
|
+
* last item in the last row or column and the first item in the first row
|
|
79
|
+
* or column and vice-versa.
|
|
76
80
|
* @default false
|
|
77
81
|
*/
|
|
78
82
|
focusLoop: boolean | Orientation;
|
|
@@ -80,12 +84,12 @@ export interface CompositeStoreState<T extends Item = Item> extends CollectionSt
|
|
|
80
84
|
* **Works only on two-dimensional composites**. If enabled, moving to the
|
|
81
85
|
* next item from the last one in a row or column will focus the first item in
|
|
82
86
|
* the next row or column and vice-versa.
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
87
|
+
* - `true` wraps between rows and columns.
|
|
88
|
+
* - `horizontal` wraps only between rows.
|
|
89
|
+
* - `vertical` wraps only between columns.
|
|
90
|
+
* - If `focusLoop` matches the value of `focusWrap`, it'll wrap between the
|
|
91
|
+
* last item in the last row or column and the first item in the first row
|
|
92
|
+
* or column and vice-versa.
|
|
89
93
|
* @default false
|
|
90
94
|
*/
|
|
91
95
|
focusWrap: boolean | Orientation;
|
|
@@ -108,12 +112,12 @@ export interface CompositeStoreState<T extends Item = Item> extends CollectionSt
|
|
|
108
112
|
includesBaseElement: boolean;
|
|
109
113
|
/**
|
|
110
114
|
* The current focused item `id`.
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
115
|
+
* - `null` focuses the base composite element and users will be able to
|
|
116
|
+
* navigate out of it using arrow keys.
|
|
117
|
+
* - If `activeId` is initially set to `null`, the `includesBaseElement` prop
|
|
118
|
+
* will also default to `true`, which means the base composite element
|
|
119
|
+
* itself will have focus and users will be able to navigate to it using
|
|
120
|
+
* arrow keys.
|
|
117
121
|
*/
|
|
118
122
|
activeId: string | null | undefined;
|
|
119
123
|
}
|
|
@@ -1,9 +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/
|
|
3
|
+
var _HEFJPUYDcjs = require('../__chunks/HEFJPUYD.cjs');
|
|
4
|
+
require('../__chunks/27ZAGOYG.cjs');
|
|
5
|
+
require('../__chunks/6SPJEESB.cjs');
|
|
6
|
+
require('../__chunks/M6ZA7XUP.cjs');
|
|
7
|
+
require('../__chunks/6455U47T.cjs');
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
exports.createDialogStore =
|
|
10
|
+
exports.createDialogStore = _HEFJPUYDcjs.createDialogStore;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../__chunks/
|
|
5
|
-
require('../__chunks/
|
|
3
|
+
var _27ZAGOYGcjs = require('../__chunks/27ZAGOYG.cjs');
|
|
4
|
+
require('../__chunks/6SPJEESB.cjs');
|
|
5
|
+
require('../__chunks/M6ZA7XUP.cjs');
|
|
6
|
+
require('../__chunks/6455U47T.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
exports.createDisclosureStore =
|
|
9
|
+
exports.createDisclosureStore = _27ZAGOYGcjs.createDisclosureStore;
|
|
@@ -7,6 +7,10 @@ export declare function createDisclosureStore(props?: DisclosureStoreProps): Dis
|
|
|
7
7
|
export interface DisclosureStoreState {
|
|
8
8
|
/**
|
|
9
9
|
* The visibility state of the content.
|
|
10
|
+
*
|
|
11
|
+
* Live examples:
|
|
12
|
+
* - [Dialog with React
|
|
13
|
+
* Router](https://ariakit.org/examples/dialog-react-router)
|
|
10
14
|
* @default false
|
|
11
15
|
*/
|
|
12
16
|
open: boolean;
|
|
@@ -15,16 +19,26 @@ export interface DisclosureStoreState {
|
|
|
15
19
|
* this will be the same as `open`. Otherwise, it will wait for the animation
|
|
16
20
|
* to complete before becoming `false` so the content is not unmounted while
|
|
17
21
|
* animating.
|
|
22
|
+
*
|
|
23
|
+
* Live examples:
|
|
24
|
+
* - [Combobox with links](https://ariakit.org/examples/combobox-links)
|
|
25
|
+
* - [Textarea with inline
|
|
26
|
+
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
18
27
|
*/
|
|
19
28
|
mounted: boolean;
|
|
20
29
|
/**
|
|
21
30
|
* Determines whether the content should animate when it is shown or hidden.
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
31
|
+
* - If `true`, the `animating` state will be `true` when the content is shown
|
|
32
|
+
* or hidden and it will wait for `stopAnimation` to be called or a CSS
|
|
33
|
+
* animation/transition to end before becoming `false`.
|
|
34
|
+
* - If it's set to a number, the `animating` state will be `true` when the
|
|
35
|
+
* content is shown or hidden and it will wait for the number of
|
|
36
|
+
* milliseconds to pass before becoming `false`.
|
|
37
|
+
*
|
|
38
|
+
* Live examples:
|
|
39
|
+
* - [Animated Combobox](https://ariakit.org/examples/combobox-animated)
|
|
40
|
+
* - [Animated Dialog](https://ariakit.org/examples/dialog-animated)
|
|
41
|
+
* - [Animated Select](https://ariakit.org/examples/select-animated)
|
|
28
42
|
* @default false
|
|
29
43
|
*/
|
|
30
44
|
animated: boolean | number;
|
|
@@ -44,6 +58,12 @@ export interface DisclosureStoreState {
|
|
|
44
58
|
export interface DisclosureStoreFunctions {
|
|
45
59
|
/**
|
|
46
60
|
* Sets the `open` state.
|
|
61
|
+
*
|
|
62
|
+
* Live examples:
|
|
63
|
+
* - [Textarea with inline
|
|
64
|
+
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
65
|
+
* - [Dialog with React
|
|
66
|
+
* Router](https://ariakit.org/examples/dialog-react-router)
|
|
47
67
|
* @example
|
|
48
68
|
* store.setOpen(true);
|
|
49
69
|
* store.setOpen((open) => !open);
|
|
@@ -51,10 +71,20 @@ export interface DisclosureStoreFunctions {
|
|
|
51
71
|
setOpen: SetState<DisclosureStoreState["open"]>;
|
|
52
72
|
/**
|
|
53
73
|
* Sets the `open` state to `true`.
|
|
74
|
+
*
|
|
75
|
+
* Live examples:
|
|
76
|
+
* - [Textarea with inline
|
|
77
|
+
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
54
78
|
*/
|
|
55
79
|
show: () => void;
|
|
56
80
|
/**
|
|
57
81
|
* Sets the `open` state to `false`.
|
|
82
|
+
*
|
|
83
|
+
* Live examples:
|
|
84
|
+
* - [Textarea with inline
|
|
85
|
+
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
86
|
+
* - [Dialog with React
|
|
87
|
+
* Router](https://ariakit.org/examples/dialog-react-router)
|
|
58
88
|
*/
|
|
59
89
|
hide: () => void;
|
|
60
90
|
/**
|