"use strict";
var import_Pivot = require("../Pivot.css");
const jsxRuntime = require("react/jsx-runtime");
const antd = require("antd");
const React = require("react");
const kit_internal_Elevation = require("./internal/Elevation.cjs");
const kit_Theme_UI = require("./Theme/UI.cjs");
require("./Theme/themeUtils.cjs");
require("./Theme/themes.cjs");
const elevationBase = "Pivot_elevationBase_1e443";
const hover = "Pivot_hover_1e443";
const border = "Pivot_border_1e443";
const base = "Pivot_base_1e443";
const css = {
  "elevation-0": "Pivot_elevation-0_1e443",
  "elevation-1": "Pivot_elevation-1_1e443",
  "elevation-2": "Pivot_elevation-2_1e443",
  "elevation-3": "Pivot_elevation-3_1e443",
  "elevation-4": "Pivot_elevation-4_1e443",
  elevationBase,
  hover,
  border,
  base
};
const convertTabType = (type) => {
  switch (type) {
    case "primary":
      return "line";
    case "secondary":
      return "card";
    default:
      return "line";
  }
};
const Pivot = ({ type = "primary", items, ...props }) => {
  const {
    themeSettings: { className: themeClass }
  } = kit_Theme_UI.useTheme();
  const tabType = convertTabType(type);
  const { elevationClass, nextElevation } = kit_internal_Elevation.useElevation();
  const classes = [themeClass, css.base, elevationClass];
  const elevatedItems = React.useMemo(
    () => items == null ? void 0 : items.map((item) => ({
      ...item,
      children: /* @__PURE__ */ jsxRuntime.jsx(kit_internal_Elevation.ElevationContext.Provider, { value: nextElevation, children: item.children })
    })),
    [items, nextElevation]
  );
  return /* @__PURE__ */ jsxRuntime.jsx(
    antd.Tabs,
    {
      className: classes.join(" "),
      items: elevatedItems,
      popupClassName: themeClass,
      type: tabType,
      ...props
    }
  );
};
module.exports = Pivot;
