| 20 | } |
| 21 | |
| 22 | function TabsList({ |
| 23 | variant = "default", |
| 24 | className, |
| 25 | children, |
| 26 | ...props |
| 27 | }: TabsPrimitive.List.Props & { |
| 28 | variant?: TabsVariant; |
| 29 | }) { |
| 30 | return ( |
| 31 | <TabsPrimitive.List |
| 32 | className={cn( |
| 33 | "relative z-0 flex w-fit items-center justify-center gap-x-0.5 text-muted-foreground", |
| 34 | "data-[orientation=vertical]:flex-col", |
| 35 | variant === "default" |
| 36 | ? "rounded-lg bg-muted p-0.5 text-muted-foreground/72" |
| 37 | : "data-[orientation=vertical]:px-1 data-[orientation=horizontal]:py-1 *:data-[slot=tabs-trigger]:hover:bg-accent", |
| 38 | className, |
| 39 | )} |
| 40 | data-slot="tabs-list" |
| 41 | {...props} |
| 42 | > |
| 43 | {children} |
| 44 | <TabsPrimitive.Indicator |
| 45 | className={cn( |
| 46 | "-translate-y-(--active-tab-bottom) absolute bottom-0 left-0 h-(--active-tab-height) w-(--active-tab-width) translate-x-(--active-tab-left) transition-[width,translate] duration-200 ease-in-out", |
| 47 | variant === "underline" |
| 48 | ? "data-[orientation=vertical]:-translate-x-px z-10 bg-primary data-[orientation=horizontal]:h-0.5 data-[orientation=vertical]:w-0.5 data-[orientation=horizontal]:translate-y-px" |
| 49 | : "-z-1 rounded-md bg-background shadow-sm dark:bg-accent", |
| 50 | )} |
| 51 | data-slot="tab-indicator" |
| 52 | /> |
| 53 | </TabsPrimitive.List> |
| 54 | ); |
| 55 | } |
| 56 | |
| 57 | function TabsTab({ className, ...props }: TabsPrimitive.Tab.Props) { |
| 58 | return ( |