@ariakit/core 0.4.18 → 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 +5 -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/{JNPL5IHP.cjs → G2CSOTWZ.cjs} +7 -7
- package/cjs/__chunks/{4ITB54IT.cjs → I4CBIWTX.cjs} +2 -3
- package/cjs/__chunks/{JNYCP2QO.cjs → LS2SNHDM.cjs} +6 -6
- package/cjs/__chunks/{UROTDZFK.cjs → R37KOEUW.cjs} +10 -10
- package/cjs/__chunks/{OYTZFOIJ.cjs → UGAVMSQJ.cjs} +18 -18
- package/cjs/__chunks/{HGVIF2R4.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 +12 -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/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/{3DNM6L6E.js → G7XPWBXK.js} +1 -2
- package/esm/__chunks/{SNHYQNEZ.js → GMGLSF2B.js} +1 -1
- package/esm/__chunks/{WSDJ6ZRB.js → H7R2CY4Q.js} +3 -3
- package/esm/__chunks/{75BJEVSH.js → IHNLLH3I.js} +2 -2
- package/esm/__chunks/{N5XGANPW.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/{RVTIKFRL.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 +2 -3
- 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
package/cjs/tab/tab-store.d.ts
CHANGED
|
@@ -21,12 +21,12 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
|
|
|
21
21
|
* will be automatically set to the first enabled tab.
|
|
22
22
|
*
|
|
23
23
|
* Live examples:
|
|
24
|
-
* - [Tab with React Router](https://ariakit.
|
|
25
|
-
* - [Combobox with Tabs](https://ariakit.
|
|
24
|
+
* - [Tab with React Router](https://ariakit.com/examples/tab-react-router)
|
|
25
|
+
* - [Combobox with Tabs](https://ariakit.com/examples/combobox-tabs)
|
|
26
26
|
* - [Select with Combobox and
|
|
27
|
-
* Tabs](https://ariakit.
|
|
27
|
+
* Tabs](https://ariakit.com/examples/select-combobox-tab)
|
|
28
28
|
* - [Command Menu with
|
|
29
|
-
* Tabs](https://ariakit.
|
|
29
|
+
* Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)
|
|
30
30
|
*/
|
|
31
31
|
selectedId: TabStoreState["activeId"];
|
|
32
32
|
/**
|
|
@@ -35,9 +35,9 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
|
|
|
35
35
|
* keys to shift focus.
|
|
36
36
|
*
|
|
37
37
|
* Live examples:
|
|
38
|
-
* - [Tab with React Router](https://ariakit.
|
|
38
|
+
* - [Tab with React Router](https://ariakit.com/examples/tab-react-router)
|
|
39
39
|
* - [Select with Combobox and
|
|
40
|
-
* Tabs](https://ariakit.
|
|
40
|
+
* Tabs](https://ariakit.com/examples/select-combobox-tab)
|
|
41
41
|
* @default true
|
|
42
42
|
*/
|
|
43
43
|
selectOnMove?: boolean;
|
|
@@ -45,9 +45,9 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
|
|
|
45
45
|
export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem> {
|
|
46
46
|
/**
|
|
47
47
|
* Sets the
|
|
48
|
-
* [`selectedId`](https://ariakit.
|
|
48
|
+
* [`selectedId`](https://ariakit.com/reference/tab-provider#selectedid) state
|
|
49
49
|
* without moving focus. If you want to move focus, use the
|
|
50
|
-
* [`select`](https://ariakit.
|
|
50
|
+
* [`select`](https://ariakit.com/reference/use-tab-store#select) function
|
|
51
51
|
* instead.
|
|
52
52
|
* @example
|
|
53
53
|
* // Selects the tab with id "tab-1"
|
|
@@ -64,14 +64,14 @@ export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem>
|
|
|
64
64
|
* A collection store containing the tab panels.
|
|
65
65
|
*
|
|
66
66
|
* Live examples:
|
|
67
|
-
* - [Animated TabPanel](https://ariakit.
|
|
67
|
+
* - [Animated TabPanel](https://ariakit.com/examples/tab-panel-animated)
|
|
68
68
|
*/
|
|
69
69
|
panels: CollectionStore<TabStorePanel>;
|
|
70
70
|
/**
|
|
71
71
|
* Selects the tab for the given id and moves focus to it. If you want to set
|
|
72
|
-
* the [`selectedId`](https://ariakit.
|
|
72
|
+
* the [`selectedId`](https://ariakit.com/reference/tab-provider#selectedid)
|
|
73
73
|
* state without moving focus, use the
|
|
74
|
-
* [`setSelectedId`](https://ariakit.
|
|
74
|
+
* [`setSelectedId`](https://ariakit.com/reference/use-tab-store#setselectedid-1)
|
|
75
75
|
* function instead.
|
|
76
76
|
* @example
|
|
77
77
|
* // Selects the tab with id "tab-1"
|
|
@@ -86,18 +86,18 @@ export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem>
|
|
|
86
86
|
export interface TabStoreOptions extends StoreOptions<TabStoreState, "orientation" | "focusLoop" | "selectedId" | "selectOnMove">, CompositeStoreOptions<TabStoreItem> {
|
|
87
87
|
/**
|
|
88
88
|
* A reference to another [composite
|
|
89
|
-
* store](https://ariakit.
|
|
89
|
+
* store](https://ariakit.com/reference/use-composite-store). This is used when
|
|
90
90
|
* rendering tabs as part of another composite widget such as
|
|
91
|
-
* [Combobox](https://ariakit.
|
|
92
|
-
* [Select](https://ariakit.
|
|
91
|
+
* [Combobox](https://ariakit.com/components/combobox) or
|
|
92
|
+
* [Select](https://ariakit.com/components/select). The stores will share the
|
|
93
93
|
* same state.
|
|
94
94
|
*/
|
|
95
95
|
composite?: CompositeStore | SelectStore | null;
|
|
96
96
|
/**
|
|
97
97
|
* A reference to a [combobox
|
|
98
|
-
* store](https://ariakit.
|
|
98
|
+
* store](https://ariakit.com/reference/use-combobox-store). This is used when
|
|
99
99
|
* rendering tabs inside a
|
|
100
|
-
* [Combobox](https://ariakit.
|
|
100
|
+
* [Combobox](https://ariakit.com/components/combobox).
|
|
101
101
|
*/
|
|
102
102
|
combobox?: ComboboxStore | null;
|
|
103
103
|
/**
|
|
@@ -105,12 +105,12 @@ export interface TabStoreOptions extends StoreOptions<TabStoreState, "orientatio
|
|
|
105
105
|
* will be automatically set to the first enabled tab.
|
|
106
106
|
*
|
|
107
107
|
* Live examples:
|
|
108
|
-
* - [Combobox with Tabs](https://ariakit.
|
|
109
|
-
* - [Animated TabPanel](https://ariakit.
|
|
108
|
+
* - [Combobox with Tabs](https://ariakit.com/examples/combobox-tabs)
|
|
109
|
+
* - [Animated TabPanel](https://ariakit.com/examples/tab-panel-animated)
|
|
110
110
|
* - [Select with Combobox and
|
|
111
|
-
* Tabs](https://ariakit.
|
|
111
|
+
* Tabs](https://ariakit.com/examples/select-combobox-tab)
|
|
112
112
|
* - [Command Menu with
|
|
113
|
-
* Tabs](https://ariakit.
|
|
113
|
+
* Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)
|
|
114
114
|
*/
|
|
115
115
|
defaultSelectedId?: TabStoreState["selectedId"];
|
|
116
116
|
}
|
package/cjs/tag/tag-store.cjs
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _CTEQSOKZcjs = require('../__chunks/CTEQSOKZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _UGAVMSQJcjs = require('../__chunks/UGAVMSQJ.cjs');
|
|
7
7
|
require('../__chunks/GDZQUFNP.cjs');
|
|
8
|
-
require('../__chunks/
|
|
9
|
-
require('../__chunks/
|
|
8
|
+
require('../__chunks/VC22SYOD.cjs');
|
|
9
|
+
require('../__chunks/I4CBIWTX.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _WMTGHDLEcjs = require('../__chunks/WMTGHDLE.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _4TRESXTOcjs = require('../__chunks/4TRESXTO.cjs');
|
|
19
19
|
|
|
20
20
|
// src/tag/tag-store.ts
|
|
21
21
|
function createTagStore(props = {}) {
|
|
22
22
|
var _a;
|
|
23
23
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
24
|
-
const composite =
|
|
24
|
+
const composite = _UGAVMSQJcjs.createCompositeStore.call(void 0, props);
|
|
25
25
|
const initialState = {
|
|
26
26
|
...composite.getState(),
|
|
27
|
-
inputElement:
|
|
28
|
-
labelElement:
|
|
29
|
-
value:
|
|
30
|
-
values:
|
|
27
|
+
inputElement: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.inputElement, null),
|
|
28
|
+
labelElement: _4TRESXTOcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.labelElement, null),
|
|
29
|
+
value: _4TRESXTOcjs.defaultValue.call(void 0, props.value, syncState == null ? void 0 : syncState.value, props.defaultValue, ""),
|
|
30
|
+
values: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
31
31
|
props.values,
|
|
32
32
|
syncState == null ? void 0 : syncState.values,
|
|
33
33
|
props.defaultValues,
|
|
34
34
|
[]
|
|
35
35
|
)
|
|
36
36
|
};
|
|
37
|
-
const tag =
|
|
38
|
-
|
|
37
|
+
const tag = _WMTGHDLEcjs.createStore.call(void 0, initialState, composite, props.store);
|
|
38
|
+
_WMTGHDLEcjs.setup.call(void 0,
|
|
39
39
|
tag,
|
|
40
|
-
() =>
|
|
40
|
+
() => _WMTGHDLEcjs.sync.call(void 0, tag, ["inputElement", "activeId"], (state) => {
|
|
41
41
|
if (!state.inputElement) return;
|
|
42
42
|
if (state.activeId !== void 0) return;
|
|
43
43
|
tag.setState("activeId", state.inputElement.id);
|
|
@@ -45,10 +45,10 @@ function createTagStore(props = {}) {
|
|
|
45
45
|
);
|
|
46
46
|
const setValues = (values) => {
|
|
47
47
|
const { values: previousValues } = tag.getState();
|
|
48
|
-
|
|
48
|
+
void _CTEQSOKZcjs.UndoManager.execute(() => {
|
|
49
49
|
let changed = true;
|
|
50
50
|
tag.setState("values", (prev) => {
|
|
51
|
-
const next =
|
|
51
|
+
const next = _4TRESXTOcjs.applyState.call(void 0, values, prev);
|
|
52
52
|
if (next === prev) {
|
|
53
53
|
changed = false;
|
|
54
54
|
}
|
package/cjs/tag/tag-store.d.cts
CHANGED
|
@@ -38,27 +38,27 @@ export interface TagStoreFunctions extends CompositeStoreFunctions<TagStoreItem>
|
|
|
38
38
|
*/
|
|
39
39
|
setLabelElement: SetState<TagStoreState["labelElement"]>;
|
|
40
40
|
/**
|
|
41
|
-
* Sets the [`value`](https://ariakit.
|
|
41
|
+
* Sets the [`value`](https://ariakit.com/reference/tag-provider#value) state.
|
|
42
42
|
*/
|
|
43
43
|
setValue: SetState<TagStoreState["value"]>;
|
|
44
44
|
/**
|
|
45
|
-
* Resets the [`value`](https://ariakit.
|
|
45
|
+
* Resets the [`value`](https://ariakit.com/reference/tag-provider#value)
|
|
46
46
|
* state to its initial value.
|
|
47
47
|
*/
|
|
48
48
|
resetValue: () => void;
|
|
49
49
|
/**
|
|
50
|
-
* Sets the [`values`](https://ariakit.
|
|
50
|
+
* Sets the [`values`](https://ariakit.com/reference/tag-provider#values) state.
|
|
51
51
|
*/
|
|
52
52
|
setValues: SetState<TagStoreState["values"]>;
|
|
53
53
|
/**
|
|
54
54
|
* Add a new value to the
|
|
55
|
-
* [`values`](https://ariakit.
|
|
55
|
+
* [`values`](https://ariakit.com/reference/tag-provider#values) state if it
|
|
56
56
|
* doesn't already exist.
|
|
57
57
|
*/
|
|
58
58
|
addValue: (value: string) => void;
|
|
59
59
|
/**
|
|
60
60
|
* Remove a value from the
|
|
61
|
-
* [`values`](https://ariakit.
|
|
61
|
+
* [`values`](https://ariakit.com/reference/tag-provider#values) state.
|
|
62
62
|
*/
|
|
63
63
|
removeValue: (value: string) => void;
|
|
64
64
|
}
|
package/cjs/tag/tag-store.d.ts
CHANGED
|
@@ -38,27 +38,27 @@ export interface TagStoreFunctions extends CompositeStoreFunctions<TagStoreItem>
|
|
|
38
38
|
*/
|
|
39
39
|
setLabelElement: SetState<TagStoreState["labelElement"]>;
|
|
40
40
|
/**
|
|
41
|
-
* Sets the [`value`](https://ariakit.
|
|
41
|
+
* Sets the [`value`](https://ariakit.com/reference/tag-provider#value) state.
|
|
42
42
|
*/
|
|
43
43
|
setValue: SetState<TagStoreState["value"]>;
|
|
44
44
|
/**
|
|
45
|
-
* Resets the [`value`](https://ariakit.
|
|
45
|
+
* Resets the [`value`](https://ariakit.com/reference/tag-provider#value)
|
|
46
46
|
* state to its initial value.
|
|
47
47
|
*/
|
|
48
48
|
resetValue: () => void;
|
|
49
49
|
/**
|
|
50
|
-
* Sets the [`values`](https://ariakit.
|
|
50
|
+
* Sets the [`values`](https://ariakit.com/reference/tag-provider#values) state.
|
|
51
51
|
*/
|
|
52
52
|
setValues: SetState<TagStoreState["values"]>;
|
|
53
53
|
/**
|
|
54
54
|
* Add a new value to the
|
|
55
|
-
* [`values`](https://ariakit.
|
|
55
|
+
* [`values`](https://ariakit.com/reference/tag-provider#values) state if it
|
|
56
56
|
* doesn't already exist.
|
|
57
57
|
*/
|
|
58
58
|
addValue: (value: string) => void;
|
|
59
59
|
/**
|
|
60
60
|
* Remove a value from the
|
|
61
|
-
* [`values`](https://ariakit.
|
|
61
|
+
* [`values`](https://ariakit.com/reference/tag-provider#values) state.
|
|
62
62
|
*/
|
|
63
63
|
removeValue: (value: string) => void;
|
|
64
64
|
}
|
|
@@ -1,26 +1,26 @@
|
|
|
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/
|
|
7
|
-
require('../__chunks/
|
|
5
|
+
require('../__chunks/VC22SYOD.cjs');
|
|
6
|
+
require('../__chunks/I4CBIWTX.cjs');
|
|
7
|
+
require('../__chunks/WMTGHDLE.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _4TRESXTOcjs = require('../__chunks/4TRESXTO.cjs');
|
|
11
11
|
|
|
12
12
|
// src/toolbar/toolbar-store.ts
|
|
13
13
|
function createToolbarStore(props = {}) {
|
|
14
14
|
var _a;
|
|
15
15
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
16
|
-
return
|
|
16
|
+
return _UGAVMSQJcjs.createCompositeStore.call(void 0, {
|
|
17
17
|
...props,
|
|
18
|
-
orientation:
|
|
18
|
+
orientation: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
19
19
|
props.orientation,
|
|
20
20
|
syncState == null ? void 0 : syncState.orientation,
|
|
21
21
|
"horizontal"
|
|
22
22
|
),
|
|
23
|
-
focusLoop:
|
|
23
|
+
focusLoop: _4TRESXTOcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -1,15 +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/
|
|
3
|
+
var _R37KOEUWcjs = require('../__chunks/R37KOEUW.cjs');
|
|
4
|
+
require('../__chunks/75F3RDBE.cjs');
|
|
5
|
+
require('../__chunks/CVLMIMPT.cjs');
|
|
6
|
+
require('../__chunks/2RUCRSRF.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/tooltip/tooltip-store.ts
|
|
15
15
|
function createTooltipStore(props = {}) {
|
|
@@ -19,26 +19,26 @@ function createTooltipStore(props = {}) {
|
|
|
19
19
|
console.warn(
|
|
20
20
|
"The `type` option on the tooltip store is deprecated.",
|
|
21
21
|
"Render a visually hidden label or use the `aria-label` or `aria-labelledby` attributes on the anchor element instead.",
|
|
22
|
-
"See https://ariakit.
|
|
22
|
+
"See https://ariakit.com/components/tooltip#tooltip-anchors-must-have-accessible-names"
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
27
|
-
const hovercard =
|
|
27
|
+
const hovercard = _R37KOEUWcjs.createHovercardStore.call(void 0, {
|
|
28
28
|
...props,
|
|
29
|
-
placement:
|
|
29
|
+
placement: _4TRESXTOcjs.defaultValue.call(void 0,
|
|
30
30
|
props.placement,
|
|
31
31
|
syncState == null ? void 0 : syncState.placement,
|
|
32
32
|
"top"
|
|
33
33
|
),
|
|
34
|
-
hideTimeout:
|
|
34
|
+
hideTimeout: _4TRESXTOcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0)
|
|
35
35
|
});
|
|
36
36
|
const initialState = {
|
|
37
37
|
...hovercard.getState(),
|
|
38
|
-
type:
|
|
39
|
-
skipTimeout:
|
|
38
|
+
type: _4TRESXTOcjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
|
|
39
|
+
skipTimeout: _4TRESXTOcjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
|
|
40
40
|
};
|
|
41
|
-
const tooltip =
|
|
41
|
+
const tooltip = _WMTGHDLEcjs.createStore.call(void 0, initialState, hovercard, props.store);
|
|
42
42
|
return {
|
|
43
43
|
...hovercard,
|
|
44
44
|
...tooltip
|
package/cjs/utils/dom.cjs
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _I4CBIWTXcjs = require('../__chunks/I4CBIWTX.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -39,4 +39,4 @@ var _4ITB54ITcjs = require('../__chunks/4ITB54IT.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
exports.canUseDOM =
|
|
42
|
+
exports.canUseDOM = _I4CBIWTXcjs.canUseDOM; exports.contains = _I4CBIWTXcjs.contains; exports.getActiveElement = _I4CBIWTXcjs.getActiveElement; exports.getDocument = _I4CBIWTXcjs.getDocument; exports.getPopupItemRole = _I4CBIWTXcjs.getPopupItemRole; exports.getPopupRole = _I4CBIWTXcjs.getPopupRole; exports.getScrollingElement = _I4CBIWTXcjs.getScrollingElement; exports.getTextboxSelection = _I4CBIWTXcjs.getTextboxSelection; exports.getTextboxValue = _I4CBIWTXcjs.getTextboxValue; exports.getWindow = _I4CBIWTXcjs.getWindow; exports.isButton = _I4CBIWTXcjs.isButton; exports.isFrame = _I4CBIWTXcjs.isFrame; exports.isPartiallyHidden = _I4CBIWTXcjs.isPartiallyHidden; exports.isTextField = _I4CBIWTXcjs.isTextField; exports.isTextbox = _I4CBIWTXcjs.isTextbox; exports.isVisible = _I4CBIWTXcjs.isVisible; exports.scrollIntoViewIfNeeded = _I4CBIWTXcjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _I4CBIWTXcjs.setSelectionRange; exports.sortBasedOnDOMPosition = _I4CBIWTXcjs.sortBasedOnDOMPosition;
|
package/cjs/utils/events.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _LS2SNHDMcjs = require('../__chunks/LS2SNHDM.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _I4CBIWTXcjs = require('../__chunks/I4CBIWTX.cjs');
|
|
7
7
|
|
|
8
8
|
// src/utils/events.ts
|
|
9
9
|
function isPortalEvent(event) {
|
|
10
10
|
return Boolean(
|
|
11
|
-
event.currentTarget && !
|
|
11
|
+
event.currentTarget && !_I4CBIWTXcjs.contains.call(void 0, event.currentTarget, event.target)
|
|
12
12
|
);
|
|
13
13
|
}
|
|
14
14
|
function isSelfTarget(event) {
|
|
@@ -17,7 +17,7 @@ function isSelfTarget(event) {
|
|
|
17
17
|
function isOpeningInNewTab(event) {
|
|
18
18
|
const element = event.currentTarget;
|
|
19
19
|
if (!element) return false;
|
|
20
|
-
const isAppleDevice =
|
|
20
|
+
const isAppleDevice = _LS2SNHDMcjs.isApple.call(void 0, );
|
|
21
21
|
if (isAppleDevice && !event.metaKey) return false;
|
|
22
22
|
if (!isAppleDevice && !event.ctrlKey) return false;
|
|
23
23
|
const tagName = element.tagName.toLowerCase();
|
|
@@ -65,7 +65,7 @@ function fireClickEvent(element, eventInit) {
|
|
|
65
65
|
function isFocusEventOutside(event, container) {
|
|
66
66
|
const containerElement = container || event.currentTarget;
|
|
67
67
|
const relatedTarget = event.relatedTarget;
|
|
68
|
-
return !relatedTarget || !
|
|
68
|
+
return !relatedTarget || !_I4CBIWTXcjs.contains.call(void 0, containerElement, relatedTarget);
|
|
69
69
|
}
|
|
70
70
|
function getInputType(event) {
|
|
71
71
|
const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event;
|
|
@@ -106,7 +106,7 @@ function addGlobalEventListener(type, listener, options, scope = window) {
|
|
|
106
106
|
const removeEventListener = () => {
|
|
107
107
|
try {
|
|
108
108
|
scope.document.removeEventListener(type, listener, options);
|
|
109
|
-
} catch (
|
|
109
|
+
} catch (e2) {
|
|
110
110
|
}
|
|
111
111
|
for (const remove of children) {
|
|
112
112
|
remove();
|
package/cjs/utils/focus.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _I4CBIWTXcjs = require('../__chunks/I4CBIWTX.cjs');
|
|
7
7
|
|
|
8
8
|
// src/utils/focus.ts
|
|
9
9
|
var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
|
|
@@ -13,7 +13,7 @@ function hasNegativeTabIndex(element) {
|
|
|
13
13
|
}
|
|
14
14
|
function isFocusable(element) {
|
|
15
15
|
if (!element.matches(selector)) return false;
|
|
16
|
-
if (!
|
|
16
|
+
if (!_I4CBIWTXcjs.isVisible.call(void 0, element)) return false;
|
|
17
17
|
if (element.closest("[inert]")) return false;
|
|
18
18
|
return true;
|
|
19
19
|
}
|
|
@@ -27,7 +27,7 @@ function isTabbable(element) {
|
|
|
27
27
|
const radioGroup = element.form.elements.namedItem(element.name);
|
|
28
28
|
if (!radioGroup) return true;
|
|
29
29
|
if (!("length" in radioGroup)) return true;
|
|
30
|
-
const activeElement =
|
|
30
|
+
const activeElement = _I4CBIWTXcjs.getActiveElement.call(void 0, element);
|
|
31
31
|
if (!activeElement) return true;
|
|
32
32
|
if (activeElement === element) return true;
|
|
33
33
|
if (!("form" in activeElement)) return true;
|
|
@@ -45,7 +45,7 @@ function getAllFocusableIn(container, includeContainer) {
|
|
|
45
45
|
const focusableElements = elements.filter(isFocusable);
|
|
46
46
|
focusableElements.forEach((element, i) => {
|
|
47
47
|
var _a;
|
|
48
|
-
if (!
|
|
48
|
+
if (!_I4CBIWTXcjs.isFrame.call(void 0, element)) return;
|
|
49
49
|
const frameBody = (_a = element.contentDocument) == null ? void 0 : _a.body;
|
|
50
50
|
if (!frameBody) return;
|
|
51
51
|
focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
|
|
@@ -72,7 +72,7 @@ function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
|
|
|
72
72
|
}
|
|
73
73
|
tabbableElements.forEach((element, i) => {
|
|
74
74
|
var _a;
|
|
75
|
-
if (!
|
|
75
|
+
if (!_I4CBIWTXcjs.isFrame.call(void 0, element)) return;
|
|
76
76
|
const frameBody = (_a = element.contentDocument) == null ? void 0 : _a.body;
|
|
77
77
|
if (!frameBody) return;
|
|
78
78
|
const allFrameTabbable = getAllTabbableIn(
|
|
@@ -113,7 +113,7 @@ function getLastTabbable(fallbackToFocusable) {
|
|
|
113
113
|
return getLastTabbableIn(document.body, false, fallbackToFocusable);
|
|
114
114
|
}
|
|
115
115
|
function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) {
|
|
116
|
-
const activeElement =
|
|
116
|
+
const activeElement = _I4CBIWTXcjs.getActiveElement.call(void 0, container);
|
|
117
117
|
const allFocusable = getAllFocusableIn(container, includeContainer);
|
|
118
118
|
const activeIndex = allFocusable.indexOf(activeElement);
|
|
119
119
|
const nextFocusableElements = allFocusable.slice(activeIndex + 1);
|
|
@@ -128,7 +128,7 @@ function getNextTabbable(fallbackToFirst, fallbackToFocusable) {
|
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
130
|
function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) {
|
|
131
|
-
const activeElement =
|
|
131
|
+
const activeElement = _I4CBIWTXcjs.getActiveElement.call(void 0, container);
|
|
132
132
|
const allFocusable = getAllFocusableIn(container, includeContainer).reverse();
|
|
133
133
|
const activeIndex = allFocusable.indexOf(activeElement);
|
|
134
134
|
const previousFocusableElements = allFocusable.slice(activeIndex + 1);
|
|
@@ -149,7 +149,7 @@ function getClosestFocusable(element) {
|
|
|
149
149
|
return element || null;
|
|
150
150
|
}
|
|
151
151
|
function hasFocus(element) {
|
|
152
|
-
const activeElement =
|
|
152
|
+
const activeElement = _I4CBIWTXcjs.getActiveElement.call(void 0, element);
|
|
153
153
|
if (!activeElement) return false;
|
|
154
154
|
if (activeElement === element) return true;
|
|
155
155
|
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
|
|
@@ -157,9 +157,9 @@ function hasFocus(element) {
|
|
|
157
157
|
return activeDescendant === element.id;
|
|
158
158
|
}
|
|
159
159
|
function hasFocusWithin(element) {
|
|
160
|
-
const activeElement =
|
|
160
|
+
const activeElement = _I4CBIWTXcjs.getActiveElement.call(void 0, element);
|
|
161
161
|
if (!activeElement) return false;
|
|
162
|
-
if (
|
|
162
|
+
if (_I4CBIWTXcjs.contains.call(void 0, element, activeElement)) return true;
|
|
163
163
|
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
|
|
164
164
|
if (!activeDescendant) return false;
|
|
165
165
|
if (!("id" in element)) return false;
|
|
@@ -172,8 +172,7 @@ function focusIfNeeded(element) {
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
function disableFocus(element) {
|
|
175
|
-
|
|
176
|
-
const currentTabindex = (_a = element.getAttribute("tabindex")) != null ? _a : "";
|
|
175
|
+
const currentTabindex = _nullishCoalesce(element.getAttribute("tabindex"), () => ( ""));
|
|
177
176
|
element.setAttribute("data-tabindex", currentTabindex);
|
|
178
177
|
element.setAttribute("tabindex", "-1");
|
|
179
178
|
}
|
package/cjs/utils/misc.cjs
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var _6BYUUR4Mcjs = require('../__chunks/6BYUUR4M.cjs');
|
|
24
23
|
|
|
24
|
+
var _4TRESXTOcjs = require('../__chunks/4TRESXTO.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -43,4 +43,6 @@ var _6BYUUR4Mcjs = require('../__chunks/6BYUUR4M.cjs');
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
exports.afterPaint = _4TRESXTOcjs.afterPaint; exports.applyState = _4TRESXTOcjs.applyState; exports.beforePaint = _4TRESXTOcjs.beforePaint; exports.chain = _4TRESXTOcjs.chain; exports.cx = _4TRESXTOcjs.cx; exports.defaultValue = _4TRESXTOcjs.defaultValue; exports.disabledFromElement = _4TRESXTOcjs.disabledFromElement; exports.disabledFromProps = _4TRESXTOcjs.disabledFromProps; exports.getKeys = _4TRESXTOcjs.getKeys; exports.hasOwnProperty = _4TRESXTOcjs.hasOwnProperty; exports.identity = _4TRESXTOcjs.identity; exports.invariant = _4TRESXTOcjs.invariant; exports.isEmpty = _4TRESXTOcjs.isEmpty; exports.isFalsyBooleanCallback = _4TRESXTOcjs.isFalsyBooleanCallback; exports.isInteger = _4TRESXTOcjs.isInteger; exports.isObject = _4TRESXTOcjs.isObject; exports.noop = _4TRESXTOcjs.noop; exports.normalizeString = _4TRESXTOcjs.normalizeString; exports.omit = _4TRESXTOcjs.omit; exports.pick = _4TRESXTOcjs.pick; exports.removeUndefinedValues = _4TRESXTOcjs.removeUndefinedValues; exports.shallowEqual = _4TRESXTOcjs.shallowEqual;
|
package/cjs/utils/misc.d.cts
CHANGED
|
@@ -113,6 +113,10 @@ export declare function disabledFromProps(props: {
|
|
|
113
113
|
disabled?: boolean;
|
|
114
114
|
"aria-disabled"?: boolean | "true" | "false";
|
|
115
115
|
}): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Checks whether something is disabled or not based on its DOM attributes.
|
|
118
|
+
*/
|
|
119
|
+
export declare function disabledFromElement(element: Element): boolean;
|
|
116
120
|
/**
|
|
117
121
|
* Removes undefined values from an object.
|
|
118
122
|
*/
|
package/cjs/utils/misc.d.ts
CHANGED
|
@@ -113,6 +113,10 @@ export declare function disabledFromProps(props: {
|
|
|
113
113
|
disabled?: boolean;
|
|
114
114
|
"aria-disabled"?: boolean | "true" | "false";
|
|
115
115
|
}): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Checks whether something is disabled or not based on its DOM attributes.
|
|
118
|
+
*/
|
|
119
|
+
export declare function disabledFromElement(element: Element): boolean;
|
|
116
120
|
/**
|
|
117
121
|
* Removes undefined values from an object.
|
|
118
122
|
*/
|
package/cjs/utils/platform.cjs
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('../__chunks/
|
|
7
|
+
var _LS2SNHDMcjs = require('../__chunks/LS2SNHDM.cjs');
|
|
8
|
+
require('../__chunks/I4CBIWTX.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
exports.isApple =
|
|
15
|
+
exports.isApple = _LS2SNHDMcjs.isApple; exports.isFirefox = _LS2SNHDMcjs.isFirefox; exports.isMac = _LS2SNHDMcjs.isMac; exports.isSafari = _LS2SNHDMcjs.isSafari; exports.isTouchDevice = _LS2SNHDMcjs.isTouchDevice;
|
package/cjs/utils/store.cjs
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('../__chunks/
|
|
12
|
+
var _WMTGHDLEcjs = require('../__chunks/WMTGHDLE.cjs');
|
|
13
|
+
require('../__chunks/4TRESXTO.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -22,4 +22,4 @@ require('../__chunks/6BYUUR4M.cjs');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
exports.batch =
|
|
25
|
+
exports.batch = _WMTGHDLEcjs.batch; exports.createStore = _WMTGHDLEcjs.createStore; exports.init = _WMTGHDLEcjs.init; exports.mergeStore = _WMTGHDLEcjs.mergeStore; exports.omit = _WMTGHDLEcjs.omit; exports.pick = _WMTGHDLEcjs.pick; exports.setup = _WMTGHDLEcjs.setup; exports.subscribe = _WMTGHDLEcjs.subscribe; exports.sync = _WMTGHDLEcjs.sync; exports.throwOnConflictingProps = _WMTGHDLEcjs.throwOnConflictingProps;
|
package/cjs/utils/store.d.cts
CHANGED
|
@@ -48,7 +48,7 @@ export interface StoreProps<S extends State = State> {
|
|
|
48
48
|
* Another store object that will be kept in sync with the original store.
|
|
49
49
|
*
|
|
50
50
|
* Live examples:
|
|
51
|
-
* - [Navigation Menubar](https://ariakit.
|
|
51
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
52
52
|
*/
|
|
53
53
|
store?: Store<Partial<S>>;
|
|
54
54
|
}
|
package/cjs/utils/store.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export interface StoreProps<S extends State = State> {
|
|
|
48
48
|
* Another store object that will be kept in sync with the original store.
|
|
49
49
|
*
|
|
50
50
|
* Live examples:
|
|
51
|
-
* - [Navigation Menubar](https://ariakit.
|
|
51
|
+
* - [Navigation Menubar](https://ariakit.com/examples/menubar-navigation)
|
|
52
52
|
*/
|
|
53
53
|
store?: Store<Partial<S>>;
|
|
54
54
|
}
|
package/cjs/utils/undo.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _CTEQSOKZcjs = require('../__chunks/CTEQSOKZ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.UndoManager =
|
|
8
|
+
exports.UndoManager = _CTEQSOKZcjs.UndoManager; exports.createUndoManager = _CTEQSOKZcjs.createUndoManager;
|
|
@@ -120,7 +120,6 @@ function getPopupRole(element, fallback) {
|
|
|
120
120
|
return fallback;
|
|
121
121
|
}
|
|
122
122
|
function getPopupItemRole(element, fallback) {
|
|
123
|
-
var _a;
|
|
124
123
|
const itemRoleByPopupRole = {
|
|
125
124
|
menu: "menuitem",
|
|
126
125
|
listbox: "option",
|
|
@@ -129,7 +128,7 @@ function getPopupItemRole(element, fallback) {
|
|
|
129
128
|
const popupRole = getPopupRole(element);
|
|
130
129
|
if (!popupRole) return fallback;
|
|
131
130
|
const key = popupRole;
|
|
132
|
-
return
|
|
131
|
+
return itemRoleByPopupRole[key] ?? fallback;
|
|
133
132
|
}
|
|
134
133
|
function scrollIntoViewIfNeeded(element, arg) {
|
|
135
134
|
if (isPartiallyHidden(element) && "scrollIntoView" in element) {
|