1 | import {
|
2 | SealedInitialState,
|
3 | useSealedState,
|
4 | } from "reakit-utils/useSealedState";
|
5 | import {
|
6 | unstable_ComboboxListState as ComboboxListState,
|
7 | unstable_ComboboxListActions as ComboboxListActions,
|
8 | unstable_ComboboxListInitialState as ComboboxListInitialState,
|
9 | unstable_useComboboxListState as useComboboxListState,
|
10 | } from "./ComboboxListState";
|
11 | import {
|
12 | ComboboxPopoverState,
|
13 | ComboboxPopoverActions,
|
14 | ComboboxPopoverInitialState,
|
15 | useComboboxPopoverState,
|
16 | } from "./__utils/ComboboxPopoverState";
|
17 |
|
18 | export function unstable_useComboboxState(
|
19 | initialState: SealedInitialState<unstable_ComboboxInitialState> = {}
|
20 | ): unstable_ComboboxStateReturn {
|
21 | const sealed = useSealedState(initialState);
|
22 | const combobox = useComboboxListState(sealed);
|
23 | return useComboboxPopoverState(combobox, sealed);
|
24 | }
|
25 |
|
26 | export type unstable_ComboboxState = ComboboxPopoverState & ComboboxListState;
|
27 |
|
28 | export type unstable_ComboboxActions = ComboboxPopoverActions &
|
29 | ComboboxListActions;
|
30 |
|
31 | export type unstable_ComboboxInitialState = ComboboxPopoverInitialState &
|
32 | ComboboxListInitialState;
|
33 |
|
34 | export type unstable_ComboboxStateReturn = unstable_ComboboxState &
|
35 | unstable_ComboboxActions;
|