var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React from "react";
import { Button } from "../../../button/index.js";
import { cl, composeEventHandlers } from "../../../utils/helpers/index.js";
import { useControllableState } from "../../../utils/hooks/index.js";
const DataToolbarToggleButton = React.forwardRef((_a, ref) => {
    var { className, isPressed, defaultPressed = false, onPressChange, onClick } = _a, props = __rest(_a, ["className", "isPressed", "defaultPressed", "onPressChange", "onClick"]);
    const [pressed, setPressed] = useControllableState({
        defaultValue: defaultPressed,
        value: isPressed,
        onChange: onPressChange,
    });
    return (React.createElement(Button, Object.assign({ className: cl("aksel-data-toolbar__toggle-button", className), ref: ref }, props, { variant: "secondary", size: "small", "data-color": "neutral", "aria-pressed": pressed, onClick: composeEventHandlers(onClick, () => setPressed((oldState) => !oldState)) })));
});
export { DataToolbarToggleButton };
export default DataToolbarToggleButton;
//# sourceMappingURL=DataToolbarToggleButton.js.map