@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
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
4
|
+
var _5JEQEZFRcjs = require('../__chunks/5JEQEZFR.cjs');
|
|
5
|
+
require('../__chunks/LTLFSC4X.cjs');
|
|
6
|
+
require('../__chunks/AETQC2AR.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../__chunks/
|
|
9
|
+
var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
|
|
10
|
+
require('../__chunks/FFZYCAXA.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -16,11 +16,11 @@ require('../__chunks/YLMJBIQM.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
23
|
-
require('../__chunks/
|
|
22
|
+
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
23
|
+
require('../__chunks/UKR6TQI3.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
var _ULSPM3Y3cjs = require('../__chunks/ULSPM3Y3.cjs');
|
|
@@ -37,9 +37,9 @@ function createSelectStore(_a = {}) {
|
|
|
37
37
|
} = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, [
|
|
38
38
|
"combobox"
|
|
39
39
|
]);
|
|
40
|
-
const store =
|
|
40
|
+
const store = _B4LYZ4EMcjs.mergeStore.call(void 0,
|
|
41
41
|
props.store,
|
|
42
|
-
|
|
42
|
+
_B4LYZ4EMcjs.omit.call(void 0, combobox, [
|
|
43
43
|
"value",
|
|
44
44
|
"items",
|
|
45
45
|
"renderedItems",
|
|
@@ -51,35 +51,35 @@ function createSelectStore(_a = {}) {
|
|
|
51
51
|
"disclosureElement"
|
|
52
52
|
])
|
|
53
53
|
);
|
|
54
|
-
|
|
54
|
+
_B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, store);
|
|
55
55
|
const syncState = store.getState();
|
|
56
|
-
const composite =
|
|
56
|
+
const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
57
57
|
store,
|
|
58
|
-
virtualFocus:
|
|
58
|
+
virtualFocus: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
59
59
|
props.virtualFocus,
|
|
60
60
|
syncState.virtualFocus,
|
|
61
61
|
true
|
|
62
62
|
),
|
|
63
|
-
includesBaseElement:
|
|
63
|
+
includesBaseElement: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
64
64
|
props.includesBaseElement,
|
|
65
65
|
syncState.includesBaseElement,
|
|
66
66
|
false
|
|
67
67
|
),
|
|
68
|
-
activeId:
|
|
68
|
+
activeId: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
69
69
|
props.activeId,
|
|
70
70
|
syncState.activeId,
|
|
71
71
|
props.defaultActiveId,
|
|
72
72
|
null
|
|
73
73
|
),
|
|
74
|
-
orientation:
|
|
74
|
+
orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
75
75
|
props.orientation,
|
|
76
76
|
syncState.orientation,
|
|
77
77
|
"vertical"
|
|
78
78
|
)
|
|
79
79
|
}));
|
|
80
|
-
const popover =
|
|
80
|
+
const popover = _5JEQEZFRcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
81
81
|
store,
|
|
82
|
-
placement:
|
|
82
|
+
placement: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
83
83
|
props.placement,
|
|
84
84
|
syncState.placement,
|
|
85
85
|
"bottom-start"
|
|
@@ -87,24 +87,24 @@ function createSelectStore(_a = {}) {
|
|
|
87
87
|
}));
|
|
88
88
|
const initialValue = new String("");
|
|
89
89
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), popover.getState()), {
|
|
90
|
-
value:
|
|
90
|
+
value: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
91
91
|
props.value,
|
|
92
92
|
syncState.value,
|
|
93
93
|
props.defaultValue,
|
|
94
94
|
initialValue
|
|
95
95
|
),
|
|
96
|
-
setValueOnMove:
|
|
96
|
+
setValueOnMove: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
97
97
|
props.setValueOnMove,
|
|
98
98
|
syncState.setValueOnMove,
|
|
99
99
|
false
|
|
100
100
|
),
|
|
101
|
-
selectElement:
|
|
102
|
-
labelElement:
|
|
101
|
+
selectElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState.selectElement, null),
|
|
102
|
+
labelElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState.labelElement, null)
|
|
103
103
|
});
|
|
104
|
-
const select =
|
|
105
|
-
|
|
104
|
+
const select = _B4LYZ4EMcjs.createStore.call(void 0, initialState, composite, popover, store);
|
|
105
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
106
106
|
select,
|
|
107
|
-
() =>
|
|
107
|
+
() => _B4LYZ4EMcjs.sync.call(void 0, select, ["value", "items"], (state) => {
|
|
108
108
|
if (state.value !== initialValue)
|
|
109
109
|
return;
|
|
110
110
|
if (!state.items.length)
|
|
@@ -117,9 +117,9 @@ function createSelectStore(_a = {}) {
|
|
|
117
117
|
select.setState("value", item.value);
|
|
118
118
|
})
|
|
119
119
|
);
|
|
120
|
-
|
|
120
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
121
121
|
select,
|
|
122
|
-
() =>
|
|
122
|
+
() => _B4LYZ4EMcjs.sync.call(void 0, select, ["mounted", "items", "value"], (state) => {
|
|
123
123
|
if (combobox)
|
|
124
124
|
return;
|
|
125
125
|
if (state.mounted)
|
|
@@ -136,9 +136,9 @@ function createSelectStore(_a = {}) {
|
|
|
136
136
|
select.setState("activeId", item.id);
|
|
137
137
|
})
|
|
138
138
|
);
|
|
139
|
-
|
|
139
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
140
140
|
select,
|
|
141
|
-
() =>
|
|
141
|
+
() => _B4LYZ4EMcjs.batch.call(void 0, select, ["setValueOnMove", "moves"], (state) => {
|
|
142
142
|
const { mounted, value, activeId } = select.getState();
|
|
143
143
|
if (!state.setValueOnMove && mounted)
|
|
144
144
|
return;
|
|
@@ -60,7 +60,8 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
|
|
|
60
60
|
}
|
|
61
61
|
export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreValue> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<SelectStoreItem>, PopoverStoreFunctions {
|
|
62
62
|
/**
|
|
63
|
-
* Sets the `value`
|
|
63
|
+
* Sets the [`value`](https://ariakit.org/reference/select-provider#value)
|
|
64
|
+
* state.
|
|
64
65
|
* @example
|
|
65
66
|
* store.setValue("Apple");
|
|
66
67
|
* store.setValue(["Apple", "Banana"]);
|
|
@@ -60,7 +60,8 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
|
|
|
60
60
|
}
|
|
61
61
|
export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreValue> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<SelectStoreItem>, PopoverStoreFunctions {
|
|
62
62
|
/**
|
|
63
|
-
* Sets the `value`
|
|
63
|
+
* Sets the [`value`](https://ariakit.org/reference/select-provider#value)
|
|
64
|
+
* state.
|
|
64
65
|
* @example
|
|
65
66
|
* store.setValue("Apple");
|
|
66
67
|
* store.setValue(["Apple", "Banana"]);
|
package/cjs/tab/tab-store.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _FFZYCAXAcjs = require('../__chunks/FFZYCAXA.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
require('../__chunks/
|
|
16
|
+
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
17
|
+
require('../__chunks/UKR6TQI3.cjs');
|
|
18
18
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
@@ -25,32 +25,32 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
|
25
25
|
function createTabStore(props = {}) {
|
|
26
26
|
var _a;
|
|
27
27
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
28
|
-
const composite =
|
|
29
|
-
orientation:
|
|
28
|
+
const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
29
|
+
orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
30
30
|
props.orientation,
|
|
31
31
|
syncState == null ? void 0 : syncState.orientation,
|
|
32
32
|
"horizontal"
|
|
33
33
|
),
|
|
34
|
-
focusLoop:
|
|
34
|
+
focusLoop: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
35
35
|
}));
|
|
36
|
-
const panels =
|
|
36
|
+
const panels = _FFZYCAXAcjs.createCollectionStore.call(void 0, );
|
|
37
37
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), {
|
|
38
|
-
selectedId:
|
|
38
|
+
selectedId: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
39
39
|
props.selectedId,
|
|
40
40
|
syncState == null ? void 0 : syncState.selectedId,
|
|
41
41
|
props.defaultSelectedId,
|
|
42
42
|
void 0
|
|
43
43
|
),
|
|
44
|
-
selectOnMove:
|
|
44
|
+
selectOnMove: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
45
45
|
props.selectOnMove,
|
|
46
46
|
syncState == null ? void 0 : syncState.selectOnMove,
|
|
47
47
|
true
|
|
48
48
|
)
|
|
49
49
|
});
|
|
50
|
-
const tab =
|
|
51
|
-
|
|
50
|
+
const tab = _B4LYZ4EMcjs.createStore.call(void 0, initialState, composite, props.store);
|
|
51
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
52
52
|
tab,
|
|
53
|
-
() =>
|
|
53
|
+
() => _B4LYZ4EMcjs.sync.call(void 0, tab, ["moves"], () => {
|
|
54
54
|
const { activeId, selectOnMove } = tab.getState();
|
|
55
55
|
if (!selectOnMove)
|
|
56
56
|
return;
|
|
@@ -66,17 +66,17 @@ function createTabStore(props = {}) {
|
|
|
66
66
|
tab.setState("selectedId", tabItem.id);
|
|
67
67
|
})
|
|
68
68
|
);
|
|
69
|
-
|
|
69
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
70
70
|
tab,
|
|
71
|
-
() =>
|
|
71
|
+
() => _B4LYZ4EMcjs.batch.call(void 0,
|
|
72
72
|
tab,
|
|
73
73
|
["selectedId"],
|
|
74
74
|
(state) => tab.setState("activeId", state.selectedId)
|
|
75
75
|
)
|
|
76
76
|
);
|
|
77
|
-
|
|
77
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
78
78
|
tab,
|
|
79
|
-
() =>
|
|
79
|
+
() => _B4LYZ4EMcjs.sync.call(void 0, tab, ["selectedId", "renderedItems"], (state) => {
|
|
80
80
|
if (state.selectedId !== void 0)
|
|
81
81
|
return;
|
|
82
82
|
const { activeId, renderedItems } = tab.getState();
|
|
@@ -91,13 +91,13 @@ function createTabStore(props = {}) {
|
|
|
91
91
|
}
|
|
92
92
|
})
|
|
93
93
|
);
|
|
94
|
-
|
|
94
|
+
_B4LYZ4EMcjs.setup.call(void 0,
|
|
95
95
|
tab,
|
|
96
|
-
() =>
|
|
96
|
+
() => _B4LYZ4EMcjs.sync.call(void 0, tab, ["renderedItems"], (state) => {
|
|
97
97
|
const tabs = state.renderedItems;
|
|
98
98
|
if (!tabs.length)
|
|
99
99
|
return;
|
|
100
|
-
return
|
|
100
|
+
return _B4LYZ4EMcjs.sync.call(void 0, panels, ["renderedItems"], (state2) => {
|
|
101
101
|
const items = state2.renderedItems;
|
|
102
102
|
const hasOrphanPanels = items.some((panel) => !panel.tabId);
|
|
103
103
|
if (!hasOrphanPanels)
|
package/cjs/tab/tab-store.d.cts
CHANGED
|
@@ -10,13 +10,9 @@ export interface TabStorePanel extends CollectionStoreItem {
|
|
|
10
10
|
tabId?: string | null;
|
|
11
11
|
}
|
|
12
12
|
export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
|
|
13
|
-
/**
|
|
14
|
-
* @default "horizontal"
|
|
15
|
-
*/
|
|
13
|
+
/** @default "horizontal" */
|
|
16
14
|
orientation: CompositeStoreState<TabStoreItem>["orientation"];
|
|
17
|
-
/**
|
|
18
|
-
* @default true
|
|
19
|
-
*/
|
|
15
|
+
/** @default true */
|
|
20
16
|
focusLoop: CompositeStoreState<TabStoreItem>["focusLoop"];
|
|
21
17
|
/**
|
|
22
18
|
* The id of the tab whose panel is currently visible. If it's `undefined`, it
|
|
@@ -28,8 +24,9 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
|
|
|
28
24
|
*/
|
|
29
25
|
selectedId: TabStoreState["activeId"];
|
|
30
26
|
/**
|
|
31
|
-
*
|
|
32
|
-
* `false`, the tab will be selected
|
|
27
|
+
* Determines if the tab should be selected when it receives focus. If set to
|
|
28
|
+
* `false`, the tab will only be selected upon clicking, not when
|
|
29
|
+
* using arrow keys to shift focus.
|
|
33
30
|
*
|
|
34
31
|
* Live examples:
|
|
35
32
|
* - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
|
|
@@ -44,9 +41,6 @@ export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem>
|
|
|
44
41
|
* without moving focus. If you want to move focus, use the
|
|
45
42
|
* [`select`](https://ariakit.org/reference/use-tab-store#select) function
|
|
46
43
|
* instead.
|
|
47
|
-
*
|
|
48
|
-
* Live examples:
|
|
49
|
-
* - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
|
|
50
44
|
* @example
|
|
51
45
|
* // Selects the tab with id "tab-1"
|
|
52
46
|
* store.setSelectedId("tab-1");
|
package/cjs/tab/tab-store.d.ts
CHANGED
|
@@ -10,13 +10,9 @@ export interface TabStorePanel extends CollectionStoreItem {
|
|
|
10
10
|
tabId?: string | null;
|
|
11
11
|
}
|
|
12
12
|
export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
|
|
13
|
-
/**
|
|
14
|
-
* @default "horizontal"
|
|
15
|
-
*/
|
|
13
|
+
/** @default "horizontal" */
|
|
16
14
|
orientation: CompositeStoreState<TabStoreItem>["orientation"];
|
|
17
|
-
/**
|
|
18
|
-
* @default true
|
|
19
|
-
*/
|
|
15
|
+
/** @default true */
|
|
20
16
|
focusLoop: CompositeStoreState<TabStoreItem>["focusLoop"];
|
|
21
17
|
/**
|
|
22
18
|
* The id of the tab whose panel is currently visible. If it's `undefined`, it
|
|
@@ -28,8 +24,9 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
|
|
|
28
24
|
*/
|
|
29
25
|
selectedId: TabStoreState["activeId"];
|
|
30
26
|
/**
|
|
31
|
-
*
|
|
32
|
-
* `false`, the tab will be selected
|
|
27
|
+
* Determines if the tab should be selected when it receives focus. If set to
|
|
28
|
+
* `false`, the tab will only be selected upon clicking, not when
|
|
29
|
+
* using arrow keys to shift focus.
|
|
33
30
|
*
|
|
34
31
|
* Live examples:
|
|
35
32
|
* - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
|
|
@@ -44,9 +41,6 @@ export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem>
|
|
|
44
41
|
* without moving focus. If you want to move focus, use the
|
|
45
42
|
* [`select`](https://ariakit.org/reference/use-tab-store#select) function
|
|
46
43
|
* instead.
|
|
47
|
-
*
|
|
48
|
-
* Live examples:
|
|
49
|
-
* - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
|
|
50
44
|
* @example
|
|
51
45
|
* // Selects the tab with id "tab-1"
|
|
52
46
|
* store.setSelectedId("tab-1");
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
4
|
+
var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
|
|
5
|
+
require('../__chunks/FFZYCAXA.cjs');
|
|
6
|
+
require('../__chunks/B4LYZ4EM.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../__chunks/
|
|
9
|
+
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
10
|
+
require('../__chunks/UKR6TQI3.cjs');
|
|
11
11
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
@@ -18,13 +18,13 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
|
18
18
|
function createToolbarStore(props = {}) {
|
|
19
19
|
var _a;
|
|
20
20
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
21
|
-
return
|
|
22
|
-
orientation:
|
|
21
|
+
return _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
22
|
+
orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
23
23
|
props.orientation,
|
|
24
24
|
syncState == null ? void 0 : syncState.orientation,
|
|
25
25
|
"horizontal"
|
|
26
26
|
),
|
|
27
|
-
focusLoop:
|
|
27
|
+
focusLoop: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -5,13 +5,9 @@ import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function createToolbarStore(props?: ToolbarStoreProps): ToolbarStore;
|
|
7
7
|
export interface ToolbarStoreState extends CompositeStoreState {
|
|
8
|
-
/**
|
|
9
|
-
* @default "horizontal"
|
|
10
|
-
*/
|
|
8
|
+
/** @default "horizontal" */
|
|
11
9
|
orientation: CompositeStoreState["orientation"];
|
|
12
|
-
/**
|
|
13
|
-
* @default true
|
|
14
|
-
*/
|
|
10
|
+
/** @default true */
|
|
15
11
|
focusLoop: CompositeStoreState["focusLoop"];
|
|
16
12
|
}
|
|
17
13
|
export interface ToolbarStoreFunctions extends CompositeStoreFunctions {
|
|
@@ -5,13 +5,9 @@ import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function createToolbarStore(props?: ToolbarStoreProps): ToolbarStore;
|
|
7
7
|
export interface ToolbarStoreState extends CompositeStoreState {
|
|
8
|
-
/**
|
|
9
|
-
* @default "horizontal"
|
|
10
|
-
*/
|
|
8
|
+
/** @default "horizontal" */
|
|
11
9
|
orientation: CompositeStoreState["orientation"];
|
|
12
|
-
/**
|
|
13
|
-
* @default true
|
|
14
|
-
*/
|
|
10
|
+
/** @default true */
|
|
15
11
|
focusLoop: CompositeStoreState["focusLoop"];
|
|
16
12
|
}
|
|
17
13
|
export interface ToolbarStoreFunctions extends CompositeStoreFunctions {
|
|
@@ -1,16 +1,16 @@
|
|
|
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
|
|
10
|
+
var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -19,20 +19,29 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
|
19
19
|
// src/tooltip/tooltip-store.ts
|
|
20
20
|
function createTooltipStore(props = {}) {
|
|
21
21
|
var _a;
|
|
22
|
+
if (process.env.NODE_ENV !== "production") {
|
|
23
|
+
if (props.type === "label") {
|
|
24
|
+
console.warn(
|
|
25
|
+
"The `type` option on the tooltip store is deprecated.",
|
|
26
|
+
"Render a visually hidden label or use the `aria-label` or `aria-labelledby` attributes on the anchor element instead.",
|
|
27
|
+
"See https://ariakit.org/components/tooltip#tooltip-anchors-must-have-accessible-names"
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
22
31
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
23
|
-
const hovercard =
|
|
24
|
-
placement:
|
|
32
|
+
const hovercard = _UEZLSKZ4cjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
33
|
+
placement: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
25
34
|
props.placement,
|
|
26
35
|
syncState == null ? void 0 : syncState.placement,
|
|
27
36
|
"top"
|
|
28
37
|
),
|
|
29
|
-
hideTimeout:
|
|
38
|
+
hideTimeout: _EEDWPDM2cjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0)
|
|
30
39
|
}));
|
|
31
40
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, hovercard.getState()), {
|
|
32
|
-
type:
|
|
33
|
-
skipTimeout:
|
|
41
|
+
type: _EEDWPDM2cjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
|
|
42
|
+
skipTimeout: _EEDWPDM2cjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
|
|
34
43
|
});
|
|
35
|
-
const tooltip =
|
|
44
|
+
const tooltip = _B4LYZ4EMcjs.createStore.call(void 0, initialState, hovercard, props.store);
|
|
36
45
|
return _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, hovercard), tooltip);
|
|
37
46
|
}
|
|
38
47
|
|
|
@@ -5,9 +5,15 @@ import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function createTooltipStore(props?: TooltipStoreProps): TooltipStore;
|
|
7
7
|
export interface TooltipStoreState extends HovercardStoreState {
|
|
8
|
+
/** @default "top" */
|
|
9
|
+
placement: HovercardStoreState["placement"];
|
|
10
|
+
/** @default 0 */
|
|
11
|
+
hideTimeout?: HovercardStoreState["hideTimeout"];
|
|
8
12
|
/**
|
|
9
13
|
* Determines whether the tooltip is being used as a label or a description
|
|
10
14
|
* for the anchor element.
|
|
15
|
+
* @deprecated Render a visually hidden label or use the `aria-label` or
|
|
16
|
+
* `aria-labelledby` attributes on the anchor element instead.
|
|
11
17
|
* @default "description"
|
|
12
18
|
*/
|
|
13
19
|
type: "label" | "description";
|
|
@@ -17,10 +23,6 @@ export interface TooltipStoreState extends HovercardStoreState {
|
|
|
17
23
|
* @default 300
|
|
18
24
|
*/
|
|
19
25
|
skipTimeout: number;
|
|
20
|
-
/** @default "top" */
|
|
21
|
-
placement: HovercardStoreState["placement"];
|
|
22
|
-
/** @default 0 */
|
|
23
|
-
hideTimeout?: HovercardStoreState["hideTimeout"];
|
|
24
26
|
}
|
|
25
27
|
export type TooltipStoreFunctions = HovercardStoreFunctions;
|
|
26
28
|
export interface TooltipStoreOptions extends HovercardStoreOptions, StoreOptions<TooltipStoreState, "type" | "placement" | "timeout" | "showTimeout" | "hideTimeout" | "skipTimeout"> {
|
|
@@ -5,9 +5,15 @@ import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function createTooltipStore(props?: TooltipStoreProps): TooltipStore;
|
|
7
7
|
export interface TooltipStoreState extends HovercardStoreState {
|
|
8
|
+
/** @default "top" */
|
|
9
|
+
placement: HovercardStoreState["placement"];
|
|
10
|
+
/** @default 0 */
|
|
11
|
+
hideTimeout?: HovercardStoreState["hideTimeout"];
|
|
8
12
|
/**
|
|
9
13
|
* Determines whether the tooltip is being used as a label or a description
|
|
10
14
|
* for the anchor element.
|
|
15
|
+
* @deprecated Render a visually hidden label or use the `aria-label` or
|
|
16
|
+
* `aria-labelledby` attributes on the anchor element instead.
|
|
11
17
|
* @default "description"
|
|
12
18
|
*/
|
|
13
19
|
type: "label" | "description";
|
|
@@ -17,10 +23,6 @@ export interface TooltipStoreState extends HovercardStoreState {
|
|
|
17
23
|
* @default 300
|
|
18
24
|
*/
|
|
19
25
|
skipTimeout: number;
|
|
20
|
-
/** @default "top" */
|
|
21
|
-
placement: HovercardStoreState["placement"];
|
|
22
|
-
/** @default 0 */
|
|
23
|
-
hideTimeout?: HovercardStoreState["hideTimeout"];
|
|
24
26
|
}
|
|
25
27
|
export type TooltipStoreFunctions = HovercardStoreFunctions;
|
|
26
28
|
export interface TooltipStoreOptions extends HovercardStoreOptions, StoreOptions<TooltipStoreState, "type" | "placement" | "timeout" | "showTimeout" | "hideTimeout" | "skipTimeout"> {
|
package/cjs/utils/dom.cjs
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _UKR6TQI3cjs = require('../__chunks/UKR6TQI3.cjs');
|
|
22
22
|
require('../__chunks/AV6KTKLE.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
@@ -39,4 +39,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
exports.canUseDOM =
|
|
42
|
+
exports.canUseDOM = _UKR6TQI3cjs.canUseDOM; exports.closest = _UKR6TQI3cjs.closest; exports.contains = _UKR6TQI3cjs.contains; exports.getActiveElement = _UKR6TQI3cjs.getActiveElement; exports.getDocument = _UKR6TQI3cjs.getDocument; exports.getPopupItemRole = _UKR6TQI3cjs.getPopupItemRole; exports.getPopupRole = _UKR6TQI3cjs.getPopupRole; exports.getScrollingElement = _UKR6TQI3cjs.getScrollingElement; exports.getTextboxSelection = _UKR6TQI3cjs.getTextboxSelection; exports.getWindow = _UKR6TQI3cjs.getWindow; exports.isButton = _UKR6TQI3cjs.isButton; exports.isFrame = _UKR6TQI3cjs.isFrame; exports.isPartiallyHidden = _UKR6TQI3cjs.isPartiallyHidden; exports.isTextField = _UKR6TQI3cjs.isTextField; exports.isVisible = _UKR6TQI3cjs.isVisible; exports.matches = _UKR6TQI3cjs.matches; exports.scrollIntoViewIfNeeded = _UKR6TQI3cjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _UKR6TQI3cjs.setSelectionRange;
|
package/cjs/utils/events.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _7DU6YMLQcjs = require('../__chunks/7DU6YMLQ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _UKR6TQI3cjs = require('../__chunks/UKR6TQI3.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -13,7 +13,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
|
13
13
|
// src/utils/events.ts
|
|
14
14
|
function isPortalEvent(event) {
|
|
15
15
|
return Boolean(
|
|
16
|
-
event.currentTarget && !
|
|
16
|
+
event.currentTarget && !_UKR6TQI3cjs.contains.call(void 0, event.currentTarget, event.target)
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
function isSelfTarget(event) {
|
|
@@ -23,7 +23,7 @@ function isOpeningInNewTab(event) {
|
|
|
23
23
|
const element = event.currentTarget;
|
|
24
24
|
if (!element)
|
|
25
25
|
return false;
|
|
26
|
-
const isAppleDevice =
|
|
26
|
+
const isAppleDevice = _7DU6YMLQcjs.isApple.call(void 0, );
|
|
27
27
|
if (isAppleDevice && !event.metaKey)
|
|
28
28
|
return false;
|
|
29
29
|
if (!isAppleDevice && !event.ctrlKey)
|
|
@@ -81,7 +81,7 @@ function fireClickEvent(element, eventInit) {
|
|
|
81
81
|
function isFocusEventOutside(event, container) {
|
|
82
82
|
const containerElement = container || event.currentTarget;
|
|
83
83
|
const relatedTarget = event.relatedTarget;
|
|
84
|
-
return !relatedTarget || !
|
|
84
|
+
return !relatedTarget || !_UKR6TQI3cjs.contains.call(void 0, containerElement, relatedTarget);
|
|
85
85
|
}
|
|
86
86
|
function queueBeforeEvent(element, type, callback) {
|
|
87
87
|
const raf = requestAnimationFrame(() => {
|