import React, { forwardRef } from "react";
import { ChevronDownIcon, ChevronUpIcon } from "@navikt/aksel-icons";
import { useFilteredOptionsContext } from "../FilteredOptions/filteredOptionsContext.js";
import { useInputContext } from "./Input.context.js";
export const ToggleListButton = forwardRef((_, ref) => {
    const { isListOpen, toggleIsListOpen } = useFilteredOptionsContext();
    const { focusInput } = useInputContext();
    return (React.createElement("div", { ref: ref, onClick: (event) => {
            event.stopPropagation();
            toggleIsListOpen();
            focusInput();
        }, className: "aksel-combobox__button-toggle-list", "aria-hidden": true }, isListOpen ? React.createElement(ChevronUpIcon, null) : React.createElement(ChevronDownIcon, null)));
});
export default ToggleListButton;
//# sourceMappingURL=ToggleListButton.js.map