"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var tabs_exports = {};
__export(tabs_exports, {
  Tab: () => Tab,
  TabList: () => TabList,
  TabPanel: () => TabPanel,
  Tabs: () => Tabs
});
module.exports = __toCommonJS(tabs_exports);
var import_react = __toESM(require("react"));
var import_theme = require("../theme.js");
const TabsContextProvider = import_react.default.createContext({
  selectedIndex: "state",
  // oxlint-disable-next-line
  onSelect: (_index) => {
  }
});
const TabList = ({ children }) => /* @__PURE__ */ import_react.default.createElement(
  "div",
  {
    "data-test-id": "__prosemirror_devtools_tabs_buttons_container__",
    style: {
      display: "flex",
      listStyle: "none",
      borderBottom: `1px solid ${import_theme.mainTheme.main20}`
    }
  },
  children
);
const TabsStyled = ({ children }) => /* @__PURE__ */ import_react.default.createElement(
  "div",
  {
    "data-test-id": "__prosemirror_devtools_tabs_container__",
    style: {
      height: "100%",
      width: "100%"
    }
  },
  children
);
const TabStyled = ({ children, isSelected, onClick }) => /* @__PURE__ */ import_react.default.createElement(
  "button",
  {
    role: "tab",
    type: "button",
    style: {
      appearance: "none",
      color: import_theme.mainTheme.text,
      textTransform: "uppercase",
      fontSize: "13px",
      lineHeight: "1",
      padding: "16px 24px 14px",
      boxSizing: "border-box",
      userSelect: "none",
      border: "none",
      borderBottom: isSelected ? `2px solid ${import_theme.mainTheme.main}` : "none",
      cursor: "pointer",
      background: "transparent",
      margin: 0,
      fontFamily: "inherit"
    },
    onClick
  },
  children
);
function Tab({ index, children }) {
  const tabs = (0, import_react.useContext)(TabsContextProvider);
  return /* @__PURE__ */ import_react.default.createElement(TabStyled, { isSelected: index === tabs.selectedIndex, onClick: () => tabs.onSelect(index) }, children);
}
function TabPanel(props) {
  const tabs = (0, import_react.useContext)(TabsContextProvider);
  return /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      style: {
        width: "100%",
        height: "calc(100% - 48px)",
        boxSizing: "border-box",
        overflowY: "auto",
        padding: "8px"
      }
    },
    props.children({ index: tabs.selectedIndex })
  );
}
function Tabs(props) {
  return /* @__PURE__ */ import_react.default.createElement(
    TabsContextProvider.Provider,
    {
      value: {
        onSelect: props.onSelect,
        selectedIndex: props.selectedIndex
      }
    },
    /* @__PURE__ */ import_react.default.createElement(TabsStyled, null, props.children)
  );
}
//# sourceMappingURL=tabs.js.map
