(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "tslib", "react", "./styles"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = require("tslib");
    var react_1 = (0, tslib_1.__importStar)(require("react"));
    var styles_1 = require("./styles");
    var Tab = (0, react_1.forwardRef)(function (_a, ref) {
        var label = _a.label, className = _a.className, onClick = _a.onClick, isDisabled = _a.isDisabled, icon = _a.icon, size = _a.size, style = _a.style, as = _a.as, children = _a.children, props = (0, tslib_1.__rest)(_a, ["label", "className", "onClick", "isDisabled", "icon", "size", "style", "as", "children"]);
        return (react_1.default.createElement(styles_1.TabStyled, (0, tslib_1.__assign)({}, props, { role: "tab", className: className, size: size, isDisabled: isDisabled, onClick: function (_e) {
                !isDisabled && onClick && onClick(_e);
            }, style: style, ref: ref, as: as }),
            icon && (0, react_1.cloneElement)(icon, { className: "tab__icon" }),
            label &&
                (size === "m" ? (react_1.default.createElement(styles_1.TabContentS, { type: "pavo", forwardedAs: "span" }, label)) : (react_1.default.createElement(styles_1.TabContent, { type: "phoenix", forwardedAs: "span" }, label))),
            children));
    });
    Tab.displayName = "Tab";
    exports.default = Tab;
});
