@mui/system 5.7.0 → 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/Box/Box.spec.d.ts +1 -1
  2. package/CHANGELOG.md +72 -0
  3. package/Container/Container.d.ts +13 -0
  4. package/Container/Container.js +81 -0
  5. package/Container/ContainerProps.d.ts +40 -0
  6. package/Container/ContainerProps.js +5 -0
  7. package/Container/containerClasses.d.ts +22 -0
  8. package/Container/containerClasses.js +17 -0
  9. package/Container/createContainer.d.ts +18 -0
  10. package/Container/createContainer.js +172 -0
  11. package/Container/index.d.ts +5 -0
  12. package/Container/index.js +42 -0
  13. package/Container/package.json +6 -0
  14. package/createBox.spec.d.ts +1 -1
  15. package/createTheme/createBreakpoints.d.ts +5 -0
  16. package/createTheme/createSpacing.d.ts +10 -10
  17. package/cssVars/createCssVarsProvider.spec.d.ts +1 -1
  18. package/cssVars/createGetCssVar.d.ts +5 -5
  19. package/cssVars/cssVarsParser.d.ts +70 -70
  20. package/cssVars/getInitColorSchemeScript.d.ts +40 -40
  21. package/cssVars/index.d.ts +2 -2
  22. package/cssVars/useCurrentColorScheme.d.ts +53 -53
  23. package/esm/Container/Container.js +70 -0
  24. package/esm/Container/ContainerProps.js +1 -0
  25. package/esm/Container/containerClasses.js +6 -0
  26. package/esm/Container/createContainer.js +151 -0
  27. package/esm/Container/index.js +3 -0
  28. package/esm/index.js +4 -1
  29. package/index.d.ts +6 -0
  30. package/index.js +32 -2
  31. package/index.spec.d.ts +1 -1
  32. package/legacy/Container/Container.js +70 -0
  33. package/legacy/Container/ContainerProps.js +1 -0
  34. package/legacy/Container/containerClasses.js +6 -0
  35. package/legacy/Container/createContainer.js +148 -0
  36. package/legacy/Container/index.js +3 -0
  37. package/legacy/index.js +5 -2
  38. package/modern/Container/Container.js +70 -0
  39. package/modern/Container/ContainerProps.js +1 -0
  40. package/modern/Container/containerClasses.js +6 -0
  41. package/modern/Container/createContainer.js +151 -0
  42. package/modern/Container/index.js +3 -0
  43. package/modern/index.js +5 -2
  44. package/package.json +4 -4
  45. package/styleFunctionSx/styleFunctionSx.spec.d.ts +1 -1
