@ariakit/core 0.3.9 → 0.3.11
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 +15 -0
- package/cjs/__chunks/{JNFZSNOI.cjs → BFE5R4EZ.cjs} +17 -17
- package/cjs/__chunks/{EFIT5L4X.cjs → E53JW5BD.cjs} +12 -12
- package/cjs/__chunks/{2UK5WUJX.cjs → F6HPKLO2.cjs} +12 -14
- package/cjs/__chunks/{2LS4JJ4S.cjs → I3Y4EXEF.cjs} +2 -2
- package/cjs/__chunks/{3UT5FE6K.cjs → KBNYGXWI.cjs} +3 -0
- package/cjs/__chunks/{UCLKUBNP.cjs → MI6NUQYQ.cjs} +31 -18
- package/cjs/__chunks/{UTICNXST.cjs → NOFH2BLB.cjs} +7 -7
- package/cjs/__chunks/{GJFZ5ZPP.cjs → OTVLDMN2.cjs} +16 -16
- package/cjs/__chunks/{5SIVMOID.cjs → TQTGWD5K.cjs} +10 -10
- package/cjs/checkbox/checkbox-store.cjs +5 -5
- package/cjs/checkbox/checkbox-store.d.cts +5 -2
- package/cjs/checkbox/checkbox-store.d.ts +5 -2
- package/cjs/collection/collection-store.cjs +4 -4
- package/cjs/collection/collection-store.d.cts +11 -11
- package/cjs/collection/collection-store.d.ts +11 -11
- package/cjs/combobox/combobox-store.cjs +32 -32
- 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 +6 -6
- package/cjs/composite/composite-store.cjs +5 -5
- package/cjs/composite/composite-store.d.cts +128 -54
- package/cjs/composite/composite-store.d.ts +128 -54
- package/cjs/dialog/dialog-store.cjs +5 -5
- package/cjs/disclosure/disclosure-store.cjs +4 -4
- package/cjs/disclosure/disclosure-store.d.cts +33 -27
- package/cjs/disclosure/disclosure-store.d.ts +33 -27
- package/cjs/form/form-store.cjs +23 -23
- package/cjs/form/form-store.d.cts +35 -26
- package/cjs/form/form-store.d.ts +35 -26
- 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 +6 -6
- package/cjs/menu/menu-store.cjs +26 -26
- package/cjs/menu/menu-store.d.cts +16 -7
- package/cjs/menu/menu-store.d.ts +16 -7
- package/cjs/menubar/menubar-store.cjs +6 -6
- 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 +8 -8
- package/cjs/radio/radio-store.d.cts +2 -1
- package/cjs/radio/radio-store.d.ts +2 -1
- package/cjs/select/select-store.cjs +28 -28
- package/cjs/select/select-store.d.cts +2 -1
- package/cjs/select/select-store.d.ts +2 -1
- package/cjs/tab/tab-store.cjs +20 -20
- package/cjs/tab/tab-store.d.cts +20 -15
- package/cjs/tab/tab-store.d.ts +20 -15
- package/cjs/toolbar/toolbar-store.cjs +7 -7
- package/cjs/toolbar/toolbar-store.d.cts +2 -6
- package/cjs/toolbar/toolbar-store.d.ts +2 -6
- package/cjs/tooltip/tooltip-store.cjs +12 -12
- package/cjs/tooltip/tooltip-store.d.cts +6 -4
- package/cjs/tooltip/tooltip-store.d.ts +6 -4
- package/cjs/utils/misc.cjs +2 -2
- package/cjs/utils/store.cjs +3 -3
- package/esm/__chunks/{TLN4ALYH.js → 22K762VQ.js} +22 -9
- package/esm/__chunks/{J6JIOWCS.js → AF6IUUFN.js} +3 -3
- package/esm/__chunks/{A2J4XZ5T.js → EAHJFCU4.js} +1 -3
- package/esm/__chunks/{DLX2AS6C.js → IERTEJ3A.js} +3 -3
- package/esm/__chunks/{T3DVYGXI.js → SOLWE6E5.js} +3 -3
- package/esm/__chunks/{LT2OYWRD.js → SX2XFD6A.js} +1 -1
- package/esm/__chunks/{EZ2TTBAQ.js → XU3EOSCU.js} +3 -3
- package/esm/__chunks/{I2VQ3XGR.js → Y3OOHFCN.js} +3 -0
- package/esm/__chunks/{NKLTHWCR.js → Z5IGYIPT.js} +2 -2
- package/esm/checkbox/checkbox-store.d.ts +5 -2
- package/esm/checkbox/checkbox-store.js +2 -2
- package/esm/collection/collection-store.d.ts +11 -11
- package/esm/collection/collection-store.js +3 -3
- package/esm/combobox/combobox-store.d.ts +3 -1
- package/esm/combobox/combobox-store.js +7 -7
- package/esm/composite/composite-overflow-store.js +5 -5
- package/esm/composite/composite-store.d.ts +128 -54
- package/esm/composite/composite-store.js +4 -4
- package/esm/dialog/dialog-store.js +4 -4
- package/esm/disclosure/disclosure-store.d.ts +33 -27
- package/esm/disclosure/disclosure-store.js +3 -3
- package/esm/form/form-store.d.ts +35 -26
- package/esm/form/form-store.js +3 -3
- package/esm/hovercard/hovercard-store.d.ts +14 -7
- package/esm/hovercard/hovercard-store.js +6 -6
- package/esm/menu/menu-bar-store.js +5 -5
- package/esm/menu/menu-store.d.ts +16 -7
- package/esm/menu/menu-store.js +8 -8
- package/esm/menubar/menubar-store.js +5 -5
- 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 +4 -4
- package/esm/select/select-store.d.ts +2 -1
- package/esm/select/select-store.js +7 -7
- package/esm/tab/tab-store.d.ts +20 -15
- package/esm/tab/tab-store.js +4 -4
- package/esm/toolbar/toolbar-store.d.ts +2 -6
- package/esm/toolbar/toolbar-store.js +4 -4
- package/esm/tooltip/tooltip-store.d.ts +6 -4
- package/esm/tooltip/tooltip-store.js +6 -6
- package/esm/utils/misc.js +1 -1
- package/esm/utils/store.js +2 -2
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
4
|
+
var _BFE5R4EZcjs = require('../__chunks/BFE5R4EZ.cjs');
|
|
5
|
+
require('../__chunks/MI6NUQYQ.cjs');
|
|
6
|
+
require('../__chunks/F6HPKLO2.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _KBNYGXWIcjs = require('../__chunks/KBNYGXWI.cjs');
|
|
10
10
|
require('../__chunks/5F4DVUNS.cjs');
|
|
11
11
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
12
12
|
|
|
@@ -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 _BFE5R4EZcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
22
|
+
orientation: _KBNYGXWIcjs.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: _KBNYGXWIcjs.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 _TQTGWD5Kcjs = require('../__chunks/TQTGWD5K.cjs');
|
|
5
|
+
require('../__chunks/E53JW5BD.cjs');
|
|
6
|
+
require('../__chunks/I3Y4EXEF.cjs');
|
|
7
|
+
require('../__chunks/OTVLDMN2.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _F6HPKLO2cjs = require('../__chunks/F6HPKLO2.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _KBNYGXWIcjs = require('../__chunks/KBNYGXWI.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -20,19 +20,19 @@ 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 =
|
|
24
|
-
placement:
|
|
23
|
+
const hovercard = _TQTGWD5Kcjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
24
|
+
placement: _KBNYGXWIcjs.defaultValue.call(void 0,
|
|
25
25
|
props.placement,
|
|
26
26
|
syncState == null ? void 0 : syncState.placement,
|
|
27
27
|
"top"
|
|
28
28
|
),
|
|
29
|
-
hideTimeout:
|
|
29
|
+
hideTimeout: _KBNYGXWIcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0)
|
|
30
30
|
}));
|
|
31
31
|
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, hovercard.getState()), {
|
|
32
|
-
type:
|
|
33
|
-
skipTimeout:
|
|
32
|
+
type: _KBNYGXWIcjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
|
|
33
|
+
skipTimeout: _KBNYGXWIcjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
|
|
34
34
|
});
|
|
35
|
-
const tooltip =
|
|
35
|
+
const tooltip = _F6HPKLO2cjs.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
|
|
|
@@ -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/misc.cjs
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _KBNYGXWIcjs = require('../__chunks/KBNYGXWI.cjs');
|
|
24
24
|
require('../__chunks/AV6KTKLE.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
@@ -43,4 +43,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
exports.afterPaint =
|
|
46
|
+
exports.afterPaint = _KBNYGXWIcjs.afterPaint; exports.applyState = _KBNYGXWIcjs.applyState; exports.beforePaint = _KBNYGXWIcjs.beforePaint; exports.chain = _KBNYGXWIcjs.chain; exports.cx = _KBNYGXWIcjs.cx; exports.defaultValue = _KBNYGXWIcjs.defaultValue; exports.disabledFromProps = _KBNYGXWIcjs.disabledFromProps; exports.getKeys = _KBNYGXWIcjs.getKeys; exports.hasOwnProperty = _KBNYGXWIcjs.hasOwnProperty; exports.identity = _KBNYGXWIcjs.identity; exports.invariant = _KBNYGXWIcjs.invariant; exports.isEmpty = _KBNYGXWIcjs.isEmpty; exports.isFalsyBooleanCallback = _KBNYGXWIcjs.isFalsyBooleanCallback; exports.isInteger = _KBNYGXWIcjs.isInteger; exports.isObject = _KBNYGXWIcjs.isObject; exports.noop = _KBNYGXWIcjs.noop; exports.normalizeString = _KBNYGXWIcjs.normalizeString; exports.omit = _KBNYGXWIcjs.omit; exports.pick = _KBNYGXWIcjs.pick; exports.shallowEqual = _KBNYGXWIcjs.shallowEqual;
|
package/cjs/utils/store.cjs
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
14
|
-
require('../__chunks/
|
|
13
|
+
var _F6HPKLO2cjs = require('../__chunks/F6HPKLO2.cjs');
|
|
14
|
+
require('../__chunks/KBNYGXWI.cjs');
|
|
15
15
|
require('../__chunks/AV6KTKLE.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
@@ -24,4 +24,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
exports.batch =
|
|
27
|
+
exports.batch = _F6HPKLO2cjs.batch; exports.createStore = _F6HPKLO2cjs.createStore; exports.init = _F6HPKLO2cjs.init; exports.mergeStore = _F6HPKLO2cjs.mergeStore; exports.omit = _F6HPKLO2cjs.omit; exports.pick = _F6HPKLO2cjs.pick; exports.setup = _F6HPKLO2cjs.setup; exports.subscribe = _F6HPKLO2cjs.subscribe; exports.sync = _F6HPKLO2cjs.sync; exports.throwOnConflictingProps = _F6HPKLO2cjs.throwOnConflictingProps;
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
init,
|
|
6
6
|
setup,
|
|
7
7
|
throwOnConflictingProps
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./EAHJFCU4.js";
|
|
9
9
|
import {
|
|
10
10
|
chain,
|
|
11
11
|
defaultValue
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./Y3OOHFCN.js";
|
|
13
13
|
import {
|
|
14
14
|
getDocument
|
|
15
15
|
} from "./DLOEKDPY.js";
|
|
@@ -84,21 +84,29 @@ function createCollectionStore(props = {}) {
|
|
|
84
84
|
};
|
|
85
85
|
const syncPrivateStore = getPrivateStore(props.store);
|
|
86
86
|
const privateStore = createStore(
|
|
87
|
-
{ renderedItems: initialState.renderedItems },
|
|
87
|
+
{ items, renderedItems: initialState.renderedItems },
|
|
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));
|
|
97
|
+
setup(privateStore, () => {
|
|
98
|
+
return batch(privateStore, ["items"], (state) => {
|
|
99
|
+
collection.setState("items", state.items);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
92
102
|
setup(privateStore, () => {
|
|
93
103
|
return batch(privateStore, ["renderedItems"], (state) => {
|
|
94
104
|
let firstRun = true;
|
|
95
|
-
|
|
105
|
+
let raf = requestAnimationFrame(() => {
|
|
96
106
|
const { renderedItems } = collection.getState();
|
|
97
107
|
if (state.renderedItems === renderedItems)
|
|
98
108
|
return;
|
|
99
|
-
|
|
100
|
-
privateStore.setState("renderedItems", sortedItems);
|
|
101
|
-
collection.setState("renderedItems", sortedItems);
|
|
109
|
+
sortItems(state.renderedItems);
|
|
102
110
|
});
|
|
103
111
|
if (typeof IntersectionObserver !== "function") {
|
|
104
112
|
return () => cancelAnimationFrame(raf);
|
|
@@ -108,7 +116,8 @@ function createCollectionStore(props = {}) {
|
|
|
108
116
|
firstRun = false;
|
|
109
117
|
return;
|
|
110
118
|
}
|
|
111
|
-
|
|
119
|
+
cancelAnimationFrame(raf);
|
|
120
|
+
raf = requestAnimationFrame(() => sortItems(state.renderedItems));
|
|
112
121
|
};
|
|
113
122
|
const root = getCommonParent(state.renderedItems);
|
|
114
123
|
const observer = new IntersectionObserver(ioCallback, { root });
|
|
@@ -158,7 +167,11 @@ function createCollectionStore(props = {}) {
|
|
|
158
167
|
};
|
|
159
168
|
return unmergeItem;
|
|
160
169
|
};
|
|
161
|
-
const registerItem = (item) => mergeItem(
|
|
170
|
+
const registerItem = (item) => mergeItem(
|
|
171
|
+
item,
|
|
172
|
+
(getItems) => privateStore.setState("items", getItems),
|
|
173
|
+
true
|
|
174
|
+
);
|
|
162
175
|
return __spreadProps(__spreadValues({}, collection), {
|
|
163
176
|
registerItem,
|
|
164
177
|
renderItem: (item) => chain(
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createDialogStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./SX2XFD6A.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore,
|
|
7
7
|
mergeStore,
|
|
8
8
|
omit,
|
|
9
9
|
throwOnConflictingProps
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./EAHJFCU4.js";
|
|
11
11
|
import {
|
|
12
12
|
defaultValue
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./Y3OOHFCN.js";
|
|
14
14
|
import {
|
|
15
15
|
__objRest,
|
|
16
16
|
__spreadProps,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
noop,
|
|
9
9
|
omit,
|
|
10
10
|
pick
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./Y3OOHFCN.js";
|
|
12
12
|
import {
|
|
13
13
|
__spreadProps,
|
|
14
14
|
__spreadValues
|
|
@@ -37,8 +37,6 @@ function createStore(initialState, ...stores) {
|
|
|
37
37
|
return () => setups.delete(callback);
|
|
38
38
|
};
|
|
39
39
|
const storeInit = () => {
|
|
40
|
-
if (!stores.length)
|
|
41
|
-
return noop;
|
|
42
40
|
const initialized = instances.size;
|
|
43
41
|
const instance = Symbol();
|
|
44
42
|
instances.add(instance);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCollectionStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./22K762VQ.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore,
|
|
7
7
|
setup,
|
|
8
8
|
sync
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./EAHJFCU4.js";
|
|
10
10
|
import {
|
|
11
11
|
defaultValue
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./Y3OOHFCN.js";
|
|
13
13
|
import {
|
|
14
14
|
flatten2DArray,
|
|
15
15
|
reverseArray
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createPopoverStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./AF6IUUFN.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./EAHJFCU4.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultValue
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./Y3OOHFCN.js";
|
|
11
11
|
import {
|
|
12
12
|
__spreadProps,
|
|
13
13
|
__spreadValues
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./IERTEJ3A.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./EAHJFCU4.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultValue
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./Y3OOHFCN.js";
|
|
11
11
|
import {
|
|
12
12
|
__spreadProps,
|
|
13
13
|
__spreadValues
|
|
@@ -63,6 +63,9 @@ function isInteger(arg) {
|
|
|
63
63
|
return String(Math.floor(Number(arg))) === arg;
|
|
64
64
|
}
|
|
65
65
|
function hasOwnProperty(object, prop) {
|
|
66
|
+
if (typeof Object.hasOwn === "function") {
|
|
67
|
+
return Object.hasOwn(object, prop);
|
|
68
|
+
}
|
|
66
69
|
return Object.prototype.hasOwnProperty.call(object, prop);
|
|
67
70
|
}
|
|
68
71
|
function chain(...fns) {
|
|
@@ -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)
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createStore,
|
|
4
4
|
throwOnConflictingProps
|
|
5
|
-
} from "../__chunks/
|
|
5
|
+
} from "../__chunks/EAHJFCU4.js";
|
|
6
6
|
import {
|
|
7
7
|
defaultValue
|
|
8
|
-
} from "../__chunks/
|
|
8
|
+
} from "../__chunks/Y3OOHFCN.js";
|
|
9
9
|
import {
|
|
10
10
|
__spreadProps,
|
|
11
11
|
__spreadValues
|
|
@@ -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,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCollectionStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/22K762VQ.js";
|
|
5
|
+
import "../__chunks/EAHJFCU4.js";
|
|
6
|
+
import "../__chunks/Y3OOHFCN.js";
|
|
7
7
|
import "../__chunks/DLOEKDPY.js";
|
|
8
8
|
import "../__chunks/4R3V3JGP.js";
|
|
9
9
|
export {
|
|
@@ -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,23 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createPopoverStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/AF6IUUFN.js";
|
|
5
|
+
import "../__chunks/SX2XFD6A.js";
|
|
6
|
+
import "../__chunks/Z5IGYIPT.js";
|
|
7
7
|
import {
|
|
8
8
|
createCompositeStore
|
|
9
|
-
} from "../__chunks/
|
|
10
|
-
import "../__chunks/
|
|
9
|
+
} from "../__chunks/IERTEJ3A.js";
|
|
10
|
+
import "../__chunks/22K762VQ.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/EAHJFCU4.js";
|
|
18
18
|
import {
|
|
19
19
|
defaultValue
|
|
20
|
-
} from "../__chunks/
|
|
20
|
+
} from "../__chunks/Y3OOHFCN.js";
|
|
21
21
|
import {
|
|
22
22
|
isSafari,
|
|
23
23
|
isTouchDevice
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createPopoverStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/AF6IUUFN.js";
|
|
5
|
+
import "../__chunks/SX2XFD6A.js";
|
|
6
|
+
import "../__chunks/Z5IGYIPT.js";
|
|
7
|
+
import "../__chunks/EAHJFCU4.js";
|
|
8
|
+
import "../__chunks/Y3OOHFCN.js";
|
|
9
9
|
import "../__chunks/4R3V3JGP.js";
|
|
10
10
|
|
|
11
11
|
// src/composite/composite-overflow-store.ts
|