Files
Minikura/apps/web/components/ui/tabs.tsx
T

55 lines
1.8 KiB
TypeScript
Raw Normal View History

2026-02-17 18:12:02 +07:00
"use client";
2026-02-13 15:52:13 +07:00
2026-02-17 18:12:02 +07:00
import * as TabsPrimitive from "@radix-ui/react-tabs";
import type * as React from "react";
2026-02-13 15:52:13 +07:00
2026-02-17 18:12:02 +07:00
import { cn } from "@/lib/cn";
2026-02-13 15:52:13 +07:00
2026-02-17 18:12:02 +07:00
function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {
2026-02-13 15:52:13 +07:00
return (
<TabsPrimitive.Root
data-slot="tabs"
className={cn("flex flex-col gap-2", className)}
{...props}
/>
2026-02-17 18:12:02 +07:00
);
2026-02-13 15:52:13 +07:00
}
2026-02-17 18:12:02 +07:00
function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {
2026-02-13 15:52:13 +07:00
return (
<TabsPrimitive.List
data-slot="tabs-list"
className={cn(
2026-08-13 01:58:09 +07:00
"text-muted-foreground inline-flex h-auto w-fit items-center justify-start gap-1 overflow-x-auto border-b-2 border-foreground bg-transparent p-0",
2026-02-13 15:52:13 +07:00
className
)}
{...props}
/>
2026-02-17 18:12:02 +07:00
);
2026-02-13 15:52:13 +07:00
}
2026-02-17 18:12:02 +07:00
function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
2026-02-13 15:52:13 +07:00
return (
<TabsPrimitive.Trigger
data-slot="tabs-trigger"
className={cn(
2026-08-13 01:58:09 +07:00
"data-[state=active]:bg-foreground data-[state=active]:text-background focus-visible:ring-ring/50 text-muted-foreground inline-flex h-9 flex-none items-center justify-center gap-1.5 rounded-t-sm border border-b-0 border-transparent px-3 py-1 font-mono text-[10px] font-bold uppercase tracking-[0.1em] whitespace-nowrap transition-colors focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
2026-02-13 15:52:13 +07:00
className
)}
{...props}
/>
2026-02-17 18:12:02 +07:00
);
2026-02-13 15:52:13 +07:00
}
2026-02-17 18:12:02 +07:00
function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {
2026-02-13 15:52:13 +07:00
return (
<TabsPrimitive.Content
data-slot="tabs-content"
className={cn("flex-1 outline-none", className)}
{...props}
/>
2026-02-17 18:12:02 +07:00
);
2026-02-13 15:52:13 +07:00
}
2026-02-17 18:12:02 +07:00
export { Tabs, TabsList, TabsTrigger, TabsContent };