@@ -8,25 +8,16 @@ const Tabs = TabsPrimitive.Root
88const TabsList = React . forwardRef <
99 React . ElementRef < typeof TabsPrimitive . List > ,
1010 React . ComponentPropsWithoutRef < typeof TabsPrimitive . List >
11- > ( ( { className, ...props } , ref ) => {
12- const childCount = React . Children . count ( props . children )
13- const isSingleTab = childCount === 1
14-
15- return (
16- < TabsPrimitive . List
17- ref = { ref }
18- className = { cn (
19- "flex h-8 sm:h-10 items-center rounded-md p-0.5 sm:p-1 text-muted-foreground bg-muted" ,
20- "overflow-x-auto scrollbar-hide" ,
21- "gap-0.5 sm:gap-1" ,
22- isSingleTab ? "w-fit" : "w-full justify-center" ,
23- "scroll-smooth" ,
24- className
25- ) }
26- { ...props }
27- />
28- )
29- } )
11+ > ( ( { className, ...props } , ref ) => (
12+ < TabsPrimitive . List
13+ ref = { ref }
14+ className = { cn (
15+ "inline-flex h-10 items-center justify-center rounded-md bg-card border border-border p-1 text-foreground shadow-sm dark:bg-muted dark:border-0 dark:shadow-none" ,
16+ className
17+ ) }
18+ { ...props }
19+ />
20+ ) )
3021TabsList . displayName = TabsPrimitive . List . displayName
3122
3223const TabsTrigger = React . forwardRef <
@@ -36,17 +27,7 @@ const TabsTrigger = React.forwardRef<
3627 < TabsPrimitive . Trigger
3728 ref = { ref }
3829 className = { cn (
39- "inline-flex items-center justify-center rounded-sm font-medium transition-all" ,
40- "px-1.5 py-1 text-xs sm:px-3 sm:py-1.5 sm:text-sm" ,
41- "whitespace-nowrap" ,
42- "min-w-[50px] sm:min-w-[80px]" ,
43- "h-6 sm:h-8" ,
44- "max-w-[100px] sm:max-w-none overflow-hidden text-ellipsis" ,
45- "text-center" ,
46- "flex-1" ,
47- "ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2" ,
48- "disabled:pointer-events-none disabled:opacity-50" ,
49- "data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm" ,
30+ "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 text-muted-foreground hover:text-foreground data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow-sm dark:data-[state=active]:bg-background dark:data-[state=active]:text-foreground" ,
5031 className
5132 ) }
5233 { ...props }
@@ -62,12 +43,11 @@ const TabsContent = React.forwardRef<
6243 ref = { ref }
6344 className = { cn (
6445 "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2" ,
65- "overflow-x-auto" ,
6646 className
6747 ) }
6848 { ...props }
6949 />
7050) )
7151TabsContent . displayName = TabsPrimitive . Content . displayName
7252
73- export { Tabs , TabsList , TabsTrigger , TabsContent }
53+ export { Tabs , TabsList , TabsTrigger , TabsContent }
0 commit comments