"use client";
import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef, useMemo } from "react";
import { TableConfigProvider } from "./TableConfigurationProvider.js";
import { table } from "./tableStyles.js";
/**
 * **Client Component**
 *
 * @example Responsive Example
 * ```tsx
 * import {
 *   Table,
 *   TableBody,
 *   TableCell,
 *   TableContainer,
 *   TableHeader,
 *   TableRow,
 * } from "@react-md/core";
 * import type { ReactElement } from "react";
 *
 * function Example(): ReactElement {
 *   return (
 *     <TableContainer>
 *       <Table>
 *         <TableHeader>
 *           <TableRow>
 *             <TableCell>Header 1</TableCell>
 *             <TableCell>Header 2</TableCell>
 *             <TableCell>Header 3</TableCell>
 *           </TableRow>
 *         </TableHeader>
 *         <TableBody>
 *           <TableRow>
 *             <TableCell>Row 1 Cell 1</TableCell>
 *             <TableCell>Row 1 Cell 2</TableCell>
 *             <TableCell>Row 1 Cell 3</TableCell>
 *           </TableRow>
 *           <TableRow>
 *             <TableCell>Row 2 Cell 1</TableCell>
 *             <TableCell>Row 2 Cell 2</TableCell>
 *             <TableCell>Row 2 Cell 3</TableCell>
 *           </TableRow>
 *           <TableRow>
 *             <TableCell>Row 3 Cell 1</TableCell>
 *             <TableCell>Row 3 Cell 2</TableCell>
 *             <TableCell>Row 3 Cell 3</TableCell>
 *           </TableRow>
 *         </TableBody>
 *       </Table>
 *     </TableContainer>
 *   );
 * }
 * ```
 */ export const Table = /*#__PURE__*/ forwardRef(function Table(props, ref) {
    const { className, children, dense = false, hAlign = "left", vAlign = "middle", lineWrap = false, fullWidth = false, disableHover = false, disableBorders = false, ...remaining } = props;
    const configuration = useMemo(()=>({
            dense,
            header: false,
            hAlign,
            vAlign,
            lineWrap,
            disableHover,
            disableBorders
        }), [
        dense,
        hAlign,
        vAlign,
        lineWrap,
        disableHover,
        disableBorders
    ]);
    return /*#__PURE__*/ _jsx(TableConfigProvider, {
        value: configuration,
        children: /*#__PURE__*/ _jsx("table", {
            ...remaining,
            ref: ref,
            className: table({
                dense,
                fullWidth,
                className
            }),
            children: children
        })
    });
});

//# sourceMappingURL=Table.js.map