import { jsx, jsxs } from 'react/jsx-runtime';
import { createContext, forwardRef, useContext } from 'react';
import { c as cn } from './utils-DdHUxIdC.js';
import { r as renderIcon } from './renderIcon-tlvMyboj.js';
import { Tabs as Tabs$1, TabsList, TabsTrigger, TabsContent } from './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 = createContext("default");

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

export { Tabs as T };
//# sourceMappingURL=Tabs-DWfKnl3S.js.map
