@ariakit/core 0.3.9 → 0.3.10
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/{2UK5WUJX.cjs → 5CBCKBZ2.cjs} +0 -2
- package/cjs/__chunks/{UTICNXST.cjs → CWDUO5EV.cjs} +4 -4
- package/cjs/__chunks/{5SIVMOID.cjs → HMO4CKUP.cjs} +4 -4
- package/cjs/__chunks/{2LS4JJ4S.cjs → MFSCSSBJ.cjs} +2 -2
- package/cjs/__chunks/{GJFZ5ZPP.cjs → MWNFQD55.cjs} +11 -11
- package/cjs/__chunks/{EFIT5L4X.cjs → Y6PHIDP6.cjs} +7 -7
- package/cjs/__chunks/{UCLKUBNP.cjs → YLMJBIQM.cjs} +16 -12
- package/cjs/__chunks/{JNFZSNOI.cjs → ZXCB7MXN.cjs} +6 -6
- package/cjs/checkbox/checkbox-store.cjs +3 -3
- package/cjs/checkbox/checkbox-store.d.cts +5 -2
- package/cjs/checkbox/checkbox-store.d.ts +5 -2
- package/cjs/collection/collection-store.cjs +3 -3
- package/cjs/collection/collection-store.d.cts +11 -11
- package/cjs/collection/collection-store.d.ts +11 -11
- package/cjs/combobox/combobox-store.cjs +20 -20
- package/cjs/combobox/combobox-store.d.cts +3 -1
- package/cjs/combobox/combobox-store.d.ts +3 -1
- package/cjs/composite/composite-overflow-store.cjs +5 -5
- package/cjs/composite/composite-store.cjs +4 -4
- package/cjs/composite/composite-store.d.cts +128 -54
- package/cjs/composite/composite-store.d.ts +128 -54
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/disclosure/disclosure-store.d.cts +33 -27
- package/cjs/disclosure/disclosure-store.d.ts +33 -27
- package/cjs/form/form-store.cjs +7 -7
- package/cjs/form/form-store.d.cts +34 -25
- package/cjs/form/form-store.d.ts +34 -25
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/menu/menu-bar-store.cjs +5 -5
- package/cjs/menu/menu-store.cjs +18 -18
- package/cjs/menubar/menubar-store.cjs +5 -5
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/radio/radio-store.cjs +5 -5
- package/cjs/select/select-store.cjs +18 -18
- package/cjs/tab/tab-store.cjs +15 -15
- package/cjs/tab/tab-store.d.cts +15 -4
- package/cjs/tab/tab-store.d.ts +15 -4
- package/cjs/toolbar/toolbar-store.cjs +4 -4
- package/cjs/tooltip/tooltip-store.cjs +7 -7
- package/cjs/utils/store.cjs +2 -2
- package/esm/__chunks/{LT2OYWRD.js → 25MEC56I.js} +1 -1
- package/esm/__chunks/{J6JIOWCS.js → AKMSZ36N.js} +2 -2
- package/esm/__chunks/{A2J4XZ5T.js → K6ELJFXN.js} +0 -2
- package/esm/__chunks/{NKLTHWCR.js → L5RYKTVQ.js} +1 -1
- package/esm/__chunks/{TLN4ALYH.js → MYUKSFP5.js} +10 -6
- package/esm/__chunks/{T3DVYGXI.js → QJ5CUA32.js} +2 -2
- package/esm/__chunks/{EZ2TTBAQ.js → UUFF4PQ6.js} +2 -2
- package/esm/__chunks/{DLX2AS6C.js → VEUNYQYR.js} +2 -2
- package/esm/checkbox/checkbox-store.d.ts +5 -2
- package/esm/checkbox/checkbox-store.js +1 -1
- package/esm/collection/collection-store.d.ts +11 -11
- package/esm/collection/collection-store.js +2 -2
- package/esm/combobox/combobox-store.d.ts +3 -1
- package/esm/combobox/combobox-store.js +6 -6
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-store.d.ts +128 -54
- package/esm/composite/composite-store.js +3 -3
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/disclosure/disclosure-store.d.ts +33 -27
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/form/form-store.d.ts +34 -25
- package/esm/form/form-store.js +2 -2
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/menu/menu-bar-store.js +4 -4
- package/esm/menu/menu-store.js +7 -7
- package/esm/menubar/menubar-store.js +4 -4
- package/esm/popover/popover-store.js +4 -4
- package/esm/radio/radio-store.js +3 -3
- package/esm/select/select-store.js +6 -6
- package/esm/tab/tab-store.d.ts +15 -4
- package/esm/tab/tab-store.js +3 -3
- package/esm/toolbar/toolbar-store.js +3 -3
- package/esm/tooltip/tooltip-store.js +5 -5
- package/esm/utils/store.js +1 -1
- 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 _Y6PHIDP6cjs = require('../__chunks/Y6PHIDP6.cjs');
|
|
5
|
+
require('../__chunks/MFSCSSBJ.cjs');
|
|
6
|
+
require('../__chunks/MWNFQD55.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../__chunks/
|
|
9
|
+
var _ZXCB7MXNcjs = require('../__chunks/ZXCB7MXN.cjs');
|
|
10
|
+
require('../__chunks/YLMJBIQM.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -16,7 +16,7 @@ require('../__chunks/UCLKUBNP.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.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 = _5CBCKBZ2cjs.mergeStore.call(void 0,
|
|
41
41
|
props.store,
|
|
42
|
-
|
|
42
|
+
_5CBCKBZ2cjs.omit.call(void 0, combobox, [
|
|
43
43
|
"value",
|
|
44
44
|
"items",
|
|
45
45
|
"renderedItems",
|
|
@@ -51,9 +51,9 @@ function createSelectStore(_a = {}) {
|
|
|
51
51
|
"disclosureElement"
|
|
52
52
|
])
|
|
53
53
|
);
|
|
54
|
-
|
|
54
|
+
_5CBCKBZ2cjs.throwOnConflictingProps.call(void 0, props, store);
|
|
55
55
|
const syncState = store.getState();
|
|
56
|
-
const composite =
|
|
56
|
+
const composite = _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
57
57
|
store,
|
|
58
58
|
virtualFocus: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
59
59
|
props.virtualFocus,
|
|
@@ -77,7 +77,7 @@ function createSelectStore(_a = {}) {
|
|
|
77
77
|
"vertical"
|
|
78
78
|
)
|
|
79
79
|
}));
|
|
80
|
-
const popover =
|
|
80
|
+
const popover = _Y6PHIDP6cjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
81
81
|
store,
|
|
82
82
|
placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
83
83
|
props.placement,
|
|
@@ -101,10 +101,10 @@ function createSelectStore(_a = {}) {
|
|
|
101
101
|
selectElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState.selectElement, null),
|
|
102
102
|
labelElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState.labelElement, null)
|
|
103
103
|
});
|
|
104
|
-
const select =
|
|
105
|
-
|
|
104
|
+
const select = _5CBCKBZ2cjs.createStore.call(void 0, initialState, composite, popover, store);
|
|
105
|
+
_5CBCKBZ2cjs.setup.call(void 0,
|
|
106
106
|
select,
|
|
107
|
-
() =>
|
|
107
|
+
() => _5CBCKBZ2cjs.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
|
+
_5CBCKBZ2cjs.setup.call(void 0,
|
|
121
121
|
select,
|
|
122
|
-
() =>
|
|
122
|
+
() => _5CBCKBZ2cjs.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
|
+
_5CBCKBZ2cjs.setup.call(void 0,
|
|
140
140
|
select,
|
|
141
|
-
() =>
|
|
141
|
+
() => _5CBCKBZ2cjs.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;
|
package/cjs/tab/tab-store.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _ZXCB7MXNcjs = require('../__chunks/ZXCB7MXN.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _YLMJBIQMcjs = require('../__chunks/YLMJBIQM.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
@@ -25,7 +25,7 @@ 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 =
|
|
28
|
+
const composite = _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
29
29
|
orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
30
30
|
props.orientation,
|
|
31
31
|
syncState == null ? void 0 : syncState.orientation,
|
|
@@ -33,7 +33,7 @@ function createTabStore(props = {}) {
|
|
|
33
33
|
),
|
|
34
34
|
focusLoop: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
35
35
|
}));
|
|
36
|
-
const panels =
|
|
36
|
+
const panels = _YLMJBIQMcjs.createCollectionStore.call(void 0, );
|
|
37
37
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), {
|
|
38
38
|
selectedId: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
39
39
|
props.selectedId,
|
|
@@ -47,10 +47,10 @@ function createTabStore(props = {}) {
|
|
|
47
47
|
true
|
|
48
48
|
)
|
|
49
49
|
});
|
|
50
|
-
const tab =
|
|
51
|
-
|
|
50
|
+
const tab = _5CBCKBZ2cjs.createStore.call(void 0, initialState, composite, props.store);
|
|
51
|
+
_5CBCKBZ2cjs.setup.call(void 0,
|
|
52
52
|
tab,
|
|
53
|
-
() =>
|
|
53
|
+
() => _5CBCKBZ2cjs.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
|
+
_5CBCKBZ2cjs.setup.call(void 0,
|
|
70
70
|
tab,
|
|
71
|
-
() =>
|
|
71
|
+
() => _5CBCKBZ2cjs.batch.call(void 0,
|
|
72
72
|
tab,
|
|
73
73
|
["selectedId"],
|
|
74
74
|
(state) => tab.setState("activeId", state.selectedId)
|
|
75
75
|
)
|
|
76
76
|
);
|
|
77
|
-
|
|
77
|
+
_5CBCKBZ2cjs.setup.call(void 0,
|
|
78
78
|
tab,
|
|
79
|
-
() =>
|
|
79
|
+
() => _5CBCKBZ2cjs.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
|
+
_5CBCKBZ2cjs.setup.call(void 0,
|
|
95
95
|
tab,
|
|
96
|
-
() =>
|
|
96
|
+
() => _5CBCKBZ2cjs.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 _5CBCKBZ2cjs.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
|
@@ -24,6 +24,7 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
|
|
|
24
24
|
*
|
|
25
25
|
* Live examples:
|
|
26
26
|
* - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
|
|
27
|
+
* - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
|
|
27
28
|
*/
|
|
28
29
|
selectedId: TabStoreState["activeId"];
|
|
29
30
|
/**
|
|
@@ -38,8 +39,11 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
|
|
|
38
39
|
}
|
|
39
40
|
export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem> {
|
|
40
41
|
/**
|
|
41
|
-
* Sets the
|
|
42
|
-
*
|
|
42
|
+
* Sets the
|
|
43
|
+
* [`selectedId`](https://ariakit.org/reference/tab-provider#selectedid) state
|
|
44
|
+
* without moving focus. If you want to move focus, use the
|
|
45
|
+
* [`select`](https://ariakit.org/reference/use-tab-store#select) function
|
|
46
|
+
* instead.
|
|
43
47
|
*
|
|
44
48
|
* Live examples:
|
|
45
49
|
* - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
|
|
@@ -60,9 +64,13 @@ export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem>
|
|
|
60
64
|
panels: CollectionStore<TabStorePanel>;
|
|
61
65
|
/**
|
|
62
66
|
* Selects the tab for the given id and moves focus to it. If you want to set
|
|
63
|
-
* the `selectedId`
|
|
67
|
+
* the [`selectedId`](https://ariakit.org/reference/tab-provider#selectedid)
|
|
68
|
+
* state without moving focus, use the
|
|
69
|
+
* [`setSelectedId`](https://ariakit.org/reference/use-tab-store#setselectedid-1)
|
|
64
70
|
* function instead.
|
|
65
|
-
*
|
|
71
|
+
*
|
|
72
|
+
* Live examples:
|
|
73
|
+
* - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
|
|
66
74
|
* @example
|
|
67
75
|
* // Selects the tab with id "tab-1"
|
|
68
76
|
* store.select("tab-1");
|
|
@@ -77,6 +85,9 @@ export interface TabStoreOptions extends StoreOptions<TabStoreState, "orientatio
|
|
|
77
85
|
/**
|
|
78
86
|
* The id of the tab whose panel is currently visible. If it's `undefined`, it
|
|
79
87
|
* will be automatically set to the first enabled tab.
|
|
88
|
+
*
|
|
89
|
+
* Live examples:
|
|
90
|
+
* - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
|
|
80
91
|
*/
|
|
81
92
|
defaultSelectedId?: TabStoreState["selectedId"];
|
|
82
93
|
}
|
package/cjs/tab/tab-store.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
|
|
|
24
24
|
*
|
|
25
25
|
* Live examples:
|
|
26
26
|
* - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
|
|
27
|
+
* - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
|
|
27
28
|
*/
|
|
28
29
|
selectedId: TabStoreState["activeId"];
|
|
29
30
|
/**
|
|
@@ -38,8 +39,11 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
|
|
|
38
39
|
}
|
|
39
40
|
export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem> {
|
|
40
41
|
/**
|
|
41
|
-
* Sets the
|
|
42
|
-
*
|
|
42
|
+
* Sets the
|
|
43
|
+
* [`selectedId`](https://ariakit.org/reference/tab-provider#selectedid) state
|
|
44
|
+
* without moving focus. If you want to move focus, use the
|
|
45
|
+
* [`select`](https://ariakit.org/reference/use-tab-store#select) function
|
|
46
|
+
* instead.
|
|
43
47
|
*
|
|
44
48
|
* Live examples:
|
|
45
49
|
* - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
|
|
@@ -60,9 +64,13 @@ export interface TabStoreFunctions extends CompositeStoreFunctions<TabStoreItem>
|
|
|
60
64
|
panels: CollectionStore<TabStorePanel>;
|
|
61
65
|
/**
|
|
62
66
|
* Selects the tab for the given id and moves focus to it. If you want to set
|
|
63
|
-
* the `selectedId`
|
|
67
|
+
* the [`selectedId`](https://ariakit.org/reference/tab-provider#selectedid)
|
|
68
|
+
* state without moving focus, use the
|
|
69
|
+
* [`setSelectedId`](https://ariakit.org/reference/use-tab-store#setselectedid-1)
|
|
64
70
|
* function instead.
|
|
65
|
-
*
|
|
71
|
+
*
|
|
72
|
+
* Live examples:
|
|
73
|
+
* - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
|
|
66
74
|
* @example
|
|
67
75
|
* // Selects the tab with id "tab-1"
|
|
68
76
|
* store.select("tab-1");
|
|
@@ -77,6 +85,9 @@ export interface TabStoreOptions extends StoreOptions<TabStoreState, "orientatio
|
|
|
77
85
|
/**
|
|
78
86
|
* The id of the tab whose panel is currently visible. If it's `undefined`, it
|
|
79
87
|
* will be automatically set to the first enabled tab.
|
|
88
|
+
*
|
|
89
|
+
* Live examples:
|
|
90
|
+
* - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
|
|
80
91
|
*/
|
|
81
92
|
defaultSelectedId?: TabStoreState["selectedId"];
|
|
82
93
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
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 _ZXCB7MXNcjs = require('../__chunks/ZXCB7MXN.cjs');
|
|
5
|
+
require('../__chunks/YLMJBIQM.cjs');
|
|
6
|
+
require('../__chunks/5CBCKBZ2.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
@@ -18,7 +18,7 @@ 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
|
|
21
|
+
return _ZXCB7MXNcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
22
22
|
orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
23
23
|
props.orientation,
|
|
24
24
|
syncState == null ? void 0 : syncState.orientation,
|
|
@@ -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/
|
|
7
|
-
require('../__chunks/
|
|
4
|
+
var _HMO4CKUPcjs = require('../__chunks/HMO4CKUP.cjs');
|
|
5
|
+
require('../__chunks/Y6PHIDP6.cjs');
|
|
6
|
+
require('../__chunks/MFSCSSBJ.cjs');
|
|
7
|
+
require('../__chunks/MWNFQD55.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
@@ -20,7 +20,7 @@ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
|
20
20
|
function createTooltipStore(props = {}) {
|
|
21
21
|
var _a;
|
|
22
22
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
23
|
-
const hovercard =
|
|
23
|
+
const hovercard = _HMO4CKUPcjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
24
24
|
placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
25
25
|
props.placement,
|
|
26
26
|
syncState == null ? void 0 : syncState.placement,
|
|
@@ -32,7 +32,7 @@ function createTooltipStore(props = {}) {
|
|
|
32
32
|
type: _3UT5FE6Kcjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
|
|
33
33
|
skipTimeout: _3UT5FE6Kcjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
|
|
34
34
|
});
|
|
35
|
-
const tooltip =
|
|
35
|
+
const tooltip = _5CBCKBZ2cjs.createStore.call(void 0, initialState, hovercard, props.store);
|
|
36
36
|
return _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, hovercard), tooltip);
|
|
37
37
|
}
|
|
38
38
|
|
package/cjs/utils/store.cjs
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _5CBCKBZ2cjs = require('../__chunks/5CBCKBZ2.cjs');
|
|
14
14
|
require('../__chunks/3UT5FE6K.cjs');
|
|
15
15
|
require('../__chunks/AV6KTKLE.cjs');
|
|
16
16
|
|
|
@@ -24,4 +24,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
exports.batch =
|
|
27
|
+
exports.batch = _5CBCKBZ2cjs.batch; exports.createStore = _5CBCKBZ2cjs.createStore; exports.init = _5CBCKBZ2cjs.init; exports.mergeStore = _5CBCKBZ2cjs.mergeStore; exports.omit = _5CBCKBZ2cjs.omit; exports.pick = _5CBCKBZ2cjs.pick; exports.setup = _5CBCKBZ2cjs.setup; exports.subscribe = _5CBCKBZ2cjs.subscribe; exports.sync = _5CBCKBZ2cjs.sync; exports.throwOnConflictingProps = _5CBCKBZ2cjs.throwOnConflictingProps;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createDialogStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./25MEC56I.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore,
|
|
7
7
|
mergeStore,
|
|
8
8
|
omit,
|
|
9
9
|
throwOnConflictingProps
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./K6ELJFXN.js";
|
|
11
11
|
import {
|
|
12
12
|
defaultValue
|
|
13
13
|
} from "./I2VQ3XGR.js";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
init,
|
|
6
6
|
setup,
|
|
7
7
|
throwOnConflictingProps
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./K6ELJFXN.js";
|
|
9
9
|
import {
|
|
10
10
|
chain,
|
|
11
11
|
defaultValue
|
|
@@ -88,17 +88,20 @@ function createCollectionStore(props = {}) {
|
|
|
88
88
|
syncPrivateStore
|
|
89
89
|
);
|
|
90
90
|
const collection = createStore(initialState, props.store);
|
|
91
|
+
const sortItems = (renderedItems) => {
|
|
92
|
+
const sortedItems = sortBasedOnDOMPosition(renderedItems);
|
|
93
|
+
privateStore.setState("renderedItems", sortedItems);
|
|
94
|
+
collection.setState("renderedItems", sortedItems);
|
|
95
|
+
};
|
|
91
96
|
setup(collection, () => init(privateStore));
|
|
92
97
|
setup(privateStore, () => {
|
|
93
98
|
return batch(privateStore, ["renderedItems"], (state) => {
|
|
94
99
|
let firstRun = true;
|
|
95
|
-
|
|
100
|
+
let raf = requestAnimationFrame(() => {
|
|
96
101
|
const { renderedItems } = collection.getState();
|
|
97
102
|
if (state.renderedItems === renderedItems)
|
|
98
103
|
return;
|
|
99
|
-
|
|
100
|
-
privateStore.setState("renderedItems", sortedItems);
|
|
101
|
-
collection.setState("renderedItems", sortedItems);
|
|
104
|
+
sortItems(state.renderedItems);
|
|
102
105
|
});
|
|
103
106
|
if (typeof IntersectionObserver !== "function") {
|
|
104
107
|
return () => cancelAnimationFrame(raf);
|
|
@@ -108,7 +111,8 @@ function createCollectionStore(props = {}) {
|
|
|
108
111
|
firstRun = false;
|
|
109
112
|
return;
|
|
110
113
|
}
|
|
111
|
-
|
|
114
|
+
cancelAnimationFrame(raf);
|
|
115
|
+
raf = requestAnimationFrame(() => sortItems(state.renderedItems));
|
|
112
116
|
};
|
|
113
117
|
const root = getCommonParent(state.renderedItems);
|
|
114
118
|
const observer = new IntersectionObserver(ioCallback, { root });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCollectionStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./MYUKSFP5.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore,
|
|
7
7
|
setup,
|
|
8
8
|
sync
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./K6ELJFXN.js";
|
|
10
10
|
import {
|
|
11
11
|
defaultValue
|
|
12
12
|
} from "./I2VQ3XGR.js";
|
|
@@ -17,7 +17,8 @@ export interface CheckboxStoreState<T extends CheckboxStoreValue = CheckboxStore
|
|
|
17
17
|
}
|
|
18
18
|
export interface CheckboxStoreFunctions<T extends CheckboxStoreValue = CheckboxStoreValue> {
|
|
19
19
|
/**
|
|
20
|
-
* Sets the `value`
|
|
20
|
+
* Sets the [`value`](https://ariakit.org/reference/checkbox-provider#value)
|
|
21
|
+
* state.
|
|
21
22
|
* @example
|
|
22
23
|
* store.setValue(true);
|
|
23
24
|
* store.setValue((value) => !value);
|
|
@@ -26,7 +27,9 @@ export interface CheckboxStoreFunctions<T extends CheckboxStoreValue = CheckboxS
|
|
|
26
27
|
}
|
|
27
28
|
export interface CheckboxStoreOptions<T extends CheckboxStoreValue = CheckboxStoreValue> extends StoreOptions<CheckboxStoreState<T>, "value"> {
|
|
28
29
|
/**
|
|
29
|
-
* The default
|
|
30
|
+
* The default
|
|
31
|
+
* [`value`](https://ariakit.org/reference/checkbox-provider#value) state of
|
|
32
|
+
* the checkbox.
|
|
30
33
|
*
|
|
31
34
|
* Live examples:
|
|
32
35
|
* - [Custom Checkbox](https://ariakit.org/examples/checkbox-custom)
|
|
@@ -16,16 +16,18 @@ export interface CollectionStoreItem {
|
|
|
16
16
|
}
|
|
17
17
|
export interface CollectionStoreState<T extends CollectionStoreItem = CollectionStoreItem> {
|
|
18
18
|
/**
|
|
19
|
-
* Lists all
|
|
20
|
-
* updated when an item is registered or unregistered
|
|
19
|
+
* Lists all items along with their metadata. This state is automatically
|
|
20
|
+
* updated when an item is registered or unregistered using the
|
|
21
|
+
* [`registerItem`](https://ariakit.org/reference/use-collection-store#registeritem)
|
|
21
22
|
* function.
|
|
22
23
|
*/
|
|
23
24
|
items: T[];
|
|
24
25
|
/**
|
|
25
|
-
* Lists all
|
|
26
|
-
* automatically updated when an item is rendered or
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* Lists all items, along with their metadata, in the exact order they appear in
|
|
27
|
+
* the DOM. This state is automatically updated when an item is rendered or
|
|
28
|
+
* unmounted using the
|
|
29
|
+
* [`renderItem`](https://ariakit.org/reference/use-collection-store#renderitem)
|
|
30
|
+
* function.
|
|
29
31
|
*/
|
|
30
32
|
renderedItems: T[];
|
|
31
33
|
}
|
|
@@ -33,7 +35,6 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
|
|
|
33
35
|
/**
|
|
34
36
|
* Registers an item in the collection. This function returns a cleanup
|
|
35
37
|
* function that unregisters the item.
|
|
36
|
-
* @param item The item to register.
|
|
37
38
|
* @example
|
|
38
39
|
* const unregisterItem = store.registerItem({ id: "item-1" });
|
|
39
40
|
* // on cleanup
|
|
@@ -42,8 +43,7 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
|
|
|
42
43
|
registerItem: BivariantCallback<(item: T) => () => void>;
|
|
43
44
|
/**
|
|
44
45
|
* Renders an item in the collection. This function returns a cleanup function
|
|
45
|
-
* that
|
|
46
|
-
* @param item The item to render.
|
|
46
|
+
* that unmounts the item.
|
|
47
47
|
* @example
|
|
48
48
|
* const unrenderItem = store.renderItem({ id: "item-1" });
|
|
49
49
|
* // on cleanup
|
|
@@ -52,7 +52,6 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
|
|
|
52
52
|
renderItem: BivariantCallback<(item: T) => () => void>;
|
|
53
53
|
/**
|
|
54
54
|
* Gets an item by its id.
|
|
55
|
-
* @param id The id of the item.
|
|
56
55
|
* @example
|
|
57
56
|
* const item = store.item("item-1");
|
|
58
57
|
*/
|
|
@@ -60,7 +59,8 @@ export interface CollectionStoreFunctions<T extends CollectionStoreItem = Collec
|
|
|
60
59
|
}
|
|
61
60
|
export interface CollectionStoreOptions<T extends CollectionStoreItem = CollectionStoreItem> extends StoreOptions<CollectionStoreState<T>, "items"> {
|
|
62
61
|
/**
|
|
63
|
-
* The defaut value for the
|
|
62
|
+
* The defaut value for the
|
|
63
|
+
* [`items`](https://ariakit.org/reference/collection-provider#items) state.
|
|
64
64
|
* @default []
|
|
65
65
|
*/
|
|
66
66
|
defaultItems?: CollectionStoreState<T>["items"];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCollectionStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/MYUKSFP5.js";
|
|
5
|
+
import "../__chunks/K6ELJFXN.js";
|
|
6
6
|
import "../__chunks/I2VQ3XGR.js";
|
|
7
7
|
import "../__chunks/DLOEKDPY.js";
|
|
8
8
|
import "../__chunks/4R3V3JGP.js";
|
|
@@ -32,7 +32,9 @@ export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = Combo
|
|
|
32
32
|
*/
|
|
33
33
|
value: string;
|
|
34
34
|
/**
|
|
35
|
-
* The value of the
|
|
35
|
+
* The value of the currently active item. This state automatically updates as
|
|
36
|
+
* the user navigates the combobox items either by keyboard or mouse click.
|
|
37
|
+
* Note that it doesn't update when the user simply hovers over the items.
|
|
36
38
|
*/
|
|
37
39
|
activeValue: string | undefined;
|
|
38
40
|
/**
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createPopoverStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/AKMSZ36N.js";
|
|
5
|
+
import "../__chunks/25MEC56I.js";
|
|
6
|
+
import "../__chunks/L5RYKTVQ.js";
|
|
7
7
|
import {
|
|
8
8
|
createCompositeStore
|
|
9
|
-
} from "../__chunks/
|
|
10
|
-
import "../__chunks/
|
|
9
|
+
} from "../__chunks/VEUNYQYR.js";
|
|
10
|
+
import "../__chunks/MYUKSFP5.js";
|
|
11
11
|
import {
|
|
12
12
|
batch,
|
|
13
13
|
createStore,
|
|
14
14
|
setup,
|
|
15
15
|
sync,
|
|
16
16
|
throwOnConflictingProps
|
|
17
|
-
} from "../__chunks/
|
|
17
|
+
} from "../__chunks/K6ELJFXN.js";
|
|
18
18
|
import {
|
|
19
19
|
defaultValue
|
|
20
20
|
} from "../__chunks/I2VQ3XGR.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createPopoverStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/AKMSZ36N.js";
|
|
5
|
+
import "../__chunks/25MEC56I.js";
|
|
6
|
+
import "../__chunks/L5RYKTVQ.js";
|
|
7
|
+
import "../__chunks/K6ELJFXN.js";
|
|
8
8
|
import "../__chunks/I2VQ3XGR.js";
|
|
9
9
|
import "../__chunks/4R3V3JGP.js";
|
|
10
10
|
|