import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2025 GoodData Corporation
import { createContext, useContext } from "react";
const StateContext = createContext(null);
export function UiComboboxContextProvider({ state, children }) {
    return _jsx(StateContext.Provider, { value: state, children: children });
}
/** @internal */
export function useComboboxState() {
    const state = useContext(StateContext);
    if (!state) {
        throw new Error("`useComboboxState` must be used within `UiCombobox`");
    }
    return state;
}
