@mui/material 5.15.13 → 5.15.15
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/Accordion/Accordion.js +30 -23
- package/AccordionActions/AccordionActions.js +14 -12
- package/AccordionDetails/AccordionDetails.js +2 -2
- package/AccordionSummary/AccordionSummary.js +29 -23
- package/Autocomplete/Autocomplete.d.ts +1 -1
- package/Autocomplete/Autocomplete.js +60 -34
- package/Autocomplete/autocompleteClasses.d.ts +3 -3
- package/CHANGELOG.md +156 -60
- package/CircularProgress/CircularProgress.d.ts +1 -1
- package/CircularProgress/CircularProgress.js +1 -1
- package/Icon/Icon.d.ts +1 -1
- package/Icon/Icon.js +1 -1
- package/OverridableComponent.d.ts +1 -1
- package/Popper/Popper.d.ts +3 -26
- package/README.md +2 -2
- package/RadioGroup/RadioGroup.d.ts +0 -2
- package/RadioGroup/RadioGroup.js +23 -2
- package/RadioGroup/index.d.ts +3 -0
- package/RadioGroup/index.js +3 -1
- package/RadioGroup/radioGroupClasses.d.ts +6 -0
- package/RadioGroup/radioGroupClasses.js +7 -0
- package/Select/Select.d.ts +8 -20
- package/Slider/Slider.js +404 -223
- package/SvgIcon/SvgIcon.js +1 -1
- package/index.js +1 -1
- package/legacy/Accordion/Accordion.js +33 -22
- package/legacy/AccordionActions/AccordionActions.js +17 -14
- package/legacy/AccordionDetails/AccordionDetails.js +2 -2
- package/legacy/AccordionSummary/AccordionSummary.js +31 -22
- package/legacy/Autocomplete/Autocomplete.js +133 -114
- package/legacy/CircularProgress/CircularProgress.js +1 -1
- package/legacy/Icon/Icon.js +1 -1
- package/legacy/RadioGroup/RadioGroup.js +21 -2
- package/legacy/RadioGroup/index.js +3 -1
- package/legacy/RadioGroup/radioGroupClasses.js +7 -0
- package/legacy/Slider/Slider.js +373 -191
- package/legacy/SvgIcon/SvgIcon.js +1 -1
- package/legacy/index.js +1 -1
- package/legacy/styles/experimental_extendTheme.js +1 -1
- package/legacy/styles/rootShouldForwardProp.js +5 -0
- package/legacy/styles/slotShouldForwardProp.js +5 -0
- package/legacy/styles/styled.js +4 -5
- package/legacy/usePagination/usePagination.js +1 -1
- package/modern/Accordion/Accordion.js +30 -23
- package/modern/AccordionActions/AccordionActions.js +14 -12
- package/modern/AccordionDetails/AccordionDetails.js +2 -2
- package/modern/AccordionSummary/AccordionSummary.js +29 -23
- package/modern/Autocomplete/Autocomplete.js +60 -34
- package/modern/CircularProgress/CircularProgress.js +1 -1
- package/modern/Icon/Icon.js +1 -1
- package/modern/RadioGroup/RadioGroup.js +23 -2
- package/modern/RadioGroup/index.js +3 -1
- package/modern/RadioGroup/radioGroupClasses.js +7 -0
- package/modern/Slider/Slider.js +337 -172
- package/modern/SvgIcon/SvgIcon.js +1 -1
- package/modern/index.js +1 -1
- package/modern/styles/experimental_extendTheme.js +1 -1
- package/modern/styles/rootShouldForwardProp.js +3 -0
- package/modern/styles/slotShouldForwardProp.js +5 -0
- package/modern/styles/styled.js +4 -3
- package/modern/usePagination/usePagination.js +1 -1
- package/node/Accordion/Accordion.js +32 -25
- package/node/AccordionActions/AccordionActions.js +16 -14
- package/node/AccordionDetails/AccordionDetails.js +4 -4
- package/node/AccordionSummary/AccordionSummary.js +33 -27
- package/node/Autocomplete/Autocomplete.js +72 -46
- package/node/CircularProgress/CircularProgress.js +1 -1
- package/node/Icon/Icon.js +1 -1
- package/node/RadioGroup/RadioGroup.js +23 -2
- package/node/RadioGroup/index.js +25 -1
- package/node/RadioGroup/radioGroupClasses.js +15 -0
- package/node/Slider/Slider.js +414 -233
- package/node/SvgIcon/SvgIcon.js +1 -1
- package/node/index.js +1 -1
- package/node/styles/experimental_extendTheme.js +1 -1
- package/node/styles/rootShouldForwardProp.js +10 -0
- package/node/styles/slotShouldForwardProp.js +11 -0
- package/node/styles/styled.js +17 -8
- package/node/usePagination/usePagination.js +1 -1
- package/package.json +6 -6
- package/styles/components.d.ts +5 -0
- package/styles/experimental_extendTheme.js +1 -1
- package/styles/overrides.d.ts +2 -0
- package/styles/rootShouldForwardProp.d.ts +2 -0
- package/styles/rootShouldForwardProp.js +3 -0
- package/styles/slotShouldForwardProp.d.ts +2 -0
- package/styles/slotShouldForwardProp.js +5 -0
- package/styles/styled.d.ts +2 -3
- package/styles/styled.js +4 -3
- package/umd/material-ui.development.js +1010 -746
- package/umd/material-ui.production.min.js +2 -2
- package/usePagination/usePagination.js +1 -1
|
@@ -38,7 +38,7 @@ var SvgIconRoot = styled('svg', {
|
|
|
38
38
|
height: '1em',
|
|
39
39
|
display: 'inline-block',
|
|
40
40
|
// the <svg> will define the property that has `currentColor`
|
|
41
|
-
//
|
|
41
|
+
// for example heroicons uses fill="none" and stroke="currentColor"
|
|
42
42
|
fill: ownerState.hasSvgAsChild ? undefined : 'currentColor',
|
|
43
43
|
flexShrink: 0,
|
|
44
44
|
transition: (_theme$transitions = theme.transitions) == null || (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {
|
package/legacy/index.js
CHANGED
|
@@ -38,7 +38,7 @@ function setColorChannel(obj, key) {
|
|
|
38
38
|
if (!("".concat(key, "Channel") in obj)) {
|
|
39
39
|
// custom channel token is not provided, generate one.
|
|
40
40
|
// if channel token can't be generated, show a warning.
|
|
41
|
-
obj["".concat(key, "Channel")] = safeColorChannel(toRgb(obj[key]), "MUI: Can't create `palette.".concat(key, "Channel` because `palette.").concat(key, "` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().") + '\n' + "To suppress this warning, you need to explicitly provide the `palette.".concat(key, "Channel` as a string (in rgb format,
|
|
41
|
+
obj["".concat(key, "Channel")] = safeColorChannel(toRgb(obj[key]), "MUI: Can't create `palette.".concat(key, "Channel` because `palette.").concat(key, "` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().") + '\n' + "To suppress this warning, you need to explicitly provide the `palette.".concat(key, "Channel` as a string (in rgb format, for example \"12 12 12\") or undefined if you want to remove the channel token."));
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
var silent = function silent(fn) {
|
package/legacy/styles/styled.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import createStyled
|
|
3
|
+
import createStyled from '@mui/system/createStyled';
|
|
4
4
|
import defaultTheme from './defaultTheme';
|
|
5
5
|
import THEME_ID from './identifier';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
export var slotShouldForwardProp = shouldForwardProp;
|
|
6
|
+
import rootShouldForwardProp from './rootShouldForwardProp';
|
|
7
|
+
export { default as slotShouldForwardProp } from './slotShouldForwardProp';
|
|
8
|
+
export { default as rootShouldForwardProp } from './rootShouldForwardProp';
|
|
10
9
|
var styled = createStyled({
|
|
11
10
|
themeId: THEME_ID,
|
|
12
11
|
defaultTheme: defaultTheme,
|
|
@@ -76,7 +76,7 @@ export default function usePagination() {
|
|
|
76
76
|
endPages.length > 0 ? endPages[0] - 2 : count - 1);
|
|
77
77
|
|
|
78
78
|
// Basic list of items to render
|
|
79
|
-
//
|
|
79
|
+
// for example itemList = ['first', 'previous', 1, 'ellipsis', 4, 5, 6, 'ellipsis', 10, 'next', 'last']
|
|
80
80
|
var itemList = [].concat(_toConsumableArray(showFirstButton ? ['first'] : []), _toConsumableArray(hidePrevButton ? [] : ['previous']), _toConsumableArray(startPages), _toConsumableArray(siblingsStart > boundaryCount + 2 ? ['start-ellipsis'] : boundaryCount + 1 < count - boundaryCount ? [boundaryCount + 1] : []), _toConsumableArray(range(siblingsStart, siblingsEnd)), _toConsumableArray(siblingsEnd < count - boundaryCount - 1 ? ['end-ellipsis'] : count - boundaryCount > boundaryCount ? [count - boundaryCount] : []), _toConsumableArray(endPages), _toConsumableArray(hideNextButton ? [] : ['next']), _toConsumableArray(showLastButton ? ['last'] : []));
|
|
81
81
|
|
|
82
82
|
// Map the button type to its page number
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["children", "className", "defaultExpanded", "disabled", "disableGutters", "expanded", "onChange", "square", "slots", "slotProps", "TransitionComponent", "TransitionProps"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { isFragment } from 'react-is';
|
|
@@ -9,8 +9,7 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import chainPropTypes from '@mui/utils/chainPropTypes';
|
|
11
11
|
import composeClasses from '@mui/utils/composeClasses';
|
|
12
|
-
import styled from '../
|
|
13
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
12
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
14
13
|
import Collapse from '../Collapse';
|
|
15
14
|
import Paper from '../Paper';
|
|
16
15
|
import AccordionContext from './AccordionContext';
|
|
@@ -19,6 +18,7 @@ import useSlot from '../utils/useSlot';
|
|
|
19
18
|
import accordionClasses, { getAccordionUtilityClass } from './accordionClasses';
|
|
20
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
const useThemeProps = createUseThemeProps('MuiAccordion');
|
|
22
22
|
const useUtilityClasses = ownerState => {
|
|
23
23
|
const {
|
|
24
24
|
classes,
|
|
@@ -92,27 +92,34 @@ const AccordionRoot = styled(Paper, {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
}, ({
|
|
95
|
-
theme
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
95
|
+
theme
|
|
96
|
+
}) => ({
|
|
97
|
+
variants: [{
|
|
98
|
+
props: props => !props.square,
|
|
99
|
+
style: {
|
|
100
|
+
borderRadius: 0,
|
|
101
|
+
'&:first-of-type': {
|
|
102
|
+
borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,
|
|
103
|
+
borderTopRightRadius: (theme.vars || theme).shape.borderRadius
|
|
104
|
+
},
|
|
105
|
+
'&:last-of-type': {
|
|
106
|
+
borderBottomLeftRadius: (theme.vars || theme).shape.borderRadius,
|
|
107
|
+
borderBottomRightRadius: (theme.vars || theme).shape.borderRadius,
|
|
108
|
+
// Fix a rendering issue on Edge
|
|
109
|
+
'@supports (-ms-ime-align: auto)': {
|
|
110
|
+
borderBottomLeftRadius: 0,
|
|
111
|
+
borderBottomRightRadius: 0
|
|
112
|
+
}
|
|
113
|
+
}
|
|
110
114
|
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
}, {
|
|
116
|
+
props: props => !props.disableGutters,
|
|
117
|
+
style: {
|
|
118
|
+
[`&.${accordionClasses.expanded}`]: {
|
|
119
|
+
margin: '16px 0'
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}]
|
|
116
123
|
}));
|
|
117
124
|
const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
|
|
118
125
|
const props = useThemeProps({
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["className", "disableSpacing"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
-
import styled from '../
|
|
11
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
10
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
12
11
|
import { getAccordionActionsUtilityClass } from './accordionActionsClasses';
|
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const useThemeProps = createUseThemeProps('MuiAccordionActions');
|
|
14
14
|
const useUtilityClasses = ownerState => {
|
|
15
15
|
const {
|
|
16
16
|
classes,
|
|
@@ -30,18 +30,20 @@ const AccordionActionsRoot = styled('div', {
|
|
|
30
30
|
} = props;
|
|
31
31
|
return [styles.root, !ownerState.disableSpacing && styles.spacing];
|
|
32
32
|
}
|
|
33
|
-
})(
|
|
34
|
-
ownerState
|
|
35
|
-
}) => _extends({
|
|
33
|
+
})({
|
|
36
34
|
display: 'flex',
|
|
37
35
|
alignItems: 'center',
|
|
38
36
|
padding: 8,
|
|
39
|
-
justifyContent: 'flex-end'
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
justifyContent: 'flex-end',
|
|
38
|
+
variants: [{
|
|
39
|
+
props: props => !props.disableSpacing,
|
|
40
|
+
style: {
|
|
41
|
+
'& > :not(style) ~ :not(style)': {
|
|
42
|
+
marginLeft: 8
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}]
|
|
46
|
+
});
|
|
45
47
|
const AccordionActions = /*#__PURE__*/React.forwardRef(function AccordionActions(inProps, ref) {
|
|
46
48
|
const props = useThemeProps({
|
|
47
49
|
props: inProps,
|
|
@@ -7,10 +7,10 @@ import * as React from 'react';
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
-
import styled from '../
|
|
11
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
10
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
12
11
|
import { getAccordionDetailsUtilityClass } from './accordionDetailsClasses';
|
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const useThemeProps = createUseThemeProps('MuiAccordionDetails');
|
|
14
14
|
const useUtilityClasses = ownerState => {
|
|
15
15
|
const {
|
|
16
16
|
classes
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["children", "className", "expandIcon", "focusVisibleClassName", "onClick"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
-
import styled from '../
|
|
11
|
-
import useThemeProps from '../styles/useThemeProps';
|
|
10
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
12
11
|
import ButtonBase from '../ButtonBase';
|
|
13
12
|
import AccordionContext from '../Accordion/AccordionContext';
|
|
14
13
|
import accordionSummaryClasses, { getAccordionSummaryUtilityClass } from './accordionSummaryClasses';
|
|
15
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
const useThemeProps = createUseThemeProps('MuiAccordionSummary');
|
|
17
17
|
const useUtilityClasses = ownerState => {
|
|
18
18
|
const {
|
|
19
19
|
classes,
|
|
@@ -34,13 +34,12 @@ const AccordionSummaryRoot = styled(ButtonBase, {
|
|
|
34
34
|
slot: 'Root',
|
|
35
35
|
overridesResolver: (props, styles) => styles.root
|
|
36
36
|
})(({
|
|
37
|
-
theme
|
|
38
|
-
ownerState
|
|
37
|
+
theme
|
|
39
38
|
}) => {
|
|
40
39
|
const transition = {
|
|
41
40
|
duration: theme.transitions.duration.shortest
|
|
42
41
|
};
|
|
43
|
-
return
|
|
42
|
+
return {
|
|
44
43
|
display: 'flex',
|
|
45
44
|
minHeight: 48,
|
|
46
45
|
padding: theme.spacing(0, 2),
|
|
@@ -53,31 +52,38 @@ const AccordionSummaryRoot = styled(ButtonBase, {
|
|
|
53
52
|
},
|
|
54
53
|
[`&:hover:not(.${accordionSummaryClasses.disabled})`]: {
|
|
55
54
|
cursor: 'pointer'
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
},
|
|
56
|
+
variants: [{
|
|
57
|
+
props: props => !props.disableGutters,
|
|
58
|
+
style: {
|
|
59
|
+
[`&.${accordionSummaryClasses.expanded}`]: {
|
|
60
|
+
minHeight: 64
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}]
|
|
64
|
+
};
|
|
62
65
|
});
|
|
63
66
|
const AccordionSummaryContent = styled('div', {
|
|
64
67
|
name: 'MuiAccordionSummary',
|
|
65
68
|
slot: 'Content',
|
|
66
69
|
overridesResolver: (props, styles) => styles.content
|
|
67
70
|
})(({
|
|
68
|
-
theme
|
|
69
|
-
|
|
70
|
-
}) => _extends({
|
|
71
|
+
theme
|
|
72
|
+
}) => ({
|
|
71
73
|
display: 'flex',
|
|
72
74
|
flexGrow: 1,
|
|
73
|
-
margin: '12px 0'
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
margin: '12px 0',
|
|
76
|
+
variants: [{
|
|
77
|
+
props: props => !props.disableGutters,
|
|
78
|
+
style: {
|
|
79
|
+
transition: theme.transitions.create(['margin'], {
|
|
80
|
+
duration: theme.transitions.duration.shortest
|
|
81
|
+
}),
|
|
82
|
+
[`&.${accordionSummaryClasses.expanded}`]: {
|
|
83
|
+
margin: '20px 0'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}]
|
|
81
87
|
}));
|
|
82
88
|
const AccordionSummaryExpandIconWrapper = styled('div', {
|
|
83
89
|
name: 'MuiAccordionSummary',
|
|
@@ -24,14 +24,14 @@ import outlinedInputClasses from '../OutlinedInput/outlinedInputClasses';
|
|
|
24
24
|
import filledInputClasses from '../FilledInput/filledInputClasses';
|
|
25
25
|
import ClearIcon from '../internal/svg-icons/Close';
|
|
26
26
|
import ArrowDropDownIcon from '../internal/svg-icons/ArrowDropDown';
|
|
27
|
-
import
|
|
28
|
-
import styled from '../styles/styled';
|
|
27
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
29
28
|
import autocompleteClasses, { getAutocompleteUtilityClass } from './autocompleteClasses';
|
|
30
29
|
import capitalize from '../utils/capitalize';
|
|
31
30
|
import useForkRef from '../utils/useForkRef';
|
|
32
31
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
33
32
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
33
|
import { createElement as _createElement } from "react";
|
|
34
|
+
const useThemeProps = createUseThemeProps('MuiAutocomplete');
|
|
35
35
|
const useUtilityClasses = ownerState => {
|
|
36
36
|
const {
|
|
37
37
|
classes,
|
|
@@ -90,9 +90,7 @@ const AutocompleteRoot = styled('div', {
|
|
|
90
90
|
[`& .${autocompleteClasses.input}`]: inputFocused && styles.inputFocused
|
|
91
91
|
}, styles.root, fullWidth && styles.fullWidth, hasPopupIcon && styles.hasPopupIcon, hasClearIcon && styles.hasClearIcon];
|
|
92
92
|
}
|
|
93
|
-
})(
|
|
94
|
-
ownerState
|
|
95
|
-
}) => _extends({
|
|
93
|
+
})({
|
|
96
94
|
[`&.${autocompleteClasses.focused} .${autocompleteClasses.clearIndicator}`]: {
|
|
97
95
|
visibility: 'visible'
|
|
98
96
|
},
|
|
@@ -101,17 +99,11 @@ const AutocompleteRoot = styled('div', {
|
|
|
101
99
|
[`&:hover .${autocompleteClasses.clearIndicator}`]: {
|
|
102
100
|
visibility: 'visible'
|
|
103
101
|
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
width: '100%'
|
|
107
|
-
}, {
|
|
108
|
-
[`& .${autocompleteClasses.tag}`]: _extends({
|
|
102
|
+
},
|
|
103
|
+
[`& .${autocompleteClasses.tag}`]: {
|
|
109
104
|
margin: 3,
|
|
110
105
|
maxWidth: 'calc(100% - 6px)'
|
|
111
|
-
},
|
|
112
|
-
margin: 2,
|
|
113
|
-
maxWidth: 'calc(100% - 4px)'
|
|
114
|
-
}),
|
|
106
|
+
},
|
|
115
107
|
[`& .${autocompleteClasses.inputRoot}`]: {
|
|
116
108
|
flexWrap: 'wrap',
|
|
117
109
|
[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]: {
|
|
@@ -200,14 +192,39 @@ const AutocompleteRoot = styled('div', {
|
|
|
200
192
|
paddingBottom: 9
|
|
201
193
|
}
|
|
202
194
|
},
|
|
203
|
-
[`& .${autocompleteClasses.input}`]:
|
|
195
|
+
[`& .${autocompleteClasses.input}`]: {
|
|
204
196
|
flexGrow: 1,
|
|
205
197
|
textOverflow: 'ellipsis',
|
|
206
198
|
opacity: 0
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
199
|
+
},
|
|
200
|
+
variants: [{
|
|
201
|
+
props: {
|
|
202
|
+
fullWidth: true
|
|
203
|
+
},
|
|
204
|
+
style: {
|
|
205
|
+
width: '100%'
|
|
206
|
+
}
|
|
207
|
+
}, {
|
|
208
|
+
props: {
|
|
209
|
+
size: 'small'
|
|
210
|
+
},
|
|
211
|
+
style: {
|
|
212
|
+
[`& .${autocompleteClasses.tag}`]: {
|
|
213
|
+
margin: 2,
|
|
214
|
+
maxWidth: 'calc(100% - 4px)'
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}, {
|
|
218
|
+
props: {
|
|
219
|
+
inputFocused: true
|
|
220
|
+
},
|
|
221
|
+
style: {
|
|
222
|
+
[`& .${autocompleteClasses.input}`]: {
|
|
223
|
+
opacity: 1
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}]
|
|
227
|
+
});
|
|
211
228
|
const AutocompleteEndAdornment = styled('div', {
|
|
212
229
|
name: 'MuiAutocomplete',
|
|
213
230
|
slot: 'EndAdornment',
|
|
@@ -234,14 +251,18 @@ const AutocompletePopupIndicator = styled(IconButton, {
|
|
|
234
251
|
overridesResolver: ({
|
|
235
252
|
ownerState
|
|
236
253
|
}, styles) => _extends({}, styles.popupIndicator, ownerState.popupOpen && styles.popupIndicatorOpen)
|
|
237
|
-
})(
|
|
238
|
-
ownerState
|
|
239
|
-
}) => _extends({
|
|
254
|
+
})({
|
|
240
255
|
padding: 2,
|
|
241
|
-
marginRight: -2
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
256
|
+
marginRight: -2,
|
|
257
|
+
variants: [{
|
|
258
|
+
props: {
|
|
259
|
+
popupOpen: true
|
|
260
|
+
},
|
|
261
|
+
style: {
|
|
262
|
+
transform: 'rotate(180deg)'
|
|
263
|
+
}
|
|
264
|
+
}]
|
|
265
|
+
});
|
|
245
266
|
const AutocompletePopper = styled(Popper, {
|
|
246
267
|
name: 'MuiAutocomplete',
|
|
247
268
|
slot: 'Popper',
|
|
@@ -254,12 +275,17 @@ const AutocompletePopper = styled(Popper, {
|
|
|
254
275
|
}, styles.popper, ownerState.disablePortal && styles.popperDisablePortal];
|
|
255
276
|
}
|
|
256
277
|
})(({
|
|
257
|
-
theme
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
278
|
+
theme
|
|
279
|
+
}) => ({
|
|
280
|
+
zIndex: (theme.vars || theme).zIndex.modal,
|
|
281
|
+
variants: [{
|
|
282
|
+
props: {
|
|
283
|
+
disablePortal: true
|
|
284
|
+
},
|
|
285
|
+
style: {
|
|
286
|
+
position: 'absolute'
|
|
287
|
+
}
|
|
288
|
+
}]
|
|
263
289
|
}));
|
|
264
290
|
const AutocompletePaper = styled(Paper, {
|
|
265
291
|
name: 'MuiAutocomplete',
|
|
@@ -571,7 +597,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
571
597
|
}))
|
|
572
598
|
}));
|
|
573
599
|
let autocompletePopper = null;
|
|
574
|
-
if (
|
|
600
|
+
if (groupedOptions.length > 0) {
|
|
575
601
|
autocompletePopper = renderAutocompletePopperChildren( /*#__PURE__*/_jsx(AutocompleteListbox, _extends({
|
|
576
602
|
as: ListboxComponent,
|
|
577
603
|
className: classes.listbox,
|
|
@@ -908,7 +934,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
|
|
|
908
934
|
ListboxProps: PropTypes.object,
|
|
909
935
|
/**
|
|
910
936
|
* If `true`, the component is in a loading state.
|
|
911
|
-
* This shows the `loadingText` in place of suggestions (only if there are no suggestions to show,
|
|
937
|
+
* This shows the `loadingText` in place of suggestions (only if there are no suggestions to show, for example `options` are empty).
|
|
912
938
|
* @default false
|
|
913
939
|
*/
|
|
914
940
|
loading: PropTypes.bool,
|
|
@@ -213,7 +213,7 @@ process.env.NODE_ENV !== "production" ? CircularProgress.propTypes /* remove-pro
|
|
|
213
213
|
/**
|
|
214
214
|
* The size of the component.
|
|
215
215
|
* If using a number, the pixel unit is assumed.
|
|
216
|
-
* If using a string, you need to provide the CSS unit,
|
|
216
|
+
* If using a string, you need to provide the CSS unit, for example '3rem'.
|
|
217
217
|
* @default 40
|
|
218
218
|
*/
|
|
219
219
|
size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
package/modern/Icon/Icon.js
CHANGED
|
@@ -104,7 +104,7 @@ process.env.NODE_ENV !== "production" ? Icon.propTypes /* remove-proptypes */ =
|
|
|
104
104
|
// └─────────────────────────────────────────────────────────────────────┘
|
|
105
105
|
/**
|
|
106
106
|
* The base class applied to the icon. Defaults to 'material-icons', but can be changed to any
|
|
107
|
-
* other base class that suits the icon font you're using (
|
|
107
|
+
* other base class that suits the icon font you're using (for example material-icons-rounded, fas, etc).
|
|
108
108
|
* @default 'material-icons'
|
|
109
109
|
*/
|
|
110
110
|
baseClassName: PropTypes.string,
|
|
@@ -2,21 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["actions", "children", "defaultValue", "name", "onChange", "value"];
|
|
5
|
+
const _excluded = ["actions", "children", "className", "defaultValue", "name", "onChange", "value"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
8
10
|
import FormGroup from '../FormGroup';
|
|
11
|
+
import { getRadioGroupUtilityClass } from './radioGroupClasses';
|
|
9
12
|
import useForkRef from '../utils/useForkRef';
|
|
10
13
|
import useControlled from '../utils/useControlled';
|
|
11
14
|
import RadioGroupContext from './RadioGroupContext';
|
|
12
15
|
import useId from '../utils/useId';
|
|
13
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
const useUtilityClasses = props => {
|
|
18
|
+
const {
|
|
19
|
+
classes,
|
|
20
|
+
row,
|
|
21
|
+
error
|
|
22
|
+
} = props;
|
|
23
|
+
const slots = {
|
|
24
|
+
root: ['root', row && 'row', error && 'error']
|
|
25
|
+
};
|
|
26
|
+
return composeClasses(slots, getRadioGroupUtilityClass, classes);
|
|
27
|
+
};
|
|
14
28
|
const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
|
|
15
29
|
const {
|
|
16
30
|
// private
|
|
17
31
|
// eslint-disable-next-line react/prop-types
|
|
18
32
|
actions,
|
|
19
33
|
children,
|
|
34
|
+
className,
|
|
20
35
|
defaultValue,
|
|
21
36
|
name: nameProp,
|
|
22
37
|
onChange,
|
|
@@ -24,6 +39,7 @@ const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref)
|
|
|
24
39
|
} = props,
|
|
25
40
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
26
41
|
const rootRef = React.useRef(null);
|
|
42
|
+
const classes = useUtilityClasses(props);
|
|
27
43
|
const [value, setValueState] = useControlled({
|
|
28
44
|
controlled: valueProp,
|
|
29
45
|
default: defaultValue,
|
|
@@ -56,7 +72,8 @@ const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref)
|
|
|
56
72
|
value: contextValue,
|
|
57
73
|
children: /*#__PURE__*/_jsx(FormGroup, _extends({
|
|
58
74
|
role: "radiogroup",
|
|
59
|
-
ref: handleRef
|
|
75
|
+
ref: handleRef,
|
|
76
|
+
className: clsx(classes.root, className)
|
|
60
77
|
}, other, {
|
|
61
78
|
children: children
|
|
62
79
|
}))
|
|
@@ -71,6 +88,10 @@ process.env.NODE_ENV !== "production" ? RadioGroup.propTypes /* remove-proptypes
|
|
|
71
88
|
* The content of the component.
|
|
72
89
|
*/
|
|
73
90
|
children: PropTypes.node,
|
|
91
|
+
/**
|
|
92
|
+
* @ignore
|
|
93
|
+
*/
|
|
94
|
+
className: PropTypes.string,
|
|
74
95
|
/**
|
|
75
96
|
* The default value. Use when the component is not controlled.
|
|
76
97
|
*/
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
export { default } from './RadioGroup';
|
|
4
|
-
export { default as useRadioGroup } from './useRadioGroup';
|
|
4
|
+
export { default as useRadioGroup } from './useRadioGroup';
|
|
5
|
+
export { default as radioGroupClasses } from './radioGroupClasses';
|
|
6
|
+
export * from './radioGroupClasses';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
2
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
3
|
+
export function getRadioGroupUtilityClass(slot) {
|
|
4
|
+
return generateUtilityClass('MuiRadioGroup', slot);
|
|
5
|
+
}
|
|
6
|
+
const radioGroupClasses = generateUtilityClasses('MuiRadioGroup', ['root', 'row', 'error']);
|
|
7
|
+
export default radioGroupClasses;
|