@@ -5,22 +5,24 @@ import { cn } from "@/lib/utils"
55
66const Tabs = TabsPrimitive . Root
77
8+ interface TabsListProps extends React . ComponentPropsWithoutRef < typeof TabsPrimitive . List > {
9+ single ?: boolean
10+ }
11+
812const TabsList = React . forwardRef <
913 React . ElementRef < typeof TabsPrimitive . List > ,
10- React . ComponentPropsWithoutRef < typeof TabsPrimitive . List >
11- > ( ( { className, ...props } , ref ) => {
14+ TabsListProps
15+ > ( ( { className, single = false , ...props } , ref ) => {
1216 const childCount = React . Children . count ( props . children )
1317 const isSingleTab = childCount === 1
1418
1519 return (
1620 < TabsPrimitive . List
1721 ref = { ref }
1822 className = { cn (
19- "flex h-8 sm:h-10 items-center rounded-md p-0.5 sm:p-1 text-muted-foreground bg-muted" ,
23+ "inline-flex items-center justify-start" ,
24+ "sm:h-10 p-0.5 sm:p-1 rounded-md text-muted-foreground bg-muted" ,
2025 "overflow-x-auto scrollbar-hide" ,
21- "gap-0.5 sm:gap-1" ,
22- isSingleTab ? "w-fit" : "w-full justify-center" ,
23- "scroll-smooth" ,
2426 className
2527 ) }
2628 { ...props }
@@ -29,10 +31,14 @@ const TabsList = React.forwardRef<
2931} )
3032TabsList . displayName = TabsPrimitive . List . displayName
3133
34+ interface TabsTriggerProps extends React . ComponentPropsWithoutRef < typeof TabsPrimitive . Trigger > {
35+ single ?: boolean
36+ }
37+
3238const TabsTrigger = React . forwardRef <
3339 React . ElementRef < typeof TabsPrimitive . Trigger > ,
34- React . ComponentPropsWithoutRef < typeof TabsPrimitive . Trigger >
35- > ( ( { className, ...props } , ref ) => (
40+ TabsTriggerProps
41+ > ( ( { className, single = false , ...props } , ref ) => (
3642 < TabsPrimitive . Trigger
3743 ref = { ref }
3844 className = { cn (
0 commit comments