'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import { useControlled, useGDS } from "../hooks/index.js";
import { cn } from "../utils/index.js";
import { Button } from "./Button.js";
const InternalButton = Button;
export function ToggleButton({ checked: controlledChecked, defaultChecked, onChange, onClick, className, ...props }) {
    useGDS();
    const [checked, setChecked] = useControlled(controlledChecked, defaultChecked ?? false, onChange);
    return (_jsx(InternalButton, { checked: checked, onClick: (event) => {
            setChecked(!checked);
            onClick?.(event);
        }, className: cn('gds-toggle-button', className), ...props }));
}
//# sourceMappingURL=ToggleButton.js.map