UNPKG

2.71 kBJavaScriptView Raw
1'use client';
2
3import * as React from 'react';
4import PropTypes from 'prop-types';
5import clsx from 'clsx';
6import composeClasses from '@mui/utils/composeClasses';
7import { styled } from "../zero-styled/index.js";
8import { useDefaultProps } from "../DefaultPropsProvider/index.js";
9import { getTableContainerUtilityClass } from "./tableContainerClasses.js";
10import { jsx as _jsx } from "react/jsx-runtime";
11const useUtilityClasses = ownerState => {
12 const {
13 classes
14 } = ownerState;
15 const slots = {
16 root: ['root']
17 };
18 return composeClasses(slots, getTableContainerUtilityClass, classes);
19};
20const TableContainerRoot = styled('div', {
21 name: 'MuiTableContainer',
22 slot: 'Root',
23 overridesResolver: (props, styles) => styles.root
24})({
25 width: '100%',
26 overflowX: 'auto'
27});
28const TableContainer = /*#__PURE__*/React.forwardRef(function TableContainer(inProps, ref) {
29 const props = useDefaultProps({
30 props: inProps,
31 name: 'MuiTableContainer'
32 });
33 const {
34 className,
35 component = 'div',
36 ...other
37 } = props;
38 const ownerState = {
39 ...props,
40 component
41 };
42 const classes = useUtilityClasses(ownerState);
43 return /*#__PURE__*/_jsx(TableContainerRoot, {
44 ref: ref,
45 as: component,
46 className: clsx(classes.root, className),
47 ownerState: ownerState,
48 ...other
49 });
50});
51process.env.NODE_ENV !== "production" ? TableContainer.propTypes /* remove-proptypes */ = {
52 // ┌────────────────────────────── Warning ──────────────────────────────┐
53 // │ These PropTypes are generated from the TypeScript type definitions. │
54 // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
55 // └─────────────────────────────────────────────────────────────────────┘
56 /**
57 * The content of the component, normally `Table`.
58 */
59 children: PropTypes.node,
60 /**
61 * Override or extend the styles applied to the component.
62 */
63 classes: PropTypes.object,
64 /**
65 * @ignore
66 */
67 className: PropTypes.string,
68 /**
69 * The component used for the root node.
70 * Either a string to use a HTML element or a component.
71 */
72 component: PropTypes.elementType,
73 /**
74 * The system prop that allows defining system overrides as well as additional CSS styles.
75 */
76 sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
77} : void 0;
78export default TableContainer;
\No newline at end of file