@ariakit/react-core 0.4.2 → 0.4.3
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 +10 -0
- package/cjs/__chunks/{LEU3BIGC.cjs → 7DQ2LBH2.cjs} +2 -4
- package/cjs/__chunks/{OGH323OW.cjs → AJF5DT5A.cjs} +2 -2
- package/cjs/__chunks/{2ZW7KXDM.cjs → GYHP7IYG.cjs} +2 -2
- package/cjs/__chunks/{33HTKI7L.cjs → IHFGURUM.cjs} +2 -2
- package/cjs/__chunks/{RKBJS357.cjs → YOQXFS4U.cjs} +11 -6
- package/cjs/collection/collection-renderer.d.cts +3 -1
- package/cjs/collection/collection-renderer.d.ts +3 -1
- package/cjs/combobox/combobox-cancel.cjs +1 -1
- package/cjs/combobox/combobox-disclosure.cjs +1 -1
- package/cjs/combobox/combobox-item.cjs +4 -4
- package/cjs/combobox/combobox-row.cjs +2 -2
- package/cjs/composite/composite-item.cjs +2 -2
- package/cjs/composite/composite-overflow-disclosure.cjs +2 -2
- package/cjs/composite/composite-renderer.d.cts +3 -1
- package/cjs/composite/composite-renderer.d.ts +3 -1
- package/cjs/form/form-radio.cjs +3 -3
- package/cjs/menu/menu-item-checkbox.cjs +3 -3
- package/cjs/menu/menu-item-radio.cjs +5 -5
- package/cjs/menu/menu-item.cjs +3 -3
- package/cjs/radio/radio.cjs +3 -3
- package/cjs/select/select-item.cjs +4 -4
- package/cjs/select/select.cjs +1 -1
- package/cjs/tab/tab-panel.cjs +3 -13
- package/cjs/tab/tab-provider.cjs +7 -2
- package/cjs/tab/tab-store.cjs +7 -2
- package/cjs/tab/tab-store.d.cts +22 -7
- package/cjs/tab/tab-store.d.ts +22 -7
- package/cjs/tab/tab.cjs +12 -9
- package/cjs/toolbar/toolbar-container.cjs +3 -3
- package/cjs/toolbar/toolbar-input.cjs +3 -3
- package/cjs/toolbar/toolbar-item.cjs +3 -3
- package/cjs/utils/misc.d.cts +5 -3
- package/cjs/utils/misc.d.ts +5 -3
- package/cjs/utils/types.d.cts +3 -1
- package/cjs/utils/types.d.ts +3 -1
- package/esm/__chunks/{DGR3GYOB.js → APFOINTZ.js} +12 -7
- package/esm/__chunks/{QDVOJENT.js → C5HA76JU.js} +1 -1
- package/esm/__chunks/{H4YBNKTY.js → HW63KLP5.js} +1 -1
- package/esm/__chunks/{VGL3CETR.js → ONUY4D7O.js} +2 -4
- package/esm/__chunks/{DCFMDHRW.js → XK6CE2M5.js} +1 -1
- package/esm/collection/collection-renderer.d.ts +3 -1
- package/esm/combobox/combobox-cancel.js +1 -1
- package/esm/combobox/combobox-disclosure.js +1 -1
- package/esm/combobox/combobox-item.js +4 -4
- package/esm/combobox/combobox-row.js +3 -3
- package/esm/composite/composite-item.js +1 -1
- package/esm/composite/composite-overflow-disclosure.js +1 -1
- package/esm/composite/composite-renderer.d.ts +3 -1
- package/esm/form/form-radio.js +2 -2
- package/esm/menu/menu-item-checkbox.js +2 -2
- package/esm/menu/menu-item-radio.js +3 -3
- package/esm/menu/menu-item.js +2 -2
- package/esm/radio/radio.js +2 -2
- package/esm/select/select-item.js +4 -4
- package/esm/select/select.js +1 -1
- package/esm/tab/tab-panel.js +4 -14
- package/esm/tab/tab-provider.js +6 -1
- package/esm/tab/tab-store.d.ts +22 -7
- package/esm/tab/tab-store.js +6 -1
- package/esm/tab/tab.js +10 -7
- package/esm/toolbar/toolbar-container.js +2 -2
- package/esm/toolbar/toolbar-input.js +2 -2
- package/esm/toolbar/toolbar-item.js +2 -2
- package/esm/utils/misc.d.ts +5 -3
- package/esm/utils/types.d.ts +3 -1
- package/package.json +2 -2
package/cjs/tab/tab-store.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Core from "@ariakit/core/tab/tab-store";
|
|
2
|
+
import type { ComboboxStore } from "../combobox/combobox-store.js";
|
|
2
3
|
import type { CompositeStore, CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
|
|
3
4
|
import type { Store } from "../utils/store.js";
|
|
4
5
|
export declare function useTabStoreProps<T extends Core.TabStore>(store: T, update: () => void, props: TabStoreProps): T & {
|
|
@@ -11,6 +12,7 @@ export declare function useTabStoreProps<T extends Core.TabStore>(store: T, upda
|
|
|
11
12
|
};
|
|
12
13
|
} & {
|
|
13
14
|
composite: CompositeStore<import("../composite/composite-store.js").CompositeStoreItem> | null | undefined;
|
|
15
|
+
combobox: ComboboxStore<import("@ariakit/core/combobox/combobox-store").ComboboxStoreSelectedValue> | null | undefined;
|
|
14
16
|
};
|
|
15
17
|
/**
|
|
16
18
|
* Creates a tab store to control the state of
|
|
@@ -33,10 +35,10 @@ export interface TabStoreItem extends Core.TabStoreItem {
|
|
|
33
35
|
}
|
|
34
36
|
export interface TabStoreState extends Core.TabStoreState, CompositeStoreState<TabStoreItem> {
|
|
35
37
|
}
|
|
36
|
-
export interface TabStoreFunctions extends Pick<TabStoreOptions, "composite">, Omit<Core.TabStoreFunctions, "panels" | "composite">, CompositeStoreFunctions<TabStoreItem> {
|
|
38
|
+
export interface TabStoreFunctions extends Pick<TabStoreOptions, "composite" | "combobox">, Omit<Core.TabStoreFunctions, "panels" | "composite" | "combobox">, CompositeStoreFunctions<TabStoreItem> {
|
|
37
39
|
panels: Store<Core.TabStoreFunctions["panels"]>;
|
|
38
40
|
}
|
|
39
|
-
export interface TabStoreOptions extends Omit<Core.TabStoreOptions, "composite">, CompositeStoreOptions<TabStoreItem> {
|
|
41
|
+
export interface TabStoreOptions extends Omit<Core.TabStoreOptions, "composite" | "combobox">, CompositeStoreOptions<TabStoreItem> {
|
|
40
42
|
/**
|
|
41
43
|
* Function that will be called when the
|
|
42
44
|
* [`selectedId`](https://ariakit.org/reference/tab-provider#selectedid) state
|
|
@@ -48,14 +50,27 @@ export interface TabStoreOptions extends Omit<Core.TabStoreOptions, "composite">
|
|
|
48
50
|
setSelectedId?: (selectedId: TabStoreState["selectedId"]) => void;
|
|
49
51
|
/**
|
|
50
52
|
* A reference to another [composite
|
|
51
|
-
* store](https://ariakit.org/reference/use-composite-store).
|
|
52
|
-
* automatically set when rendering tabs
|
|
53
|
-
* [Combobox](https://ariakit.org/components/combobox) or
|
|
53
|
+
* store](https://ariakit.org/reference/use-composite-store). This is
|
|
54
|
+
* automatically set when rendering tabs as part of another composite widget,
|
|
55
|
+
* such as [Combobox](https://ariakit.org/components/combobox) or
|
|
54
56
|
* [Select](https://ariakit.org/components/select).
|
|
57
|
+
*
|
|
58
|
+
* Live examples:
|
|
59
|
+
* - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
|
|
55
60
|
*/
|
|
56
61
|
composite?: CompositeStore | null;
|
|
62
|
+
/**
|
|
63
|
+
* A reference to a [combobox
|
|
64
|
+
* store](https://ariakit.org/reference/use-combobox-store). This is
|
|
65
|
+
* automatically set when rendering tabs inside a
|
|
66
|
+
* [Combobox](https://ariakit.org/components/combobox).
|
|
67
|
+
*
|
|
68
|
+
* Live examples:
|
|
69
|
+
* - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
|
|
70
|
+
*/
|
|
71
|
+
combobox?: ComboboxStore | null;
|
|
57
72
|
}
|
|
58
|
-
export interface TabStoreProps extends TabStoreOptions, Omit<Core.TabStoreProps, "composite"> {
|
|
73
|
+
export interface TabStoreProps extends TabStoreOptions, Omit<Core.TabStoreProps, "composite" | "combobox"> {
|
|
59
74
|
}
|
|
60
|
-
export interface TabStore extends TabStoreFunctions, Omit<Store<Core.TabStore>, "panels" | "composite"> {
|
|
75
|
+
export interface TabStore extends TabStoreFunctions, Omit<Store<Core.TabStore>, "panels" | "composite" | "combobox"> {
|
|
61
76
|
}
|
package/cjs/tab/tab.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _7DQ2LBH2cjs = require('../__chunks/7DQ2LBH2.cjs');
|
|
6
6
|
require('../__chunks/U4NXCMZ3.cjs');
|
|
7
7
|
require('../__chunks/HD5AHCRI.cjs');
|
|
8
8
|
|
|
@@ -86,14 +86,17 @@ var useTab = _NGD3IQDBcjs.createHook.call(void 0, function useTab2(_a) {
|
|
|
86
86
|
(element) => {
|
|
87
87
|
if (!(store == null ? void 0 : store.composite))
|
|
88
88
|
return element;
|
|
89
|
+
const defaultProps = {
|
|
90
|
+
id,
|
|
91
|
+
store: store.composite,
|
|
92
|
+
shouldRegisterItem: selected && shouldRegisterItem,
|
|
93
|
+
render: element
|
|
94
|
+
};
|
|
89
95
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
90
|
-
|
|
91
|
-
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
store: store.composite,
|
|
95
|
-
shouldRegisterItem: selected && shouldRegisterItem
|
|
96
|
-
}
|
|
96
|
+
_7DQ2LBH2cjs.CompositeItem,
|
|
97
|
+
_AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, defaultProps), {
|
|
98
|
+
render: store.combobox && store.composite !== store.combobox ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _7DQ2LBH2cjs.CompositeItem, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, defaultProps), { store: store.combobox })) : element
|
|
99
|
+
})
|
|
97
100
|
);
|
|
98
101
|
},
|
|
99
102
|
[store, id, selected, shouldRegisterItem]
|
|
@@ -106,7 +109,7 @@ var useTab = _NGD3IQDBcjs.createHook.call(void 0, function useTab2(_a) {
|
|
|
106
109
|
}, props), {
|
|
107
110
|
onClick
|
|
108
111
|
});
|
|
109
|
-
props =
|
|
112
|
+
props = _7DQ2LBH2cjs.useCompositeItem.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
|
|
110
113
|
store
|
|
111
114
|
}, props), {
|
|
112
115
|
accessibleWhenDisabled,
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
var _MJP4XPFZcjs = require('../__chunks/MJP4XPFZ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('../__chunks/
|
|
7
|
+
var _AJF5DT5Acjs = require('../__chunks/AJF5DT5A.cjs');
|
|
8
|
+
require('../__chunks/7DQ2LBH2.cjs');
|
|
9
9
|
require('../__chunks/U4NXCMZ3.cjs');
|
|
10
10
|
require('../__chunks/HD5AHCRI.cjs');
|
|
11
11
|
require('../__chunks/6ZZYUFPW.cjs');
|
|
@@ -38,7 +38,7 @@ var useToolbarContainer = _NGD3IQDBcjs.createHook.call(void 0,
|
|
|
38
38
|
const context = _MVDQWSSVcjs.useToolbarContext.call(void 0, );
|
|
39
39
|
store = store || context;
|
|
40
40
|
props = _MJP4XPFZcjs.useCompositeContainer.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
|
|
41
|
-
props =
|
|
41
|
+
props = _AJF5DT5Acjs.useToolbarItem.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
|
|
42
42
|
return props;
|
|
43
43
|
}
|
|
44
44
|
);
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
var _WGZQRLXVcjs = require('../__chunks/WGZQRLXV.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('../__chunks/
|
|
7
|
+
var _AJF5DT5Acjs = require('../__chunks/AJF5DT5A.cjs');
|
|
8
|
+
require('../__chunks/7DQ2LBH2.cjs');
|
|
9
9
|
require('../__chunks/U4NXCMZ3.cjs');
|
|
10
10
|
require('../__chunks/HD5AHCRI.cjs');
|
|
11
11
|
require('../__chunks/6ZZYUFPW.cjs');
|
|
@@ -38,7 +38,7 @@ var useToolbarInput = _NGD3IQDBcjs.createHook.call(void 0,
|
|
|
38
38
|
const context = _MVDQWSSVcjs.useToolbarContext.call(void 0, );
|
|
39
39
|
store = store || context;
|
|
40
40
|
props = _WGZQRLXVcjs.useCompositeInput.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
|
|
41
|
-
props =
|
|
41
|
+
props = _AJF5DT5Acjs.useToolbarItem.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
|
|
42
42
|
return props;
|
|
43
43
|
}
|
|
44
44
|
);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../__chunks/
|
|
5
|
+
var _AJF5DT5Acjs = require('../__chunks/AJF5DT5A.cjs');
|
|
6
|
+
require('../__chunks/7DQ2LBH2.cjs');
|
|
7
7
|
require('../__chunks/U4NXCMZ3.cjs');
|
|
8
8
|
require('../__chunks/HD5AHCRI.cjs');
|
|
9
9
|
require('../__chunks/6ZZYUFPW.cjs');
|
|
@@ -20,4 +20,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
exports.ToolbarItem =
|
|
23
|
+
exports.ToolbarItem = _AJF5DT5Acjs.ToolbarItem; exports.useToolbarItem = _AJF5DT5Acjs.useToolbarItem;
|
package/cjs/utils/misc.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HTMLAttributes, MutableRefObject, ReactElement,
|
|
1
|
+
import type { HTMLAttributes, MutableRefObject, ReactElement, Ref, RefCallback } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Sets both a function and object React ref.
|
|
4
4
|
*/
|
|
@@ -6,11 +6,13 @@ export declare function setRef<T>(ref: RefCallback<T> | MutableRefObject<T> | nu
|
|
|
6
6
|
/**
|
|
7
7
|
* Checks if an element is a valid React element with a ref.
|
|
8
8
|
*/
|
|
9
|
-
export declare function isValidElementWithRef<P>(element: unknown): element is ReactElement<P> &
|
|
9
|
+
export declare function isValidElementWithRef<P>(element: unknown): element is ReactElement<P> & {
|
|
10
|
+
ref?: Ref<any>;
|
|
11
|
+
};
|
|
10
12
|
/**
|
|
11
13
|
* Gets the ref property from a React element.
|
|
12
14
|
*/
|
|
13
|
-
export declare function getRefProperty(element: unknown):
|
|
15
|
+
export declare function getRefProperty(element: unknown): Ref<any> | undefined;
|
|
14
16
|
/**
|
|
15
17
|
* Merges two sets of props.
|
|
16
18
|
*/
|
package/cjs/utils/misc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HTMLAttributes, MutableRefObject, ReactElement,
|
|
1
|
+
import type { HTMLAttributes, MutableRefObject, ReactElement, Ref, RefCallback } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Sets both a function and object React ref.
|
|
4
4
|
*/
|
|
@@ -6,11 +6,13 @@ export declare function setRef<T>(ref: RefCallback<T> | MutableRefObject<T> | nu
|
|
|
6
6
|
/**
|
|
7
7
|
* Checks if an element is a valid React element with a ref.
|
|
8
8
|
*/
|
|
9
|
-
export declare function isValidElementWithRef<P>(element: unknown): element is ReactElement<P> &
|
|
9
|
+
export declare function isValidElementWithRef<P>(element: unknown): element is ReactElement<P> & {
|
|
10
|
+
ref?: Ref<any>;
|
|
11
|
+
};
|
|
10
12
|
/**
|
|
11
13
|
* Gets the ref property from a React element.
|
|
12
14
|
*/
|
|
13
|
-
export declare function getRefProperty(element: unknown):
|
|
15
|
+
export declare function getRefProperty(element: unknown): Ref<any> | undefined;
|
|
14
16
|
/**
|
|
15
17
|
* Merges two sets of props.
|
|
16
18
|
*/
|
package/cjs/utils/types.d.cts
CHANGED
|
@@ -6,7 +6,9 @@ import type { AnyObject, EmptyObject } from "@ariakit/core/utils/types";
|
|
|
6
6
|
* @example
|
|
7
7
|
* const children: RenderProp = (props) => <div {...props} />;
|
|
8
8
|
*/
|
|
9
|
-
export type RenderProp<P = React.HTMLAttributes<any> &
|
|
9
|
+
export type RenderProp<P = React.HTMLAttributes<any> & {
|
|
10
|
+
ref?: React.Ref<any>;
|
|
11
|
+
}> = (props: P) => React.ReactNode;
|
|
10
12
|
/**
|
|
11
13
|
* The `wrapElement` prop.
|
|
12
14
|
*/
|
package/cjs/utils/types.d.ts
CHANGED
|
@@ -6,7 +6,9 @@ import type { AnyObject, EmptyObject } from "@ariakit/core/utils/types";
|
|
|
6
6
|
* @example
|
|
7
7
|
* const children: RenderProp = (props) => <div {...props} />;
|
|
8
8
|
*/
|
|
9
|
-
export type RenderProp<P = React.HTMLAttributes<any> &
|
|
9
|
+
export type RenderProp<P = React.HTMLAttributes<any> & {
|
|
10
|
+
ref?: React.Ref<any>;
|
|
11
|
+
}> = (props: P) => React.ReactNode;
|
|
10
12
|
/**
|
|
11
13
|
* The `wrapElement` prop.
|
|
12
14
|
*/
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
useComboboxContext
|
|
4
|
+
} from "./N4X7J4OQ.js";
|
|
5
|
+
import {
|
|
6
|
+
useSelectContext
|
|
7
|
+
} from "./SYZHUNAU.js";
|
|
2
8
|
import {
|
|
3
9
|
useCompositeStoreProps
|
|
4
10
|
} from "./ZR5N62ZV.js";
|
|
5
|
-
import {
|
|
6
|
-
useCompositeContext
|
|
7
|
-
} from "./QFI3MCMR.js";
|
|
8
11
|
import {
|
|
9
12
|
useStore,
|
|
10
13
|
useStoreProps
|
|
@@ -21,7 +24,7 @@ import {
|
|
|
21
24
|
import { useMemo } from "react";
|
|
22
25
|
import * as Core from "@ariakit/core/tab/tab-store";
|
|
23
26
|
function useTabStoreProps(store, update, props) {
|
|
24
|
-
useUpdateEffect(update, [props.composite]);
|
|
27
|
+
useUpdateEffect(update, [props.composite, props.combobox]);
|
|
25
28
|
store = useCompositeStoreProps(store, update, props);
|
|
26
29
|
useStoreProps(store, props, "selectedId", "setSelectedId");
|
|
27
30
|
useStoreProps(store, props, "selectOnMove");
|
|
@@ -29,13 +32,15 @@ function useTabStoreProps(store, update, props) {
|
|
|
29
32
|
useUpdateEffect(updatePanels, [store, updatePanels]);
|
|
30
33
|
return Object.assign(
|
|
31
34
|
useMemo(() => __spreadProps(__spreadValues({}, store), { panels }), [store, panels]),
|
|
32
|
-
{ composite: props.composite }
|
|
35
|
+
{ composite: props.composite, combobox: props.combobox }
|
|
33
36
|
);
|
|
34
37
|
}
|
|
35
38
|
function useTabStore(props = {}) {
|
|
36
|
-
const
|
|
39
|
+
const combobox = useComboboxContext();
|
|
40
|
+
const composite = useSelectContext() || combobox;
|
|
37
41
|
props = __spreadProps(__spreadValues({}, props), {
|
|
38
|
-
composite: props.composite !== void 0 ? props.composite : composite
|
|
42
|
+
composite: props.composite !== void 0 ? props.composite : composite,
|
|
43
|
+
combobox: props.combobox !== void 0 ? props.combobox : combobox
|
|
39
44
|
});
|
|
40
45
|
const [store, update] = useStore(Core.createTabStore, props);
|
|
41
46
|
return useTabStoreProps(store, update, props);
|
|
@@ -213,12 +213,10 @@ var useCompositeItem = createHook(
|
|
|
213
213
|
return;
|
|
214
214
|
if (!store)
|
|
215
215
|
return;
|
|
216
|
-
const { activeId, virtualFocus: virtualFocus2, baseElement: baseElement2 } = store.getState();
|
|
217
216
|
if (targetIsAnotherItem(event, store))
|
|
218
217
|
return;
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
218
|
+
const { virtualFocus: virtualFocus2, baseElement: baseElement2 } = store.getState();
|
|
219
|
+
store.setActiveId(id);
|
|
222
220
|
if (!virtualFocus2)
|
|
223
221
|
return;
|
|
224
222
|
if (!isSelfTarget(event))
|
|
@@ -49,7 +49,9 @@ declare function getItem<T extends Item = any>(items: Items<T>, index: number):
|
|
|
49
49
|
export declare function useCollectionRenderer<T extends Item = any>({ store, items: itemsProp, initialItems, gap, itemSize, estimatedItemSize, overscan: overscanProp, orientation: orientationProp, padding, paddingStart, paddingEnd, persistentIndices, renderOnScroll, renderOnResize, children: renderItem, ...props }: CollectionRendererProps<T>): {
|
|
50
50
|
children: ReactNode[];
|
|
51
51
|
wrapElement?: import("../utils/types.js").WrapElement | undefined;
|
|
52
|
-
render?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("../utils/types.js").RenderProp<import("react").HTMLAttributes<any> &
|
|
52
|
+
render?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("../utils/types.js").RenderProp<import("react").HTMLAttributes<any> & {
|
|
53
|
+
ref?: import("react").Ref<any> | undefined;
|
|
54
|
+
}> | undefined;
|
|
53
55
|
ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
|
|
54
56
|
defaultChecked?: boolean | undefined;
|
|
55
57
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
useButton
|
|
4
4
|
} from "../__chunks/CKAOM5LG.js";
|
|
5
|
+
import "../__chunks/PJ7ERAIM.js";
|
|
5
6
|
import {
|
|
6
7
|
useComboboxProviderContext
|
|
7
8
|
} from "../__chunks/N4X7J4OQ.js";
|
|
8
|
-
import "../__chunks/PJ7ERAIM.js";
|
|
9
9
|
import "../__chunks/QFI3MCMR.js";
|
|
10
10
|
import "../__chunks/6LTHW2TQ.js";
|
|
11
11
|
import "../__chunks/5B3U64HV.js";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "../__chunks/LTYBQEWX.js";
|
|
5
5
|
import "../__chunks/R6SM2O47.js";
|
|
6
6
|
import "../__chunks/CKAOM5LG.js";
|
|
7
|
+
import "../__chunks/PJ7ERAIM.js";
|
|
7
8
|
import {
|
|
8
9
|
useComboboxProviderContext
|
|
9
10
|
} from "../__chunks/N4X7J4OQ.js";
|
|
10
|
-
import "../__chunks/PJ7ERAIM.js";
|
|
11
11
|
import "../__chunks/QFI3MCMR.js";
|
|
12
12
|
import "../__chunks/6LTHW2TQ.js";
|
|
13
13
|
import "../__chunks/5B3U64HV.js";
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
useCompositeHover
|
|
4
4
|
} from "../__chunks/VXKKJNIF.js";
|
|
5
|
+
import {
|
|
6
|
+
useCompositeItem
|
|
7
|
+
} from "../__chunks/ONUY4D7O.js";
|
|
8
|
+
import "../__chunks/PJ7ERAIM.js";
|
|
5
9
|
import {
|
|
6
10
|
ComboboxItemCheckedContext,
|
|
7
11
|
ComboboxItemValueContext,
|
|
8
12
|
ComboboxListRoleContext,
|
|
9
13
|
useComboboxScopedContext
|
|
10
14
|
} from "../__chunks/N4X7J4OQ.js";
|
|
11
|
-
import {
|
|
12
|
-
useCompositeItem
|
|
13
|
-
} from "../__chunks/VGL3CETR.js";
|
|
14
|
-
import "../__chunks/PJ7ERAIM.js";
|
|
15
15
|
import "../__chunks/IFMAUEA7.js";
|
|
16
16
|
import "../__chunks/3IEDWLST.js";
|
|
17
17
|
import "../__chunks/QFI3MCMR.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useComboboxScopedContext
|
|
4
|
-
} from "../__chunks/N4X7J4OQ.js";
|
|
5
2
|
import {
|
|
6
3
|
useCompositeRow
|
|
7
4
|
} from "../__chunks/TZ7AP4RP.js";
|
|
5
|
+
import {
|
|
6
|
+
useComboboxScopedContext
|
|
7
|
+
} from "../__chunks/N4X7J4OQ.js";
|
|
8
8
|
import "../__chunks/QFI3MCMR.js";
|
|
9
9
|
import "../__chunks/6LTHW2TQ.js";
|
|
10
10
|
import "../__chunks/5B3U64HV.js";
|
|
@@ -8,7 +8,7 @@ import "../__chunks/DYQUE3V3.js";
|
|
|
8
8
|
import "../__chunks/CKAOM5LG.js";
|
|
9
9
|
import {
|
|
10
10
|
useCompositeItem
|
|
11
|
-
} from "../__chunks/
|
|
11
|
+
} from "../__chunks/ONUY4D7O.js";
|
|
12
12
|
import "../__chunks/PJ7ERAIM.js";
|
|
13
13
|
import "../__chunks/IFMAUEA7.js";
|
|
14
14
|
import "../__chunks/3IEDWLST.js";
|
|
@@ -18,7 +18,9 @@ type ItemProps<T extends Item, P extends BaseItemProps = BaseItemProps> = Collec
|
|
|
18
18
|
export declare function useCompositeRenderer<T extends Item = any>({ store, orientation: orientationProp, persistentIndices: persistentIndicesProp, children: renderItem, "aria-setsize": ariaSetSize, "aria-posinset": ariaPosInSet, ...props }: CompositeRendererProps<T>): {
|
|
19
19
|
children: ReactNode[];
|
|
20
20
|
wrapElement?: import("../utils/types.js").WrapElement | undefined;
|
|
21
|
-
render?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("../utils/types.js").RenderProp<import("react").HTMLAttributes<any> &
|
|
21
|
+
render?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("../utils/types.js").RenderProp<import("react").HTMLAttributes<any> & {
|
|
22
|
+
ref?: import("react").Ref<any> | undefined;
|
|
23
|
+
}> | undefined;
|
|
22
24
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
23
25
|
defaultChecked?: boolean | undefined;
|
|
24
26
|
defaultValue?: string | number | readonly string[] | undefined;
|
package/esm/form/form-radio.js
CHANGED
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
} from "../__chunks/HQB73KOV.js";
|
|
8
8
|
import {
|
|
9
9
|
useRadio
|
|
10
|
-
} from "../__chunks/
|
|
10
|
+
} from "../__chunks/C5HA76JU.js";
|
|
11
11
|
import "../__chunks/MIIHBIKN.js";
|
|
12
|
-
import "../__chunks/
|
|
12
|
+
import "../__chunks/ONUY4D7O.js";
|
|
13
13
|
import "../__chunks/PJ7ERAIM.js";
|
|
14
14
|
import "../__chunks/IFMAUEA7.js";
|
|
15
15
|
import "../__chunks/3IEDWLST.js";
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
import "../__chunks/ZKBA2XH4.js";
|
|
9
9
|
import {
|
|
10
10
|
useMenuItem
|
|
11
|
-
} from "../__chunks/
|
|
11
|
+
} from "../__chunks/HW63KLP5.js";
|
|
12
12
|
import {
|
|
13
13
|
useMenuScopedContext
|
|
14
14
|
} from "../__chunks/3HX4ZAOG.js";
|
|
15
15
|
import "../__chunks/UY6VBRVY.js";
|
|
16
16
|
import "../__chunks/VXKKJNIF.js";
|
|
17
17
|
import "../__chunks/6XBVQI3K.js";
|
|
18
|
-
import "../__chunks/
|
|
18
|
+
import "../__chunks/ONUY4D7O.js";
|
|
19
19
|
import "../__chunks/PJ7ERAIM.js";
|
|
20
20
|
import "../__chunks/IFMAUEA7.js";
|
|
21
21
|
import "../__chunks/3IEDWLST.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
useMenuItem
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/HW63KLP5.js";
|
|
5
5
|
import {
|
|
6
6
|
MenuItemCheckedContext,
|
|
7
7
|
useMenuScopedContext
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
import "../__chunks/UY6VBRVY.js";
|
|
10
10
|
import {
|
|
11
11
|
useRadio
|
|
12
|
-
} from "../__chunks/
|
|
12
|
+
} from "../__chunks/C5HA76JU.js";
|
|
13
13
|
import "../__chunks/MIIHBIKN.js";
|
|
14
14
|
import "../__chunks/VXKKJNIF.js";
|
|
15
|
-
import "../__chunks/
|
|
15
|
+
import "../__chunks/ONUY4D7O.js";
|
|
16
16
|
import "../__chunks/PJ7ERAIM.js";
|
|
17
17
|
import "../__chunks/IFMAUEA7.js";
|
|
18
18
|
import "../__chunks/3IEDWLST.js";
|
package/esm/menu/menu-item.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
MenuItem,
|
|
4
4
|
useMenuItem
|
|
5
|
-
} from "../__chunks/
|
|
5
|
+
} from "../__chunks/HW63KLP5.js";
|
|
6
6
|
import "../__chunks/3HX4ZAOG.js";
|
|
7
7
|
import "../__chunks/UY6VBRVY.js";
|
|
8
8
|
import "../__chunks/VXKKJNIF.js";
|
|
9
|
-
import "../__chunks/
|
|
9
|
+
import "../__chunks/ONUY4D7O.js";
|
|
10
10
|
import "../__chunks/PJ7ERAIM.js";
|
|
11
11
|
import "../__chunks/IFMAUEA7.js";
|
|
12
12
|
import "../__chunks/3IEDWLST.js";
|
package/esm/radio/radio.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Radio,
|
|
4
4
|
useRadio
|
|
5
|
-
} from "../__chunks/
|
|
5
|
+
} from "../__chunks/C5HA76JU.js";
|
|
6
6
|
import "../__chunks/MIIHBIKN.js";
|
|
7
|
-
import "../__chunks/
|
|
7
|
+
import "../__chunks/ONUY4D7O.js";
|
|
8
8
|
import "../__chunks/PJ7ERAIM.js";
|
|
9
9
|
import "../__chunks/IFMAUEA7.js";
|
|
10
10
|
import "../__chunks/3IEDWLST.js";
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
useCompositeHover
|
|
4
4
|
} from "../__chunks/VXKKJNIF.js";
|
|
5
|
+
import {
|
|
6
|
+
useCompositeItem
|
|
7
|
+
} from "../__chunks/ONUY4D7O.js";
|
|
8
|
+
import "../__chunks/PJ7ERAIM.js";
|
|
5
9
|
import {
|
|
6
10
|
SelectItemCheckedContext,
|
|
7
11
|
useSelectScopedContext
|
|
8
12
|
} from "../__chunks/SYZHUNAU.js";
|
|
9
|
-
import {
|
|
10
|
-
useCompositeItem
|
|
11
|
-
} from "../__chunks/VGL3CETR.js";
|
|
12
|
-
import "../__chunks/PJ7ERAIM.js";
|
|
13
13
|
import "../__chunks/IFMAUEA7.js";
|
|
14
14
|
import "../__chunks/3IEDWLST.js";
|
|
15
15
|
import "../__chunks/QFI3MCMR.js";
|
package/esm/select/select.js
CHANGED
|
@@ -13,11 +13,11 @@ import "../__chunks/NN4HLGKS.js";
|
|
|
13
13
|
import {
|
|
14
14
|
useCompositeTypeahead
|
|
15
15
|
} from "../__chunks/QRAMDWD7.js";
|
|
16
|
+
import "../__chunks/PJ7ERAIM.js";
|
|
16
17
|
import {
|
|
17
18
|
SelectScopedContextProvider,
|
|
18
19
|
useSelectProviderContext
|
|
19
20
|
} from "../__chunks/SYZHUNAU.js";
|
|
20
|
-
import "../__chunks/PJ7ERAIM.js";
|
|
21
21
|
import "../__chunks/3IEDWLST.js";
|
|
22
22
|
import "../__chunks/QFI3MCMR.js";
|
|
23
23
|
import "../__chunks/6LTHW2TQ.js";
|
package/esm/tab/tab-panel.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
} from "../__chunks/4R3V3JGP.js";
|
|
41
41
|
|
|
42
42
|
// src/tab/tab-panel.tsx
|
|
43
|
-
import {
|
|
43
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
44
44
|
import { createTabStore } from "@ariakit/core/tab/tab-store";
|
|
45
45
|
import { getAllTabbableIn } from "@ariakit/core/utils/focus";
|
|
46
46
|
import { invariant } from "@ariakit/core/utils/misc";
|
|
@@ -124,27 +124,17 @@ var useTabPanel = createHook(
|
|
|
124
124
|
const open = store.useState(
|
|
125
125
|
(state) => !!tabId && state.selectedId === tabId
|
|
126
126
|
);
|
|
127
|
+
const disclosure = useDisclosureStore({ open });
|
|
128
|
+
const mounted = disclosure.useState("mounted");
|
|
127
129
|
props = __spreadProps(__spreadValues({
|
|
128
130
|
id,
|
|
129
131
|
role: "tabpanel",
|
|
130
132
|
"aria-labelledby": tabId || void 0
|
|
131
133
|
}, props), {
|
|
134
|
+
children: unmountOnHide && !mounted ? null : props.children,
|
|
132
135
|
ref: useMergeRefs(ref, props.ref),
|
|
133
136
|
onKeyDown
|
|
134
137
|
});
|
|
135
|
-
const disclosure = useDisclosureStore({ open });
|
|
136
|
-
const mounted = disclosure.useState("mounted");
|
|
137
|
-
props = useWrapElement(
|
|
138
|
-
props,
|
|
139
|
-
(element) => {
|
|
140
|
-
if (!unmountOnHide)
|
|
141
|
-
return element;
|
|
142
|
-
if (!mounted)
|
|
143
|
-
return /* @__PURE__ */ jsx(Fragment, {});
|
|
144
|
-
return element;
|
|
145
|
-
},
|
|
146
|
-
[unmountOnHide, mounted]
|
|
147
|
-
);
|
|
148
138
|
props = useFocusable(__spreadValues({
|
|
149
139
|
// If the tab panel is rendered as part of another composite widget such
|
|
150
140
|
// as combobox, it should not be focusable.
|
package/esm/tab/tab-provider.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
useTabStore
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/APFOINTZ.js";
|
|
5
|
+
import "../__chunks/N4X7J4OQ.js";
|
|
6
|
+
import "../__chunks/SYZHUNAU.js";
|
|
5
7
|
import {
|
|
6
8
|
TabContextProvider
|
|
7
9
|
} from "../__chunks/VFICFWOQ.js";
|
|
@@ -9,6 +11,9 @@ import "../__chunks/ZR5N62ZV.js";
|
|
|
9
11
|
import "../__chunks/LGWSZOP2.js";
|
|
10
12
|
import "../__chunks/QFI3MCMR.js";
|
|
11
13
|
import "../__chunks/6LTHW2TQ.js";
|
|
14
|
+
import "../__chunks/5B3U64HV.js";
|
|
15
|
+
import "../__chunks/IWHI6Y45.js";
|
|
16
|
+
import "../__chunks/RG6J4TID.js";
|
|
12
17
|
import "../__chunks/GUCZNEAD.js";
|
|
13
18
|
import "../__chunks/PWUXK5IM.js";
|
|
14
19
|
import "../__chunks/WOWUAP42.js";
|