/** * Tabs — Base UI's tabs wearing Studio's tokens; replaces six hand-rolled * strips with one implementation (roving tabindex, arrow/Home/End, `aria-controls`). */ import { Tabs as BaseTabs } from "@base-ui/react/tabs"; import type { ComponentPropsWithoutRef, ElementType } from "react"; import { cn } from "./cn"; import type { PreviewState } from "./Button"; /** * Base UI lets `className` be a function of the part's state. Studio's parts * merge a string with `cn`, so the string form is the one they accept. */ type StyledProps = Omit, "className"> & { className?: string; }; /** * Groups a tab list with its panels. Uncontrolled by default; pass `value` and * `onValueChange` for a strip whose selection lives in a store. */ export function Tabs(props: ComponentPropsWithoutRef) { return ; } /** The strip. Give it an `aria-label`: a tablist with no name is unlabelled. */ export function TabsList({ className, ...props }: StyledProps) { return ( ); } interface TabProps extends StyledProps { value: string; "data-preview-state"?: PreviewState; } /** * aria-selected drives the selected look (Base UI sets it) so assistive tech * and sighted users match. data-preview-state is for gallery shots only. */ export function Tab({ value, className, ...props }: TabProps) { return ( ); } /** The panel for one tab. Base UI wires `aria-labelledby` back to its tab. */ export function TabPanel({ className, ...props }: StyledProps) { return ; }