Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol.
wisp.place
2.0 kB
39 lines
1import { cn } from '@public/lib/utils'
2import * as TabsPrimitive from '@radix-ui/react-tabs'
3import type * as React from 'react'
4
5function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {
6 return <TabsPrimitive.Root data-slot="tabs" className={cn('flex flex-col gap-2', className)} {...props} />
7}
8
9function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {
10 return (
11 <TabsPrimitive.List
12 data-slot="tabs-list"
13 className={cn(
14 'bg-muted dark:bg-muted/80 text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]',
15 className,
16 )}
17 {...props}
18 />
19 )
20}
21
22function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
23 return (
24 <TabsPrimitive.Trigger
25 data-slot="tabs-trigger"
26 className={cn(
27 "data-[state=active]:bg-background dark:data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:text-foreground dark:data-[state=active]:border-border focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-border dark:data-[state=active]:shadow-sm text-muted-foreground dark:text-muted-foreground/70 hover:bg-muted/50 dark:hover:bg-muted/50 inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
28 className,
29 )}
30 {...props}
31 />
32 )
33}
34
35function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {
36 return <TabsPrimitive.Content data-slot="tabs-content" className={cn('outline-none', className)} {...props} />
37}
38
39export { Tabs, TabsContent, TabsList, TabsTrigger }