import { Tabs as BaseTabs } from "@base-ui/react/tabs"; import { CaretLeftIcon, CaretRightIcon } from "../icons"; import type { ComponentProps, ReactNode } from "react"; import { Link } from "../provider"; import { Button } from "./button"; import { cn } from "./cn"; export interface TabItem { value: string; label: ReactNode; /** Renders the tab as another element, such as a link, so a view tab can be opened in a new tab. */ render?: ComponentProps["render"]; nativeButton?: boolean; } /** * A row of views. `underline` marks the active view with an ink line; `segmented` is a compact switch * between two or three filters, with segments of equal width. */ export function Tabs({ tabs, value, onValueChange, variant = "underline", className, listClassName }: { tabs: readonly TabItem[]; value: string; onValueChange?: (value: string) => void; variant?: "underline" | "segmented"; size?: string; className?: string; listClassName?: string }) { const underline = variant === "underline"; return ( onValueChange?.(next as string)} className={className}> {tabs.map((tab) => ( {tab.label} ))} ); } /** A count beside a tab label. */ export function TabCount({ children }: { children: ReactNode }) { return {children}; } function BreadcrumbsRoot({ className, children }: { className?: string; children: ReactNode }) { return ( ); } /** Where a page sits: each part links up, the last part is the current page. */ export const Breadcrumbs = Object.assign(BreadcrumbsRoot, { Link: ({ href, className, ...props }: ComponentProps<"a"> & { href: string }) => , Current: ({ className, ...props }: ComponentProps<"span">) => , Separator: () => ( / ), }); /** Newer and older pages of a list. */ export function Pagination({ page, hasNextPage, setPage }: { page: number; perPage?: number; hasNextPage: boolean; controls?: string; setPage: (page: number) => void }) { return ( ); } function TableRoot({ className, ...props }: ComponentProps<"table">) { return ; } /** A dense data table: hairline rows, quiet headers, tabular numerals. */ export const Table = Object.assign(TableRoot, { Header: (props: ComponentProps<"thead">) => , Body: (props: ComponentProps<"tbody">) => , Row: ({ className, ...props }: ComponentProps<"tr">) => , Head: ({ className, ...props }: ComponentProps<"th">) =>
, Cell: ({ className, ...props }: ComponentProps<"td">) => , });