@ariakit/react-core 0.3.7 → 0.3.8
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 +24 -0
- package/cjs/__chunks/{VEG6PRAG.cjs → 3WCBE6SU.cjs} +3 -1
- package/cjs/__chunks/{CILQPSH2.cjs → FA25CV2I.cjs} +2 -2
- package/cjs/__chunks/{AYDXWQBF.cjs → L3WS5HGI.cjs} +2 -0
- package/cjs/__chunks/{QU2266CJ.cjs → WH4I6OSN.cjs} +12 -4
- package/cjs/__chunks/{LVOI2KVN.cjs → XGKLTARH.cjs} +2 -2
- package/cjs/checkbox/checkbox-provider.cjs +2 -2
- package/cjs/combobox/combobox-cancel.cjs +2 -2
- package/cjs/combobox/combobox-context.cjs +4 -2
- package/cjs/combobox/combobox-context.d.cts +6 -5
- package/cjs/combobox/combobox-context.d.ts +6 -5
- package/cjs/combobox/combobox-disclosure.cjs +2 -2
- package/cjs/combobox/combobox-item-check.cjs +50 -0
- package/cjs/combobox/combobox-item-check.d.cts +60 -0
- package/cjs/combobox/combobox-item-check.d.ts +60 -0
- package/cjs/combobox/combobox-item-value.cjs +3 -3
- package/cjs/combobox/combobox-item.cjs +45 -8
- package/cjs/combobox/combobox-item.d.cts +31 -13
- package/cjs/combobox/combobox-item.d.ts +31 -13
- package/cjs/combobox/combobox-label.cjs +55 -0
- package/cjs/combobox/combobox-label.d.cts +42 -0
- package/cjs/combobox/combobox-label.d.ts +42 -0
- package/cjs/combobox/combobox-list.cjs +3 -3
- package/cjs/combobox/combobox-popover.cjs +5 -5
- package/cjs/combobox/combobox-provider.cjs +4 -4
- package/cjs/combobox/combobox-provider.d.cts +8 -4
- package/cjs/combobox/combobox-provider.d.ts +8 -4
- package/cjs/combobox/combobox-row.cjs +2 -2
- package/cjs/combobox/combobox-separator.cjs +2 -2
- package/cjs/combobox/combobox-store.cjs +2 -2
- package/cjs/combobox/combobox-store.d.cts +26 -8
- package/cjs/combobox/combobox-store.d.ts +26 -8
- package/cjs/combobox/combobox.cjs +22 -12
- package/cjs/composite/composite-hover.d.cts +3 -0
- package/cjs/composite/composite-hover.d.ts +3 -0
- package/cjs/composite/composite-item.d.cts +3 -0
- package/cjs/composite/composite-item.d.ts +3 -0
- package/cjs/disclosure/disclosure-content.d.cts +1 -0
- package/cjs/disclosure/disclosure-content.d.ts +1 -0
- package/cjs/disclosure/disclosure.d.cts +3 -0
- package/cjs/disclosure/disclosure.d.ts +3 -0
- package/cjs/focusable/focusable.d.cts +1 -0
- package/cjs/focusable/focusable.d.ts +1 -0
- package/cjs/form/form-checkbox.cjs +1 -1
- package/cjs/hovercard/hovercard-anchor.d.cts +3 -0
- package/cjs/hovercard/hovercard-anchor.d.ts +3 -0
- package/cjs/menu/menu-item-checkbox.cjs +1 -1
- package/cjs/menu/menu-provider.cjs +3 -3
- package/cjs/menu/menu-store.cjs +3 -3
- package/cjs/menu/menu-store.d.cts +5 -11
- package/cjs/menu/menu-store.d.ts +5 -11
- package/cjs/popover/popover.d.cts +4 -0
- package/cjs/popover/popover.d.ts +4 -0
- package/cjs/portal/portal.d.cts +3 -0
- package/cjs/portal/portal.d.ts +3 -0
- package/cjs/select/select-item.cjs +3 -3
- package/cjs/select/select-label.cjs +1 -1
- package/cjs/select/select-provider.cjs +3 -3
- package/cjs/select/select-store.cjs +3 -3
- package/cjs/select/select-store.d.cts +1 -7
- package/cjs/select/select-store.d.ts +1 -7
- package/combobox/combobox-item-check/package.json +8 -0
- package/combobox/combobox-label/package.json +8 -0
- package/esm/__chunks/{KFUKDUTY.js → 4AMOOZBQ.js} +10 -2
- package/esm/__chunks/{PHTJ3BCW.js → 7HYEBVZE.js} +1 -1
- package/esm/__chunks/{NE6JAKK6.js → P3UZS6BC.js} +1 -1
- package/esm/__chunks/{MTC2KUZZ.js → W76OTZCC.js} +3 -1
- package/esm/__chunks/{24AKC2LC.js → ZETMAOTK.js} +2 -0
- package/esm/checkbox/checkbox-provider.js +3 -3
- package/esm/combobox/combobox-cancel.js +1 -1
- package/esm/combobox/combobox-context.d.ts +6 -5
- package/esm/combobox/combobox-context.js +3 -1
- package/esm/combobox/combobox-disclosure.js +1 -1
- package/esm/combobox/combobox-item-check.d.ts +60 -0
- package/esm/combobox/combobox-item-check.js +50 -0
- package/esm/combobox/combobox-item-value.js +1 -1
- package/esm/combobox/combobox-item.d.ts +31 -13
- package/esm/combobox/combobox-item.js +44 -7
- package/esm/combobox/combobox-label.d.ts +42 -0
- package/esm/combobox/combobox-label.js +55 -0
- package/esm/combobox/combobox-list.js +2 -2
- package/esm/combobox/combobox-popover.js +2 -2
- package/esm/combobox/combobox-provider.d.ts +8 -4
- package/esm/combobox/combobox-provider.js +2 -2
- package/esm/combobox/combobox-row.js +1 -1
- package/esm/combobox/combobox-separator.js +1 -1
- package/esm/combobox/combobox-store.d.ts +26 -8
- package/esm/combobox/combobox-store.js +1 -1
- package/esm/combobox/combobox.js +21 -11
- package/esm/composite/composite-hover.d.ts +3 -0
- package/esm/composite/composite-item.d.ts +3 -0
- package/esm/disclosure/disclosure-content.d.ts +1 -0
- package/esm/disclosure/disclosure.d.ts +3 -0
- package/esm/focusable/focusable.d.ts +1 -0
- package/esm/form/form-checkbox.js +1 -1
- package/esm/hovercard/hovercard-anchor.d.ts +3 -0
- package/esm/menu/menu-item-checkbox.js +1 -1
- package/esm/menu/menu-provider.js +2 -2
- package/esm/menu/menu-store.d.ts +5 -11
- package/esm/menu/menu-store.js +2 -2
- package/esm/popover/popover.d.ts +4 -0
- package/esm/portal/portal.d.ts +3 -0
- package/esm/select/select-item.js +3 -3
- package/esm/select/select-label.js +2 -2
- package/esm/select/select-provider.js +2 -2
- package/esm/select/select-store.d.ts +1 -7
- package/esm/select/select-store.js +2 -2
- package/package.json +16 -2
- package/cjs/collection/collection-context.d.cts +0 -34
- package/cjs/collection/collection-context.d.ts +0 -34
- package/cjs/composite/utils.d.cts +0 -69
- package/cjs/composite/utils.d.ts +0 -69
- package/cjs/tab/tab-store.d.cts +0 -74
- package/cjs/tab/tab-store.d.ts +0 -74
- package/esm/collection/collection-context.d.ts +0 -34
- package/esm/composite/utils.d.ts +0 -69
- package/esm/tab/tab-store.d.ts +0 -74
|
@@ -61,6 +61,7 @@ export interface DisclosureContentOptions<T extends As = "div"> extends Options<
|
|
|
61
61
|
* the DOM when it's hidden.
|
|
62
62
|
*
|
|
63
63
|
* Live examples:
|
|
64
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
64
65
|
* - [Combobox with integrated
|
|
65
66
|
* filter](https://ariakit.org/examples/combobox-filtering-integrated)
|
|
66
67
|
* - [Textarea with inline
|
|
@@ -42,6 +42,9 @@ export interface DisclosureOptions<T extends As = "button"> extends ButtonOption
|
|
|
42
42
|
* [`toggle`](https://ariakit.org/reference/use-disclosure-store#toggle) will
|
|
43
43
|
* be called on click. This is useful if you want to handle the toggle logic
|
|
44
44
|
* yourself.
|
|
45
|
+
*
|
|
46
|
+
* Live examples:
|
|
47
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
45
48
|
* @default true
|
|
46
49
|
*/
|
|
47
50
|
toggleOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;
|
|
@@ -42,6 +42,9 @@ export interface DisclosureOptions<T extends As = "button"> extends ButtonOption
|
|
|
42
42
|
* [`toggle`](https://ariakit.org/reference/use-disclosure-store#toggle) will
|
|
43
43
|
* be called on click. This is useful if you want to handle the toggle logic
|
|
44
44
|
* yourself.
|
|
45
|
+
*
|
|
46
|
+
* Live examples:
|
|
47
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
45
48
|
* @default true
|
|
46
49
|
*/
|
|
47
50
|
toggleOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;
|
|
@@ -106,6 +106,7 @@ export interface FocusableOptions<T extends As = "div"> extends Options<T> {
|
|
|
106
106
|
* programmatic equivalent of the `data-focus-visible` attribute.
|
|
107
107
|
*
|
|
108
108
|
* Live examples:
|
|
109
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
109
110
|
* - [Custom Checkbox](https://ariakit.org/examples/checkbox-custom)
|
|
110
111
|
*/
|
|
111
112
|
onFocusVisible?: BivariantCallback<(event: SyntheticEvent<HTMLElement>) => void>;
|
|
@@ -106,6 +106,7 @@ export interface FocusableOptions<T extends As = "div"> extends Options<T> {
|
|
|
106
106
|
* programmatic equivalent of the `data-focus-visible` attribute.
|
|
107
107
|
*
|
|
108
108
|
* Live examples:
|
|
109
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
109
110
|
* - [Custom Checkbox](https://ariakit.org/examples/checkbox-custom)
|
|
110
111
|
*/
|
|
111
112
|
onFocusVisible?: BivariantCallback<(event: SyntheticEvent<HTMLElement>) => void>;
|
|
@@ -8,10 +8,10 @@ var _FROYTN4Bcjs = require('../__chunks/FROYTN4B.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _BY6ER73Ucjs = require('../__chunks/BY6ER73U.cjs');
|
|
11
|
+
require('../__chunks/63UPRTFZ.cjs');
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
var _5GQV7KPQcjs = require('../__chunks/5GQV7KPQ.cjs');
|
|
14
|
-
require('../__chunks/63UPRTFZ.cjs');
|
|
15
15
|
require('../__chunks/ERFHNHON.cjs');
|
|
16
16
|
require('../__chunks/DAJUUBUI.cjs');
|
|
17
17
|
require('../__chunks/R5A2WTWB.cjs');
|
|
@@ -39,6 +39,9 @@ export interface HovercardAnchorOptions<T extends As = "a"> extends FocusableOpt
|
|
|
39
39
|
store?: HovercardStore;
|
|
40
40
|
/**
|
|
41
41
|
* Whether to show the hovercard on mouse move.
|
|
42
|
+
*
|
|
43
|
+
* Live examples:
|
|
44
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
42
45
|
* @default true
|
|
43
46
|
*/
|
|
44
47
|
showOnHover?: BooleanOrCallback<ReactMouseEvent<HTMLElement>>;
|
|
@@ -39,6 +39,9 @@ export interface HovercardAnchorOptions<T extends As = "a"> extends FocusableOpt
|
|
|
39
39
|
store?: HovercardStore;
|
|
40
40
|
/**
|
|
41
41
|
* Whether to show the hovercard on mouse move.
|
|
42
|
+
*
|
|
43
|
+
* Live examples:
|
|
44
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
42
45
|
* @default true
|
|
43
46
|
*/
|
|
44
47
|
showOnHover?: BooleanOrCallback<ReactMouseEvent<HTMLElement>>;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
var _BY6ER73Ucjs = require('../__chunks/BY6ER73U.cjs');
|
|
5
|
+
require('../__chunks/63UPRTFZ.cjs');
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
var _5GQV7KPQcjs = require('../__chunks/5GQV7KPQ.cjs');
|
|
8
|
-
require('../__chunks/63UPRTFZ.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _YAPOM5RTcjs = require('../__chunks/YAPOM5RT.cjs');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _XGKLTARHcjs = require('../__chunks/XGKLTARH.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _NGEKJJDHcjs = require('../__chunks/NGEKJJDH.cjs');
|
|
8
8
|
require('../__chunks/7LBZXSLY.cjs');
|
|
9
|
-
require('../__chunks/
|
|
9
|
+
require('../__chunks/3WCBE6SU.cjs');
|
|
10
10
|
require('../__chunks/A5RWZSX7.cjs');
|
|
11
11
|
require('../__chunks/TUVU5ERH.cjs');
|
|
12
12
|
require('../__chunks/UZNYSPKP.cjs');
|
|
@@ -28,7 +28,7 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
28
28
|
// src/menu/menu-provider.tsx
|
|
29
29
|
var _jsxruntime = require('react/jsx-runtime');
|
|
30
30
|
function MenuProvider(props = {}) {
|
|
31
|
-
const store =
|
|
31
|
+
const store = _XGKLTARHcjs.useMenuStore.call(void 0, props);
|
|
32
32
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _NGEKJJDHcjs.MenuContextProvider, { value: store, children: props.children });
|
|
33
33
|
}
|
|
34
34
|
|
package/cjs/menu/menu-store.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _XGKLTARHcjs = require('../__chunks/XGKLTARH.cjs');
|
|
6
6
|
require('../__chunks/NGEKJJDH.cjs');
|
|
7
7
|
require('../__chunks/7LBZXSLY.cjs');
|
|
8
|
-
require('../__chunks/
|
|
8
|
+
require('../__chunks/3WCBE6SU.cjs');
|
|
9
9
|
require('../__chunks/A5RWZSX7.cjs');
|
|
10
10
|
require('../__chunks/TUVU5ERH.cjs');
|
|
11
11
|
require('../__chunks/UZNYSPKP.cjs');
|
|
@@ -26,4 +26,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
exports.useMenuStore =
|
|
29
|
+
exports.useMenuStore = _XGKLTARHcjs.useMenuStore; exports.useMenuStoreProps = _XGKLTARHcjs.useMenuStoreProps;
|
|
@@ -7,18 +7,12 @@ import type { MenubarStore } from "../menubar/menubar-store.js";
|
|
|
7
7
|
import type { Store } from "../utils/store.js";
|
|
8
8
|
type Values = Core.MenuStoreValues;
|
|
9
9
|
export declare function useMenuStoreProps<T extends Core.MenuStore>(store: T, update: () => void, props: MenuStoreProps): T & {
|
|
10
|
-
combobox: (
|
|
11
|
-
useState: {
|
|
12
|
-
(): import("@ariakit/core/combobox/combobox-store").ComboboxStoreState;
|
|
13
|
-
<K extends keyof import("@ariakit/core/combobox/combobox-store").ComboboxStoreState>(key: K): import("@ariakit/core/combobox/combobox-store").ComboboxStoreState[K];
|
|
14
|
-
<V>(selector: (state: import("@ariakit/core/combobox/combobox-store").ComboboxStoreState) => V): V;
|
|
15
|
-
};
|
|
16
|
-
}) | null | undefined;
|
|
10
|
+
combobox: (ComboboxStore<string | string[]> & import("@ariakit/core/combobox/combobox-store").ComboboxStore<string | string[]>) | null | undefined;
|
|
17
11
|
parent: (MenuStoreFunctions<Core.MenuStoreValues> & Core.MenuStoreFunctions<Core.MenuStoreValues> & import("@ariakit/core/utils/store").Store<Core.MenuStoreState<Core.MenuStoreValues>> & {
|
|
18
12
|
useState: {
|
|
19
13
|
(): Core.MenuStoreState<Core.MenuStoreValues>;
|
|
20
|
-
<
|
|
21
|
-
<
|
|
14
|
+
<K extends keyof Core.MenuStoreState<Core.MenuStoreValues>>(key: K): Core.MenuStoreState<Core.MenuStoreValues>[K];
|
|
15
|
+
<V>(selector: (state: Core.MenuStoreState<Core.MenuStoreValues>) => V): V;
|
|
22
16
|
};
|
|
23
17
|
} & Core.MenuStoreFunctions<{
|
|
24
18
|
[x: string]: string | number | boolean | (string | number)[];
|
|
@@ -28,8 +22,8 @@ export declare function useMenuStoreProps<T extends Core.MenuStore>(store: T, up
|
|
|
28
22
|
menubar: (import("../menubar/menubar-store.js").MenubarStoreFunctions & import("@ariakit/core/menubar/menubar-store").MenubarStore & {
|
|
29
23
|
useState: {
|
|
30
24
|
(): import("@ariakit/core/menubar/menubar-store").MenubarStoreState;
|
|
31
|
-
<
|
|
32
|
-
<
|
|
25
|
+
<K_1 extends keyof import("@ariakit/core/menubar/menubar-store").MenubarStoreState>(key: K_1): import("@ariakit/core/menubar/menubar-store").MenubarStoreState[K_1];
|
|
26
|
+
<V_1>(selector: (state: import("@ariakit/core/menubar/menubar-store").MenubarStoreState) => V_1): V_1;
|
|
33
27
|
};
|
|
34
28
|
}) | null | undefined;
|
|
35
29
|
};
|
package/cjs/menu/menu-store.d.ts
CHANGED
|
@@ -7,18 +7,12 @@ import type { MenubarStore } from "../menubar/menubar-store.js";
|
|
|
7
7
|
import type { Store } from "../utils/store.js";
|
|
8
8
|
type Values = Core.MenuStoreValues;
|
|
9
9
|
export declare function useMenuStoreProps<T extends Core.MenuStore>(store: T, update: () => void, props: MenuStoreProps): T & {
|
|
10
|
-
combobox: (
|
|
11
|
-
useState: {
|
|
12
|
-
(): import("@ariakit/core/combobox/combobox-store").ComboboxStoreState;
|
|
13
|
-
<K extends keyof import("@ariakit/core/combobox/combobox-store").ComboboxStoreState>(key: K): import("@ariakit/core/combobox/combobox-store").ComboboxStoreState[K];
|
|
14
|
-
<V>(selector: (state: import("@ariakit/core/combobox/combobox-store").ComboboxStoreState) => V): V;
|
|
15
|
-
};
|
|
16
|
-
}) | null | undefined;
|
|
10
|
+
combobox: (ComboboxStore<string | string[]> & import("@ariakit/core/combobox/combobox-store").ComboboxStore<string | string[]>) | null | undefined;
|
|
17
11
|
parent: (MenuStoreFunctions<Core.MenuStoreValues> & Core.MenuStoreFunctions<Core.MenuStoreValues> & import("@ariakit/core/utils/store").Store<Core.MenuStoreState<Core.MenuStoreValues>> & {
|
|
18
12
|
useState: {
|
|
19
13
|
(): Core.MenuStoreState<Core.MenuStoreValues>;
|
|
20
|
-
<
|
|
21
|
-
<
|
|
14
|
+
<K extends keyof Core.MenuStoreState<Core.MenuStoreValues>>(key: K): Core.MenuStoreState<Core.MenuStoreValues>[K];
|
|
15
|
+
<V>(selector: (state: Core.MenuStoreState<Core.MenuStoreValues>) => V): V;
|
|
22
16
|
};
|
|
23
17
|
} & Core.MenuStoreFunctions<{
|
|
24
18
|
[x: string]: string | number | boolean | (string | number)[];
|
|
@@ -28,8 +22,8 @@ export declare function useMenuStoreProps<T extends Core.MenuStore>(store: T, up
|
|
|
28
22
|
menubar: (import("../menubar/menubar-store.js").MenubarStoreFunctions & import("@ariakit/core/menubar/menubar-store").MenubarStore & {
|
|
29
23
|
useState: {
|
|
30
24
|
(): import("@ariakit/core/menubar/menubar-store").MenubarStoreState;
|
|
31
|
-
<
|
|
32
|
-
<
|
|
25
|
+
<K_1 extends keyof import("@ariakit/core/menubar/menubar-store").MenubarStoreState>(key: K_1): import("@ariakit/core/menubar/menubar-store").MenubarStoreState[K_1];
|
|
26
|
+
<V_1>(selector: (state: import("@ariakit/core/menubar/menubar-store").MenubarStoreState) => V_1): V_1;
|
|
33
27
|
};
|
|
34
28
|
}) | null | undefined;
|
|
35
29
|
};
|
|
@@ -43,6 +43,9 @@ export interface PopoverOptions<T extends As = "div"> extends DialogOptions<T> {
|
|
|
43
43
|
/**
|
|
44
44
|
* Props that will be passed to the popover wrapper element. This element will
|
|
45
45
|
* be used to position the popover.
|
|
46
|
+
*
|
|
47
|
+
* Live examples:
|
|
48
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
46
49
|
*/
|
|
47
50
|
wrapperProps?: HTMLAttributes<HTMLDivElement>;
|
|
48
51
|
/**
|
|
@@ -68,6 +71,7 @@ export interface PopoverOptions<T extends As = "div"> extends DialogOptions<T> {
|
|
|
68
71
|
* negative values to make the popover shift to the opposite side.
|
|
69
72
|
*
|
|
70
73
|
* Live examples:
|
|
74
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
71
75
|
* - [Submenu](https://ariakit.org/examples/menu-nested)
|
|
72
76
|
* - [Menubar](https://ariakit.org/components/menubar)
|
|
73
77
|
* @default 0
|
package/cjs/popover/popover.d.ts
CHANGED
|
@@ -43,6 +43,9 @@ export interface PopoverOptions<T extends As = "div"> extends DialogOptions<T> {
|
|
|
43
43
|
/**
|
|
44
44
|
* Props that will be passed to the popover wrapper element. This element will
|
|
45
45
|
* be used to position the popover.
|
|
46
|
+
*
|
|
47
|
+
* Live examples:
|
|
48
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
46
49
|
*/
|
|
47
50
|
wrapperProps?: HTMLAttributes<HTMLDivElement>;
|
|
48
51
|
/**
|
|
@@ -68,6 +71,7 @@ export interface PopoverOptions<T extends As = "div"> extends DialogOptions<T> {
|
|
|
68
71
|
* negative values to make the popover shift to the opposite side.
|
|
69
72
|
*
|
|
70
73
|
* Live examples:
|
|
74
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
71
75
|
* - [Submenu](https://ariakit.org/examples/menu-nested)
|
|
72
76
|
* - [Menubar](https://ariakit.org/components/menubar)
|
|
73
77
|
* @default 0
|
package/cjs/portal/portal.d.cts
CHANGED
|
@@ -98,6 +98,9 @@ export interface PortalOptions<T extends As = "div"> extends Options<T> {
|
|
|
98
98
|
* An HTML element or a memoized callback function that returns an HTML
|
|
99
99
|
* element to be used as the portal element. By default, the portal element
|
|
100
100
|
* will be a `div` element appended to the `document.body`.
|
|
101
|
+
*
|
|
102
|
+
* Live examples:
|
|
103
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
101
104
|
* @example
|
|
102
105
|
* ```jsx
|
|
103
106
|
* const [portal, setPortal] = useState(null);
|
package/cjs/portal/portal.d.ts
CHANGED
|
@@ -98,6 +98,9 @@ export interface PortalOptions<T extends As = "div"> extends Options<T> {
|
|
|
98
98
|
* An HTML element or a memoized callback function that returns an HTML
|
|
99
99
|
* element to be used as the portal element. By default, the portal element
|
|
100
100
|
* will be a `div` element appended to the `document.body`.
|
|
101
|
+
*
|
|
102
|
+
* Live examples:
|
|
103
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
101
104
|
* @example
|
|
102
105
|
* ```jsx
|
|
103
106
|
* const [portal, setPortal] = useState(null);
|
|
@@ -45,9 +45,9 @@ var _events = require('@ariakit/core/utils/events');
|
|
|
45
45
|
var _misc = require('@ariakit/core/utils/misc');
|
|
46
46
|
var _jsxruntime = require('react/jsx-runtime');
|
|
47
47
|
function isSelected(storeValue, itemValue) {
|
|
48
|
-
if (storeValue == null)
|
|
49
|
-
return false;
|
|
50
48
|
if (itemValue == null)
|
|
49
|
+
return;
|
|
50
|
+
if (storeValue == null)
|
|
51
51
|
return false;
|
|
52
52
|
if (Array.isArray(storeValue)) {
|
|
53
53
|
return storeValue.includes(itemValue);
|
|
@@ -127,7 +127,7 @@ var useSelectItem = _RNZNGEL4cjs.createHook.call(void 0,
|
|
|
127
127
|
const selected = store.useState((state) => isSelected(state.value, value));
|
|
128
128
|
props = _EO6LS72Hcjs.useWrapElement.call(void 0,
|
|
129
129
|
props,
|
|
130
|
-
(element) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _2WCJJQSKcjs.SelectItemCheckedContext.Provider, { value: selected, children: element }),
|
|
130
|
+
(element) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _2WCJJQSKcjs.SelectItemCheckedContext.Provider, { value: selected != null ? selected : false, children: element }),
|
|
131
131
|
[selected]
|
|
132
132
|
);
|
|
133
133
|
const contentElement = store.useState("contentElement");
|
|
@@ -29,7 +29,7 @@ var _misc = require('@ariakit/core/utils/misc');
|
|
|
29
29
|
var useSelectLabel = _RNZNGEL4cjs.createHook.call(void 0,
|
|
30
30
|
(_a) => {
|
|
31
31
|
var _b = _a, { store } = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, ["store"]);
|
|
32
|
-
const context = _2WCJJQSKcjs.
|
|
32
|
+
const context = _2WCJJQSKcjs.useSelectProviderContext.call(void 0, );
|
|
33
33
|
store = store || context;
|
|
34
34
|
_misc.invariant.call(void 0,
|
|
35
35
|
store,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
4
|
+
var _FA25CV2Icjs = require('../__chunks/FA25CV2I.cjs');
|
|
5
|
+
require('../__chunks/3WCBE6SU.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _2WCJJQSKcjs = require('../__chunks/2WCJJQSK.cjs');
|
|
@@ -25,7 +25,7 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
25
25
|
// src/select/select-provider.tsx
|
|
26
26
|
var _jsxruntime = require('react/jsx-runtime');
|
|
27
27
|
function SelectProvider(props = {}) {
|
|
28
|
-
const store =
|
|
28
|
+
const store = _FA25CV2Icjs.useSelectStore.call(void 0, props);
|
|
29
29
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _2WCJJQSKcjs.SelectContextProvider, { value: store, children: props.children });
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../__chunks/
|
|
5
|
+
var _FA25CV2Icjs = require('../__chunks/FA25CV2I.cjs');
|
|
6
|
+
require('../__chunks/3WCBE6SU.cjs');
|
|
7
7
|
require('../__chunks/A5RWZSX7.cjs');
|
|
8
8
|
require('../__chunks/TUVU5ERH.cjs');
|
|
9
9
|
require('../__chunks/UZNYSPKP.cjs');
|
|
@@ -22,4 +22,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
exports.useSelectStore =
|
|
25
|
+
exports.useSelectStore = _FA25CV2Icjs.useSelectStore; exports.useSelectStoreProps = _FA25CV2Icjs.useSelectStoreProps;
|
|
@@ -7,13 +7,7 @@ import type { Store } from "../utils/store.js";
|
|
|
7
7
|
type Item = Core.SelectStoreItem;
|
|
8
8
|
type Value = Core.SelectStoreValue;
|
|
9
9
|
export declare function useSelectStoreProps<T extends Core.SelectStore>(store: T, update: () => void, props: SelectStoreProps): T & {
|
|
10
|
-
combobox: (
|
|
11
|
-
useState: {
|
|
12
|
-
(): import("@ariakit/core/combobox/combobox-store").ComboboxStoreState;
|
|
13
|
-
<K extends keyof import("@ariakit/core/combobox/combobox-store").ComboboxStoreState>(key: K): import("@ariakit/core/combobox/combobox-store").ComboboxStoreState[K];
|
|
14
|
-
<V>(selector: (state: import("@ariakit/core/combobox/combobox-store").ComboboxStoreState) => V): V;
|
|
15
|
-
};
|
|
16
|
-
}) | null | undefined;
|
|
10
|
+
combobox: (ComboboxStore<string | string[]> & import("@ariakit/core/combobox/combobox-store").ComboboxStore<string | string[]>) | null | undefined;
|
|
17
11
|
};
|
|
18
12
|
/**
|
|
19
13
|
* Creates a select store.
|
|
@@ -7,13 +7,7 @@ import type { Store } from "../utils/store.js";
|
|
|
7
7
|
type Item = Core.SelectStoreItem;
|
|
8
8
|
type Value = Core.SelectStoreValue;
|
|
9
9
|
export declare function useSelectStoreProps<T extends Core.SelectStore>(store: T, update: () => void, props: SelectStoreProps): T & {
|
|
10
|
-
combobox: (
|
|
11
|
-
useState: {
|
|
12
|
-
(): import("@ariakit/core/combobox/combobox-store").ComboboxStoreState;
|
|
13
|
-
<K extends keyof import("@ariakit/core/combobox/combobox-store").ComboboxStoreState>(key: K): import("@ariakit/core/combobox/combobox-store").ComboboxStoreState[K];
|
|
14
|
-
<V>(selector: (state: import("@ariakit/core/combobox/combobox-store").ComboboxStoreState) => V): V;
|
|
15
|
-
};
|
|
16
|
-
}) | null | undefined;
|
|
10
|
+
combobox: (ComboboxStore<string | string[]> & import("@ariakit/core/combobox/combobox-store").ComboboxStore<string | string[]>) | null | undefined;
|
|
17
11
|
};
|
|
18
12
|
/**
|
|
19
13
|
* Creates a select store.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ariakit/react-core/combobox/combobox-item-check",
|
|
3
|
+
"private": true,
|
|
4
|
+
"sideEffects": false,
|
|
5
|
+
"main": "../../cjs/combobox/combobox-item-check.cjs",
|
|
6
|
+
"module": "../../esm/combobox/combobox-item-check.js",
|
|
7
|
+
"types": "../../cjs/combobox/combobox-item-check.d.ts"
|
|
8
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ComboboxScopedContextProvider,
|
|
4
4
|
useComboboxProviderContext
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./W76OTZCC.js";
|
|
6
6
|
import {
|
|
7
7
|
isHidden
|
|
8
8
|
} from "./A7CE3X6M.js";
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
createHook
|
|
16
16
|
} from "./3ORBWXWF.js";
|
|
17
17
|
import {
|
|
18
|
+
useAttribute,
|
|
18
19
|
useEvent,
|
|
19
20
|
useId,
|
|
20
21
|
useMergeRefs,
|
|
@@ -90,11 +91,18 @@ var useComboboxList = createHook(
|
|
|
90
91
|
const mounted = store.useState("mounted");
|
|
91
92
|
const hidden = isHidden(mounted, props.hidden, alwaysVisible);
|
|
92
93
|
const style = hidden ? __spreadProps(__spreadValues({}, props.style), { display: "none" }) : props.style;
|
|
94
|
+
const multiSelectable = store.useState(
|
|
95
|
+
(state) => Array.isArray(state.selectedValue)
|
|
96
|
+
);
|
|
97
|
+
const role = useAttribute(ref, "role", props.role);
|
|
98
|
+
const isCompositeRole = role === "listbox" || role === "tree" || role === "grid";
|
|
99
|
+
const ariaMultiSelectable = isCompositeRole ? multiSelectable || void 0 : void 0;
|
|
93
100
|
props = __spreadProps(__spreadValues({
|
|
94
101
|
id,
|
|
95
102
|
hidden,
|
|
96
103
|
role: "listbox",
|
|
97
|
-
tabIndex: focusable ? -1 : void 0
|
|
104
|
+
tabIndex: focusable ? -1 : void 0,
|
|
105
|
+
"aria-multiselectable": ariaMultiSelectable
|
|
98
106
|
}, props), {
|
|
99
107
|
ref: useMergeRefs(id ? store.setContentElement : null, ref, props.ref),
|
|
100
108
|
style,
|
|
@@ -25,6 +25,7 @@ var ComboboxScopedContextProvider = ctx.ScopedContextProvider;
|
|
|
25
25
|
var ComboboxItemValueContext = createContext(
|
|
26
26
|
void 0
|
|
27
27
|
);
|
|
28
|
+
var ComboboxItemCheckedContext = createContext(false);
|
|
28
29
|
|
|
29
30
|
export {
|
|
30
31
|
useComboboxContext,
|
|
@@ -32,5 +33,6 @@ export {
|
|
|
32
33
|
useComboboxProviderContext,
|
|
33
34
|
ComboboxContextProvider,
|
|
34
35
|
ComboboxScopedContextProvider,
|
|
35
|
-
ComboboxItemValueContext
|
|
36
|
+
ComboboxItemValueContext,
|
|
37
|
+
ComboboxItemCheckedContext
|
|
36
38
|
};
|
|
@@ -16,7 +16,9 @@ function useComboboxStoreProps(store, update, props) {
|
|
|
16
16
|
store = usePopoverStoreProps(store, update, props);
|
|
17
17
|
store = useCompositeStoreProps(store, update, props);
|
|
18
18
|
useStoreProps(store, props, "value", "setValue");
|
|
19
|
+
useStoreProps(store, props, "selectedValue", "setSelectedValue");
|
|
19
20
|
useStoreProps(store, props, "resetValueOnHide");
|
|
21
|
+
useStoreProps(store, props, "resetValueOnSelect");
|
|
20
22
|
return store;
|
|
21
23
|
}
|
|
22
24
|
function useComboboxStore(props = {}) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useCheckboxStore
|
|
4
|
-
} from "../__chunks/BI7ZXWGY.js";
|
|
5
2
|
import {
|
|
6
3
|
CheckboxContextProvider
|
|
7
4
|
} from "../__chunks/VPR2WHQV.js";
|
|
5
|
+
import {
|
|
6
|
+
useCheckboxStore
|
|
7
|
+
} from "../__chunks/BI7ZXWGY.js";
|
|
8
8
|
import "../__chunks/3ORBWXWF.js";
|
|
9
9
|
import "../__chunks/XF5ITC6P.js";
|
|
10
10
|
import "../__chunks/6O5OEQGF.js";
|
|
@@ -12,9 +12,10 @@ import type { ComboboxStore } from "./combobox-store.js";
|
|
|
12
12
|
* // Use the store...
|
|
13
13
|
* }
|
|
14
14
|
*/
|
|
15
|
-
export declare const useComboboxContext: () => ComboboxStore | undefined;
|
|
16
|
-
export declare const useComboboxScopedContext: (onlyScoped?: boolean) => ComboboxStore | undefined;
|
|
17
|
-
export declare const useComboboxProviderContext: () => ComboboxStore | undefined;
|
|
18
|
-
export declare const ComboboxContextProvider: (props: import("react").ProviderProps<ComboboxStore | undefined>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare const ComboboxScopedContextProvider: (props: import("react").ProviderProps<ComboboxStore | undefined>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const useComboboxContext: () => ComboboxStore<string | string[]> | undefined;
|
|
16
|
+
export declare const useComboboxScopedContext: (onlyScoped?: boolean) => ComboboxStore<string | string[]> | undefined;
|
|
17
|
+
export declare const useComboboxProviderContext: () => ComboboxStore<string | string[]> | undefined;
|
|
18
|
+
export declare const ComboboxContextProvider: (props: import("react").ProviderProps<ComboboxStore<string | string[]> | undefined>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const ComboboxScopedContextProvider: (props: import("react").ProviderProps<ComboboxStore<string | string[]> | undefined>) => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export declare const ComboboxItemValueContext: import("react").Context<string | undefined>;
|
|
21
|
+
export declare const ComboboxItemCheckedContext: import("react").Context<boolean>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
ComboboxContextProvider,
|
|
4
|
+
ComboboxItemCheckedContext,
|
|
4
5
|
ComboboxItemValueContext,
|
|
5
6
|
ComboboxScopedContextProvider,
|
|
6
7
|
useComboboxContext,
|
|
7
8
|
useComboboxProviderContext,
|
|
8
9
|
useComboboxScopedContext
|
|
9
|
-
} from "../__chunks/
|
|
10
|
+
} from "../__chunks/W76OTZCC.js";
|
|
10
11
|
import "../__chunks/IB7YUKH5.js";
|
|
11
12
|
import "../__chunks/4UUKJZ4V.js";
|
|
12
13
|
import "../__chunks/7H5KSHHF.js";
|
|
@@ -18,6 +19,7 @@ import "../__chunks/XM66DUTO.js";
|
|
|
18
19
|
import "../__chunks/4R3V3JGP.js";
|
|
19
20
|
export {
|
|
20
21
|
ComboboxContextProvider,
|
|
22
|
+
ComboboxItemCheckedContext,
|
|
21
23
|
ComboboxItemValueContext,
|
|
22
24
|
ComboboxScopedContextProvider,
|
|
23
25
|
useComboboxContext,
|
|
@@ -6,7 +6,7 @@ import "../__chunks/BHEJ6NUH.js";
|
|
|
6
6
|
import "../__chunks/VDNZBO4W.js";
|
|
7
7
|
import {
|
|
8
8
|
useComboboxProviderContext
|
|
9
|
-
} from "../__chunks/
|
|
9
|
+
} from "../__chunks/W76OTZCC.js";
|
|
10
10
|
import "../__chunks/NWCBQ4CV.js";
|
|
11
11
|
import "../__chunks/IB7YUKH5.js";
|
|
12
12
|
import "../__chunks/4UUKJZ4V.js";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { CheckboxCheckOptions } from "../checkbox/checkbox-check.jsx";
|
|
2
|
+
import type { As, Props } from "../utils/types.js";
|
|
3
|
+
import type { ComboboxStore } from "./combobox-store.js";
|
|
4
|
+
/**
|
|
5
|
+
* Returns props to create a `ComboboxItemCheck` component. This hook must be
|
|
6
|
+
* used in a component that's wrapped with `ComboboxItem` or the `checked` prop
|
|
7
|
+
* must be explicitly passed to the component.
|
|
8
|
+
* @see https://ariakit.org/components/combobox
|
|
9
|
+
* @example
|
|
10
|
+
* ```jsx
|
|
11
|
+
* const props = useComboboxItemCheck({ checked: true });
|
|
12
|
+
* <Role {...props} />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const useComboboxItemCheck: import("../utils/types.js").Hook<ComboboxItemCheckOptions<"span">>;
|
|
16
|
+
/**
|
|
17
|
+
* Renders a checkmark inside a
|
|
18
|
+
* [`ComboboxItem`](https://ariakit.org/reference/combobox-item) component. This
|
|
19
|
+
* component must be wrapped with
|
|
20
|
+
* [`ComboboxItem`](https://ariakit.org/reference/combobox-item) or the
|
|
21
|
+
* [`checked`](https://ariakit.org/reference/combobox-item-check#checked) prop
|
|
22
|
+
* must be explicitly passed to the component.
|
|
23
|
+
* @see https://ariakit.org/components/combobox
|
|
24
|
+
* @example
|
|
25
|
+
* ```jsx {5,9}
|
|
26
|
+
* <ComboboxProvider>
|
|
27
|
+
* <Combobox />
|
|
28
|
+
* <ComboboxPopover>
|
|
29
|
+
* <ComboboxItem value="Apple">
|
|
30
|
+
* <ComboboxItemCheck />
|
|
31
|
+
* Apple
|
|
32
|
+
* </ComboboxItem>
|
|
33
|
+
* <ComboboxItem value="Orange">
|
|
34
|
+
* <ComboboxItemCheck />
|
|
35
|
+
* Orange
|
|
36
|
+
* </ComboboxItem>
|
|
37
|
+
* </ComboboxPopover>
|
|
38
|
+
* </ComboboxProvider>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare const ComboboxItemCheck: import("../utils/types.js").Component<ComboboxItemCheckOptions<"span">>;
|
|
42
|
+
export interface ComboboxItemCheckOptions<T extends As = "span"> extends CheckboxCheckOptions<T> {
|
|
43
|
+
/**
|
|
44
|
+
* Object returned by the
|
|
45
|
+
* [`useComboboxStore`](https://ariakit.org/reference/use-combobox-store)
|
|
46
|
+
* hook. If not provided, the parent
|
|
47
|
+
* [`ComboboxList`](https://ariakit.org/reference/combobox-list) or
|
|
48
|
+
* [`ComboboxPopover`](https://ariakit.org/reference/combobox-popover)
|
|
49
|
+
* components' context will be used.
|
|
50
|
+
*/
|
|
51
|
+
store?: ComboboxStore;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the check mark should be shown. This value is automatically
|
|
54
|
+
* inferred from the parent
|
|
55
|
+
* [`ComboboxItem`](https://ariakit.org/reference/combobox-item) component.
|
|
56
|
+
* Manually setting this prop will override the inferred value.
|
|
57
|
+
*/
|
|
58
|
+
checked?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export type ComboboxItemCheckProps<T extends As = "span"> = Props<ComboboxItemCheckOptions<T>>;
|