UNPKG

2.77 kBJavaScriptView Raw
1'use client';
2
3import PropTypes from 'prop-types';
4import { createContainer } from '@mui/system';
5import capitalize from "../utils/capitalize.js";
6import styled from "../styles/styled.js";
7import { useDefaultProps } from "../DefaultPropsProvider/index.js";
8const Container = createContainer({
9 createStyledComponent: styled('div', {
10 name: 'MuiContainer',
11 slot: 'Root',
12 overridesResolver: (props, styles) => {
13 const {
14 ownerState
15 } = props;
16 return [styles.root, styles[`maxWidth${capitalize(String(ownerState.maxWidth))}`], ownerState.fixed && styles.fixed, ownerState.disableGutters && styles.disableGutters];
17 }
18 }),
19 useThemeProps: inProps => useDefaultProps({
20 props: inProps,
21 name: 'MuiContainer'
22 })
23});
24process.env.NODE_ENV !== "production" ? Container.propTypes /* remove-proptypes */ = {
25 // ┌────────────────────────────── Warning ──────────────────────────────┐
26 // │ These PropTypes are generated from the TypeScript type definitions. │
27 // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
28 // └─────────────────────────────────────────────────────────────────────┘
29 /**
30 * @ignore
31 */
32 children: PropTypes.node,
33 /**
34 * Override or extend the styles applied to the component.
35 */
36 classes: PropTypes.object,
37 /**
38 * The component used for the root node.
39 * Either a string to use a HTML element or a component.
40 */
41 component: PropTypes.elementType,
42 /**
43 * If `true`, the left and right padding is removed.
44 * @default false
45 */
46 disableGutters: PropTypes.bool,
47 /**
48 * Set the max-width to match the min-width of the current breakpoint.
49 * This is useful if you'd prefer to design for a fixed set of sizes
50 * instead of trying to accommodate a fully fluid viewport.
51 * It's fluid by default.
52 * @default false
53 */
54 fixed: PropTypes.bool,
55 /**
56 * Determine the max-width of the container.
57 * The container width grows with the size of the screen.
58 * Set to `false` to disable `maxWidth`.
59 * @default 'lg'
60 */
61 maxWidth: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), PropTypes.string]),
62 /**
63 * The system prop that allows defining system overrides as well as additional CSS styles.
64 */
65 sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
66} : void 0;
67export default Container;
\No newline at end of file