'use strict';

var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var utils = require('./utils-BhM0B89p.js');
var renderIcon = require('./renderIcon-BRrpZu9a.js');
var primitives_Tabs = require('./primitives/Tabs.js');

const SIZE_CLASSES = {
  default: "",
  lg: "text-[15px] px-3 py-1.5"
};
const LIST_HEIGHT = {
  default: "",
  lg: "group-data-horizontal/tabs:h-10"
};
const TabsSizeContext = React.createContext("default");

const TabsRoot = React.forwardRef(
  ({ size = "default", children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TabsSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(primitives_Tabs.Tabs, { ref, ...props, children }) })
);
TabsRoot.displayName = "Tabs";
const TabsListComponent = React.forwardRef(
  ({ className, ...props }, ref) => {
    const size = React.useContext(TabsSizeContext);
    return /* @__PURE__ */ jsxRuntime.jsx(
      primitives_Tabs.TabsList,
      {
        ref,
        className: utils.cn(LIST_HEIGHT[size], className),
        ...props
      }
    );
  }
);
TabsListComponent.displayName = "Tabs.List";
const TabsItemComponent = React.forwardRef(
  ({ icon, className, children, ...otherProps }, ref) => {
    const size = React.useContext(TabsSizeContext);
    return /* @__PURE__ */ jsxRuntime.jsxs(
      primitives_Tabs.TabsTrigger,
      {
        ref,
        className: utils.cn(SIZE_CLASSES[size], icon && "gap-1.5", className),
        ...otherProps,
        children: [
          icon && renderIcon.renderIcon(icon, size === "lg" ? "size-5" : "size-4"),
          children
        ]
      }
    );
  }
);
TabsItemComponent.displayName = "Tabs.Item";
const TabsContentComponent = React.forwardRef(
  (props, ref) => /* @__PURE__ */ jsxRuntime.jsx(primitives_Tabs.TabsContent, { ref, ...props })
);
TabsContentComponent.displayName = "Tabs.Content";
const Tabs = Object.assign(TabsRoot, {
  List: TabsListComponent,
  Item: TabsItemComponent,
  Content: TabsContentComponent
});

exports.Tabs = Tabs;
//# sourceMappingURL=Tabs-YPRmLtUM.js.map
