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, { forwardRef } from "react";
import { BodyShort } from "../../typography/BodyShort.js";
import { cl } from "../../utils/helpers/index.js";
import { useToggleGroupContext } from "../ToggleGroup.context.js";
import { useToggleItem } from "./useToggleItem.js";
const ToggleItem = forwardRef((_a, forwardedRef) => {
    var { className, children, icon, label, value, onClick, onFocus, onKeyDown, disabled } = _a, rest = __rest(_a, ["className", "children", "icon", "label", "value", "onClick", "onFocus", "onKeyDown", "disabled"]);
    const toggleItemProps = useToggleItem({
        value,
        onClick,
        onFocus,
        disabled,
        onKeyDown,
    });
    const ctx = useToggleGroupContext();
    return (React.createElement("button", Object.assign({}, rest, { ref: forwardedRef, className: cl("aksel-toggle-group__button", className), type: "button" }, toggleItemProps),
        React.createElement(BodyShort, { as: "span", className: "aksel-toggle-group__button-inner", size: ctx === null || ctx === void 0 ? void 0 : ctx.size }, children !== null && children !== void 0 ? children : (React.createElement(React.Fragment, null,
            icon,
            label)))));
});
export default ToggleItem;
//# sourceMappingURL=ToggleItem.js.map