@@ -2,11 +2,15 @@ import * as React from "react";
22import { Tabs as TabsPrimitive } from "@base-ui-components/react/tabs" ;
33import { cn } from "../utils/classname" ;
44
5+ type BackgroundVariant = "layer-1" | "layer-2" | "layer-3" | "layer-transparent" ;
6+
57type TabsCompound = React . ForwardRefExoticComponent <
68 React . ComponentProps < typeof TabsPrimitive . Root > & React . RefAttributes < React . ElementRef < typeof TabsPrimitive . Root > >
79> & {
810 List : React . ForwardRefExoticComponent <
9- React . ComponentProps < typeof TabsPrimitive . List > & React . RefAttributes < React . ElementRef < typeof TabsPrimitive . List > >
11+ React . ComponentProps < typeof TabsPrimitive . List > & {
12+ background ?: BackgroundVariant ;
13+ } & React . RefAttributes < React . ElementRef < typeof TabsPrimitive . List > >
1014 > ;
1115 Trigger : React . ForwardRefExoticComponent <
1216 React . ComponentProps < typeof TabsPrimitive . Tab > & { size ?: "sm" | "md" | "lg" } & React . RefAttributes <
@@ -34,14 +38,26 @@ const TabsRoot = React.forwardRef(function TabsRoot(
3438} ) ;
3539
3640const TabsList = React . forwardRef ( function TabsList (
37- { className, ...props } : React . ComponentProps < typeof TabsPrimitive . List > ,
41+ {
42+ className,
43+ background = "layer-1" ,
44+ ...props
45+ } : React . ComponentProps < typeof TabsPrimitive . List > & {
46+ background ?: BackgroundVariant ;
47+ } ,
3848 ref : React . ForwardedRef < React . ElementRef < typeof TabsPrimitive . List > >
3949) {
4050 return (
4151 < TabsPrimitive . List
4252 data-slot = "tabs-list"
4353 className = { cn (
44- "flex w-full items-center justify-between gap-1.5 rounded-md text-13 p-0.5 bg-layer-1/60 relative overflow-auto" ,
54+ "flex w-full items-center justify-between gap-1.5 rounded-md text-13 p-0.5 relative overflow-auto" ,
55+ {
56+ "bg-layer-1" : background === "layer-1" ,
57+ "bg-layer-2" : background === "layer-2" ,
58+ "bg-layer-3" : background === "layer-3" ,
59+ "bg-layer-transparent" : background === "layer-transparent" ,
60+ } ,
4561 className
4662 ) }
4763 { ...props }
0 commit comments