package/Box/Box.spec.d.ts CHANGED
@@ -1 +1 @@
1
- export {};
1
+ export {};
package/CHANGELOG.md CHANGED
@@ -1,5 +1,77 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.8.0
4
+
5
+ <!-- generated comparing v5.7.0..master -->
6
+
7
+ _May 17, 2022_
8
+
9
+ A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - 🚀 [Blog post](https://mui.com/blog/premium-plan-release/) for announcing the release of the Premium plan of MUI X is out thanks to @joserodolfofreitas.
12
+ - Codemod for `jss` to `tss-react` migration is out thanks to @ryancogswell
13
+ - And more 🐛 bug fixes and 📚 documentation improvements.
14
+
15
+ ### `@mui/material@5.8.0`
16
+
17
+ - &#8203;<!-- 37 -->[Autocomplete] Fix `getInputProps` TypeScript return type (#32730) @ZeeshanTamboli
18
+ - &#8203;<!-- 36 -->[Autocomplete] Forward props to renderTags() (#32637) @emlai
19
+ - &#8203;<!-- 35 -->[Badge] Fix TypeScript error when adding style overrides for Badge (#32745) @ZeeshanTamboli
20
+ - &#8203;<!-- 09 -->[Menu] Fix context menu open position (#32661) @oliviertassinari
21
+
22
+ ### `@mui/system@5.8.0`
23
+
24
+ - &#8203;<!-- 05 -->[system] Add `Container` component and `createContainer` factory (#32263) @mnajdova
25
+
26
+ ### `@mui/base@5.0.0-alpha.81`
27
+
28
+ - &#8203;<!-- 15 -->[InputUnstyled] Support callbacks in componentsProps (#32271) @michaldudak
29
+ - &#8203;<!-- 14 -->[InputUnstyled] Define ownerState and slot props' types (#32491) @michaldudak
30
+ - &#8203;<!-- 08 -->[MenuUnstyled] Demos improvements (#32714) @michaldudak
31
+ - &#8203;<!-- 07 -->[OptionUnstyled] Define ownerState and slot props' types (#32717) @michaldudak
32
+
33
+ ### `@mui/joy@5.0.0-alpha.28`
34
+
35
+ - &#8203;<!-- 13 -->[Joy] Add Badge doc (#32790) @siriwatknp
36
+ - &#8203;<!-- 12 -->[Joy] Add global variant feature page (#32695) @siriwatknp
37
+ - &#8203;<!-- 11 -->[Joy] Add avatar page (#32711) @siriwatknp
38
+
39
+ ### `@mui/codemod@5.8.0`
40
+
41
+ - &#8203;<!-- 33 -->[codemod] Add jss to tss-react codemod (#31802) @ryancogswell
42
+
43
+ ### Docs
44
+
45
+ - &#8203;<!-- 34 -->[blog] Add release post for MUI X Premium (#32720) @joserodolfofreitas
46
+ - &#8203;<!-- 29 -->[docs] Fix wrong code snippet for overriding styles in theme with a callback value (#32781) @ZeeshanTamboli
47
+ - &#8203;<!-- 28 -->[docs] Update Crowdin logo (#32782) @andrii-bodnar
48
+ - &#8203;<!-- 27 -->[docs] Improve callouts design (#32709) @danilo-leal
49
+ - &#8203;<!-- 26 -->[docs] Revise the "Understanding MUI packages" article (#32382) @danilo-leal
50
+ - &#8203;<!-- 25 -->[docs] Fix link to the material icons (#32771) @oliviertassinari
51
+ - &#8203;<!-- 24 -->[docs] Add notification for Premium release blog post (#32728) @joserodolfofreitas
52
+ - &#8203;<!-- 23 -->[docs] Base Portal style revisions and final review (#32157) @samuelsycamore
53
+ - &#8203;<!-- 22 -->[docs] Add joy to docs package.json (#32744) @siriwatknp
54
+ - &#8203;<!-- 21 -->[docs] Fix TOC-related styles not being applied when disableAd=true (#32733) @cherniavskii
55
+ - &#8203;<!-- 20 -->[docs] Add TypeScript guide on the polymorphic components (#32168) @mnajdova
56
+ - &#8203;<!-- 19 -->[docs] Fix warning mode pass to React.Fragment (#32729) @siriwatknp
57
+ - &#8203;<!-- 18 -->[docs] Revise Showcase copy for clarity + audit appList (#31946) @samuelsycamore
58
+ - &#8203;<!-- 17 -->[examples] Update remix example's tsconfig with required values (#32723) @michaldudak
59
+ - &#8203;<!-- 16 -->[examples] Update to use React 18's createRoot (#32506) @mnajdova
60
+ - &#8203;<!-- 10 -->[l10n] Fix typos and translations on arSD and arEG locales (#31848) @shadigaafar
61
+ - &#8203;<!-- 04 -->[website] Improve communication about MUI X components that are still wip (#32708) @danilo-leal
62
+ - &#8203;<!-- 03 -->[website] Remove scrollbar on x-axis (#32291) @MrHBS
63
+ - &#8203;<!-- 02 -->[website] Update the pricing page for the MUI X premium plan release (#32458) @joserodolfofreitas
64
+ - &#8203;<!-- 01 -->[website] Update sponsors (#32725) @oliviertassinari
65
+
66
+ ### Core
67
+
68
+ - &#8203;<!-- 32 -->[core] Enabled Renovate's lockfile maintenance (#32635) @michaldudak
69
+ - &#8203;<!-- 31 -->[core] Extract `MuiPage` interface to separate file (#32715) @cherniavskii
70
+ - &#8203;<!-- 30 -->[core] Remove unnecessary `spacing` parameter from `createMixins` method (#32690) @ZeeshanTamboli
71
+ - &#8203;<!-- 06 -->[private-classnames] Remove package and move everything to utils (#32758) @mnajdova
72
+
73
+ All contributors of this release in alphabetical order: @andrii-bodnar, @cherniavskii, @danilo-leal, @emlai, @joserodolfofreitas, @michaldudak, @mnajdova, @MrHBS, @oliviertassinari, @ryancogswell, @samuelsycamore, @shadigaafar, @siriwatknp, @ZeeshanTamboli
74
+
3
75
  ## 5.7.0
4
76
 
5
77
  <!-- generated comparing v5.6.4..master -->
@@ -0,0 +1,13 @@
1
+ /**
2
+ *
3
+ * Demos:
4
+ *
5
+ * - [Container (Material UI)](https://mui.com/material-ui/react-container/)
6
+ * - [Container (MUI System)](https://mui.com/system/react-container/)
7
+ *
8
+ * API:
9
+ *
10
+ * - [Container API](https://mui.com/system/api/container/)
11
+ */
12
+ declare const Container: import("@mui/types").OverridableComponent<import("./ContainerProps").ContainerTypeMap<{}, "div">>;
13
+ export default Container;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _createContainer = _interopRequireDefault(require("./createContainer"));
13
+
14
+ /**
15
+ *
16
+ * Demos:
17
+ *
18
+ * - [Container (Material UI)](https://mui.com/material-ui/react-container/)
19
+ * - [Container (MUI System)](https://mui.com/system/react-container/)
20
+ *
21
+ * API:
22
+ *
23
+ * - [Container API](https://mui.com/system/api/container/)
24
+ */
25
+ const Container = (0, _createContainer.default)();
26
+ process.env.NODE_ENV !== "production" ? Container.propTypes
27
+ /* remove-proptypes */
28
+ = {
29
+ // ----------------------------- Warning --------------------------------
30
+ // | These PropTypes are generated from the TypeScript type definitions |
31
+ // | To update them edit TypeScript types and run "yarn proptypes" |
32
+ // ----------------------------------------------------------------------
33
+
34
+ /**
35
+ * @ignore
36
+ */
37
+ children: _propTypes.default.node,
38
+
39
+ /**
40
+ * Override or extend the styles applied to the component.
41
+ */
42
+ classes: _propTypes.default.object,
43
+
44
+ /**
45
+ * The component used for the root node.
46
+ * Either a string to use a HTML element or a component.
47
+ */
48
+ component: _propTypes.default.elementType,
49
+
50
+ /**
51
+ * If `true`, the left and right padding is removed.
52
+ * @default false
53
+ */
54
+ disableGutters: _propTypes.default.bool,
55
+
56
+ /**
57
+ * Set the max-width to match the min-width of the current breakpoint.
58
+ * This is useful if you'd prefer to design for a fixed set of sizes
59
+ * instead of trying to accommodate a fully fluid viewport.
60
+ * It's fluid by default.
61
+ * @default false
62
+ */
63
+ fixed: _propTypes.default.bool,
64
+
65
+ /**
66
+ * Determine the max-width of the container.
67
+ * The container width grows with the size of the screen.
68
+ * Set to `false` to disable `maxWidth`.
69
+ * @default 'lg'
70
+ */
71
+ maxWidth: _propTypes.default
72
+ /* @typescript-to-proptypes-ignore */
73
+ .oneOfType([_propTypes.default.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), _propTypes.default.string]),
74
+
75
+ /**
76
+ * The system prop that allows defining system overrides as well as additional CSS styles.
77
+ */
78
+ sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
79
+ } : void 0;
80
+ var _default = Container;
81
+ exports.default = _default;
@@ -0,0 +1,40 @@
1
+ import * as React from 'react';
2
+ import { OverrideProps } from '@mui/types';
3
+ import { SxProps } from '../styleFunctionSx';
4
+ import { Theme, Breakpoint } from '../createTheme';
5
+ import { ContainerClasses } from './containerClasses';
6
+ export interface ContainerTypeMap<P = {}, D extends React.ElementType = 'div'> {
7
+ props: P & {
8
+ children?: React.ReactNode;
9
+ /**
10
+ * Override or extend the styles applied to the component.
11
+ */
12
+ classes?: Partial<ContainerClasses>;
13
+ /**
14
+ * If `true`, the left and right padding is removed.
15
+ * @default false
16
+ */
17
+ disableGutters?: boolean;
18
+ /**
19
+ * Set the max-width to match the min-width of the current breakpoint.
20
+ * This is useful if you'd prefer to design for a fixed set of sizes
21
+ * instead of trying to accommodate a fully fluid viewport.
22
+ * It's fluid by default.
23
+ * @default false
24
+ */
25
+ fixed?: boolean;
26
+ /**
27
+ * Determine the max-width of the container.
28
+ * The container width grows with the size of the screen.
29
+ * Set to `false` to disable `maxWidth`.
30
+ * @default 'lg'
31
+ */
32
+ maxWidth?: Breakpoint | false;
33
+ /**
34
+ * The system prop that allows defining system overrides as well as additional CSS styles.
35
+ */
36
+ sx?: SxProps<Theme>;
37
+ };
38
+ defaultComponent: D;
39
+ }
40
+ export declare type ContainerProps<D extends React.ElementType = ContainerTypeMap['defaultComponent'], P = {}> = OverrideProps<ContainerTypeMap<P, D>, D>;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,22 @@
1
+ export interface ContainerClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to the root element if `disableGutters={true}`. */
5
+ disableGutters: string;
6
+ /** Styles applied to the root element if `fixed={true}`. */
7
+ fixed: string;
8
+ /** Styles applied to the root element if `maxWidth="xs"`. */
9
+ maxWidthXs: string;
10
+ /** Styles applied to the root element if `maxWidth="sm"`. */
11
+ maxWidthSm: string;
12
+ /** Styles applied to the root element if `maxWidth="md"`. */
13
+ maxWidthMd: string;
14
+ /** Styles applied to the root element if `maxWidth="lg"`. */
15
+ maxWidthLg: string;
16
+ /** Styles applied to the root element if `maxWidth="xl"`. */
17
+ maxWidthXl: string;
18
+ }
19
+ export declare type ContainerClassKey = keyof ContainerClasses;
20
+ export declare function getContainerUtilityClass(slot: string): string;
21
+ declare const containerClasses: ContainerClasses;
22
+ export default containerClasses;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ exports.getContainerUtilityClass = getContainerUtilityClass;
8
+
9
+ var _utils = require("@mui/utils");
10
+
11
+ function getContainerUtilityClass(slot) {
12
+ return (0, _utils.unstable_generateUtilityClass)('MuiContainer', slot);
13
+ }
14
+
15
+ const containerClasses = (0, _utils.unstable_generateUtilityClasses)('MuiContainer', ['root', 'disableGutters', 'fixed', 'maxWidthXs', 'maxWidthSm', 'maxWidthMd', 'maxWidthLg', 'maxWidthXl']);
16
+ var _default = containerClasses;
17
+ exports.default = _default;
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import { Interpolation, StyledComponent } from '@mui/styled-engine';
3
+ import { OverridableComponent } from '@mui/types';
4
+ import { ContainerProps, ContainerTypeMap } from './ContainerProps';
5
+ import { Theme as DefaultTheme } from '../createTheme';
6
+ interface StyleFnProps<Theme> extends ContainerProps {
7
+ theme: Theme;
8
+ ownerState: ContainerProps;
9
+ }
10
+ declare type RequiredThemeStructure = Pick<DefaultTheme, 'breakpoints' | 'spacing'>;
11
+ export default function createContainer<Theme extends RequiredThemeStructure = DefaultTheme>(options?: {
12
+ createStyledComponent?: (...styles: Array<Interpolation<StyleFnProps<Theme>>>) => StyledComponent<ContainerProps>;
13
+ useThemeProps?: (inProps: ContainerProps) => ContainerProps & {
14
+ component?: React.ElementType;
15
+ };
16
+ componentName?: string;
17
+ }): OverridableComponent<ContainerTypeMap<{}, "div">>;
18
+ export {};
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = createContainer;
9
+
10
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
+
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
14
+ var React = _interopRequireWildcard(require("react"));
15
+
16
+ var _propTypes = _interopRequireDefault(require("prop-types"));
17
+
18
+ var _clsx = _interopRequireDefault(require("clsx"));
19
+
20
+ var _utils = require("@mui/utils");
21
+
22
+ var _useThemeProps = _interopRequireDefault(require("../useThemeProps"));
23
+
24
+ var _styled = _interopRequireDefault(require("../styled"));
25
+
26
+ var _createTheme = _interopRequireDefault(require("../createTheme"));
27
+
28
+ var _jsxRuntime = require("react/jsx-runtime");
29
+
30
+ const _excluded = ["className", "component", "disableGutters", "fixed", "maxWidth", "classes"];
31
+
32
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
+
34
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
+
36
+ const defaultTheme = (0, _createTheme.default)();
37
+ const defaultCreateStyledComponent = (0, _styled.default)('div', {
38
+ name: 'MuiContainer',
39
+ slot: 'Root',
40
+ overridesResolver: (props, styles) => {
41
+ const {
42
+ ownerState
43
+ } = props;
44
+ return [styles.root, styles[`maxWidth${(0, _utils.unstable_capitalize)(String(ownerState.maxWidth))}`], ownerState.fixed && styles.fixed, ownerState.disableGutters && styles.disableGutters];
45
+ }
46
+ });
47
+
48
+ const useThemePropsDefault = inProps => (0, _useThemeProps.default)({
49
+ props: inProps,
50
+ name: 'MuiContainer',
51
+ defaultTheme
52
+ });
53
+
54
+ const useUtilityClasses = (ownerState, componentName) => {
55
+ const getContainerUtilityClass = slot => {
56
+ return (0, _utils.unstable_generateUtilityClass)(componentName, slot);
57
+ };
58
+
59
+ const {
60
+ classes,
61
+ fixed,
62
+ disableGutters,
63
+ maxWidth
64
+ } = ownerState;
65
+ const slots = {
66
+ root: ['root', maxWidth && `maxWidth${(0, _utils.unstable_capitalize)(String(maxWidth))}`, fixed && 'fixed', disableGutters && 'disableGutters']
67
+ };
68
+ return (0, _utils.unstable_composeClasses)(slots, getContainerUtilityClass, classes);
69
+ };
70
+
71
+ function createContainer(options = {}) {
72
+ const {
73
+ // This will allow adding custom styled fn (for example for custom sx style function)
74
+ createStyledComponent = defaultCreateStyledComponent,
75
+ useThemeProps = useThemePropsDefault,
76
+ componentName = 'MuiContainer'
77
+ } = options;
78
+ const ContainerRoot = createStyledComponent(({
79
+ theme,
80
+ ownerState
81
+ }) => (0, _extends2.default)({
82
+ width: '100%',
83
+ marginLeft: 'auto',
84
+ boxSizing: 'border-box',
85
+ marginRight: 'auto',
86
+ display: 'block'
87
+ }, !ownerState.disableGutters && {
88
+ paddingLeft: theme.spacing(2),
89
+ paddingRight: theme.spacing(2),
90
+ // @ts-ignore module augmentation fails if custom breakpoints are used
91
+ [theme.breakpoints.up('sm')]: {
92
+ paddingLeft: theme.spacing(3),
93
+ paddingRight: theme.spacing(3)
94
+ }
95
+ }), ({
96
+ theme,
97
+ ownerState
98
+ }) => ownerState.fixed && Object.keys(theme.breakpoints.values).reduce((acc, breakpointValueKey) => {
99
+ const breakpoint = breakpointValueKey;
100
+ const value = theme.breakpoints.values[breakpoint];
101
+
102
+ if (value !== 0) {
103
+ // @ts-ignore
104
+ acc[theme.breakpoints.up(breakpoint)] = {
105
+ maxWidth: `${value}${theme.breakpoints.unit}`
106
+ };
107
+ }
108
+
109
+ return acc;
110
+ }, {}), ({
111
+ theme,
112
+ ownerState
113
+ }) => (0, _extends2.default)({}, ownerState.maxWidth === 'xs' && {
114
+ // @ts-ignore module augmentation fails if custom breakpoints are used
115
+ [theme.breakpoints.up('xs')]: {
116
+ // @ts-ignore module augmentation fails if custom breakpoints are used
117
+ maxWidth: Math.max(theme.breakpoints.values.xs, 444)
118
+ }
119
+ }, ownerState.maxWidth && // @ts-ignore module augmentation fails if custom breakpoints are used
120
+ ownerState.maxWidth !== 'xs' && {
121
+ // @ts-ignore module augmentation fails if custom breakpoints are used
122
+ [theme.breakpoints.up(ownerState.maxWidth)]: {
123
+ // @ts-ignore module augmentation fails if custom breakpoints are used
124
+ maxWidth: `${theme.breakpoints.values[ownerState.maxWidth]}${theme.breakpoints.unit}`
125
+ }
126
+ }));
127
+ const Container = /*#__PURE__*/React.forwardRef(function Container(inProps, ref) {
128
+ const props = useThemeProps(inProps);
129
+ const {
130
+ className,
131
+ component = 'div',
132
+ disableGutters = false,
133
+ fixed = false,
134
+ maxWidth = 'lg'
135
+ } = props,
136
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
137
+ const ownerState = (0, _extends2.default)({}, props, {
138
+ component,
139
+ disableGutters,
140
+ fixed,
141
+ maxWidth
142
+ }); // @ts-ignore module augmentation fails if custom breakpoints are used
143
+
144
+ const classes = useUtilityClasses(ownerState, componentName);
145
+ return (
146
+ /*#__PURE__*/
147
+ // @ts-ignore theme is injected by the styled util
148
+ (0, _jsxRuntime.jsx)(ContainerRoot, (0, _extends2.default)({
149
+ as: component // @ts-ignore module augmentation fails if custom breakpoints are used
150
+ ,
151
+ ownerState: ownerState,
152
+ className: (0, _clsx.default)(classes.root, className),
153
+ ref: ref
154
+ }, other))
155
+ );
156
+ });
157
+ process.env.NODE_ENV !== "production" ? Container.propTypes
158
+ /* remove-proptypes */
159
+ = {
160
+ children: _propTypes.default.node,
161
+ classes: _propTypes.default.object,
162
+ className: _propTypes.default.string,
163
+ component: _propTypes.default.elementType,
164
+ disableGutters: _propTypes.default.bool,
165
+ fixed: _propTypes.default.bool,
166
+ maxWidth: _propTypes.default
167
+ /* @typescript-to-proptypes-ignore */
168
+ .oneOfType([_propTypes.default.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), _propTypes.default.string]),
169
+ sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
170
+ } : void 0;
171
+ return Container;
172
+ }
@@ -0,0 +1,5 @@
1
+ export { default } from './Container';
2
+ export * from './Container';
3
+
4
+ export { default as containerClasses } from './containerClasses';
5
+ export * from './containerClasses';
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ var _exportNames = {
9
+ containerClasses: true
10
+ };
11
+ Object.defineProperty(exports, "containerClasses", {
12
+ enumerable: true,
13
+ get: function () {
14
+ return _containerClasses.default;
15
+ }
16
+ });
17
+ Object.defineProperty(exports, "default", {
18
+ enumerable: true,
19
+ get: function () {
20
+ return _Container.default;
21
+ }
22
+ });
23
+
24
+ var _Container = _interopRequireDefault(require("./Container"));
25
+
26
+ var _containerClasses = _interopRequireWildcard(require("./containerClasses"));
27
+
28
+ Object.keys(_containerClasses).forEach(function (key) {
29
+ if (key === "default" || key === "__esModule") return;
30
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
31
+ if (key in exports && exports[key] === _containerClasses[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _containerClasses[key];
36
+ }
37
+ });
38
+ });
39
+
40
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
41
+
42
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "../esm/Container/index.js",
4
+ "main": "./index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -61,6 +61,11 @@ export interface Breakpoints {
61
61
  * the screen size given by the breakpoint key (exclusive) and starting at the screen size given by the next breakpoint key (inclusive).
