@mui/material 5.12.0 → 5.12.2
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 +2 -2
- package/Badge/Badge.d.ts +3 -6
- package/Button/Button.js +4 -2
- package/CHANGELOG.md +142 -0
- package/FilledInput/filledInputClasses.d.ts +2 -0
- package/FormControl/FormControl.js +1 -1
- package/FormControlLabel/FormControlLabel.d.ts +4 -0
- package/FormControlLabel/FormControlLabel.js +34 -14
- package/FormControlLabel/formControlLabelClasses.d.ts +4 -0
- package/FormControlLabel/formControlLabelClasses.js +1 -1
- package/Modal/Modal.d.ts +6 -3
- package/Modal/Modal.js +11 -3
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +1 -1
- package/OutlinedInput/outlinedInputClasses.d.ts +2 -0
- package/OverridableComponent.d.ts +1 -1
- package/Popper/Popper.d.ts +5 -5
- package/Popper/Popper.js +28 -4
- package/Popper/index.d.ts +1 -1
- package/Stack/Stack.d.ts +1 -1
- package/Stack/Stack.js +1 -1
- package/Tabs/ScrollbarSize.js +2 -2
- package/index.js +1 -1
- package/legacy/Autocomplete/Autocomplete.js +2 -2
- package/legacy/Button/Button.js +4 -2
- package/legacy/FormControl/FormControl.js +1 -1
- package/legacy/FormControlLabel/FormControlLabel.js +35 -14
- package/legacy/FormControlLabel/formControlLabelClasses.js +1 -1
- package/legacy/Modal/Modal.js +11 -3
- package/legacy/Modal/index.js +1 -1
- package/legacy/Popper/Popper.js +29 -5
- package/legacy/Stack/Stack.js +1 -1
- package/legacy/Tabs/ScrollbarSize.js +2 -2
- package/legacy/index.js +1 -1
- package/legacy/styles/ThemeProvider.js +8 -1
- package/legacy/styles/experimental_extendTheme.js +5 -1
- package/modern/Autocomplete/Autocomplete.js +2 -2
- package/modern/Button/Button.js +100 -96
- package/modern/FormControl/FormControl.js +1 -1
- package/modern/FormControlLabel/FormControlLabel.js +33 -13
- package/modern/FormControlLabel/formControlLabelClasses.js +1 -1
- package/modern/Modal/Modal.js +11 -3
- package/modern/Modal/index.js +1 -1
- package/modern/Popper/Popper.js +28 -4
- package/modern/Stack/Stack.js +1 -1
- package/modern/Tabs/ScrollbarSize.js +2 -2
- package/modern/index.js +1 -1
- package/modern/styles/ThemeProvider.js +8 -1
- package/modern/styles/experimental_extendTheme.js +5 -1
- package/node/Autocomplete/Autocomplete.js +2 -2
- package/node/Button/Button.js +4 -2
- package/node/FormControl/FormControl.js +1 -1
- package/node/FormControlLabel/FormControlLabel.js +35 -15
- package/node/FormControlLabel/formControlLabelClasses.js +1 -1
- package/node/Modal/Modal.js +13 -5
- package/node/Modal/index.js +15 -18
- package/node/Popper/Popper.js +28 -4
- package/node/Stack/Stack.js +1 -1
- package/node/Tabs/ScrollbarSize.js +1 -1
- package/node/index.js +1 -1
- package/node/styles/ThemeProvider.js +8 -1
- package/node/styles/experimental_extendTheme.js +5 -1
- package/package.json +4 -4
- package/styles/ThemeProvider.js +8 -1
- package/styles/experimental_extendTheme.d.ts +7 -0
- package/styles/experimental_extendTheme.js +5 -1
- package/umd/material-ui.development.js +170 -82
- package/umd/material-ui.production.min.js +21 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "slotProps", "value"];
|
|
3
|
+
const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "required", "slotProps", "value"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -20,11 +20,13 @@ const useUtilityClasses = ownerState => {
|
|
|
20
20
|
classes,
|
|
21
21
|
disabled,
|
|
22
22
|
labelPlacement,
|
|
23
|
-
error
|
|
23
|
+
error,
|
|
24
|
+
required
|
|
24
25
|
} = ownerState;
|
|
25
26
|
const slots = {
|
|
26
|
-
root: ['root', disabled && 'disabled', `labelPlacement${capitalize(labelPlacement)}`, error && 'error'],
|
|
27
|
-
label: ['label', disabled && 'disabled']
|
|
27
|
+
root: ['root', disabled && 'disabled', `labelPlacement${capitalize(labelPlacement)}`, error && 'error', required && 'required'],
|
|
28
|
+
label: ['label', disabled && 'disabled'],
|
|
29
|
+
asterisk: ['asterisk', error && 'error']
|
|
28
30
|
};
|
|
29
31
|
return composeClasses(slots, getFormControlLabelUtilityClasses, classes);
|
|
30
32
|
};
|
|
@@ -73,6 +75,17 @@ export const FormControlLabelRoot = styled('label', {
|
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
}));
|
|
78
|
+
const AsteriskComponent = styled('span', {
|
|
79
|
+
name: 'MuiFormControlLabel',
|
|
80
|
+
slot: 'Asterisk',
|
|
81
|
+
overridesResolver: (props, styles) => styles.asterisk
|
|
82
|
+
})(({
|
|
83
|
+
theme
|
|
84
|
+
}) => ({
|
|
85
|
+
[`&.${formControlLabelClasses.error}`]: {
|
|
86
|
+
color: (theme.vars || theme).palette.error.main
|
|
87
|
+
}
|
|
88
|
+
}));
|
|
76
89
|
|
|
77
90
|
/**
|
|
78
91
|
* Drop-in replacement of the `Radio`, `Switch` and `Checkbox` component.
|
|
@@ -91,19 +104,16 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
91
104
|
disableTypography,
|
|
92
105
|
label: labelProp,
|
|
93
106
|
labelPlacement = 'end',
|
|
107
|
+
required: requiredProp,
|
|
94
108
|
slotProps = {}
|
|
95
109
|
} = props,
|
|
96
110
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
97
111
|
const muiFormControl = useFormControl();
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
disabled = control.props.disabled;
|
|
101
|
-
}
|
|
102
|
-
if (typeof disabled === 'undefined' && muiFormControl) {
|
|
103
|
-
disabled = muiFormControl.disabled;
|
|
104
|
-
}
|
|
112
|
+
const disabled = disabledProp ?? control.props.disabled ?? muiFormControl?.disabled;
|
|
113
|
+
const required = requiredProp ?? control.props.required;
|
|
105
114
|
const controlProps = {
|
|
106
|
-
disabled
|
|
115
|
+
disabled,
|
|
116
|
+
required
|
|
107
117
|
};
|
|
108
118
|
['checked', 'name', 'onChange', 'value', 'inputRef'].forEach(key => {
|
|
109
119
|
if (typeof control.props[key] === 'undefined' && typeof props[key] !== 'undefined') {
|
|
@@ -118,6 +128,7 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
118
128
|
const ownerState = _extends({}, props, {
|
|
119
129
|
disabled,
|
|
120
130
|
labelPlacement,
|
|
131
|
+
required,
|
|
121
132
|
error: fcs.error
|
|
122
133
|
});
|
|
123
134
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -136,7 +147,12 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
136
147
|
ownerState: ownerState,
|
|
137
148
|
ref: ref
|
|
138
149
|
}, other, {
|
|
139
|
-
children: [/*#__PURE__*/React.cloneElement(control, controlProps), label
|
|
150
|
+
children: [/*#__PURE__*/React.cloneElement(control, controlProps), label, required && /*#__PURE__*/_jsxs(AsteriskComponent, {
|
|
151
|
+
ownerState: ownerState,
|
|
152
|
+
"aria-hidden": true,
|
|
153
|
+
className: classes.asterisk,
|
|
154
|
+
children: ["\u2009", '*']
|
|
155
|
+
})]
|
|
140
156
|
}));
|
|
141
157
|
});
|
|
142
158
|
process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-proptypes */ = {
|
|
@@ -199,6 +215,10 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-pro
|
|
|
199
215
|
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
|
200
216
|
*/
|
|
201
217
|
onChange: PropTypes.func,
|
|
218
|
+
/**
|
|
219
|
+
* If `true`, the label will indicate that the `input` is required.
|
|
220
|
+
*/
|
|
221
|
+
required: PropTypes.bool,
|
|
202
222
|
/**
|
|
203
223
|
* The props used for each slot inside.
|
|
204
224
|
* @default {}
|
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '../generateUtilityClass';
|
|
|
3
3
|
export function getFormControlLabelUtilityClasses(slot) {
|
|
4
4
|
return generateUtilityClass('MuiFormControlLabel', slot);
|
|
5
5
|
}
|
|
6
|
-
const formControlLabelClasses = generateUtilityClasses('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error']);
|
|
6
|
+
const formControlLabelClasses = generateUtilityClasses('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error', 'required', 'asterisk']);
|
|
7
7
|
export default formControlLabelClasses;
|
package/modern/Modal/Modal.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "slotProps", "slots", "theme"];
|
|
3
|
+
const _excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "container", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "open", "slotProps", "slots", "theme"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import ModalUnstyled, { modalUnstyledClasses } from '@mui/base/
|
|
7
|
+
import ModalUnstyled, { modalClasses as modalUnstyledClasses } from '@mui/base/Modal';
|
|
8
8
|
import { isHostComponent, resolveComponentProps } from '@mui/base/utils';
|
|
9
9
|
import { elementAcceptingRef, HTMLElementType } from '@mui/utils';
|
|
10
10
|
import styled from '../styles/styled';
|
|
@@ -69,6 +69,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
69
69
|
className,
|
|
70
70
|
closeAfterTransition = false,
|
|
71
71
|
children,
|
|
72
|
+
container,
|
|
72
73
|
component,
|
|
73
74
|
components = {},
|
|
74
75
|
componentsProps = {},
|
|
@@ -80,6 +81,9 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
80
81
|
disableScrollLock = false,
|
|
81
82
|
hideBackdrop = false,
|
|
82
83
|
keepMounted = false,
|
|
84
|
+
onBackdropClick,
|
|
85
|
+
onClose,
|
|
86
|
+
open,
|
|
83
87
|
slotProps,
|
|
84
88
|
slots,
|
|
85
89
|
// eslint-disable-next-line react/prop-types
|
|
@@ -88,6 +92,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
88
92
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
89
93
|
const [exited, setExited] = React.useState(true);
|
|
90
94
|
const commonProps = {
|
|
95
|
+
container,
|
|
91
96
|
closeAfterTransition,
|
|
92
97
|
disableAutoFocus,
|
|
93
98
|
disableEnforceFocus,
|
|
@@ -96,7 +101,10 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
96
101
|
disableRestoreFocus,
|
|
97
102
|
disableScrollLock,
|
|
98
103
|
hideBackdrop,
|
|
99
|
-
keepMounted
|
|
104
|
+
keepMounted,
|
|
105
|
+
onBackdropClick,
|
|
106
|
+
onClose,
|
|
107
|
+
open
|
|
100
108
|
};
|
|
101
109
|
const ownerState = _extends({}, props, commonProps, {
|
|
102
110
|
exited
|
package/modern/Modal/index.js
CHANGED
package/modern/Popper/Popper.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["components", "componentsProps", "slots", "slotProps"];
|
|
4
|
-
import
|
|
3
|
+
const _excluded = ["anchorEl", "component", "components", "componentsProps", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "transition", "slots", "slotProps"];
|
|
4
|
+
import BasePopper from '@mui/base/Popper';
|
|
5
5
|
import { useThemeWithoutDefault as useTheme } from '@mui/system';
|
|
6
6
|
import { HTMLElementType, refType } from '@mui/utils';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import { styled, useThemeProps } from '../styles';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
const PopperRoot = styled(
|
|
11
|
+
const PopperRoot = styled(BasePopper, {
|
|
12
12
|
name: 'MuiPopper',
|
|
13
13
|
slot: 'Root',
|
|
14
14
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -33,20 +33,44 @@ const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
|
|
|
33
33
|
name: 'MuiPopper'
|
|
34
34
|
});
|
|
35
35
|
const {
|
|
36
|
+
anchorEl,
|
|
37
|
+
component,
|
|
36
38
|
components,
|
|
37
39
|
componentsProps,
|
|
40
|
+
container,
|
|
41
|
+
disablePortal,
|
|
42
|
+
keepMounted,
|
|
43
|
+
modifiers,
|
|
44
|
+
open,
|
|
45
|
+
placement,
|
|
46
|
+
popperOptions,
|
|
47
|
+
popperRef,
|
|
48
|
+
transition,
|
|
38
49
|
slots,
|
|
39
50
|
slotProps
|
|
40
51
|
} = props,
|
|
41
52
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
42
53
|
const RootComponent = slots?.root ?? components?.Root;
|
|
54
|
+
const otherProps = _extends({
|
|
55
|
+
anchorEl,
|
|
56
|
+
component,
|
|
57
|
+
container,
|
|
58
|
+
disablePortal,
|
|
59
|
+
keepMounted,
|
|
60
|
+
modifiers,
|
|
61
|
+
open,
|
|
62
|
+
placement,
|
|
63
|
+
popperOptions,
|
|
64
|
+
popperRef,
|
|
65
|
+
transition
|
|
66
|
+
}, other);
|
|
43
67
|
return /*#__PURE__*/_jsx(PopperRoot, _extends({
|
|
44
68
|
direction: theme?.direction,
|
|
45
69
|
slots: {
|
|
46
70
|
root: RootComponent
|
|
47
71
|
},
|
|
48
72
|
slotProps: slotProps ?? componentsProps
|
|
49
|
-
},
|
|
73
|
+
}, otherProps, {
|
|
50
74
|
ref: ref
|
|
51
75
|
}));
|
|
52
76
|
});
|
package/modern/Stack/Stack.js
CHANGED
|
@@ -49,7 +49,7 @@ process.env.NODE_ENV !== "production" ? Stack.propTypes /* remove-proptypes */ =
|
|
|
49
49
|
/**
|
|
50
50
|
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
51
51
|
*
|
|
52
|
-
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack
|
|
52
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
|
|
53
53
|
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
54
54
|
*
|
|
55
55
|
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
@@ -4,7 +4,7 @@ const _excluded = ["onChange"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import debounce from '../utils/debounce';
|
|
7
|
-
import { ownerWindow } from '../utils';
|
|
7
|
+
import { ownerWindow, unstable_useEnhancedEffect as useEnhancedEffect } from '../utils';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
const styles = {
|
|
10
10
|
width: 99,
|
|
@@ -29,7 +29,7 @@ export default function ScrollbarSize(props) {
|
|
|
29
29
|
const setMeasurements = () => {
|
|
30
30
|
scrollbarHeight.current = nodeRef.current.offsetHeight - nodeRef.current.clientHeight;
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
useEnhancedEffect(() => {
|
|
33
33
|
const handleResize = debounce(() => {
|
|
34
34
|
const prevHeight = scrollbarHeight.current;
|
|
35
35
|
setMeasurements();
|
package/modern/index.js
CHANGED
|
@@ -18,5 +18,12 @@ export default function ThemeProvider(_ref) {
|
|
|
18
18
|
}));
|
|
19
19
|
}
|
|
20
20
|
process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = {
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Your component tree.
|
|
23
|
+
*/
|
|
24
|
+
children: PropTypes.node,
|
|
25
|
+
/**
|
|
26
|
+
* A theme object. You can provide a function to extend the outer theme.
|
|
27
|
+
*/
|
|
28
|
+
theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired
|
|
22
29
|
} : void 0;
|
|
@@ -109,7 +109,7 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// assign component variables
|
|
112
|
-
assignNode(palette, ['Alert', 'AppBar', 'Avatar', 'Chip', 'FilledInput', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']);
|
|
112
|
+
assignNode(palette, ['Alert', 'AppBar', 'Avatar', 'Button', 'Chip', 'FilledInput', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']);
|
|
113
113
|
if (key === 'light') {
|
|
114
114
|
setColor(palette.Alert, 'errorColor', safeDarken(palette.error.light, 0.6));
|
|
115
115
|
setColor(palette.Alert, 'infoColor', safeDarken(palette.info.light, 0.6));
|
|
@@ -133,6 +133,8 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
133
133
|
setColor(palette.Alert, 'warningIconColor', setCssVarColor('palette-warning-main'));
|
|
134
134
|
setColor(palette.AppBar, 'defaultBg', setCssVarColor('palette-grey-100'));
|
|
135
135
|
setColor(palette.Avatar, 'defaultBg', setCssVarColor('palette-grey-400'));
|
|
136
|
+
setColor(palette.Button, 'inheritContainedBg', setCssVarColor('palette-grey-300'));
|
|
137
|
+
setColor(palette.Button, 'inheritContainedHoverBg', setCssVarColor('palette-grey-A100'));
|
|
136
138
|
setColor(palette.Chip, 'defaultBorder', setCssVarColor('palette-grey-400'));
|
|
137
139
|
setColor(palette.Chip, 'defaultAvatarColor', setCssVarColor('palette-grey-700'));
|
|
138
140
|
setColor(palette.Chip, 'defaultIconColor', setCssVarColor('palette-grey-700'));
|
|
@@ -193,6 +195,8 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
193
195
|
setColor(palette.AppBar, 'darkBg', setCssVarColor('palette-background-paper')); // specific for dark mode
|
|
194
196
|
setColor(palette.AppBar, 'darkColor', setCssVarColor('palette-text-primary')); // specific for dark mode
|
|
195
197
|
setColor(palette.Avatar, 'defaultBg', setCssVarColor('palette-grey-600'));
|
|
198
|
+
setColor(palette.Button, 'inheritContainedBg', setCssVarColor('palette-grey-800'));
|
|
199
|
+
setColor(palette.Button, 'inheritContainedHoverBg', setCssVarColor('palette-grey-700'));
|
|
196
200
|
setColor(palette.Chip, 'defaultBorder', setCssVarColor('palette-grey-700'));
|
|
197
201
|
setColor(palette.Chip, 'defaultAvatarColor', setCssVarColor('palette-grey-300'));
|
|
198
202
|
setColor(palette.Chip, 'defaultIconColor', setCssVarColor('palette-grey-300'));
|
|
@@ -152,7 +152,7 @@ const AutocompleteRoot = (0, _styled.default)('div', {
|
|
|
152
152
|
paddingRight: 52 + 4 + 9
|
|
153
153
|
},
|
|
154
154
|
[`& .${_autocompleteClasses.default.input}`]: {
|
|
155
|
-
padding: '7.5px 4px 7.5px
|
|
155
|
+
padding: '7.5px 4px 7.5px 5px'
|
|
156
156
|
},
|
|
157
157
|
[`& .${_autocompleteClasses.default.endAdornment}`]: {
|
|
158
158
|
right: 9
|
|
@@ -165,7 +165,7 @@ const AutocompleteRoot = (0, _styled.default)('div', {
|
|
|
165
165
|
paddingBottom: 6,
|
|
166
166
|
paddingLeft: 6,
|
|
167
167
|
[`& .${_autocompleteClasses.default.input}`]: {
|
|
168
|
-
padding: '2.5px 4px 2.5px
|
|
168
|
+
padding: '2.5px 4px 2.5px 8px'
|
|
169
169
|
}
|
|
170
170
|
},
|
|
171
171
|
[`& .${_filledInputClasses.default.root}`]: {
|
package/node/Button/Button.js
CHANGED
|
@@ -69,6 +69,8 @@ const ButtonRoot = (0, _styled.default)(_ButtonBase.default, {
|
|
|
69
69
|
ownerState
|
|
70
70
|
}) => {
|
|
71
71
|
var _theme$palette$getCon, _theme$palette;
|
|
72
|
+
const inheritContainedBackgroundColor = theme.palette.mode === 'light' ? theme.palette.grey[300] : theme.palette.grey[800];
|
|
73
|
+
const inheritContainedHoverBackgroundColor = theme.palette.mode === 'light' ? theme.palette.grey.A100 : theme.palette.grey[700];
|
|
72
74
|
return (0, _extends2.default)({}, theme.typography.button, {
|
|
73
75
|
minWidth: 64,
|
|
74
76
|
padding: '6px 16px',
|
|
@@ -97,7 +99,7 @@ const ButtonRoot = (0, _styled.default)(_ButtonBase.default, {
|
|
|
97
99
|
backgroundColor: 'transparent'
|
|
98
100
|
}
|
|
99
101
|
}, ownerState.variant === 'contained' && {
|
|
100
|
-
backgroundColor:
|
|
102
|
+
backgroundColor: theme.vars ? theme.vars.palette.Button.inheritContainedHoverBg : inheritContainedHoverBackgroundColor,
|
|
101
103
|
boxShadow: (theme.vars || theme).shadows[4],
|
|
102
104
|
// Reset on touch devices, it doesn't add specificity
|
|
103
105
|
'@media (hover: none)': {
|
|
@@ -140,7 +142,7 @@ const ButtonRoot = (0, _styled.default)(_ButtonBase.default, {
|
|
|
140
142
|
color: theme.vars ?
|
|
141
143
|
// this is safe because grey does not change between default light/dark mode
|
|
142
144
|
theme.vars.palette.text.primary : (_theme$palette$getCon = (_theme$palette = theme.palette).getContrastText) == null ? void 0 : _theme$palette$getCon.call(_theme$palette, theme.palette.grey[300]),
|
|
143
|
-
backgroundColor:
|
|
145
|
+
backgroundColor: theme.vars ? theme.vars.palette.Button.inheritContainedBg : inheritContainedBackgroundColor,
|
|
144
146
|
boxShadow: (theme.vars || theme).shadows[2]
|
|
145
147
|
}, ownerState.variant === 'contained' && ownerState.color !== 'inherit' && {
|
|
146
148
|
color: (theme.vars || theme).palette[ownerState.color].contrastText,
|
|
@@ -147,7 +147,7 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
147
147
|
if (!(0, _isMuiElement.default)(child, ['Input', 'Select'])) {
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
|
-
if ((0, _utils.isFilled)(child.props, true)) {
|
|
150
|
+
if ((0, _utils.isFilled)(child.props, true) || (0, _utils.isFilled)(child.props.inputProps, true)) {
|
|
151
151
|
initialFilled = true;
|
|
152
152
|
}
|
|
153
153
|
});
|
|
@@ -20,7 +20,7 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
|
20
20
|
var _formControlLabelClasses = _interopRequireWildcard(require("./formControlLabelClasses"));
|
|
21
21
|
var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "slotProps", "value"];
|
|
23
|
+
const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "required", "slotProps", "value"];
|
|
24
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
25
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
26
|
const useUtilityClasses = ownerState => {
|
|
@@ -28,11 +28,13 @@ const useUtilityClasses = ownerState => {
|
|
|
28
28
|
classes,
|
|
29
29
|
disabled,
|
|
30
30
|
labelPlacement,
|
|
31
|
-
error
|
|
31
|
+
error,
|
|
32
|
+
required
|
|
32
33
|
} = ownerState;
|
|
33
34
|
const slots = {
|
|
34
|
-
root: ['root', disabled && 'disabled', `labelPlacement${(0, _capitalize.default)(labelPlacement)}`, error && 'error'],
|
|
35
|
-
label: ['label', disabled && 'disabled']
|
|
35
|
+
root: ['root', disabled && 'disabled', `labelPlacement${(0, _capitalize.default)(labelPlacement)}`, error && 'error', required && 'required'],
|
|
36
|
+
label: ['label', disabled && 'disabled'],
|
|
37
|
+
asterisk: ['asterisk', error && 'error']
|
|
36
38
|
};
|
|
37
39
|
return (0, _base.unstable_composeClasses)(slots, _formControlLabelClasses.getFormControlLabelUtilityClasses, classes);
|
|
38
40
|
};
|
|
@@ -81,14 +83,25 @@ const FormControlLabelRoot = (0, _styled.default)('label', {
|
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
}));
|
|
86
|
+
exports.FormControlLabelRoot = FormControlLabelRoot;
|
|
87
|
+
const AsteriskComponent = (0, _styled.default)('span', {
|
|
88
|
+
name: 'MuiFormControlLabel',
|
|
89
|
+
slot: 'Asterisk',
|
|
90
|
+
overridesResolver: (props, styles) => styles.asterisk
|
|
91
|
+
})(({
|
|
92
|
+
theme
|
|
93
|
+
}) => ({
|
|
94
|
+
[`&.${_formControlLabelClasses.default.error}`]: {
|
|
95
|
+
color: (theme.vars || theme).palette.error.main
|
|
96
|
+
}
|
|
97
|
+
}));
|
|
84
98
|
|
|
85
99
|
/**
|
|
86
100
|
* Drop-in replacement of the `Radio`, `Switch` and `Checkbox` component.
|
|
87
101
|
* Use this component if you want to display an extra label.
|
|
88
102
|
*/
|
|
89
|
-
exports.FormControlLabelRoot = FormControlLabelRoot;
|
|
90
103
|
const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel(inProps, ref) {
|
|
91
|
-
var _slotProps$typography;
|
|
104
|
+
var _ref, _slotProps$typography;
|
|
92
105
|
const props = (0, _useThemeProps.default)({
|
|
93
106
|
props: inProps,
|
|
94
107
|
name: 'MuiFormControlLabel'
|
|
@@ -101,19 +114,16 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
101
114
|
disableTypography,
|
|
102
115
|
label: labelProp,
|
|
103
116
|
labelPlacement = 'end',
|
|
117
|
+
required: requiredProp,
|
|
104
118
|
slotProps = {}
|
|
105
119
|
} = props,
|
|
106
120
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
107
121
|
const muiFormControl = (0, _FormControl.useFormControl)();
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
disabled = control.props.disabled;
|
|
111
|
-
}
|
|
112
|
-
if (typeof disabled === 'undefined' && muiFormControl) {
|
|
113
|
-
disabled = muiFormControl.disabled;
|
|
114
|
-
}
|
|
122
|
+
const disabled = (_ref = disabledProp != null ? disabledProp : control.props.disabled) != null ? _ref : muiFormControl == null ? void 0 : muiFormControl.disabled;
|
|
123
|
+
const required = requiredProp != null ? requiredProp : control.props.required;
|
|
115
124
|
const controlProps = {
|
|
116
|
-
disabled
|
|
125
|
+
disabled,
|
|
126
|
+
required
|
|
117
127
|
};
|
|
118
128
|
['checked', 'name', 'onChange', 'value', 'inputRef'].forEach(key => {
|
|
119
129
|
if (typeof control.props[key] === 'undefined' && typeof props[key] !== 'undefined') {
|
|
@@ -128,6 +138,7 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
128
138
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
129
139
|
disabled,
|
|
130
140
|
labelPlacement,
|
|
141
|
+
required,
|
|
131
142
|
error: fcs.error
|
|
132
143
|
});
|
|
133
144
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -146,7 +157,12 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
146
157
|
ownerState: ownerState,
|
|
147
158
|
ref: ref
|
|
148
159
|
}, other, {
|
|
149
|
-
children: [/*#__PURE__*/React.cloneElement(control, controlProps), label
|
|
160
|
+
children: [/*#__PURE__*/React.cloneElement(control, controlProps), label, required && /*#__PURE__*/(0, _jsxRuntime.jsxs)(AsteriskComponent, {
|
|
161
|
+
ownerState: ownerState,
|
|
162
|
+
"aria-hidden": true,
|
|
163
|
+
className: classes.asterisk,
|
|
164
|
+
children: ["\u2009", '*']
|
|
165
|
+
})]
|
|
150
166
|
}));
|
|
151
167
|
});
|
|
152
168
|
process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-proptypes */ = {
|
|
@@ -209,6 +225,10 @@ process.env.NODE_ENV !== "production" ? FormControlLabel.propTypes /* remove-pro
|
|
|
209
225
|
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
|
210
226
|
*/
|
|
211
227
|
onChange: _propTypes.default.func,
|
|
228
|
+
/**
|
|
229
|
+
* If `true`, the label will indicate that the `input` is required.
|
|
230
|
+
*/
|
|
231
|
+
required: _propTypes.default.bool,
|
|
212
232
|
/**
|
|
213
233
|
* The props used for each slot inside.
|
|
214
234
|
* @default {}
|
|
@@ -11,6 +11,6 @@ var _generateUtilityClass = _interopRequireDefault(require("../generateUtilityCl
|
|
|
11
11
|
function getFormControlLabelUtilityClasses(slot) {
|
|
12
12
|
return (0, _generateUtilityClass.default)('MuiFormControlLabel', slot);
|
|
13
13
|
}
|
|
14
|
-
const formControlLabelClasses = (0, _utils.unstable_generateUtilityClasses)('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error']);
|
|
14
|
+
const formControlLabelClasses = (0, _utils.unstable_generateUtilityClasses)('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error', 'required', 'asterisk']);
|
|
15
15
|
var _default = formControlLabelClasses;
|
|
16
16
|
exports.default = _default;
|
package/node/Modal/Modal.js
CHANGED
|
@@ -10,17 +10,17 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
|
-
var
|
|
13
|
+
var _Modal = _interopRequireWildcard(require("@mui/base/Modal"));
|
|
14
14
|
var _utils = require("@mui/base/utils");
|
|
15
15
|
var _utils2 = require("@mui/utils");
|
|
16
16
|
var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
17
17
|
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
18
18
|
var _Backdrop = _interopRequireDefault(require("../Backdrop"));
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const _excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "slotProps", "slots", "theme"];
|
|
20
|
+
const _excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "container", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "open", "slotProps", "slots", "theme"];
|
|
21
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
const modalClasses =
|
|
23
|
+
const modalClasses = _Modal.modalClasses;
|
|
24
24
|
exports.modalClasses = modalClasses;
|
|
25
25
|
const ModalRoot = (0, _styled.default)('div', {
|
|
26
26
|
name: 'MuiModal',
|
|
@@ -80,6 +80,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
80
80
|
className,
|
|
81
81
|
closeAfterTransition = false,
|
|
82
82
|
children,
|
|
83
|
+
container,
|
|
83
84
|
component,
|
|
84
85
|
components = {},
|
|
85
86
|
componentsProps = {},
|
|
@@ -91,6 +92,9 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
91
92
|
disableScrollLock = false,
|
|
92
93
|
hideBackdrop = false,
|
|
93
94
|
keepMounted = false,
|
|
95
|
+
onBackdropClick,
|
|
96
|
+
onClose,
|
|
97
|
+
open,
|
|
94
98
|
slotProps,
|
|
95
99
|
slots,
|
|
96
100
|
// eslint-disable-next-line react/prop-types
|
|
@@ -99,6 +103,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
99
103
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
100
104
|
const [exited, setExited] = React.useState(true);
|
|
101
105
|
const commonProps = {
|
|
106
|
+
container,
|
|
102
107
|
closeAfterTransition,
|
|
103
108
|
disableAutoFocus,
|
|
104
109
|
disableEnforceFocus,
|
|
@@ -107,7 +112,10 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
107
112
|
disableRestoreFocus,
|
|
108
113
|
disableScrollLock,
|
|
109
114
|
hideBackdrop,
|
|
110
|
-
keepMounted
|
|
115
|
+
keepMounted,
|
|
116
|
+
onBackdropClick,
|
|
117
|
+
onClose,
|
|
118
|
+
open
|
|
111
119
|
};
|
|
112
120
|
const ownerState = (0, _extends2.default)({}, props, commonProps, {
|
|
113
121
|
exited
|
|
@@ -116,7 +124,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
116
124
|
const BackdropSlot = (_ref2 = (_slots$backdrop = slots == null ? void 0 : slots.backdrop) != null ? _slots$backdrop : components.Backdrop) != null ? _ref2 : BackdropComponent;
|
|
117
125
|
const rootSlotProps = (_slotProps$root = slotProps == null ? void 0 : slotProps.root) != null ? _slotProps$root : componentsProps.root;
|
|
118
126
|
const backdropSlotProps = (_slotProps$backdrop = slotProps == null ? void 0 : slotProps.backdrop) != null ? _slotProps$backdrop : componentsProps.backdrop;
|
|
119
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
127
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.default, (0, _extends2.default)({
|
|
120
128
|
slots: {
|
|
121
129
|
root: RootSlot,
|
|
122
130
|
backdrop: BackdropSlot
|
package/node/Modal/index.js
CHANGED
|
@@ -3,34 +3,31 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
ModalManager: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "ModalManager", {
|
|
8
10
|
enumerable: true,
|
|
9
11
|
get: function () {
|
|
10
|
-
return _Modal.
|
|
12
|
+
return _Modal.ModalManager;
|
|
11
13
|
}
|
|
12
14
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Object.defineProperty(exports, key, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _ModalUnstyled[key];
|
|
22
|
-
}
|
|
23
|
-
});
|
|
15
|
+
Object.defineProperty(exports, "default", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () {
|
|
18
|
+
return _Modal2.default;
|
|
19
|
+
}
|
|
24
20
|
});
|
|
25
|
-
var _Modal =
|
|
26
|
-
|
|
21
|
+
var _Modal = require("@mui/base/Modal");
|
|
22
|
+
var _Modal2 = _interopRequireWildcard(require("./Modal"));
|
|
23
|
+
Object.keys(_Modal2).forEach(function (key) {
|
|
27
24
|
if (key === "default" || key === "__esModule") return;
|
|
28
25
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
29
|
-
if (key in exports && exports[key] ===
|
|
26
|
+
if (key in exports && exports[key] === _Modal2[key]) return;
|
|
30
27
|
Object.defineProperty(exports, key, {
|
|
31
28
|
enumerable: true,
|
|
32
29
|
get: function () {
|
|
33
|
-
return
|
|
30
|
+
return _Modal2[key];
|
|
34
31
|
}
|
|
35
32
|
});
|
|
36
33
|
});
|