@mui/material 5.11.15 → 5.12.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.
- package/Autocomplete/Autocomplete.js +9 -1
- package/Badge/badgeClasses.d.ts +18 -18
- package/Box/Box.js +2 -0
- package/CHANGELOG.md +139 -26
- package/CardActionArea/CardActionArea.js +2 -0
- package/GlobalStyles/GlobalStyles.js +4 -4
- package/Menu/Menu.js +1 -1
- package/NativeSelect/NativeSelectInput.d.ts +1 -0
- package/NativeSelect/NativeSelectInput.js +12 -5
- package/NativeSelect/nativeSelectClasses.d.ts +2 -0
- package/NativeSelect/nativeSelectClasses.js +1 -1
- package/OverridableComponent.d.ts +1 -1
- package/PaginationItem/paginationItemClasses.d.ts +2 -2
- package/Popper/Popper.js +0 -4
- package/README.md +5 -5
- package/Select/Select.d.ts +1 -1
- package/Select/Select.js +15 -10
- package/Select/SelectInput.d.ts +1 -0
- package/Select/SelectInput.js +14 -4
- package/Select/selectClasses.d.ts +2 -0
- package/Select/selectClasses.js +1 -1
- package/Slider/Slider.js +6 -6
- package/Slider/sliderClasses.d.ts +22 -22
- package/Tabs/Tabs.js +1 -1
- package/Toolbar/Toolbar.d.ts +1 -1
- package/Toolbar/Toolbar.js +1 -1
- package/Unstable_Grid2/Grid2.js +1 -0
- package/darkScrollbar/index.js +1 -1
- package/index.js +1 -1
- package/legacy/Autocomplete/Autocomplete.js +8 -3
- package/legacy/Box/Box.js +2 -0
- package/legacy/CardActionArea/CardActionArea.js +2 -0
- package/legacy/GlobalStyles/GlobalStyles.js +4 -4
- package/legacy/Menu/Menu.js +1 -1
- package/legacy/NativeSelect/NativeSelectInput.js +12 -5
- package/legacy/NativeSelect/nativeSelectClasses.js +1 -1
- package/legacy/Popper/Popper.js +0 -4
- package/legacy/Select/Select.js +15 -10
- package/legacy/Select/SelectInput.js +14 -5
- package/legacy/Select/selectClasses.js +1 -1
- package/legacy/Slider/Slider.js +6 -6
- package/legacy/Tabs/Tabs.js +1 -1
- package/legacy/Toolbar/Toolbar.js +1 -1
- package/legacy/Unstable_Grid2/Grid2.js +1 -0
- package/legacy/darkScrollbar/index.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/styles/CssVarsProvider.js +2 -0
- package/legacy/styles/ThemeProvider.js +19 -1
- package/legacy/styles/identifier.js +1 -0
- package/legacy/styles/index.js +1 -0
- package/legacy/styles/styled.js +2 -0
- package/legacy/styles/useTheme.js +2 -1
- package/legacy/styles/useThemeProps.js +3 -1
- package/modern/Autocomplete/Autocomplete.js +9 -1
- package/modern/Box/Box.js +2 -0
- package/modern/CardActionArea/CardActionArea.js +2 -0
- package/modern/GlobalStyles/GlobalStyles.js +4 -4
- package/modern/Menu/Menu.js +1 -1
- package/modern/NativeSelect/NativeSelectInput.js +12 -5
- package/modern/NativeSelect/nativeSelectClasses.js +1 -1
- package/modern/Popper/Popper.js +0 -4
- package/modern/Select/Select.js +15 -10
- package/modern/Select/SelectInput.js +14 -4
- package/modern/Select/selectClasses.js +1 -1
- package/modern/Slider/Slider.js +6 -6
- package/modern/Tabs/Tabs.js +1 -1
- package/modern/Toolbar/Toolbar.js +1 -1
- package/modern/Unstable_Grid2/Grid2.js +1 -0
- package/modern/darkScrollbar/index.js +1 -1
- package/modern/index.js +1 -1
- package/modern/styles/CssVarsProvider.js +2 -0
- package/modern/styles/ThemeProvider.js +22 -1
- package/modern/styles/identifier.js +1 -0
- package/modern/styles/index.js +1 -0
- package/modern/styles/styled.js +2 -0
- package/modern/styles/useTheme.js +2 -1
- package/modern/styles/useThemeProps.js +3 -1
- package/node/Autocomplete/Autocomplete.js +9 -1
- package/node/Box/Box.js +2 -0
- package/node/CardActionArea/CardActionArea.js +2 -0
- package/node/GlobalStyles/GlobalStyles.js +4 -4
- package/node/Menu/Menu.js +1 -1
- package/node/NativeSelect/NativeSelectInput.js +12 -5
- package/node/NativeSelect/nativeSelectClasses.js +1 -1
- package/node/Popper/Popper.js +0 -4
- package/node/Select/Select.js +15 -10
- package/node/Select/SelectInput.js +14 -4
- package/node/Select/selectClasses.js +1 -1
- package/node/Slider/Slider.js +6 -6
- package/node/Tabs/Tabs.js +1 -1
- package/node/Toolbar/Toolbar.js +1 -1
- package/node/Unstable_Grid2/Grid2.js +1 -0
- package/node/darkScrollbar/index.js +1 -1
- package/node/index.js +1 -1
- package/node/styles/CssVarsProvider.js +2 -0
- package/node/styles/ThemeProvider.js +26 -7
- package/node/styles/identifier.js +8 -0
- package/node/styles/index.js +8 -0
- package/node/styles/styled.js +2 -0
- package/node/styles/useTheme.js +2 -1
- package/node/styles/useThemeProps.js +3 -1
- package/package.json +7 -7
- package/styles/CssVarsProvider.d.ts +5 -0
- package/styles/CssVarsProvider.js +2 -0
- package/styles/ThemeProvider.js +22 -1
- package/styles/experimental_extendTheme.d.ts +1 -1
- package/styles/identifier.d.ts +2 -0
- package/styles/identifier.js +1 -0
- package/styles/index.d.ts +1 -0
- package/styles/index.js +1 -0
- package/styles/styled.js +2 -0
- package/styles/useTheme.js +2 -1
- package/styles/useThemeProps.js +3 -1
- package/umd/material-ui.development.js +660 -533
- package/umd/material-ui.production.min.js +21 -21
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
- [_Joy UI_](https://mui.com/joy-ui/getting-started/overview/) is a beautifully designed library of React UI components.
|
|
13
13
|
|
|
14
|
-
- [
|
|
14
|
+
- [_Base UI_](https://mui.com/base/getting-started/overview/) is our library of "unstyled" components and low-level hooks. With Base, you gain complete control over your app's CSS and accessibility features.
|
|
15
15
|
|
|
16
16
|
- [_MUI System_](https://mui.com/system/getting-started/overview/) is a collection of CSS utilities to help you rapidly lay out custom designs.
|
|
17
17
|
|
|
@@ -63,9 +63,9 @@ yarn add @mui/material @emotion/react @emotion/styled
|
|
|
63
63
|
**Note:** `@next` only points to pre-releases.
|
|
64
64
|
Use `@latest` for the latest stable release.
|
|
65
65
|
|
|
66
|
-
###
|
|
66
|
+
### Base UI
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
Base UI is available as an [npm package](https://www.npmjs.com/package/@mui/base).
|
|
69
69
|
|
|
70
70
|
**npm:**
|
|
71
71
|
|
|
@@ -79,7 +79,7 @@ npm install @mui/base
|
|
|
79
79
|
yarn add @mui/base
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
**Note**:
|
|
82
|
+
**Note**: Base UI is still in alpha.
|
|
83
83
|
We are adding new components regularly and you're welcome to contribute!
|
|
84
84
|
|
|
85
85
|
### MUI System
|
|
@@ -180,7 +180,7 @@ Our documentation features [a collection of example projects using Material UI](
|
|
|
180
180
|
|
|
181
181
|
- [Material UI](https://mui.com/material-ui/getting-started/overview/)
|
|
182
182
|
- [Joy UI](https://mui.com/joy-ui/getting-started/overview/)
|
|
183
|
-
- [
|
|
183
|
+
- [Base UI](https://mui.com/base/getting-started/overview/)
|
|
184
184
|
- [MUI System](https://mui.com/system/getting-started/overview/)
|
|
185
185
|
|
|
186
186
|
## Premium themes
|
package/Select/Select.d.ts
CHANGED
|
@@ -104,7 +104,7 @@ export interface SelectProps<T = unknown>
|
|
|
104
104
|
onChange?: SelectInputProps<T>['onChange'];
|
|
105
105
|
/**
|
|
106
106
|
* Callback fired when the component requests to be closed.
|
|
107
|
-
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select
|
|
107
|
+
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapses).
|
|
108
108
|
*
|
|
109
109
|
* @param {object} event The event source of the callback.
|
|
110
110
|
*/
|
package/Select/Select.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
var _StyledInput, _StyledFilledInput;
|
|
4
3
|
const _excluded = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"];
|
|
5
4
|
import * as React from 'react';
|
|
6
5
|
import PropTypes from 'prop-types';
|
|
@@ -67,21 +66,26 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
67
66
|
const fcs = formControlState({
|
|
68
67
|
props,
|
|
69
68
|
muiFormControl,
|
|
70
|
-
states: ['variant']
|
|
69
|
+
states: ['variant', 'error']
|
|
71
70
|
});
|
|
72
71
|
const variant = fcs.variant || variantProp;
|
|
73
|
-
const InputComponent = input || {
|
|
74
|
-
standard: _StyledInput || (_StyledInput = /*#__PURE__*/_jsx(StyledInput, {})),
|
|
75
|
-
outlined: /*#__PURE__*/_jsx(StyledOutlinedInput, {
|
|
76
|
-
label: label
|
|
77
|
-
}),
|
|
78
|
-
filled: _StyledFilledInput || (_StyledFilledInput = /*#__PURE__*/_jsx(StyledFilledInput, {}))
|
|
79
|
-
}[variant];
|
|
80
72
|
const ownerState = _extends({}, props, {
|
|
81
73
|
variant,
|
|
82
74
|
classes: classesProp
|
|
83
75
|
});
|
|
84
76
|
const classes = useUtilityClasses(ownerState);
|
|
77
|
+
const InputComponent = input || {
|
|
78
|
+
standard: /*#__PURE__*/_jsx(StyledInput, {
|
|
79
|
+
ownerState: ownerState
|
|
80
|
+
}),
|
|
81
|
+
outlined: /*#__PURE__*/_jsx(StyledOutlinedInput, {
|
|
82
|
+
label: label,
|
|
83
|
+
ownerState: ownerState
|
|
84
|
+
}),
|
|
85
|
+
filled: /*#__PURE__*/_jsx(StyledFilledInput, {
|
|
86
|
+
ownerState: ownerState
|
|
87
|
+
})
|
|
88
|
+
}[variant];
|
|
85
89
|
const inputComponentRef = useForkRef(ref, InputComponent.ref);
|
|
86
90
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
87
91
|
children: /*#__PURE__*/React.cloneElement(InputComponent, _extends({
|
|
@@ -90,6 +94,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
90
94
|
inputComponent,
|
|
91
95
|
inputProps: _extends({
|
|
92
96
|
children,
|
|
97
|
+
error: fcs.error,
|
|
93
98
|
IconComponent,
|
|
94
99
|
variant,
|
|
95
100
|
type: undefined,
|
|
@@ -223,7 +228,7 @@ process.env.NODE_ENV !== "production" ? Select.propTypes /* remove-proptypes */
|
|
|
223
228
|
onChange: PropTypes.func,
|
|
224
229
|
/**
|
|
225
230
|
* Callback fired when the component requests to be closed.
|
|
226
|
-
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select
|
|
231
|
+
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapses).
|
|
227
232
|
*
|
|
228
233
|
* @param {object} event The event source of the callback.
|
|
229
234
|
*/
|
package/Select/SelectInput.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface SelectInputProps<T = unknown> {
|
|
|
17
17
|
autoWidth: boolean;
|
|
18
18
|
defaultOpen?: boolean;
|
|
19
19
|
disabled?: boolean;
|
|
20
|
+
error?: boolean;
|
|
20
21
|
IconComponent?: React.ElementType;
|
|
21
22
|
inputRef?: (
|
|
22
23
|
ref: HTMLSelectElement | { node: HTMLInputElement; value: SelectInputProps<T>['value'] },
|
package/Select/SelectInput.js
CHANGED
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
4
4
|
var _span;
|
|
5
|
-
const _excluded = ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultOpen", "defaultValue", "disabled", "displayEmpty", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"];
|
|
5
|
+
const _excluded = ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultOpen", "defaultValue", "disabled", "displayEmpty", "error", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { isFragment } from 'react-is';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
@@ -33,6 +33,8 @@ const SelectSelect = styled('div', {
|
|
|
33
33
|
[`&.${selectClasses.select}`]: styles.select
|
|
34
34
|
}, {
|
|
35
35
|
[`&.${selectClasses.select}`]: styles[ownerState.variant]
|
|
36
|
+
}, {
|
|
37
|
+
[`&.${selectClasses.error}`]: styles.error
|
|
36
38
|
}, {
|
|
37
39
|
[`&.${selectClasses.multiple}`]: styles.multiple
|
|
38
40
|
}];
|
|
@@ -90,10 +92,11 @@ const useUtilityClasses = ownerState => {
|
|
|
90
92
|
variant,
|
|
91
93
|
disabled,
|
|
92
94
|
multiple,
|
|
93
|
-
open
|
|
95
|
+
open,
|
|
96
|
+
error
|
|
94
97
|
} = ownerState;
|
|
95
98
|
const slots = {
|
|
96
|
-
select: ['select', variant, disabled && 'disabled', multiple && 'multiple'],
|
|
99
|
+
select: ['select', variant, disabled && 'disabled', multiple && 'multiple', error && 'error'],
|
|
97
100
|
icon: ['icon', `icon${capitalize(variant)}`, open && 'iconOpen', disabled && 'disabled'],
|
|
98
101
|
nativeInput: ['nativeInput']
|
|
99
102
|
};
|
|
@@ -115,6 +118,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
115
118
|
defaultValue,
|
|
116
119
|
disabled,
|
|
117
120
|
displayEmpty,
|
|
121
|
+
error = false,
|
|
118
122
|
IconComponent,
|
|
119
123
|
inputRef: inputRefProp,
|
|
120
124
|
labelId,
|
|
@@ -420,7 +424,8 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
420
424
|
const ownerState = _extends({}, props, {
|
|
421
425
|
variant,
|
|
422
426
|
value,
|
|
423
|
-
open
|
|
427
|
+
open,
|
|
428
|
+
error
|
|
424
429
|
});
|
|
425
430
|
const classes = useUtilityClasses(ownerState);
|
|
426
431
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
@@ -450,6 +455,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
450
455
|
children: "\u200B"
|
|
451
456
|
})) : display
|
|
452
457
|
})), /*#__PURE__*/_jsx(SelectNativeInput, _extends({
|
|
458
|
+
"aria-invalid": error,
|
|
453
459
|
value: Array.isArray(value) ? value.join(',') : value,
|
|
454
460
|
name: name,
|
|
455
461
|
ref: inputRef,
|
|
@@ -541,6 +547,10 @@ process.env.NODE_ENV !== "production" ? SelectInput.propTypes = {
|
|
|
541
547
|
* If `true`, the selected item is displayed even if its value is empty.
|
|
542
548
|
*/
|
|
543
549
|
displayEmpty: PropTypes.bool,
|
|
550
|
+
/**
|
|
551
|
+
* If `true`, the `select input` will indicate an error.
|
|
552
|
+
*/
|
|
553
|
+
error: PropTypes.bool,
|
|
544
554
|
/**
|
|
545
555
|
* The icon that displays the arrow.
|
|
546
556
|
*/
|
|
@@ -23,6 +23,8 @@ export interface SelectClasses {
|
|
|
23
23
|
iconStandard: string;
|
|
24
24
|
/** Styles applied to the underlying native input component. */
|
|
25
25
|
nativeInput: string;
|
|
26
|
+
/** State class applied to the root element if `error={true}`. */
|
|
27
|
+
error: string;
|
|
26
28
|
}
|
|
27
29
|
export type SelectClassKey = keyof SelectClasses;
|
|
28
30
|
export declare function getSelectUtilityClasses(slot: string): string;
|
package/Select/selectClasses.js
CHANGED
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '../generateUtilityClass';
|
|
|
3
3
|
export function getSelectUtilityClasses(slot) {
|
|
4
4
|
return generateUtilityClass('MuiSelect', slot);
|
|
5
5
|
}
|
|
6
|
-
const selectClasses = generateUtilityClasses('MuiSelect', ['select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput']);
|
|
6
|
+
const selectClasses = generateUtilityClasses('MuiSelect', ['select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
|
|
7
7
|
export default selectClasses;
|
package/Slider/Slider.js
CHANGED
|
@@ -269,7 +269,7 @@ const StyledSliderValueLabel = styled(SliderValueLabel, {
|
|
|
269
269
|
ownerState
|
|
270
270
|
}) => _extends({
|
|
271
271
|
[`&.${sliderClasses.valueLabelOpen}`]: {
|
|
272
|
-
transform: 'translateY(-100%) scale(1)
|
|
272
|
+
transform: `${ownerState.orientation === 'vertical' ? 'translateY(-50%)' : 'translateY(-100%)'} scale(1)`
|
|
273
273
|
},
|
|
274
274
|
zIndex: 1,
|
|
275
275
|
whiteSpace: 'nowrap'
|
|
@@ -278,7 +278,7 @@ const StyledSliderValueLabel = styled(SliderValueLabel, {
|
|
|
278
278
|
transition: theme.transitions.create(['transform'], {
|
|
279
279
|
duration: theme.transitions.duration.shortest
|
|
280
280
|
}),
|
|
281
|
-
transform: 'translateY(-100%) scale(0)
|
|
281
|
+
transform: `${ownerState.orientation === 'vertical' ? 'translateY(-50%)' : 'translateY(-100%)'} scale(0)`,
|
|
282
282
|
position: 'absolute',
|
|
283
283
|
backgroundColor: (theme.vars || theme).palette.grey[600],
|
|
284
284
|
borderRadius: 2,
|
|
@@ -301,18 +301,18 @@ const StyledSliderValueLabel = styled(SliderValueLabel, {
|
|
|
301
301
|
left: '50%'
|
|
302
302
|
}
|
|
303
303
|
}, ownerState.orientation === 'vertical' && {
|
|
304
|
-
right: '30px',
|
|
305
|
-
top: '
|
|
304
|
+
right: ownerState.size === 'small' ? '20px' : '30px',
|
|
305
|
+
top: '50%',
|
|
306
306
|
transformOrigin: 'right center',
|
|
307
307
|
'&:before': {
|
|
308
308
|
position: 'absolute',
|
|
309
309
|
content: '""',
|
|
310
310
|
width: 8,
|
|
311
311
|
height: 8,
|
|
312
|
-
transform: 'translate(-50%, 50%) rotate(45deg)',
|
|
312
|
+
transform: 'translate(-50%, -50%) rotate(45deg)',
|
|
313
313
|
backgroundColor: 'inherit',
|
|
314
314
|
right: '-20%',
|
|
315
|
-
top: '
|
|
315
|
+
top: '50%'
|
|
316
316
|
}
|
|
317
317
|
}, ownerState.size === 'small' && {
|
|
318
318
|
fontSize: theme.typography.pxToRem(12),
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
export interface SliderClasses {
|
|
2
|
-
/**
|
|
2
|
+
/** Styles applied to the root element. */
|
|
3
3
|
root: string;
|
|
4
|
-
/**
|
|
4
|
+
/** Styles applied to the root element if `color="primary"`. */
|
|
5
5
|
colorPrimary: string;
|
|
6
|
-
/**
|
|
6
|
+
/** Styles applied to the root element if `color="secondary"`. */
|
|
7
7
|
colorSecondary: string;
|
|
8
|
-
/**
|
|
8
|
+
/** Styles applied to the root element if `marks` is provided with at least one label. */
|
|
9
9
|
marked: string;
|
|
10
|
-
/**
|
|
10
|
+
/** Styles applied to the root element if `orientation="vertical"`. */
|
|
11
11
|
vertical: string;
|
|
12
12
|
/** State class applied to the root and thumb element if `disabled={true}`. */
|
|
13
13
|
disabled: string;
|
|
14
14
|
/** State class applied to the root if a thumb is being dragged. */
|
|
15
15
|
dragging: string;
|
|
16
|
-
/**
|
|
16
|
+
/** Styles applied to the rail element. */
|
|
17
17
|
rail: string;
|
|
18
|
-
/**
|
|
18
|
+
/** Styles applied to the track element. */
|
|
19
19
|
track: string;
|
|
20
|
-
/**
|
|
20
|
+
/** Styles applied to the root element if `track={false}`. */
|
|
21
21
|
trackFalse: string;
|
|
22
|
-
/**
|
|
22
|
+
/** Styles applied to the root element if `track="inverted"`. */
|
|
23
23
|
trackInverted: string;
|
|
24
|
-
/**
|
|
24
|
+
/** Styles applied to the thumb element. */
|
|
25
25
|
thumb: string;
|
|
26
26
|
/** State class applied to the thumb element if it's active. */
|
|
27
27
|
active: string;
|
|
28
28
|
/** State class applied to the thumb element if keyboard focused. */
|
|
29
29
|
focusVisible: string;
|
|
30
|
-
/**
|
|
30
|
+
/** Styles applied to the mark element. */
|
|
31
31
|
mark: string;
|
|
32
|
-
/**
|
|
32
|
+
/** Styles applied to the mark element if active (depending on the value). */
|
|
33
33
|
markActive: string;
|
|
34
|
-
/**
|
|
34
|
+
/** Styles applied to the mark label element. */
|
|
35
35
|
markLabel: string;
|
|
36
|
-
/**
|
|
36
|
+
/** Styles applied to the mark label element if active (depending on the value). */
|
|
37
37
|
markLabelActive: string;
|
|
38
|
-
/**
|
|
38
|
+
/** Styles applied to the root element if `size="small"`. */
|
|
39
39
|
sizeSmall: string;
|
|
40
|
-
/**
|
|
40
|
+
/** Styles applied to the thumb element if `color="primary"`. */
|
|
41
41
|
thumbColorPrimary: string;
|
|
42
|
-
/**
|
|
42
|
+
/** Styles applied to the thumb element if `color="secondary"`. */
|
|
43
43
|
thumbColorSecondary: string;
|
|
44
|
-
/**
|
|
44
|
+
/** Styles applied to the thumb element if `size="small"`. */
|
|
45
45
|
thumbSizeSmall: string;
|
|
46
|
-
/**
|
|
46
|
+
/** Styles applied to the thumb label element. */
|
|
47
47
|
valueLabel: string;
|
|
48
|
-
/**
|
|
48
|
+
/** Styles applied to the thumb label element if it's open. */
|
|
49
49
|
valueLabelOpen: string;
|
|
50
|
-
/**
|
|
50
|
+
/** Styles applied to the thumb label's circle element. */
|
|
51
51
|
valueLabelCircle: string;
|
|
52
|
-
/**
|
|
52
|
+
/** Styles applied to the thumb label's label element. */
|
|
53
53
|
valueLabelLabel: string;
|
|
54
54
|
}
|
|
55
55
|
export type SliderClassKey = keyof SliderClasses;
|
package/Tabs/Tabs.js
CHANGED
|
@@ -418,7 +418,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
418
418
|
moveTabsScroll(getScrollSize());
|
|
419
419
|
};
|
|
420
420
|
|
|
421
|
-
// TODO Remove <ScrollbarSize /> as browser support for
|
|
421
|
+
// TODO Remove <ScrollbarSize /> as browser support for hiding the scrollbar
|
|
422
422
|
// with CSS improves.
|
|
423
423
|
const handleScrollbarSizeChange = React.useCallback(scrollbarWidth => {
|
|
424
424
|
setScrollerStyle({
|
package/Toolbar/Toolbar.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ToolbarTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
|
11
11
|
props: P & {
|
|
12
12
|
/**
|
|
13
13
|
* The Toolbar children, usually a mixture of `IconButton`, `Button` and `Typography`.
|
|
14
|
-
* The Toolbar is a flex container, allowing flex item
|
|
14
|
+
* The Toolbar is a flex container, allowing flex item properties to be used to lay out the children.
|
|
15
15
|
*/
|
|
16
16
|
children?: React.ReactNode;
|
|
17
17
|
/**
|
package/Toolbar/Toolbar.js
CHANGED
|
@@ -81,7 +81,7 @@ process.env.NODE_ENV !== "production" ? Toolbar.propTypes /* remove-proptypes */
|
|
|
81
81
|
// ----------------------------------------------------------------------
|
|
82
82
|
/**
|
|
83
83
|
* The Toolbar children, usually a mixture of `IconButton`, `Button` and `Typography`.
|
|
84
|
-
* The Toolbar is a flex container, allowing flex item
|
|
84
|
+
* The Toolbar is a flex container, allowing flex item properties to be used to lay out the children.
|
|
85
85
|
*/
|
|
86
86
|
children: PropTypes.node,
|
|
87
87
|
/**
|
package/Unstable_Grid2/Grid2.js
CHANGED
package/darkScrollbar/index.js
CHANGED
package/index.js
CHANGED
|
@@ -465,8 +465,8 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
465
465
|
groupedOptions = _useAutocomplete.groupedOptions;
|
|
466
466
|
var hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
|
|
467
467
|
var hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
|
|
468
|
-
|
|
469
|
-
|
|
468
|
+
var _getInputProps = getInputProps(),
|
|
469
|
+
handleInputMouseDown = _getInputProps.onMouseDown; // If you modify this, make sure to keep the `AutocompleteOwnerState` type in sync.
|
|
470
470
|
var ownerState = _extends({}, props, {
|
|
471
471
|
disablePortal: disablePortal,
|
|
472
472
|
expanded: expanded,
|
|
@@ -563,7 +563,12 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
|
|
|
563
563
|
InputProps: _extends({
|
|
564
564
|
ref: setAnchorEl,
|
|
565
565
|
className: classes.inputRoot,
|
|
566
|
-
startAdornment: startAdornment
|
|
566
|
+
startAdornment: startAdornment,
|
|
567
|
+
onClick: function onClick(event) {
|
|
568
|
+
if (event.target === event.currentTarget) {
|
|
569
|
+
handleInputMouseDown(event);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
567
572
|
}, (hasClearIcon || hasPopupIcon) && {
|
|
568
573
|
endAdornment: /*#__PURE__*/_jsxs(AutocompleteEndAdornment, {
|
|
569
574
|
className: classes.endAdornment,
|
package/legacy/Box/Box.js
CHANGED
|
@@ -2,8 +2,10 @@ import { createBox } from '@mui/system';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { unstable_ClassNameGenerator as ClassNameGenerator } from '../className';
|
|
4
4
|
import { createTheme } from '../styles';
|
|
5
|
+
import THEME_ID from '../styles/identifier';
|
|
5
6
|
var defaultTheme = createTheme();
|
|
6
7
|
var Box = createBox({
|
|
8
|
+
themeId: THEME_ID,
|
|
7
9
|
defaultTheme: defaultTheme,
|
|
8
10
|
defaultClassName: 'MuiBox-root',
|
|
9
11
|
generateClassName: ClassNameGenerator.generate
|
|
@@ -31,6 +31,8 @@ var CardActionAreaRoot = styled(ButtonBase, {
|
|
|
31
31
|
return _ref2 = {
|
|
32
32
|
display: 'block',
|
|
33
33
|
textAlign: 'inherit',
|
|
34
|
+
borderRadius: 'inherit',
|
|
35
|
+
// for Safari to work https://github.com/mui/material-ui/issues/36285.
|
|
34
36
|
width: '100%'
|
|
35
37
|
}, _defineProperty(_ref2, "&:hover .".concat(cardActionAreaClasses.focusHighlight), {
|
|
36
38
|
opacity: (theme.vars || theme).palette.action.hoverOpacity,
|
|
@@ -3,10 +3,12 @@ import * as React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { GlobalStyles as SystemGlobalStyles } from '@mui/system';
|
|
5
5
|
import defaultTheme from '../styles/defaultTheme';
|
|
6
|
+
import THEME_ID from '../styles/identifier';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
function GlobalStyles(props) {
|
|
8
9
|
return /*#__PURE__*/_jsx(SystemGlobalStyles, _extends({}, props, {
|
|
9
|
-
defaultTheme: defaultTheme
|
|
10
|
+
defaultTheme: defaultTheme,
|
|
11
|
+
themeId: THEME_ID
|
|
10
12
|
}));
|
|
11
13
|
}
|
|
12
14
|
process.env.NODE_ENV !== "production" ? GlobalStyles.propTypes /* remove-proptypes */ = {
|
|
@@ -17,8 +19,6 @@ process.env.NODE_ENV !== "production" ? GlobalStyles.propTypes /* remove-proptyp
|
|
|
17
19
|
/**
|
|
18
20
|
* The styles you want to apply globally.
|
|
19
21
|
*/
|
|
20
|
-
styles: PropTypes
|
|
21
|
-
__emotion_styles: PropTypes.any.isRequired
|
|
22
|
-
}), PropTypes.string, PropTypes.bool])
|
|
22
|
+
styles: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.array, PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool])
|
|
23
23
|
} : void 0;
|
|
24
24
|
export default GlobalStyles;
|
package/legacy/Menu/Menu.js
CHANGED
|
@@ -49,7 +49,7 @@ var MenuPaper = styled(Paper, {
|
|
|
49
49
|
}
|
|
50
50
|
})({
|
|
51
51
|
// specZ: The maximum height of a simple menu should be one or more rows less than the view
|
|
52
|
-
// height. This ensures a
|
|
52
|
+
// height. This ensures a tappable area outside of the simple menu with which to dismiss
|
|
53
53
|
// the menu.
|
|
54
54
|
maxHeight: 'calc(100% - 96px)',
|
|
55
55
|
// Add iOS momentum scrolling for iOS < 13.0
|
|
@@ -16,9 +16,10 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
16
16
|
variant = ownerState.variant,
|
|
17
17
|
disabled = ownerState.disabled,
|
|
18
18
|
multiple = ownerState.multiple,
|
|
19
|
-
open = ownerState.open
|
|
19
|
+
open = ownerState.open,
|
|
20
|
+
error = ownerState.error;
|
|
20
21
|
var slots = {
|
|
21
|
-
select: ['select', variant, disabled && 'disabled', multiple && 'multiple'],
|
|
22
|
+
select: ['select', variant, disabled && 'disabled', multiple && 'multiple', error && 'error'],
|
|
22
23
|
icon: ['icon', "icon".concat(capitalize(variant)), open && 'iconOpen', disabled && 'disabled']
|
|
23
24
|
};
|
|
24
25
|
return composeClasses(slots, getNativeSelectUtilityClasses, classes);
|
|
@@ -80,7 +81,7 @@ var NativeSelectSelect = styled('select', {
|
|
|
80
81
|
shouldForwardProp: rootShouldForwardProp,
|
|
81
82
|
overridesResolver: function overridesResolver(props, styles) {
|
|
82
83
|
var ownerState = props.ownerState;
|
|
83
|
-
return [styles.select, styles[ownerState.variant], _defineProperty({}, "&.".concat(nativeSelectClasses.multiple), styles.multiple)];
|
|
84
|
+
return [styles.select, styles[ownerState.variant], ownerState.error && styles.error, _defineProperty({}, "&.".concat(nativeSelectClasses.multiple), styles.multiple)];
|
|
84
85
|
}
|
|
85
86
|
})(nativeSelectSelectStyles);
|
|
86
87
|
export var nativeSelectIconStyles = function nativeSelectIconStyles(_ref3) {
|
|
@@ -121,14 +122,16 @@ var NativeSelectIcon = styled('svg', {
|
|
|
121
122
|
var NativeSelectInput = /*#__PURE__*/React.forwardRef(function NativeSelectInput(props, ref) {
|
|
122
123
|
var className = props.className,
|
|
123
124
|
disabled = props.disabled,
|
|
125
|
+
error = props.error,
|
|
124
126
|
IconComponent = props.IconComponent,
|
|
125
127
|
inputRef = props.inputRef,
|
|
126
128
|
_props$variant = props.variant,
|
|
127
129
|
variant = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
128
|
-
other = _objectWithoutProperties(props, ["className", "disabled", "IconComponent", "inputRef", "variant"]);
|
|
130
|
+
other = _objectWithoutProperties(props, ["className", "disabled", "error", "IconComponent", "inputRef", "variant"]);
|
|
129
131
|
var ownerState = _extends({}, props, {
|
|
130
132
|
disabled: disabled,
|
|
131
|
-
variant: variant
|
|
133
|
+
variant: variant,
|
|
134
|
+
error: error
|
|
132
135
|
});
|
|
133
136
|
var classes = useUtilityClasses(ownerState);
|
|
134
137
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
@@ -163,6 +166,10 @@ process.env.NODE_ENV !== "production" ? NativeSelectInput.propTypes = {
|
|
|
163
166
|
* If `true`, the select is disabled.
|
|
164
167
|
*/
|
|
165
168
|
disabled: PropTypes.bool,
|
|
169
|
+
/**
|
|
170
|
+
* If `true`, the `select input` will indicate an error.
|
|
171
|
+
*/
|
|
172
|
+
error: PropTypes.bool,
|
|
166
173
|
/**
|
|
167
174
|
* The icon that displays the arrow.
|
|
168
175
|
*/
|
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '../generateUtilityClass';
|
|
|
3
3
|
export function getNativeSelectUtilityClasses(slot) {
|
|
4
4
|
return generateUtilityClass('MuiNativeSelect', slot);
|
|
5
5
|
}
|
|
6
|
-
var nativeSelectClasses = generateUtilityClasses('MuiNativeSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput']);
|
|
6
|
+
var nativeSelectClasses = generateUtilityClasses('MuiNativeSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
|
|
7
7
|
export default nativeSelectClasses;
|
package/legacy/Popper/Popper.js
CHANGED
|
@@ -129,10 +129,6 @@ process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */
|
|
|
129
129
|
* If `true`, the component is shown.
|
|
130
130
|
*/
|
|
131
131
|
open: PropTypes.bool.isRequired,
|
|
132
|
-
/**
|
|
133
|
-
* @ignore
|
|
134
|
-
*/
|
|
135
|
-
ownerState: PropTypes.any,
|
|
136
132
|
/**
|
|
137
133
|
* Popper placement.
|
|
138
134
|
* @default 'bottom'
|
package/legacy/Select/Select.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _StyledInput, _StyledFilledInput;
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import PropTypes from 'prop-types';
|
|
6
5
|
import clsx from 'clsx';
|
|
@@ -74,21 +73,26 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
74
73
|
var fcs = formControlState({
|
|
75
74
|
props: props,
|
|
76
75
|
muiFormControl: muiFormControl,
|
|
77
|
-
states: ['variant']
|
|
76
|
+
states: ['variant', 'error']
|
|
78
77
|
});
|
|
79
78
|
var variant = fcs.variant || variantProp;
|
|
80
|
-
var InputComponent = input || {
|
|
81
|
-
standard: _StyledInput || (_StyledInput = /*#__PURE__*/_jsx(StyledInput, {})),
|
|
82
|
-
outlined: /*#__PURE__*/_jsx(StyledOutlinedInput, {
|
|
83
|
-
label: label
|
|
84
|
-
}),
|
|
85
|
-
filled: _StyledFilledInput || (_StyledFilledInput = /*#__PURE__*/_jsx(StyledFilledInput, {}))
|
|
86
|
-
}[variant];
|
|
87
79
|
var ownerState = _extends({}, props, {
|
|
88
80
|
variant: variant,
|
|
89
81
|
classes: classesProp
|
|
90
82
|
});
|
|
91
83
|
var classes = useUtilityClasses(ownerState);
|
|
84
|
+
var InputComponent = input || {
|
|
85
|
+
standard: /*#__PURE__*/_jsx(StyledInput, {
|
|
86
|
+
ownerState: ownerState
|
|
87
|
+
}),
|
|
88
|
+
outlined: /*#__PURE__*/_jsx(StyledOutlinedInput, {
|
|
89
|
+
label: label,
|
|
90
|
+
ownerState: ownerState
|
|
91
|
+
}),
|
|
92
|
+
filled: /*#__PURE__*/_jsx(StyledFilledInput, {
|
|
93
|
+
ownerState: ownerState
|
|
94
|
+
})
|
|
95
|
+
}[variant];
|
|
92
96
|
var inputComponentRef = useForkRef(ref, InputComponent.ref);
|
|
93
97
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
94
98
|
children: /*#__PURE__*/React.cloneElement(InputComponent, _extends({
|
|
@@ -97,6 +101,7 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
97
101
|
inputComponent: inputComponent,
|
|
98
102
|
inputProps: _extends({
|
|
99
103
|
children: children,
|
|
104
|
+
error: fcs.error,
|
|
100
105
|
IconComponent: IconComponent,
|
|
101
106
|
variant: variant,
|
|
102
107
|
type: undefined,
|
|
@@ -230,7 +235,7 @@ process.env.NODE_ENV !== "production" ? Select.propTypes /* remove-proptypes */
|
|
|
230
235
|
onChange: PropTypes.func,
|
|
231
236
|
/**
|
|
232
237
|
* Callback fired when the component requests to be closed.
|
|
233
|
-
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select
|
|
238
|
+
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapses).
|
|
234
239
|
*
|
|
235
240
|
* @param {object} event The event source of the callback.
|
|
236
241
|
*/
|