@mui/material 5.2.3 → 5.2.7
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/Avatar/Avatar.d.ts +4 -2
- package/Badge/Badge.d.ts +25 -0
- package/Badge/Badge.js +40 -10
- package/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/ButtonGroup/ButtonGroupContext.d.ts +1 -1
- package/CHANGELOG.md +227 -0
- package/CssBaseline/CssBaseline.d.ts +1 -1
- package/GlobalStyles/GlobalStyles.d.ts +2 -1
- package/Grid/Grid.js +74 -66
- package/InputBase/InputBase.d.ts +6 -0
- package/InputBase/InputBase.js +10 -2
- package/ListItem/ListItem.d.ts +1 -1
- package/ListItemButton/ListItemButton.d.ts +1 -1
- package/MenuItem/MenuItem.d.ts +1 -1
- package/OutlinedInput/OutlinedInput.js +14 -1
- package/README.md +15 -27
- package/Select/SelectInput.js +11 -3
- package/SvgIcon/SvgIcon.d.ts +8 -0
- package/SvgIcon/SvgIcon.js +19 -3
- package/Tabs/Tabs.d.ts +1 -1
- package/TextField/TextField.js +2 -9
- package/index.js +1 -1
- package/legacy/Badge/Badge.js +46 -11
- package/legacy/Grid/Grid.js +84 -78
- package/legacy/InputBase/InputBase.js +10 -2
- package/legacy/OutlinedInput/OutlinedInput.js +14 -1
- package/legacy/Select/SelectInput.js +11 -5
- package/legacy/SvgIcon/SvgIcon.js +20 -3
- package/legacy/TextField/TextField.js +2 -9
- package/legacy/index.js +1 -1
- package/legacy/locale/index.js +319 -142
- package/locale/index.d.ts +2 -0
- package/locale/index.js +220 -50
- package/modern/Badge/Badge.js +40 -10
- package/modern/Grid/Grid.js +74 -66
- package/modern/InputBase/InputBase.js +10 -2
- package/modern/OutlinedInput/OutlinedInput.js +14 -1
- package/modern/Select/SelectInput.js +11 -3
- package/modern/SvgIcon/SvgIcon.js +19 -3
- package/modern/TextField/TextField.js +2 -7
- package/modern/index.js +1 -1
- package/modern/locale/index.js +220 -50
- package/node/Badge/Badge.js +40 -10
- package/node/Grid/Grid.js +75 -65
- package/node/InputBase/InputBase.js +10 -2
- package/node/OutlinedInput/OutlinedInput.js +15 -1
- package/node/Select/SelectInput.js +11 -3
- package/node/SvgIcon/SvgIcon.js +19 -3
- package/node/TextField/TextField.js +1 -8
- package/node/index.js +1 -1
- package/node/locale/index.js +223 -51
- package/package.json +3 -3
- package/styles/createTheme.d.ts +1 -1
- package/transitions/transition.d.ts +1 -2
- package/umd/material-ui.development.js +278 -171
- package/umd/material-ui.production.min.js +21 -21
package/InputBase/InputBase.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
4
|
-
const _excluded = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "startAdornment", "type", "value"];
|
|
4
|
+
const _excluded = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "startAdornment", "type", "value"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
@@ -220,6 +220,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
220
220
|
componentsProps = {},
|
|
221
221
|
defaultValue,
|
|
222
222
|
disabled,
|
|
223
|
+
disableInjectingGlobalStyles,
|
|
223
224
|
endAdornment,
|
|
224
225
|
fullWidth = false,
|
|
225
226
|
id,
|
|
@@ -450,7 +451,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
450
451
|
const Input = components.Input || InputBaseComponent;
|
|
451
452
|
inputProps = _extends({}, inputProps, componentsProps.input);
|
|
452
453
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
453
|
-
children: [inputGlobalStyles, /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, !isHostComponent(Root) && {
|
|
454
|
+
children: [!disableInjectingGlobalStyles && inputGlobalStyles, /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, !isHostComponent(Root) && {
|
|
454
455
|
ownerState: _extends({}, ownerState, rootProps.ownerState)
|
|
455
456
|
}, {
|
|
456
457
|
ref: ref,
|
|
@@ -564,6 +565,13 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
|
|
|
564
565
|
*/
|
|
565
566
|
disabled: PropTypes.bool,
|
|
566
567
|
|
|
568
|
+
/**
|
|
569
|
+
* If `true`, GlobalStyles for the auto-fill keyframes will not be injected/removed on mount/unmount. Make sure to inject them at the top of your application.
|
|
570
|
+
* This option is intended to help with boosting the initial rendering performance if you are loading a big amount of Input components at once.
|
|
571
|
+
* @default false
|
|
572
|
+
*/
|
|
573
|
+
disableInjectingGlobalStyles: PropTypes.bool,
|
|
574
|
+
|
|
567
575
|
/**
|
|
568
576
|
* End `InputAdornment` for this component.
|
|
569
577
|
*/
|
package/ListItem/ListItem.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
|
-
import { Theme } from '
|
|
3
|
+
import { Theme } from '../styles';
|
|
4
4
|
import { ExtendButtonBase } from '../ButtonBase';
|
|
5
5
|
import { OverridableComponent, OverrideProps } from '../OverridableComponent';
|
|
6
6
|
import { ListItemClasses } from './listItemClasses';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
|
-
import { Theme } from '
|
|
3
|
+
import { Theme } from '../styles';
|
|
4
4
|
import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase';
|
|
5
5
|
import { OverrideProps } from '../OverridableComponent';
|
|
6
6
|
import { ListItemButtonClasses } from './listItemButtonClasses';
|
package/MenuItem/MenuItem.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SxProps } from '@mui/system';
|
|
2
|
-
import { Theme } from '
|
|
2
|
+
import { Theme } from '../styles';
|
|
3
3
|
import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase';
|
|
4
4
|
import { OverrideProps } from '../OverridableComponent';
|
|
5
5
|
import { MenuItemClasses } from './menuItemClasses';
|
|
@@ -6,10 +6,13 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { refType } from '@mui/utils';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
8
8
|
import NotchedOutline from './NotchedOutline';
|
|
9
|
+
import useFormControl from '../FormControl/useFormControl';
|
|
10
|
+
import formControlState from '../FormControl/formControlState';
|
|
9
11
|
import styled, { rootShouldForwardProp } from '../styles/styled';
|
|
10
12
|
import outlinedInputClasses, { getOutlinedInputUtilityClass } from './outlinedInputClasses';
|
|
11
13
|
import InputBase, { rootOverridesResolver as inputBaseRootOverridesResolver, inputOverridesResolver as inputBaseInputOverridesResolver, InputBaseRoot, InputBaseComponent as InputBaseInput } from '../InputBase/InputBase';
|
|
12
14
|
import useThemeProps from '../styles/useThemeProps';
|
|
15
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
17
|
|
|
15
18
|
const useUtilityClasses = ownerState => {
|
|
@@ -101,6 +104,8 @@ const OutlinedInputInput = styled(InputBaseInput, {
|
|
|
101
104
|
paddingRight: 0
|
|
102
105
|
}));
|
|
103
106
|
const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps, ref) {
|
|
107
|
+
var _React$Fragment;
|
|
108
|
+
|
|
104
109
|
const props = useThemeProps({
|
|
105
110
|
props: inProps,
|
|
106
111
|
name: 'MuiOutlinedInput'
|
|
@@ -118,6 +123,12 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
118
123
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
119
124
|
|
|
120
125
|
const classes = useUtilityClasses(props);
|
|
126
|
+
const muiFormControl = useFormControl();
|
|
127
|
+
const fcs = formControlState({
|
|
128
|
+
props,
|
|
129
|
+
muiFormControl,
|
|
130
|
+
states: ['required']
|
|
131
|
+
});
|
|
121
132
|
return /*#__PURE__*/_jsx(InputBase, _extends({
|
|
122
133
|
components: _extends({
|
|
123
134
|
Root: OutlinedInputRoot,
|
|
@@ -125,7 +136,9 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
125
136
|
}, components),
|
|
126
137
|
renderSuffix: state => /*#__PURE__*/_jsx(NotchedOutlineRoot, {
|
|
127
138
|
className: classes.notchedOutline,
|
|
128
|
-
label: label,
|
|
139
|
+
label: label && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
140
|
+
children: [label, "\xA0", '*']
|
|
141
|
+
})) : label,
|
|
129
142
|
notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
|
|
130
143
|
}),
|
|
131
144
|
fullWidth: fullWidth,
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Quickly build beautiful [React](https://reactjs.org/) apps. MUI is a simple and
|
|
|
18
18
|
[](https://github.com/mui-org/material-ui/issues/27062)
|
|
19
19
|
[](https://isitmaintained.com/project/mui-org/material-ui 'Average time to resolve an issue')
|
|
20
20
|
[](https://translate.mui.com/project/material-ui-docs)
|
|
21
|
-
[](https://opencollective.com/mui)
|
|
22
22
|
|
|
23
23
|
</div>
|
|
24
24
|
|
|
@@ -51,38 +51,26 @@ Please note that `@next` will only point to pre-releases; to get the latest stab
|
|
|
51
51
|
|
|
52
52
|
### Diamond 💎
|
|
53
53
|
|
|
54
|
-
<p
|
|
55
|
-
<a
|
|
56
|
-
<a
|
|
57
|
-
<a
|
|
54
|
+
<p align="center">
|
|
55
|
+
<a href="https://octopus.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="128" width="128" src="https://avatars3.githubusercontent.com/u/1287123?s=256" alt="octopus" title="Repeatable, reliable deployments" loading="lazy" /></a>
|
|
56
|
+
<a href="https://www.doit-intl.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="128" width="128" src="https://avatars3.githubusercontent.com/u/8424863?s=256" alt="doit-intl" title="Management Platform for Google Cloud and AWS" loading="lazy" /></a>
|
|
57
|
+
<a href="https://www.aptugo.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="128" width="128" src="https://www.aptugo.com/img/favicon.png" alt="aptugo" title="Augmented Software Development Platform" loading="lazy" /></a>
|
|
58
58
|
</p>
|
|
59
59
|
|
|
60
60
|
Diamond Sponsors are those who have pledged \$1,500/month or more to MUI.
|
|
61
61
|
|
|
62
62
|
### Gold 🏆
|
|
63
63
|
|
|
64
|
-
via [Patreon](https://www.patreon.com/oliviertassinari)
|
|
65
|
-
|
|
66
|
-
<p style="display: flex; justify-content: center;">
|
|
67
|
-
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="tidelift" href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img height="96" width="96" src="https://github.com/tidelift.png?size=192" alt="tidelift" title="Enterprise-ready open-source software" loading="lazy" /></a>
|
|
68
|
-
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="bitsrc" href="https://bit.dev/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img height="96" width="96" src="https://github.com/teambit.png?size=192" alt="bitsrc" title="The fastest way to share code" loading="lazy" /></a>
|
|
69
|
-
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="movavi" href="https://spicefactory.co/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img height="96" width="96" src="https://avatars.githubusercontent.com/u/13365608?s=192" alt="Next gen digital product studio." loading="lazy" /></a>
|
|
70
|
-
</p>
|
|
71
|
-
|
|
72
|
-
via [OpenCollective](https://opencollective.com/mui)
|
|
64
|
+
via [OpenCollective](https://opencollective.com/mui) or via [Patreon](https://www.patreon.com/oliviertassinari)
|
|
73
65
|
|
|
74
|
-
<p
|
|
75
|
-
<a
|
|
76
|
-
<a
|
|
77
|
-
<a
|
|
78
|
-
<a
|
|
79
|
-
<a
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
Direct
|
|
83
|
-
|
|
84
|
-
<p style="display: flex; justify-content: center; flex-wrap: wrap;">
|
|
85
|
-
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="elevator" href="https://www.elevatormag.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img src="https://mui.com/static/sponsors/elevator.png" alt="elevator" title="The dopest new hip hop, upcoming artists, music news, culture, and style" height="57" width="191" loading="lazy"></a>
|
|
66
|
+
<p align="center">
|
|
67
|
+
<a href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://github.com/tidelift.png?size=192" alt="tidelift.com" title="Enterprise-ready open-source software" loading="lazy" /></a>
|
|
68
|
+
<a href="https://bit.dev/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank" style="margin-rig ht: 16px;"><img height="96" width="96" src="https://github.com/teambit.png?size=192" alt="bit.dev" title="The fastest way to share code" loading="lazy" /></a>
|
|
69
|
+
<a href="https://www.text-em-all.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img src="https://images.opencollective.com/callemall/09710fe/logo/192.png" alt="text-em-all.com" title="Mass Text Messaging & Automated Calling" height="96" width="96" loading="lazy"></a>
|
|
70
|
+
<a href="https://www.laststance.io/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/laststance/daffd6c/avatar/192.png" alt="laststance.io" title="Indipendent organization for OSS activity based on Tokyo" loading="lazy" /></a>
|
|
71
|
+
<a href="https://www.movavi.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/movavi-software/a1d0167/logo/192.png" alt="movavi.com" title="Screen recorder for Mac" loading="lazy" /></a>
|
|
72
|
+
<a href="https://topaussiecasinos.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/aussiecasinohex/923df37/logo/192.png" alt="topaussiecasinos.com" title="Aussie Gambling Guide" loading="lazy" /></a>
|
|
73
|
+
<a href="https://sumatosoft.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/sumatosoft_company/0b78570/avatar/192.png" alt="sumatosoft.com" title="We help companies to digitalize their businesses" loading="lazy" /></a>
|
|
86
74
|
</p>
|
|
87
75
|
|
|
88
76
|
Gold Sponsors are those who have pledged \$500/month or more to MUI.
|
|
@@ -132,7 +120,7 @@ Check out our [documentation website](https://mui.com/).
|
|
|
132
120
|
|
|
133
121
|
## Premium Themes
|
|
134
122
|
|
|
135
|
-
You can find complete templates & themes in the [MUI Store](https://
|
|
123
|
+
You can find complete templates & themes in the [MUI Store](https://mui.com/store/?utm_source=docs&utm_medium=referral&utm_campaign=readme-store).
|
|
136
124
|
|
|
137
125
|
## Contributing
|
|
138
126
|
|
package/Select/SelectInput.js
CHANGED
|
@@ -405,10 +405,18 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
405
405
|
|
|
406
406
|
if (computeDisplay) {
|
|
407
407
|
if (multiple) {
|
|
408
|
-
if (
|
|
409
|
-
display =
|
|
408
|
+
if (displayMultiple.length === 0) {
|
|
409
|
+
display = null;
|
|
410
410
|
} else {
|
|
411
|
-
display = displayMultiple.reduce((
|
|
411
|
+
display = displayMultiple.reduce((output, child, index) => {
|
|
412
|
+
output.push(child);
|
|
413
|
+
|
|
414
|
+
if (index < displayMultiple.length - 1) {
|
|
415
|
+
output.push(', ');
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
return output;
|
|
419
|
+
}, []);
|
|
412
420
|
}
|
|
413
421
|
} else {
|
|
414
422
|
display = displaySingle;
|
package/SvgIcon/SvgIcon.d.ts
CHANGED
|
@@ -48,6 +48,14 @@ export interface SvgIconTypeMap<P = {}, D extends React.ElementType = 'svg'> {
|
|
|
48
48
|
* Applies a color attribute to the SVG element.
|
|
49
49
|
*/
|
|
50
50
|
htmlColor?: string;
|
|
51
|
+
/**
|
|
52
|
+
* If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`
|
|
53
|
+
* prop will be ignored.
|
|
54
|
+
* Useful when you want to reference a custom `component` and have `SvgIcon` pass that
|
|
55
|
+
* `component`'s viewBox to the root node.
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
inheritViewBox?: boolean;
|
|
51
59
|
/**
|
|
52
60
|
* The shape-rendering attribute. The behavior of the different options is described on the
|
|
53
61
|
* [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering).
|
package/SvgIcon/SvgIcon.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["children", "className", "color", "component", "fontSize", "htmlColor", "titleAccess", "viewBox"];
|
|
3
|
+
const _excluded = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -76,6 +76,7 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
76
76
|
component = 'svg',
|
|
77
77
|
fontSize = 'medium',
|
|
78
78
|
htmlColor,
|
|
79
|
+
inheritViewBox = false,
|
|
79
80
|
titleAccess,
|
|
80
81
|
viewBox = '0 0 24 24'
|
|
81
82
|
} = props,
|
|
@@ -85,21 +86,27 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
85
86
|
color,
|
|
86
87
|
component,
|
|
87
88
|
fontSize,
|
|
89
|
+
inheritViewBox,
|
|
88
90
|
viewBox
|
|
89
91
|
});
|
|
90
92
|
|
|
93
|
+
const more = {};
|
|
94
|
+
|
|
95
|
+
if (!inheritViewBox) {
|
|
96
|
+
more.viewBox = viewBox;
|
|
97
|
+
}
|
|
98
|
+
|
|
91
99
|
const classes = useUtilityClasses(ownerState);
|
|
92
100
|
return /*#__PURE__*/_jsxs(SvgIconRoot, _extends({
|
|
93
101
|
as: component,
|
|
94
102
|
className: clsx(classes.root, className),
|
|
95
103
|
ownerState: ownerState,
|
|
96
104
|
focusable: "false",
|
|
97
|
-
viewBox: viewBox,
|
|
98
105
|
color: htmlColor,
|
|
99
106
|
"aria-hidden": titleAccess ? undefined : true,
|
|
100
107
|
role: titleAccess ? 'img' : undefined,
|
|
101
108
|
ref: ref
|
|
102
|
-
}, other, {
|
|
109
|
+
}, more, other, {
|
|
103
110
|
children: [children, titleAccess ? /*#__PURE__*/_jsx("title", {
|
|
104
111
|
children: titleAccess
|
|
105
112
|
}) : null]
|
|
@@ -156,6 +163,15 @@ process.env.NODE_ENV !== "production" ? SvgIcon.propTypes
|
|
|
156
163
|
*/
|
|
157
164
|
htmlColor: PropTypes.string,
|
|
158
165
|
|
|
166
|
+
/**
|
|
167
|
+
* If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`
|
|
168
|
+
* prop will be ignored.
|
|
169
|
+
* Useful when you want to reference a custom `component` and have `SvgIcon` pass that
|
|
170
|
+
* `component`'s viewBox to the root node.
|
|
171
|
+
* @default false
|
|
172
|
+
*/
|
|
173
|
+
inheritViewBox: PropTypes.bool,
|
|
174
|
+
|
|
159
175
|
/**
|
|
160
176
|
* The shape-rendering attribute. The behavior of the different options is described on the
|
|
161
177
|
* [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering).
|
package/Tabs/Tabs.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ export interface TabsTypeMap<P = {}, D extends React.ElementType = typeof Button
|
|
|
88
88
|
* Props applied to the tab indicator element.
|
|
89
89
|
* @default {}
|
|
90
90
|
*/
|
|
91
|
-
TabIndicatorProps?:
|
|
91
|
+
TabIndicatorProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
92
92
|
/**
|
|
93
93
|
* Props applied to the [`TabScrollButton`](/api/tab-scroll-button/) element.
|
|
94
94
|
* @default {}
|
package/TextField/TextField.js
CHANGED
|
@@ -16,8 +16,8 @@ import FormControl from '../FormControl';
|
|
|
16
16
|
import FormHelperText from '../FormHelperText';
|
|
17
17
|
import Select from '../Select';
|
|
18
18
|
import { getTextFieldUtilityClass } from './textFieldClasses';
|
|
19
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
21
|
const variantComponent = {
|
|
22
22
|
standard: Input,
|
|
23
23
|
filled: FilledInput,
|
|
@@ -141,14 +141,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
|
|
|
141
141
|
InputMore.notched = InputLabelProps.shrink;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
var _InputLabelProps$requ;
|
|
146
|
-
|
|
147
|
-
const displayRequired = (_InputLabelProps$requ = InputLabelProps == null ? void 0 : InputLabelProps.required) != null ? _InputLabelProps$requ : required;
|
|
148
|
-
InputMore.label = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
149
|
-
children: [label, displayRequired && '\u00a0*']
|
|
150
|
-
});
|
|
151
|
-
}
|
|
144
|
+
InputMore.label = label;
|
|
152
145
|
}
|
|
153
146
|
|
|
154
147
|
if (select) {
|
package/index.js
CHANGED
package/legacy/Badge/Badge.js
CHANGED
|
@@ -11,16 +11,19 @@ import styled from '../styles/styled';
|
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
12
|
import capitalize from '../utils/capitalize';
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
export var badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning'
|
|
14
|
+
export var badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular', // TODO: v6 remove the overlap value from these class keys
|
|
15
|
+
'anchorOriginTopLeftCircular', 'anchorOriginTopLeftRectangular', 'anchorOriginTopRightCircular', 'anchorOriginTopRightRectangular', 'anchorOriginBottomLeftCircular', 'anchorOriginBottomLeftRectangular', 'anchorOriginBottomRightCircular', 'anchorOriginBottomRightRectangular']));
|
|
15
16
|
var RADIUS_STANDARD = 10;
|
|
16
17
|
var RADIUS_DOT = 4;
|
|
17
18
|
|
|
18
19
|
var extendUtilityClasses = function extendUtilityClasses(ownerState) {
|
|
19
20
|
var color = ownerState.color,
|
|
21
|
+
anchorOrigin = ownerState.anchorOrigin,
|
|
22
|
+
overlap = ownerState.overlap,
|
|
20
23
|
_ownerState$classes = ownerState.classes,
|
|
21
24
|
classes = _ownerState$classes === void 0 ? {} : _ownerState$classes;
|
|
22
25
|
return _extends({}, classes, {
|
|
23
|
-
badge: clsx(classes.badge, color !== 'default' && [getBadgeUtilityClass("color".concat(capitalize(color))), classes["color".concat(capitalize(color))]])
|
|
26
|
+
badge: clsx(classes.badge, getBadgeUtilityClass("anchorOrigin".concat(capitalize(anchorOrigin.vertical)).concat(capitalize(anchorOrigin.horizontal)).concat(capitalize(overlap))), getBadgeUtilityClass("overlap".concat(capitalize(overlap))), color !== 'default' && [getBadgeUtilityClass("color".concat(capitalize(color))), classes["color".concat(capitalize(color))]])
|
|
24
27
|
});
|
|
25
28
|
};
|
|
26
29
|
|
|
@@ -141,6 +144,11 @@ var BadgeBadge = styled('span', {
|
|
|
141
144
|
})
|
|
142
145
|
});
|
|
143
146
|
});
|
|
147
|
+
|
|
148
|
+
var shouldSpreadAdditionalProps = function shouldSpreadAdditionalProps(Slot) {
|
|
149
|
+
return !Slot || !isHostComponent(Slot);
|
|
150
|
+
};
|
|
151
|
+
|
|
144
152
|
var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
145
153
|
var _componentsProps$root, _componentsProps$badg;
|
|
146
154
|
|
|
@@ -149,10 +157,19 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
149
157
|
name: 'MuiBadge'
|
|
150
158
|
});
|
|
151
159
|
|
|
152
|
-
var _props$
|
|
160
|
+
var _props$anchorOrigin = props.anchorOrigin,
|
|
161
|
+
anchorOriginProp = _props$anchorOrigin === void 0 ? {
|
|
162
|
+
vertical: 'top',
|
|
163
|
+
horizontal: 'right'
|
|
164
|
+
} : _props$anchorOrigin,
|
|
165
|
+
_props$component = props.component,
|
|
166
|
+
component = _props$component === void 0 ? 'span' : _props$component,
|
|
167
|
+
_props$components = props.components,
|
|
153
168
|
components = _props$components === void 0 ? {} : _props$components,
|
|
154
169
|
_props$componentsProp = props.componentsProps,
|
|
155
170
|
componentsProps = _props$componentsProp === void 0 ? {} : _props$componentsProp,
|
|
171
|
+
_props$overlap = props.overlap,
|
|
172
|
+
overlapProp = _props$overlap === void 0 ? 'rectangular' : _props$overlap,
|
|
156
173
|
_props$color = props.color,
|
|
157
174
|
colorProp = _props$color === void 0 ? 'default' : _props$color,
|
|
158
175
|
invisibleProp = props.invisible,
|
|
@@ -161,10 +178,12 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
161
178
|
showZero = _props$showZero === void 0 ? false : _props$showZero,
|
|
162
179
|
_props$variant = props.variant,
|
|
163
180
|
variantProp = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
164
|
-
other = _objectWithoutProperties(props, ["components", "componentsProps", "color", "invisible", "badgeContent", "showZero", "variant"]);
|
|
181
|
+
other = _objectWithoutProperties(props, ["anchorOrigin", "component", "components", "componentsProps", "overlap", "color", "invisible", "badgeContent", "showZero", "variant"]);
|
|
165
182
|
|
|
166
183
|
var prevProps = usePreviousProps({
|
|
167
|
-
|
|
184
|
+
anchorOrigin: anchorOriginProp,
|
|
185
|
+
color: colorProp,
|
|
186
|
+
overlap: overlapProp
|
|
168
187
|
});
|
|
169
188
|
var invisible = invisibleProp;
|
|
170
189
|
|
|
@@ -174,15 +193,22 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
174
193
|
|
|
175
194
|
var _ref10 = invisible ? prevProps : props,
|
|
176
195
|
_ref10$color = _ref10.color,
|
|
177
|
-
color = _ref10$color === void 0 ? colorProp : _ref10$color
|
|
196
|
+
color = _ref10$color === void 0 ? colorProp : _ref10$color,
|
|
197
|
+
_ref10$overlap = _ref10.overlap,
|
|
198
|
+
overlap = _ref10$overlap === void 0 ? overlapProp : _ref10$overlap,
|
|
199
|
+
_ref10$anchorOrigin = _ref10.anchorOrigin,
|
|
200
|
+
anchorOrigin = _ref10$anchorOrigin === void 0 ? anchorOriginProp : _ref10$anchorOrigin;
|
|
178
201
|
|
|
179
202
|
var ownerState = _extends({}, props, {
|
|
203
|
+
anchorOrigin: anchorOrigin,
|
|
180
204
|
invisible: invisible,
|
|
181
|
-
color: color
|
|
205
|
+
color: color,
|
|
206
|
+
overlap: overlap
|
|
182
207
|
});
|
|
183
208
|
|
|
184
209
|
var classes = extendUtilityClasses(ownerState);
|
|
185
210
|
return /*#__PURE__*/_jsx(BadgeUnstyled, _extends({
|
|
211
|
+
anchorOrigin: anchorOrigin,
|
|
186
212
|
invisible: invisibleProp,
|
|
187
213
|
badgeContent: badgeContentProp,
|
|
188
214
|
showZero: showZero,
|
|
@@ -193,14 +219,17 @@ var Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
193
219
|
Badge: BadgeBadge
|
|
194
220
|
}, components),
|
|
195
221
|
componentsProps: {
|
|
196
|
-
root: _extends({}, componentsProps.root, (
|
|
222
|
+
root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
|
|
223
|
+
as: component,
|
|
197
224
|
ownerState: _extends({}, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.ownerState, {
|
|
198
|
-
color: color
|
|
225
|
+
color: color,
|
|
226
|
+
overlap: overlap
|
|
199
227
|
})
|
|
200
228
|
}),
|
|
201
|
-
badge: _extends({}, componentsProps.badge, (
|
|
229
|
+
badge: _extends({}, componentsProps.badge, shouldSpreadAdditionalProps(components.Badge) && {
|
|
202
230
|
ownerState: _extends({}, (_componentsProps$badg = componentsProps.badge) == null ? void 0 : _componentsProps$badg.ownerState, {
|
|
203
|
-
color: color
|
|
231
|
+
color: color,
|
|
232
|
+
overlap: overlap
|
|
204
233
|
})
|
|
205
234
|
})
|
|
206
235
|
},
|
|
@@ -251,6 +280,12 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
251
280
|
/* @typescript-to-proptypes-ignore */
|
|
252
281
|
.oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
|
|
253
282
|
|
|
283
|
+
/**
|
|
284
|
+
* The component used for the root node.
|
|
285
|
+
* Either a string to use a HTML element or a component.
|
|
286
|
+
*/
|
|
287
|
+
component: PropTypes.elementType,
|
|
288
|
+
|
|
254
289
|
/**
|
|
255
290
|
* The components used for each slot inside the Badge.
|
|
256
291
|
* Either a string to use a HTML element or a component.
|