@mui/material 5.8.6 → 5.9.1
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.
- package/Autocomplete/Autocomplete.d.ts +2 -0
- package/Autocomplete/Autocomplete.js +14 -10
- package/ButtonBase/TouchRipple.js +1 -1
- package/CHANGELOG.md +185 -0
- package/Modal/Modal.js +6 -6
- package/Popper/Popper.d.ts +1 -6
- package/README.md +57 -24
- package/ScopedCssBaseline/ScopedCssBaseline.d.ts +6 -0
- package/ScopedCssBaseline/ScopedCssBaseline.js +6 -1
- package/Select/Select.d.ts +1 -1
- package/Select/Select.js +1 -1
- package/Slider/Slider.js +3 -2
- package/SnackbarContent/SnackbarContent.js +1 -1
- package/Tooltip/Tooltip.js +6 -5
- package/Unstable_Grid2/Grid2.d.ts +4 -0
- package/Unstable_Grid2/Grid2.js +34 -0
- package/Unstable_Grid2/Grid2Props.d.ts +15 -0
- package/Unstable_Grid2/Grid2Props.js +1 -0
- package/Unstable_Grid2/grid2Classes.d.ts +5 -0
- package/Unstable_Grid2/grid2Classes.js +14 -0
- package/Unstable_Grid2/index.d.ts +4 -0
- package/Unstable_Grid2/index.js +4 -0
- package/Unstable_Grid2/package.json +6 -0
- package/index.d.ts +3 -0
- package/index.js +3 -1
- package/legacy/Autocomplete/Autocomplete.js +14 -10
- package/legacy/ButtonBase/TouchRipple.js +1 -1
- package/legacy/Modal/Modal.js +13 -9
- package/legacy/ScopedCssBaseline/ScopedCssBaseline.js +6 -1
- package/legacy/Select/Select.js +1 -1
- package/legacy/Slider/Slider.js +3 -2
- package/legacy/SnackbarContent/SnackbarContent.js +1 -1
- package/legacy/Tooltip/Tooltip.js +6 -5
- package/legacy/Unstable_Grid2/Grid2.js +38 -0
- package/legacy/Unstable_Grid2/Grid2Props.js +1 -0
- package/legacy/Unstable_Grid2/grid2Classes.js +27 -0
- package/legacy/Unstable_Grid2/index.js +4 -0
- package/legacy/index.js +3 -1
- package/legacy/styles/CssVarsProvider.js +10 -10
- package/legacy/styles/experimental_extendTheme.js +60 -44
- package/modern/Autocomplete/Autocomplete.js +13 -9
- package/modern/ButtonBase/TouchRipple.js +1 -1
- package/modern/Modal/Modal.js +6 -6
- package/modern/ScopedCssBaseline/ScopedCssBaseline.js +6 -1
- package/modern/Select/Select.js +1 -1
- package/modern/Slider/Slider.js +3 -2
- package/modern/SnackbarContent/SnackbarContent.js +1 -1
- package/modern/Tooltip/Tooltip.js +6 -5
- package/modern/Unstable_Grid2/Grid2.js +34 -0
- package/modern/Unstable_Grid2/Grid2Props.js +1 -0
- package/modern/Unstable_Grid2/grid2Classes.js +14 -0
- package/modern/Unstable_Grid2/index.js +4 -0
- package/modern/index.js +3 -1
- package/modern/styles/CssVarsProvider.js +6 -6
- package/modern/styles/experimental_extendTheme.js +55 -45
- package/node/Autocomplete/Autocomplete.js +14 -10
- package/node/ButtonBase/TouchRipple.js +1 -1
- package/node/Modal/Modal.js +9 -9
- package/node/ScopedCssBaseline/ScopedCssBaseline.js +6 -1
- package/node/Select/Select.js +1 -1
- package/node/Slider/Slider.js +3 -2
- package/node/SnackbarContent/SnackbarContent.js +1 -1
- package/node/Tooltip/Tooltip.js +6 -5
- package/node/Unstable_Grid2/Grid2.js +47 -0
- package/node/Unstable_Grid2/Grid2Props.js +5 -0
- package/node/Unstable_Grid2/grid2Classes.js +25 -0
- package/node/Unstable_Grid2/index.js +56 -0
- package/node/index.js +22 -1
- package/node/styles/CssVarsProvider.js +11 -10
- package/node/styles/experimental_extendTheme.js +57 -44
- package/package.json +7 -7
- package/styles/CssVarsProvider.d.ts +9 -5
- package/styles/CssVarsProvider.js +10 -10
- package/styles/components.d.ts +5 -0
- package/styles/createTheme.d.ts +1 -1
- package/styles/experimental_extendTheme.d.ts +132 -40
- package/styles/experimental_extendTheme.js +55 -45
- package/styles/index.d.ts +11 -0
- package/styles/overrides.d.ts +3 -1
- package/styles/props.d.ts +2 -0
- package/themeCssVarsAugmentation/index.d.ts +6 -41
- package/umd/material-ui.development.js +918 -416
- package/umd/material-ui.production.min.js +20 -25
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { createGrid } from '@mui/system/Unstable_Grid';
|
|
3
|
+
import { styled, useThemeProps } from '../styles';
|
|
4
|
+
const Grid2 = createGrid({
|
|
5
|
+
createStyledComponent: styled('div', {
|
|
6
|
+
name: 'MuiGrid2',
|
|
7
|
+
overridesResolver: (props, styles) => styles.root
|
|
8
|
+
}),
|
|
9
|
+
componentName: 'MuiGrid2',
|
|
10
|
+
// eslint-disable-next-line material-ui/mui-name-matches-component-name
|
|
11
|
+
useThemeProps: inProps => useThemeProps({
|
|
12
|
+
props: inProps,
|
|
13
|
+
name: 'MuiGrid2'
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
process.env.NODE_ENV !== "production" ? Grid2.propTypes
|
|
17
|
+
/* remove-proptypes */
|
|
18
|
+
= {
|
|
19
|
+
// ----------------------------- Warning --------------------------------
|
|
20
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
21
|
+
// | To update them edit TypeScript types and run "yarn proptypes" |
|
|
22
|
+
// ----------------------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The content of the component.
|
|
26
|
+
*/
|
|
27
|
+
children: PropTypes.node,
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @ignore
|
|
31
|
+
*/
|
|
32
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
33
|
+
} : void 0;
|
|
34
|
+
export default Grid2;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OverrideProps } from '@mui/types';
|
|
3
|
+
import { SxProps, SystemProps } from '@mui/system';
|
|
4
|
+
import { GridBaseProps } from '@mui/system/Unstable_Grid';
|
|
5
|
+
import { Theme } from '../styles';
|
|
6
|
+
export declare type Grid2Slot = 'root';
|
|
7
|
+
export interface Grid2TypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
8
|
+
props: P & GridBaseProps & {
|
|
9
|
+
sx?: SxProps<Theme>;
|
|
10
|
+
} & SystemProps<Theme>;
|
|
11
|
+
defaultComponent: D;
|
|
12
|
+
}
|
|
13
|
+
export declare type Grid2Props<D extends React.ElementType = Grid2TypeMap['defaultComponent'], P = {
|
|
14
|
+
component?: React.ElementType;
|
|
15
|
+
}> = OverrideProps<Grid2TypeMap<P, D>, D>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { generateUtilityClass, generateUtilityClasses } from '@mui/base';
|
|
2
|
+
export function getGrid2UtilityClass(slot) {
|
|
3
|
+
return generateUtilityClass('MuiGrid2', slot);
|
|
4
|
+
}
|
|
5
|
+
const SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
6
|
+
const DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];
|
|
7
|
+
const WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];
|
|
8
|
+
const GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
9
|
+
const grid2Classes = generateUtilityClasses('MuiGrid2', ['root', 'container', 'item', 'zeroMinWidth', // spacings
|
|
10
|
+
...SPACINGS.map(spacing => `spacing-xs-${spacing}`), // direction values
|
|
11
|
+
...DIRECTIONS.map(direction => `direction-xs-${direction}`), // wrap values
|
|
12
|
+
...WRAPS.map(wrap => `wrap-xs-${wrap}`), // grid sizes for all breakpoints
|
|
13
|
+
...GRID_SIZES.map(size => `grid-xs-${size}`), ...GRID_SIZES.map(size => `grid-sm-${size}`), ...GRID_SIZES.map(size => `grid-md-${size}`), ...GRID_SIZES.map(size => `grid-lg-${size}`), ...GRID_SIZES.map(size => `grid-xl-${size}`)]);
|
|
14
|
+
export default grid2Classes;
|
package/index.d.ts
CHANGED
|
@@ -224,6 +224,9 @@ export * from './FormLabel';
|
|
|
224
224
|
export { default as Grid } from './Grid';
|
|
225
225
|
export * from './Grid';
|
|
226
226
|
|
|
227
|
+
export { default as Unstable_Grid2 } from './Unstable_Grid2';
|
|
228
|
+
export * from './Unstable_Grid2';
|
|
229
|
+
|
|
227
230
|
export { default as Grow } from './Grow';
|
|
228
231
|
export * from './Grow';
|
|
229
232
|
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.9.1
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -106,6 +106,8 @@ export { default as FormLabel } from './FormLabel';
|
|
|
106
106
|
export * from './FormLabel';
|
|
107
107
|
export { default as Grid } from './Grid';
|
|
108
108
|
export * from './Grid';
|
|
109
|
+
export { default as Unstable_Grid2 } from './Unstable_Grid2';
|
|
110
|
+
export * from './Unstable_Grid2';
|
|
109
111
|
export { default as Grow } from './Grow';
|
|
110
112
|
export * from './Grow';
|
|
111
113
|
export { default as Hidden } from './Hidden';
|
|
@@ -316,7 +316,7 @@ var AutocompleteGroupUl = styled('ul', {
|
|
|
316
316
|
}));
|
|
317
317
|
export { createFilterOptions };
|
|
318
318
|
var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps, ref) {
|
|
319
|
-
var _componentsProps$clea, _componentsProps$pape;
|
|
319
|
+
var _componentsProps$clea, _componentsProps$popu, _componentsProps$popp, _componentsProps$pape;
|
|
320
320
|
|
|
321
321
|
var props = useThemeProps({
|
|
322
322
|
props: inProps,
|
|
@@ -477,7 +477,7 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
477
477
|
if (multiple && value.length > 0) {
|
|
478
478
|
var getCustomizedTagProps = function getCustomizedTagProps(params) {
|
|
479
479
|
return _extends({
|
|
480
|
-
className:
|
|
480
|
+
className: classes.tag,
|
|
481
481
|
disabled: disabled
|
|
482
482
|
}, getTagProps(params));
|
|
483
483
|
};
|
|
@@ -577,21 +577,21 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
577
577
|
disabled: disabled,
|
|
578
578
|
"aria-label": popupOpen ? closeText : openText,
|
|
579
579
|
title: popupOpen ? closeText : openText,
|
|
580
|
-
|
|
581
|
-
|
|
580
|
+
ownerState: ownerState
|
|
581
|
+
}, componentsProps.popupIndicator, {
|
|
582
|
+
className: clsx(classes.popupIndicator, (_componentsProps$popu = componentsProps.popupIndicator) == null ? void 0 : _componentsProps$popu.className),
|
|
582
583
|
children: popupIcon
|
|
583
584
|
})) : null]
|
|
584
585
|
})
|
|
585
586
|
}),
|
|
586
587
|
inputProps: _extends({
|
|
587
|
-
className:
|
|
588
|
+
className: classes.input,
|
|
588
589
|
disabled: disabled,
|
|
589
590
|
readOnly: readOnly
|
|
590
591
|
}, getInputProps())
|
|
591
592
|
})
|
|
592
|
-
})), popupOpen && anchorEl ? /*#__PURE__*/_jsx(AutocompletePopper, {
|
|
593
|
+
})), popupOpen && anchorEl ? /*#__PURE__*/_jsx(AutocompletePopper, _extends({
|
|
593
594
|
as: PopperComponent,
|
|
594
|
-
className: clsx(classes.popper),
|
|
595
595
|
disablePortal: disablePortal,
|
|
596
596
|
style: {
|
|
597
597
|
width: anchorEl ? anchorEl.clientWidth : null
|
|
@@ -599,7 +599,9 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
599
599
|
ownerState: ownerState,
|
|
600
600
|
role: "presentation",
|
|
601
601
|
anchorEl: anchorEl,
|
|
602
|
-
open: true
|
|
602
|
+
open: true
|
|
603
|
+
}, componentsProps.popper, {
|
|
604
|
+
className: clsx(classes.popper, (_componentsProps$popp = componentsProps.popper) == null ? void 0 : _componentsProps$popp.className),
|
|
603
605
|
children: /*#__PURE__*/_jsxs(AutocompletePaper, _extends({
|
|
604
606
|
ownerState: ownerState,
|
|
605
607
|
as: PaperComponent
|
|
@@ -638,7 +640,7 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
638
640
|
})
|
|
639
641
|
})) : null]
|
|
640
642
|
}))
|
|
641
|
-
}) : null]
|
|
643
|
+
})) : null]
|
|
642
644
|
});
|
|
643
645
|
});
|
|
644
646
|
process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
@@ -740,7 +742,9 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
740
742
|
*/
|
|
741
743
|
componentsProps: PropTypes.shape({
|
|
742
744
|
clearIndicator: PropTypes.object,
|
|
743
|
-
paper: PropTypes.object
|
|
745
|
+
paper: PropTypes.object,
|
|
746
|
+
popper: PropTypes.object,
|
|
747
|
+
popupIndicator: PropTypes.object
|
|
744
748
|
}),
|
|
745
749
|
|
|
746
750
|
/**
|
|
@@ -158,7 +158,7 @@ var TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, re
|
|
|
158
158
|
rippleX = Math.round(rect.width / 2);
|
|
159
159
|
rippleY = Math.round(rect.height / 2);
|
|
160
160
|
} else {
|
|
161
|
-
var _ref5 = event.touches ? event.touches[0] : event,
|
|
161
|
+
var _ref5 = event.touches && event.touches.length > 0 ? event.touches[0] : event,
|
|
162
162
|
clientX = _ref5.clientX,
|
|
163
163
|
clientY = _ref5.clientY;
|
|
164
164
|
|
package/legacy/Modal/Modal.js
CHANGED
|
@@ -2,9 +2,9 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import { isHostComponent } from '@mui/base';
|
|
6
|
-
import { elementAcceptingRef, HTMLElementType } from '@mui/utils';
|
|
7
5
|
import ModalUnstyled, { modalUnstyledClasses } from '@mui/base/ModalUnstyled';
|
|
6
|
+
import { isHostComponent, resolveComponentProps } from '@mui/base/utils';
|
|
7
|
+
import { elementAcceptingRef, HTMLElementType } from '@mui/utils';
|
|
8
8
|
import styled from '../styles/styled';
|
|
9
9
|
import useThemeProps from '../styles/useThemeProps';
|
|
10
10
|
import Backdrop from '../Backdrop';
|
|
@@ -125,11 +125,15 @@ var Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
125
125
|
Backdrop: BackdropComponent
|
|
126
126
|
}, components),
|
|
127
127
|
componentsProps: {
|
|
128
|
-
root:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
root: function root() {
|
|
129
|
+
return _extends({}, resolveComponentProps(componentsProps.root, ownerState), !isHostComponent(Root) && {
|
|
130
|
+
as: component,
|
|
131
|
+
theme: theme
|
|
132
|
+
});
|
|
133
|
+
},
|
|
134
|
+
backdrop: function backdrop() {
|
|
135
|
+
return _extends({}, BackdropProps, resolveComponentProps(componentsProps.backdrop, ownerState));
|
|
136
|
+
}
|
|
133
137
|
},
|
|
134
138
|
onTransitionEnter: function onTransitionEnter() {
|
|
135
139
|
return setExited(false);
|
|
@@ -210,8 +214,8 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
210
214
|
* @default {}
|
|
211
215
|
*/
|
|
212
216
|
componentsProps: PropTypes.shape({
|
|
213
|
-
backdrop: PropTypes.object,
|
|
214
|
-
root: PropTypes.object
|
|
217
|
+
backdrop: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
218
|
+
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
215
219
|
}),
|
|
216
220
|
|
|
217
221
|
/**
|
|
@@ -94,6 +94,11 @@ process.env.NODE_ENV !== "production" ? ScopedCssBaseline.propTypes
|
|
|
94
94
|
* For more details, check out https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
|
|
95
95
|
* For browser support, check out https://caniuse.com/?search=color-scheme
|
|
96
96
|
*/
|
|
97
|
-
enableColorScheme: PropTypes.bool
|
|
97
|
+
enableColorScheme: PropTypes.bool,
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
101
|
+
*/
|
|
102
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
98
103
|
} : void 0;
|
|
99
104
|
export default ScopedCssBaseline;
|
package/legacy/Select/Select.js
CHANGED
|
@@ -301,7 +301,7 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
|
|
|
301
301
|
* If the value is an object it must have reference equality with the option in order to be selected.
|
|
302
302
|
* If the value is not an object, the string representation must match with the string representation of the option in order to be selected.
|
|
303
303
|
*/
|
|
304
|
-
value: PropTypes.any,
|
|
304
|
+
value: PropTypes.oneOfType([PropTypes.oneOf(['']), PropTypes.any]),
|
|
305
305
|
|
|
306
306
|
/**
|
|
307
307
|
* The variant to use.
|
package/legacy/Slider/Slider.js
CHANGED
|
@@ -283,7 +283,6 @@ var SliderValueLabel = styled(SliderValueLabelUnstyled, {
|
|
|
283
283
|
transition: theme.transitions.create(['transform'], {
|
|
284
284
|
duration: theme.transitions.duration.shortest
|
|
285
285
|
}),
|
|
286
|
-
transformOrigin: 'bottom center',
|
|
287
286
|
transform: 'translateY(-100%) scale(0)',
|
|
288
287
|
position: 'absolute',
|
|
289
288
|
backgroundColor: (theme.vars || theme).palette.grey[600],
|
|
@@ -295,6 +294,7 @@ var SliderValueLabel = styled(SliderValueLabelUnstyled, {
|
|
|
295
294
|
padding: '0.25rem 0.75rem'
|
|
296
295
|
}, ownerState.orientation === 'horizontal' && {
|
|
297
296
|
top: '-10px',
|
|
297
|
+
transformOrigin: 'bottom center',
|
|
298
298
|
'&:before': {
|
|
299
299
|
position: 'absolute',
|
|
300
300
|
content: '""',
|
|
@@ -307,7 +307,8 @@ var SliderValueLabel = styled(SliderValueLabelUnstyled, {
|
|
|
307
307
|
}
|
|
308
308
|
}, ownerState.orientation === 'vertical' && {
|
|
309
309
|
right: '30px',
|
|
310
|
-
top: '
|
|
310
|
+
top: '24px',
|
|
311
|
+
transformOrigin: 'right center',
|
|
311
312
|
'&:before': {
|
|
312
313
|
position: 'absolute',
|
|
313
314
|
content: '""',
|
|
@@ -34,7 +34,7 @@ var SnackbarContentRoot = styled(Paper, {
|
|
|
34
34
|
var emphasis = theme.palette.mode === 'light' ? 0.8 : 0.98;
|
|
35
35
|
var backgroundColor = emphasize(theme.palette.background.default, emphasis);
|
|
36
36
|
return _extends({}, theme.typography.body2, _defineProperty({
|
|
37
|
-
color: theme.vars ? theme.vars.palette.
|
|
37
|
+
color: theme.vars ? theme.vars.palette.SnackbarContent.color : theme.palette.getContrastText(backgroundColor),
|
|
38
38
|
backgroundColor: theme.vars ? theme.vars.palette.SnackbarContent.bg : backgroundColor,
|
|
39
39
|
display: 'flex',
|
|
40
40
|
alignItems: 'center',
|
|
@@ -360,12 +360,15 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
360
360
|
var handleEnter = function handleEnter(event) {
|
|
361
361
|
if (ignoreNonTouchEvents.current && event.type !== 'touchstart') {
|
|
362
362
|
return;
|
|
363
|
+
} // Workaround for https://github.com/facebook/react/issues/7769
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
if (!childNode) {
|
|
367
|
+
setChildNode(event.currentTarget);
|
|
363
368
|
} // Remove the title ahead of time.
|
|
364
369
|
// We don't want to wait for the next render commit.
|
|
365
370
|
// We would risk displaying two tooltips at the same time (native + this one).
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
if (childNode) {
|
|
371
|
+
else {
|
|
369
372
|
childNode.removeAttribute('title');
|
|
370
373
|
}
|
|
371
374
|
|
|
@@ -411,8 +414,6 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
411
414
|
|
|
412
415
|
var handleFocus = function handleFocus(event) {
|
|
413
416
|
// Workaround for https://github.com/facebook/react/issues/7769
|
|
414
|
-
// The autoFocus of React might trigger the event before the componentDidMount.
|
|
415
|
-
// We need to account for this eventuality.
|
|
416
417
|
if (!childNode) {
|
|
417
418
|
setChildNode(event.currentTarget);
|
|
418
419
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { createGrid } from '@mui/system/Unstable_Grid';
|
|
3
|
+
import { styled, useThemeProps as _useThemeProps } from '../styles';
|
|
4
|
+
var Grid2 = createGrid({
|
|
5
|
+
createStyledComponent: styled('div', {
|
|
6
|
+
name: 'MuiGrid2',
|
|
7
|
+
overridesResolver: function overridesResolver(props, styles) {
|
|
8
|
+
return styles.root;
|
|
9
|
+
}
|
|
10
|
+
}),
|
|
11
|
+
componentName: 'MuiGrid2',
|
|
12
|
+
// eslint-disable-next-line material-ui/mui-name-matches-component-name
|
|
13
|
+
useThemeProps: function useThemeProps(inProps) {
|
|
14
|
+
return _useThemeProps({
|
|
15
|
+
props: inProps,
|
|
16
|
+
name: 'MuiGrid2'
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
process.env.NODE_ENV !== "production" ? Grid2.propTypes
|
|
21
|
+
/* remove-proptypes */
|
|
22
|
+
= {
|
|
23
|
+
// ----------------------------- Warning --------------------------------
|
|
24
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
25
|
+
// | To update them edit TypeScript types and run "yarn proptypes" |
|
|
26
|
+
// ----------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The content of the component.
|
|
30
|
+
*/
|
|
31
|
+
children: PropTypes.node,
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @ignore
|
|
35
|
+
*/
|
|
36
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
37
|
+
} : void 0;
|
|
38
|
+
export default Grid2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import { generateUtilityClass, generateUtilityClasses } from '@mui/base';
|
|
3
|
+
export function getGrid2UtilityClass(slot) {
|
|
4
|
+
return generateUtilityClass('MuiGrid2', slot);
|
|
5
|
+
}
|
|
6
|
+
var SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
7
|
+
var DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];
|
|
8
|
+
var WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];
|
|
9
|
+
var GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
10
|
+
var grid2Classes = generateUtilityClasses('MuiGrid2', ['root', 'container', 'item', 'zeroMinWidth'].concat(_toConsumableArray(SPACINGS.map(function (spacing) {
|
|
11
|
+
return "spacing-xs-".concat(spacing);
|
|
12
|
+
})), _toConsumableArray(DIRECTIONS.map(function (direction) {
|
|
13
|
+
return "direction-xs-".concat(direction);
|
|
14
|
+
})), _toConsumableArray(WRAPS.map(function (wrap) {
|
|
15
|
+
return "wrap-xs-".concat(wrap);
|
|
16
|
+
})), _toConsumableArray(GRID_SIZES.map(function (size) {
|
|
17
|
+
return "grid-xs-".concat(size);
|
|
18
|
+
})), _toConsumableArray(GRID_SIZES.map(function (size) {
|
|
19
|
+
return "grid-sm-".concat(size);
|
|
20
|
+
})), _toConsumableArray(GRID_SIZES.map(function (size) {
|
|
21
|
+
return "grid-md-".concat(size);
|
|
22
|
+
})), _toConsumableArray(GRID_SIZES.map(function (size) {
|
|
23
|
+
return "grid-lg-".concat(size);
|
|
24
|
+
})), _toConsumableArray(GRID_SIZES.map(function (size) {
|
|
25
|
+
return "grid-xl-".concat(size);
|
|
26
|
+
}))));
|
|
27
|
+
export default grid2Classes;
|
package/legacy/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.9.1
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -106,6 +106,8 @@ export { default as FormLabel } from './FormLabel';
|
|
|
106
106
|
export * from './FormLabel';
|
|
107
107
|
export { default as Grid } from './Grid';
|
|
108
108
|
export * from './Grid';
|
|
109
|
+
export { default as Unstable_Grid2 } from './Unstable_Grid2';
|
|
110
|
+
export * from './Unstable_Grid2';
|
|
109
111
|
export { default as Grow } from './Grow';
|
|
110
112
|
export * from './Grow';
|
|
111
113
|
export { default as Hidden } from './Hidden';
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
4
2
|
import { unstable_createCssVarsProvider as createCssVarsProvider } from '@mui/system';
|
|
5
3
|
import experimental_extendTheme from './experimental_extendTheme';
|
|
6
4
|
import createTypography from './createTypography';
|
|
5
|
+
|
|
6
|
+
var shouldSkipGeneratingVar = function shouldSkipGeneratingVar(keys) {
|
|
7
|
+
var _keys$;
|
|
8
|
+
|
|
9
|
+
return !!keys[0].match(/(typography|mixins|breakpoints|direction|transitions)/) || keys[0] === 'palette' && !!((_keys$ = keys[1]) != null && _keys$.match(/(mode|contrastThreshold|tonalOffset)/));
|
|
10
|
+
};
|
|
11
|
+
|
|
7
12
|
var defaultTheme = experimental_extendTheme();
|
|
8
13
|
|
|
9
14
|
var _createCssVarsProvide = createCssVarsProvider({
|
|
@@ -15,7 +20,6 @@ var _createCssVarsProvide = createCssVarsProvider({
|
|
|
15
20
|
light: 'light',
|
|
16
21
|
dark: 'dark'
|
|
17
22
|
},
|
|
18
|
-
prefix: 'mui',
|
|
19
23
|
resolveTheme: function resolveTheme(theme) {
|
|
20
24
|
var newTheme = _extends({}, theme, {
|
|
21
25
|
typography: createTypography(theme.palette, theme.typography)
|
|
@@ -23,14 +27,10 @@ var _createCssVarsProvide = createCssVarsProvider({
|
|
|
23
27
|
|
|
24
28
|
return newTheme;
|
|
25
29
|
},
|
|
26
|
-
shouldSkipGeneratingVar:
|
|
27
|
-
var _keys$;
|
|
28
|
-
|
|
29
|
-
return !!keys[0].match(/(typography|mixins|breakpoints|direction|transitions)/) || keys[0] === 'palette' && !!((_keys$ = keys[1]) != null && _keys$.match(/(mode|contrastThreshold|tonalOffset)/));
|
|
30
|
-
}
|
|
30
|
+
shouldSkipGeneratingVar: shouldSkipGeneratingVar
|
|
31
31
|
}),
|
|
32
|
-
|
|
32
|
+
CssVarsProvider = _createCssVarsProvide.CssVarsProvider,
|
|
33
33
|
useColorScheme = _createCssVarsProvide.useColorScheme,
|
|
34
34
|
getInitColorSchemeScript = _createCssVarsProvide.getInitColorSchemeScript;
|
|
35
35
|
|
|
36
|
-
export { useColorScheme, getInitColorSchemeScript, Experimental_CssVarsProvider };
|
|
36
|
+
export { useColorScheme, getInitColorSchemeScript, shouldSkipGeneratingVar, CssVarsProvider as Experimental_CssVarsProvider };
|