/* eslint-disable react/prop-types */ import * as React from "react"; import {cn} from "@/lib/utilities"; import styles from "./table.module.css"; /** * Props for the {@link Table} component. */ export type TableProps = React.HTMLAttributes; /** * Props for the {@link TableHeader} component. */ export type TableHeaderProps = React.HTMLAttributes; /** * Props for the {@link TableBody} component. */ export type TableBodyProps = React.HTMLAttributes; /** * Props for the {@link TableFooter} component. */ export type TableFooterProps = React.HTMLAttributes; /** * Props for the {@link TableRow} component. */ export type TableRowProps = React.HTMLAttributes; /** * Props for the {@link TableHead} component. */ export type TableHeadProps = React.ThHTMLAttributes; /** * Props for the {@link TableCell} component. */ export type TableCellProps = React.TdHTMLAttributes; /** * Props for the {@link TableCaption} component. */ export type TableCaptionProps = React.HTMLAttributes; /** * Wraps a table in a horizontally scrollable container. * * @remarks * - Pure CSS component (no Base UI primitive) * - Renders a `` element inside a `
` container * - Styling via CSS Modules with `--ac-*` custom properties * * @example * ```tsx *
* *
* ``` * * @see {@link TableProps} for available props */ const Table = React.forwardRef( ({className, ...props}: Readonly, ref): React.JSX.Element => (
), ); /** * Renders the table header section. * * @remarks * - Pure CSS component (no Base UI primitive) * - Renders a `` element * - Styling via CSS Modules with `--ac-*` custom properties * * @example * ```tsx * * * * ``` * * @see {@link TableHeaderProps} for available props */ const TableHeader = React.forwardRef( ({className, ...props}: Readonly, ref): React.JSX.Element => ( ), ); /** * Renders the table body section. * * @remarks * - Pure CSS component (no Base UI primitive) * - Renders a `` element * - Styling via CSS Modules with `--ac-*` custom properties * * @example * ```tsx * * * * ``` * * @see {@link TableBodyProps} for available props */ const TableBody = React.forwardRef( ({className, ...props}: Readonly, ref): React.JSX.Element => ( ), ); /** * Renders the table footer section. * * @remarks * - Pure CSS component (no Base UI primitive) * - Renders a `` element * - Styling via CSS Modules with `--ac-*` custom properties * * @example * ```tsx * * * * ``` * * @see {@link TableFooterProps} for available props */ const TableFooter = React.forwardRef( ({className, ...props}: Readonly, ref): React.JSX.Element => ( ), ); /** * Renders a table row. * * @remarks * - Pure CSS component (no Base UI primitive) * - Renders a `` element * - Styling via CSS Modules with `--ac-*` custom properties * * @example * ```tsx * * Value * * ``` * * @see {@link TableRowProps} for available props */ const TableRow = React.forwardRef( ({className, ...props}: Readonly, ref): React.JSX.Element => ( ), ); /** * Renders a header cell. * * @remarks * - Pure CSS component (no Base UI primitive) * - Renders a `
` element * - Styling via CSS Modules with `--ac-*` custom properties * * @example * ```tsx * Name * ``` * * @see {@link TableHeadProps} for available props */ const TableHead = React.forwardRef( ({className, ...props}: Readonly, ref): React.JSX.Element => ( ), ); /** * Renders a standard table cell. * * @remarks * - Pure CSS component (no Base UI primitive) * - Renders a `` element * - Styling via CSS Modules with `--ac-*` custom properties * * @example * ```tsx * Acme Inc. * ``` * * @see {@link TableCellProps} for available props */ const TableCell = React.forwardRef( ({className, ...props}: Readonly, ref): React.JSX.Element => ( ), ); /** * Renders the table caption. * * @remarks * - Pure CSS component (no Base UI primitive) * - Renders a `
` element * - Styling via CSS Modules with `--ac-*` custom properties * * @example * ```tsx * Recent invoices * ``` * * @see {@link TableCaptionProps} for available props */ const TableCaption = React.forwardRef( ({className, ...props}: Readonly, ref): React.JSX.Element => ( ), ); Table.displayName = "Table"; TableHeader.displayName = "TableHeader"; TableBody.displayName = "TableBody"; TableFooter.displayName = "TableFooter"; TableRow.displayName = "TableRow"; TableHead.displayName = "TableHead"; TableCell.displayName = "TableCell"; TableCaption.displayName = "TableCaption"; export {Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow};