"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tabs = exports.TabAddButton = exports.Tab = void 0;
var react_1 = require("@graphiql/react");
var react_2 = __importDefault(require("react"));
function TabCloseButton(props) {
    return (react_2.default.createElement("div", { role: "button", "aria-pressed": false, className: "graphiql-tab-close", "aria-label": "Close Tab", title: "Close Tab", onClick: function (ev) {
            ev.stopPropagation();
            props.onClick();
        } },
        react_2.default.createElement(react_1.CloseIcon, null)));
}
function Tab(props) {
    return (react_2.default.createElement(react_1.UnstyledButton, __assign({}, props.tabProps, { role: "tab", type: "button", "aria-selected": props.isActive, title: props.title, className: "graphiql-tab" + (props.isActive ? ' graphiql-tab-active' : ''), onClick: props.onSelect }),
        props.title,
        props.isCloseable ? (react_2.default.createElement(TabCloseButton, { onClick: function () { return props.onClose(); } })) : null));
}
exports.Tab = Tab;
function TabAddButton(props) {
    return (react_2.default.createElement(react_1.UnstyledButton, { className: "graphiql-add-tabs", onClick: props.onClick },
        react_2.default.createElement(react_1.PlusIcon, null)));
}
exports.TabAddButton = TabAddButton;
function Tabs(props) {
    return (react_2.default.createElement("div", __assign({ role: "tablist", className: "graphiql-tabs" }, props.tabsProps), props.children));
}
exports.Tabs = Tabs;
//# sourceMappingURL=Tabs.js.map