62
62
  */
63
63
  not: (key: Breakpoint) => string;
64
+ /**
65
+ * The unit used for the breakpoint's values.
66
+ * @default 'px'
67
+ */
68
+ unit?: string | undefined;
64
69
  }
65
70
 
66
71
  export interface BreakpointsOptions extends Partial<Breakpoints> {
@@ -1,10 +1,10 @@
1
- export declare type SpacingOptions = number | Spacing | ((abs: number) => number | string) | ((abs: number | string) => number | string) | ReadonlyArray<string | number>;
2
- export declare type SpacingArgument = number | string;
3
- export interface Spacing {
4
- (): string;
5
- (value: number): string;
6
- (topBottom: SpacingArgument, rightLeft: SpacingArgument): string;
7
- (top: SpacingArgument, rightLeft: SpacingArgument, bottom: SpacingArgument): string;
8
- (top: SpacingArgument, right: SpacingArgument, bottom: SpacingArgument, left: SpacingArgument): string;
9
- }
10
- export default function createSpacing(spacingInput?: SpacingOptions): Spacing;
1
+ export declare type SpacingOptions = number | Spacing | ((abs: number) => number | string) | ((abs: number | string) => number | string) | ReadonlyArray<string | number>;
2
+ export declare type SpacingArgument = number | string;
3
+ export interface Spacing {
4
+ (): string;
5
+ (value: number): string;
6
+ (topBottom: SpacingArgument, rightLeft: SpacingArgument): string;
7
+ (top: SpacingArgument, rightLeft: SpacingArgument, bottom: SpacingArgument): string;
8
+ (top: SpacingArgument, right: SpacingArgument, bottom: SpacingArgument, left: SpacingArgument): string;
9
+ }
10
+ export default function createSpacing(spacingInput?: SpacingOptions): Spacing;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,5 +1,5 @@
1
- /**
2
- * The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
3
- * and they does not need to remember the prefix (defined once).
4
- */
5
- export default function createGetCssVar<T extends string = string>(prefix?: string): <AdditionalVars extends string = never>(field: T | AdditionalVars, ...vars: (T | AdditionalVars)[]) => string;
1
+ /**
2
+ * The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
3
+ * and they does not need to remember the prefix (defined once).
4
+ */
5
+ export default function createGetCssVar<T extends string = string>(prefix?: string): <AdditionalVars extends string = never>(field: T | AdditionalVars, ...vars: (T | AdditionalVars)[]) => string;