@mui/material 5.11.10 → 5.11.11
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/accordionClasses.d.ts +18 -18
- package/AccordionActions/accordionActionsClasses.d.ts +10 -10
- package/AccordionDetails/accordionDetailsClasses.d.ts +8 -8
- package/AccordionSummary/accordionSummaryClasses.d.ts +22 -22
- package/Alert/alertClasses.d.ts +44 -44
- package/AlertTitle/alertTitleClasses.d.ts +8 -8
- package/AppBar/appBarClasses.d.ts +28 -28
- package/Autocomplete/Autocomplete.d.ts +3 -1
- package/Autocomplete/autocompleteClasses.d.ts +54 -54
- package/Avatar/avatarClasses.d.ts +20 -20
- package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
- package/Backdrop/backdropClasses.d.ts +10 -10
- package/Badge/Badge.js +1 -1
- package/Badge/badgeClasses.d.ts +56 -56
- package/BottomNavigation/BottomNavigation.js +0 -0
- package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
- package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
- package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
- package/Button/buttonClasses.d.ts +100 -100
- package/ButtonBase/buttonBaseClasses.d.ts +12 -12
- package/ButtonBase/touchRippleClasses.d.ts +20 -20
- package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
- package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
- package/CHANGELOG.md +89 -0
- package/Card/cardClasses.d.ts +8 -8
- package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
- package/CardActions/cardActionsClasses.d.ts +10 -10
- package/CardContent/cardContentClasses.d.ts +8 -8
- package/CardHeader/cardHeaderClasses.d.ts +18 -18
- package/CardMedia/cardMediaClasses.d.ts +12 -12
- package/Checkbox/checkboxClasses.d.ts +18 -18
- package/Chip/chipClasses.d.ts +96 -96
- package/CircularProgress/circularProgressClasses.d.ts +26 -26
- package/ClickAwayListener/index.d.ts +2 -2
- package/Collapse/collapseClasses.d.ts +18 -18
- package/Container/Container.js +0 -1
- package/Container/containerClasses.d.ts +6 -6
- package/Dialog/DialogContext.d.ts +6 -6
- package/Dialog/dialogClasses.d.ts +36 -36
- package/DialogActions/dialogActionsClasses.d.ts +10 -10
- package/DialogContent/dialogContentClasses.d.ts +10 -10
- package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
- package/DialogTitle/dialogTitleClasses.d.ts +8 -8
- package/Divider/dividerClasses.d.ts +34 -34
- package/Drawer/drawerClasses.d.ts +30 -30
- package/Fab/fabClasses.d.ts +26 -26
- package/FilledInput/filledInputClasses.d.ts +40 -40
- package/FormControl/FormControlContext.d.ts +17 -17
- package/FormControl/formControlClasses.d.ts +14 -14
- package/FormControl/useFormControl.d.ts +2 -2
- package/FormControlLabel/formControlLabelClasses.d.ts +20 -20
- package/FormGroup/formGroupClasses.d.ts +12 -12
- package/FormHelperText/formHelperTextClasses.d.ts +22 -22
- package/FormLabel/formLabelClasses.d.ts +22 -22
- package/Grid/gridClasses.d.ts +48 -48
- package/Icon/iconClasses.d.ts +24 -24
- package/IconButton/iconButtonClasses.d.ts +34 -34
- package/ImageList/imageListClasses.d.ts +16 -16
- package/ImageListItem/imageListItemClasses.d.ts +18 -18
- package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
- package/Input/inputClasses.d.ts +34 -34
- package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
- package/InputBase/InputBase.js +2 -2
- package/InputBase/inputBaseClasses.d.ts +46 -46
- package/InputLabel/InputLabel.js +3 -1
- package/InputLabel/inputLabelClasses.d.ts +32 -32
- package/LinearProgress/linearProgressClasses.d.ts +42 -42
- package/Link/getTextDecoration.d.ts +15 -15
- package/Link/linkClasses.d.ts +18 -18
- package/List/listClasses.d.ts +14 -14
- package/ListItem/listItemClasses.d.ts +30 -30
- package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
- package/ListItemButton/listItemButtonClasses.d.ts +22 -22
- package/ListItemIcon/listItemIconClasses.d.ts +10 -10
- package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
- package/ListItemText/listItemTextClasses.d.ts +18 -18
- package/ListSubheader/ListSubheader.js +1 -0
- package/ListSubheader/listSubheaderClasses.d.ts +18 -18
- package/Menu/menuClasses.d.ts +12 -12
- package/MenuItem/menuItemClasses.d.ts +20 -20
- package/MenuList/MenuList.js +7 -0
- package/MobileStepper/mobileStepperClasses.d.ts +22 -22
- package/Modal/Modal.d.ts +9 -1
- package/Modal/Modal.js +14 -9
- package/NativeSelect/nativeSelectClasses.d.ts +32 -32
- package/OutlinedInput/OutlinedInput.js +1 -1
- package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
- package/Pagination/paginationClasses.d.ts +14 -14
- package/PaginationItem/paginationItemClasses.d.ts +42 -42
- package/Paper/paperClasses.d.ts +39 -39
- package/Popover/popoverClasses.d.ts +10 -10
- package/Popper/Popper.d.ts +55 -55
- package/README.md +0 -2
- package/Radio/radioClasses.d.ts +16 -16
- package/RadioGroup/RadioGroupContext.d.ts +11 -11
- package/RadioGroup/useRadioGroup.d.ts +4 -4
- package/Rating/Rating.js +2 -2
- package/Rating/ratingClasses.d.ts +40 -40
- package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
- package/Select/SelectInput.js +2 -22
- package/Select/selectClasses.d.ts +30 -30
- package/Skeleton/skeletonClasses.d.ts +26 -26
- package/Slider/Slider.d.ts +5 -1
- package/Slider/Slider.js +16 -11
- package/Slider/SliderValueLabel.d.ts +15 -15
- package/Slider/SliderValueLabel.types.d.ts +24 -24
- package/Slider/sliderClasses.d.ts +58 -58
- package/Snackbar/Snackbar.js +21 -125
- package/Snackbar/snackbarClasses.d.ts +20 -20
- package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
- package/SpeedDial/speedDialClasses.d.ts +22 -22
- package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
- package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
- package/Stack/Stack.d.ts +0 -1
- package/Stack/Stack.js +9 -120
- package/Stack/index.d.ts +3 -0
- package/Stack/index.js +2 -1
- package/Stack/stackClasses.d.ts +6 -0
- package/Stack/stackClasses.js +7 -0
- package/Step/StepContext.d.ts +20 -20
- package/Step/stepClasses.d.ts +16 -16
- package/StepButton/stepButtonClasses.d.ts +14 -14
- package/StepConnector/stepConnectorClasses.d.ts +26 -26
- package/StepContent/stepContentClasses.d.ts +12 -12
- package/StepIcon/stepIconClasses.d.ts +16 -16
- package/StepLabel/stepLabelClasses.d.ts +28 -28
- package/Stepper/StepperContext.d.ts +18 -18
- package/Stepper/stepperClasses.d.ts +14 -14
- package/SvgIcon/svgIconClasses.d.ts +26 -26
- package/Switch/switchClasses.d.ts +32 -32
- package/Tab/tabClasses.d.ts +26 -26
- package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
- package/Table/tableClasses.d.ts +10 -10
- package/TableBody/tableBodyClasses.d.ts +8 -8
- package/TableCell/tableCellClasses.d.ts +32 -32
- package/TableContainer/tableContainerClasses.d.ts +8 -8
- package/TableFooter/tableFooterClasses.d.ts +8 -8
- package/TableHead/tableHeadClasses.d.ts +8 -8
- package/TablePagination/tablePaginationClasses.d.ts +28 -28
- package/TableRow/tableRowClasses.d.ts +16 -16
- package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
- package/Tabs/tabsClasses.d.ts +32 -32
- package/TextField/textFieldClasses.d.ts +8 -8
- package/ToggleButton/toggleButtonClasses.d.ts +24 -24
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
- package/Toolbar/toolbarClasses.d.ts +14 -14
- package/Tooltip/tooltipClasses.d.ts +30 -30
- package/Typography/typographyClasses.d.ts +50 -50
- package/Unstable_Grid2/Grid2.d.ts +4 -4
- package/Unstable_Grid2/Grid2.js +2 -3
- package/Unstable_Grid2/Grid2Props.d.ts +15 -15
- package/Unstable_Grid2/grid2Classes.d.ts +5 -5
- package/Unstable_Grid2/index.d.ts +4 -4
- package/className/index.d.ts +1 -1
- package/darkScrollbar/index.d.ts +28 -28
- package/generateUtilityClass/index.d.ts +2 -2
- package/generateUtilityClasses/index.d.ts +1 -1
- package/index.js +1 -1
- package/internal/switchBaseClasses.d.ts +12 -12
- package/legacy/Badge/Badge.js +1 -1
- package/legacy/BottomNavigation/BottomNavigation.js +0 -0
- package/legacy/Container/Container.js +0 -1
- package/legacy/InputBase/InputBase.js +2 -2
- package/legacy/InputLabel/InputLabel.js +3 -1
- package/legacy/ListSubheader/ListSubheader.js +1 -0
- package/legacy/MenuList/MenuList.js +7 -0
- package/legacy/Modal/Modal.js +14 -9
- package/legacy/OutlinedInput/OutlinedInput.js +1 -1
- package/legacy/Rating/Rating.js +2 -2
- package/legacy/Select/SelectInput.js +2 -22
- package/legacy/Slider/Slider.js +16 -12
- package/legacy/Snackbar/Snackbar.js +20 -119
- package/legacy/Stack/Stack.js +13 -122
- package/legacy/Stack/index.js +2 -1
- package/legacy/Stack/stackClasses.js +7 -0
- package/legacy/Unstable_Grid2/Grid2.js +2 -3
- package/legacy/index.js +1 -1
- package/legacy/styles/createTheme.js +1 -0
- package/legacy/useAutocomplete/useAutocomplete.js +2 -2
- package/locale/index.d.ts +75 -75
- package/modern/Badge/Badge.js +1 -1
- package/modern/BottomNavigation/BottomNavigation.js +0 -0
- package/modern/Container/Container.js +0 -1
- package/modern/InputBase/InputBase.js +2 -2
- package/modern/InputLabel/InputLabel.js +3 -1
- package/modern/ListSubheader/ListSubheader.js +1 -0
- package/modern/MenuList/MenuList.js +7 -0
- package/modern/Modal/Modal.js +14 -9
- package/modern/OutlinedInput/OutlinedInput.js +1 -1
- package/modern/Rating/Rating.js +2 -2
- package/modern/Select/SelectInput.js +2 -18
- package/modern/Slider/Slider.js +16 -11
- package/modern/Snackbar/Snackbar.js +21 -125
- package/modern/Stack/Stack.js +9 -120
- package/modern/Stack/index.js +2 -1
- package/modern/Stack/stackClasses.js +7 -0
- package/modern/Unstable_Grid2/Grid2.js +2 -3
- package/modern/index.js +1 -1
- package/modern/styles/createTheme.js +1 -0
- package/modern/useAutocomplete/useAutocomplete.js +2 -2
- package/node/Badge/Badge.js +2 -2
- package/node/BottomNavigation/BottomNavigation.js +0 -0
- package/node/Container/Container.js +0 -2
- package/node/InputBase/InputBase.js +2 -2
- package/node/InputLabel/InputLabel.js +3 -1
- package/node/ListSubheader/ListSubheader.js +1 -0
- package/node/MenuList/MenuList.js +7 -0
- package/node/Modal/Modal.js +14 -9
- package/node/OutlinedInput/OutlinedInput.js +1 -1
- package/node/Rating/Rating.js +2 -2
- package/node/Select/SelectInput.js +2 -22
- package/node/Slider/Slider.js +19 -14
- package/node/Snackbar/Snackbar.js +20 -124
- package/node/Stack/Stack.js +9 -122
- package/node/Stack/index.js +8 -1
- package/node/Stack/stackClasses.js +16 -0
- package/node/Unstable_Grid2/Grid2.js +0 -1
- package/node/index.js +1 -1
- package/node/styles/createTheme.js +1 -0
- package/node/useAutocomplete/useAutocomplete.js +8 -6
- package/package.json +6 -6
- package/styles/CssVarsProvider.d.ts +16 -16
- package/styles/createTheme.js +1 -0
- package/styles/excludeVariablesFromRoot.d.ts +5 -5
- package/styles/getOverlayAlpha.d.ts +2 -2
- package/transitions/index.d.ts +1 -1
- package/transitions/transition.d.ts +13 -13
- package/transitions/utils.d.ts +23 -23
- package/types/OverridableComponentAugmentation.d.ts +31 -31
- package/umd/material-ui.development.js +4132 -4060
- package/umd/material-ui.production.min.js +21 -21
- package/useAutocomplete/useAutocomplete.d.ts +2 -2
- package/useAutocomplete/useAutocomplete.js +2 -2
- package/useMediaQuery/useMediaQuery.d.ts +46 -46
- package/useTouchRipple/index.d.ts +1 -1
- package/useTouchRipple/useTouchRipple.d.ts +28 -28
- package/utils/getScrollbarSize.d.ts +2 -2
- package/utils/ownerDocument.d.ts +2 -2
- package/utils/ownerWindow.d.ts +2 -2
- package/utils/setRef.d.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
export { unstable_generateUtilityClasses as default } from '@mui/utils';
|
|
1
|
+
export { unstable_generateUtilityClasses as default } from '@mui/utils';
|
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export interface SwitchBaseClasses {
|
|
2
|
-
root: string;
|
|
3
|
-
checked: string;
|
|
4
|
-
disabled: string;
|
|
5
|
-
input: string;
|
|
6
|
-
edgeStart: string;
|
|
7
|
-
edgeEnd: string;
|
|
8
|
-
}
|
|
9
|
-
export type SwitchBaseClassKey = keyof SwitchBaseClasses;
|
|
10
|
-
export declare function getSwitchBaseUtilityClass(slot: string): string;
|
|
11
|
-
declare const switchBaseClasses: SwitchBaseClasses;
|
|
12
|
-
export default switchBaseClasses;
|
|
1
|
+
export interface SwitchBaseClasses {
|
|
2
|
+
root: string;
|
|
3
|
+
checked: string;
|
|
4
|
+
disabled: string;
|
|
5
|
+
input: string;
|
|
6
|
+
edgeStart: string;
|
|
7
|
+
edgeEnd: string;
|
|
8
|
+
}
|
|
9
|
+
export type SwitchBaseClassKey = keyof SwitchBaseClasses;
|
|
10
|
+
export declare function getSwitchBaseUtilityClass(slot: string): string;
|
|
11
|
+
declare const switchBaseClasses: SwitchBaseClasses;
|
|
12
|
+
export default switchBaseClasses;
|
package/legacy/Badge/Badge.js
CHANGED
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { usePreviousProps } from '@mui/utils';
|
|
8
8
|
import composeClasses from '@mui/base/composeClasses';
|
|
9
|
-
import
|
|
9
|
+
import useBadge from '@mui/base/useBadge';
|
|
10
10
|
import { useSlotProps } from '@mui/base';
|
|
11
11
|
import styled from '../styles/styled';
|
|
12
12
|
import useThemeProps from '../styles/useThemeProps';
|
|
File without changes
|
|
@@ -439,7 +439,7 @@ var InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref) {
|
|
|
439
439
|
ref: ref,
|
|
440
440
|
onClick: handleClick
|
|
441
441
|
}, other, {
|
|
442
|
-
className: clsx(classes.root, rootProps.className, className),
|
|
442
|
+
className: clsx(classes.root, rootProps.className, className, readOnly && 'MuiInputBase-readOnly'),
|
|
443
443
|
children: [startAdornment, /*#__PURE__*/_jsx(FormControlContext.Provider, {
|
|
444
444
|
value: null,
|
|
445
445
|
children: /*#__PURE__*/_jsx(Input, _extends({
|
|
@@ -466,7 +466,7 @@ var InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref) {
|
|
|
466
466
|
ownerState: _extends({}, ownerState, inputProps.ownerState)
|
|
467
467
|
}, {
|
|
468
468
|
ref: handleInputRef,
|
|
469
|
-
className: clsx(classes.input, inputProps.className),
|
|
469
|
+
className: clsx(classes.input, inputProps.className, readOnly && 'MuiInputBase-readOnly'),
|
|
470
470
|
onBlur: handleBlur,
|
|
471
471
|
onChange: handleChange,
|
|
472
472
|
onFocus: handleFocus
|
|
@@ -94,7 +94,9 @@ var InputLabelRoot = styled(FormLabel, {
|
|
|
94
94
|
}, ownerState.shrink && {
|
|
95
95
|
userSelect: 'none',
|
|
96
96
|
pointerEvents: 'auto',
|
|
97
|
-
|
|
97
|
+
// Theoretically, we should have (8+5)*2/0.75 = 34px
|
|
98
|
+
// but it feels a better when it bleeds a bit on the left, so 32px.
|
|
99
|
+
maxWidth: 'calc(133% - 32px)',
|
|
98
100
|
transform: 'translate(14px, -9px) scale(0.75)'
|
|
99
101
|
}));
|
|
100
102
|
});
|
|
@@ -86,6 +86,7 @@ var ListSubheader = /*#__PURE__*/React.forwardRef(function ListSubheader(inProps
|
|
|
86
86
|
ownerState: ownerState
|
|
87
87
|
}, other));
|
|
88
88
|
});
|
|
89
|
+
ListSubheader.muiSkipListHighlight = true;
|
|
89
90
|
process.env.NODE_ENV !== "production" ? ListSubheader.propTypes /* remove-proptypes */ = {
|
|
90
91
|
// ----------------------------- Warning --------------------------------
|
|
91
92
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -196,6 +196,13 @@ var MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
|
|
|
196
196
|
activeItemIndex = index;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
+
if (activeItemIndex === index && (child.props.disabled || child.props.muiSkipListHighlight || child.type.muiSkipListHighlight)) {
|
|
200
|
+
activeItemIndex += 1;
|
|
201
|
+
if (activeItemIndex >= children.length) {
|
|
202
|
+
// there are no focusable items within the list.
|
|
203
|
+
activeItemIndex = -1;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
199
206
|
});
|
|
200
207
|
var items = React.Children.map(children, function (child, index) {
|
|
201
208
|
if (index === activeItemIndex) {
|
package/legacy/Modal/Modal.js
CHANGED
|
@@ -2,6 +2,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import ModalUnstyled, { modalUnstyledClasses } from '@mui/base/ModalUnstyled';
|
|
6
7
|
import { isHostComponent, resolveComponentProps } from '@mui/base/utils';
|
|
7
8
|
import { elementAcceptingRef, HTMLElementType } from '@mui/utils';
|
|
@@ -10,9 +11,6 @@ import useThemeProps from '../styles/useThemeProps';
|
|
|
10
11
|
import Backdrop from '../Backdrop';
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
export var modalClasses = modalUnstyledClasses;
|
|
13
|
-
var extendUtilityClasses = function extendUtilityClasses(ownerState) {
|
|
14
|
-
return ownerState.classes;
|
|
15
|
-
};
|
|
16
14
|
var ModalRoot = styled('div', {
|
|
17
15
|
name: 'MuiModal',
|
|
18
16
|
slot: 'Root',
|
|
@@ -66,6 +64,8 @@ var Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
66
64
|
var _props$BackdropCompon = props.BackdropComponent,
|
|
67
65
|
BackdropComponent = _props$BackdropCompon === void 0 ? ModalBackdrop : _props$BackdropCompon,
|
|
68
66
|
BackdropProps = props.BackdropProps,
|
|
67
|
+
classes = props.classes,
|
|
68
|
+
className = props.className,
|
|
69
69
|
_props$closeAfterTran = props.closeAfterTransition,
|
|
70
70
|
closeAfterTransition = _props$closeAfterTran === void 0 ? false : _props$closeAfterTran,
|
|
71
71
|
children = props.children,
|
|
@@ -93,7 +93,7 @@ var Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
93
93
|
slotProps = props.slotProps,
|
|
94
94
|
slots = props.slots,
|
|
95
95
|
theme = props.theme,
|
|
96
|
-
other = _objectWithoutProperties(props, ["BackdropComponent", "BackdropProps", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "slotProps", "slots", "theme"]);
|
|
96
|
+
other = _objectWithoutProperties(props, ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "slotProps", "slots", "theme"]);
|
|
97
97
|
var _React$useState = React.useState(true),
|
|
98
98
|
exited = _React$useState[0],
|
|
99
99
|
setExited = _React$useState[1];
|
|
@@ -111,7 +111,6 @@ var Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
111
111
|
var ownerState = _extends({}, props, commonProps, {
|
|
112
112
|
exited: exited
|
|
113
113
|
});
|
|
114
|
-
var classes = extendUtilityClasses(ownerState);
|
|
115
114
|
var RootSlot = (_ref2 = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components.Root) != null ? _ref2 : ModalRoot;
|
|
116
115
|
var BackdropSlot = (_ref3 = (_slots$backdrop = slots == null ? void 0 : slots.backdrop) != null ? _slots$backdrop : components.Backdrop) != null ? _ref3 : BackdropComponent;
|
|
117
116
|
var rootSlotProps = (_slotProps$root = slotProps == null ? void 0 : slotProps.root) != null ? _slotProps$root : componentsProps.root;
|
|
@@ -126,10 +125,14 @@ var Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
126
125
|
return _extends({}, resolveComponentProps(rootSlotProps, ownerState), !isHostComponent(RootSlot) && {
|
|
127
126
|
as: component,
|
|
128
127
|
theme: theme
|
|
128
|
+
}, {
|
|
129
|
+
className: clsx(className, rootSlotProps == null ? void 0 : rootSlotProps.className, classes == null ? void 0 : classes.root, !ownerState.open && ownerState.exited && (classes == null ? void 0 : classes.hidden))
|
|
129
130
|
});
|
|
130
131
|
},
|
|
131
132
|
backdrop: function backdrop() {
|
|
132
|
-
return _extends({}, BackdropProps, resolveComponentProps(backdropSlotProps, ownerState)
|
|
133
|
+
return _extends({}, BackdropProps, resolveComponentProps(backdropSlotProps, ownerState), {
|
|
134
|
+
className: clsx(backdropSlotProps == null ? void 0 : backdropSlotProps.className, classes == null ? void 0 : classes.backdrop)
|
|
135
|
+
});
|
|
133
136
|
}
|
|
134
137
|
},
|
|
135
138
|
onTransitionEnter: function onTransitionEnter() {
|
|
@@ -139,9 +142,7 @@ var Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
139
142
|
return setExited(true);
|
|
140
143
|
},
|
|
141
144
|
ref: ref
|
|
142
|
-
}, other, {
|
|
143
|
-
classes: classes
|
|
144
|
-
}, commonProps, {
|
|
145
|
+
}, other, commonProps, {
|
|
145
146
|
children: children
|
|
146
147
|
}));
|
|
147
148
|
});
|
|
@@ -178,6 +179,10 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes /* remove-proptypes */ =
|
|
|
178
179
|
* Override or extend the styles applied to the component.
|
|
179
180
|
*/
|
|
180
181
|
classes: PropTypes.object,
|
|
182
|
+
/**
|
|
183
|
+
* @ignore
|
|
184
|
+
*/
|
|
185
|
+
className: PropTypes.string,
|
|
181
186
|
/**
|
|
182
187
|
* When set to true the Modal waits until a nested Transition is completed before closing.
|
|
183
188
|
* @default false
|
|
@@ -161,7 +161,7 @@ var OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps
|
|
|
161
161
|
ownerState: ownerState,
|
|
162
162
|
className: classes.notchedOutline,
|
|
163
163
|
label: label != null && label !== '' && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
164
|
-
children: [label, "\
|
|
164
|
+
children: [label, "\u2009", '*']
|
|
165
165
|
})) : label,
|
|
166
166
|
notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
|
|
167
167
|
});
|
package/legacy/Rating/Rating.js
CHANGED
|
@@ -44,7 +44,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
44
44
|
emptyValueFocused = ownerState.emptyValueFocused,
|
|
45
45
|
focusVisible = ownerState.focusVisible;
|
|
46
46
|
var slots = {
|
|
47
|
-
root: ['root', "size".concat(capitalize(size)), disabled && 'disabled', focusVisible && 'focusVisible', readOnly && '
|
|
47
|
+
root: ['root', "size".concat(capitalize(size)), disabled && 'disabled', focusVisible && 'focusVisible', readOnly && 'readOnly'],
|
|
48
48
|
label: ['label', 'pristine'],
|
|
49
49
|
labelEmptyValue: [emptyValueFocused && 'labelEmptyValueActive'],
|
|
50
50
|
icon: ['icon'],
|
|
@@ -459,7 +459,7 @@ var Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
|
|
|
459
459
|
ref: handleRef,
|
|
460
460
|
onMouseMove: handleMouseMove,
|
|
461
461
|
onMouseLeave: handleMouseLeave,
|
|
462
|
-
className: clsx(classes.root, className),
|
|
462
|
+
className: clsx(classes.root, className, readOnly && 'MuiRating-readOnly'),
|
|
463
463
|
ownerState: ownerState,
|
|
464
464
|
role: readOnly ? 'img' : null,
|
|
465
465
|
"aria-label": readOnly ? getLabelText(value) : null
|
|
@@ -336,8 +336,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
336
336
|
computeDisplay = true;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
var items = childrenArray.map(function (child
|
|
340
|
-
var _arr$, _arr$$props, _arr$2, _arr$2$props;
|
|
339
|
+
var items = childrenArray.map(function (child) {
|
|
341
340
|
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
342
341
|
return null;
|
|
343
342
|
}
|
|
@@ -366,25 +365,6 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
366
365
|
if (selected) {
|
|
367
366
|
foundMatch = true;
|
|
368
367
|
}
|
|
369
|
-
if (child.props.value === undefined) {
|
|
370
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
371
|
-
'aria-readonly': true,
|
|
372
|
-
role: 'option'
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
var isFirstSelectableElement = function isFirstSelectableElement() {
|
|
376
|
-
if (value) {
|
|
377
|
-
return selected;
|
|
378
|
-
}
|
|
379
|
-
var firstSelectableElement = arr.find(function (item) {
|
|
380
|
-
var _item$props;
|
|
381
|
-
return (item == null ? void 0 : (_item$props = item.props) == null ? void 0 : _item$props.value) !== undefined && item.props.disabled !== true;
|
|
382
|
-
});
|
|
383
|
-
if (child === firstSelectableElement) {
|
|
384
|
-
return true;
|
|
385
|
-
}
|
|
386
|
-
return selected;
|
|
387
|
-
};
|
|
388
368
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
389
369
|
'aria-selected': selected ? 'true' : 'false',
|
|
390
370
|
onClick: handleItemClick(child),
|
|
@@ -400,7 +380,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
400
380
|
}
|
|
401
381
|
},
|
|
402
382
|
role: 'option',
|
|
403
|
-
selected:
|
|
383
|
+
selected: selected,
|
|
404
384
|
value: undefined,
|
|
405
385
|
// The value is most likely not a valid HTML attribute.
|
|
406
386
|
'data-value': child.props.value // Instead, we provide it as a data attribute.
|
package/legacy/Slider/Slider.js
CHANGED
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { chainPropTypes } from '@mui/utils';
|
|
8
8
|
import { isHostComponent, useSlotProps, unstable_composeClasses as composeClasses } from '@mui/base';
|
|
9
|
-
import {
|
|
9
|
+
import useSlider, { valueToPercent } from '@mui/base/useSlider';
|
|
10
10
|
import { alpha, lighten, darken } from '@mui/system';
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
12
|
import styled, { slotShouldForwardProp } from '../styles/styled';
|
|
@@ -17,9 +17,6 @@ import SliderValueLabel from './SliderValueLabel';
|
|
|
17
17
|
import sliderClasses, { getSliderUtilityClass } from './sliderClasses';
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
var valueToPercent = function valueToPercent(value, min, max) {
|
|
21
|
-
return (value - min) * 100 / (max - min);
|
|
22
|
-
};
|
|
23
20
|
function Identity(x) {
|
|
24
21
|
return x;
|
|
25
22
|
}
|
|
@@ -587,7 +584,8 @@ var Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
587
584
|
elementType: ThumbSlot,
|
|
588
585
|
getSlotProps: getThumbProps,
|
|
589
586
|
externalSlotProps: thumbSlotProps,
|
|
590
|
-
ownerState: _extends({}, ownerState, thumbSlotProps == null ? void 0 : thumbSlotProps.ownerState)
|
|
587
|
+
ownerState: _extends({}, ownerState, thumbSlotProps == null ? void 0 : thumbSlotProps.ownerState),
|
|
588
|
+
className: classes.thumb
|
|
591
589
|
});
|
|
592
590
|
var valueLabelProps = useSlotProps({
|
|
593
591
|
elementType: ValueLabelSlot,
|
|
@@ -604,7 +602,8 @@ var Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
604
602
|
var markLabelProps = useSlotProps({
|
|
605
603
|
elementType: MarkLabelSlot,
|
|
606
604
|
externalSlotProps: markLabelSlotProps,
|
|
607
|
-
ownerState: ownerState
|
|
605
|
+
ownerState: ownerState,
|
|
606
|
+
className: classes.markLabel
|
|
608
607
|
});
|
|
609
608
|
var inputSliderProps = useSlotProps({
|
|
610
609
|
elementType: InputSlot,
|
|
@@ -647,8 +646,10 @@ var Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
647
646
|
var percent = valueToPercent(value, min, max);
|
|
648
647
|
var style = axisProps[axis].offset(percent);
|
|
649
648
|
var ValueLabelComponent = valueLabelDisplay === 'off' ? Forward : ValueLabelSlot;
|
|
650
|
-
return
|
|
651
|
-
|
|
649
|
+
return (
|
|
650
|
+
/*#__PURE__*/
|
|
651
|
+
/* TODO v6: Change component structure. It will help in avoiding the complicated React.cloneElement API added in SliderValueLabel component. Should be: Thumb -> Input, ValueLabel. Follow Joy UI's Slider structure. */
|
|
652
|
+
_jsx(ValueLabelComponent, _extends({}, !isHostComponent(ValueLabelComponent) && {
|
|
652
653
|
valueLabelFormat: valueLabelFormat,
|
|
653
654
|
valueLabelDisplay: valueLabelDisplay,
|
|
654
655
|
value: typeof valueLabelFormat === 'function' ? valueLabelFormat(scale(value), index) : valueLabelFormat,
|
|
@@ -657,8 +658,7 @@ var Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
657
658
|
disabled: disabled
|
|
658
659
|
}, valueLabelProps, {
|
|
659
660
|
children: /*#__PURE__*/_jsx(ThumbSlot, _extends({
|
|
660
|
-
"data-index": index
|
|
661
|
-
"data-focusvisible": focusedThumbIndex === index
|
|
661
|
+
"data-index": index
|
|
662
662
|
}, thumbProps, {
|
|
663
663
|
className: clsx(classes.thumb, thumbProps.className, active === index && classes.active, focusedThumbIndex === index && classes.focusVisible),
|
|
664
664
|
style: _extends({}, style, {
|
|
@@ -673,8 +673,8 @@ var Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
673
673
|
value: values[index]
|
|
674
674
|
}, inputSliderProps))
|
|
675
675
|
}))
|
|
676
|
-
}))
|
|
677
|
-
|
|
676
|
+
}), index)
|
|
677
|
+
);
|
|
678
678
|
})]
|
|
679
679
|
}));
|
|
680
680
|
});
|
|
@@ -715,6 +715,10 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
|
|
|
715
715
|
* Override or extend the styles applied to the component.
|
|
716
716
|
*/
|
|
717
717
|
classes: PropTypes.object,
|
|
718
|
+
/**
|
|
719
|
+
* @ignore
|
|
720
|
+
*/
|
|
721
|
+
className: PropTypes.string,
|
|
718
722
|
/**
|
|
719
723
|
* The color of the component.
|
|
720
724
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
@@ -3,13 +3,12 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import
|
|
7
|
-
import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
6
|
+
import { unstable_composeClasses as composeClasses, useSlotProps } from '@mui/base';
|
|
8
7
|
import ClickAwayListener from '@mui/base/ClickAwayListener';
|
|
8
|
+
import useSnackbar from '@mui/base/useSnackbar';
|
|
9
9
|
import styled from '../styles/styled';
|
|
10
10
|
import useTheme from '../styles/useTheme';
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
|
-
import useEventCallback from '../utils/useEventCallback';
|
|
13
12
|
import capitalize from '../utils/capitalize';
|
|
14
13
|
import Grow from '../Grow';
|
|
15
14
|
import SnackbarContent from '../SnackbarContent';
|
|
@@ -114,78 +113,28 @@ var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
114
113
|
anchorOrigin: {
|
|
115
114
|
vertical: vertical,
|
|
116
115
|
horizontal: horizontal
|
|
117
|
-
}
|
|
116
|
+
},
|
|
117
|
+
autoHideDuration: autoHideDuration,
|
|
118
|
+
disableWindowBlurListener: disableWindowBlurListener,
|
|
119
|
+
TransitionComponent: TransitionComponent,
|
|
120
|
+
transitionDuration: transitionDuration
|
|
118
121
|
});
|
|
119
122
|
var classes = useUtilityClasses(ownerState);
|
|
120
|
-
var
|
|
123
|
+
var _useSnackbar = useSnackbar(_extends({}, ownerState, {
|
|
124
|
+
ref: ref
|
|
125
|
+
})),
|
|
126
|
+
getRootProps = _useSnackbar.getRootProps,
|
|
127
|
+
onClickAway = _useSnackbar.onClickAway;
|
|
121
128
|
var _React$useState = React.useState(true),
|
|
122
129
|
exited = _React$useState[0],
|
|
123
130
|
setExited = _React$useState[1];
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
131
|
+
var rootProps = useSlotProps({
|
|
132
|
+
elementType: SnackbarRoot,
|
|
133
|
+
getSlotProps: getRootProps,
|
|
134
|
+
externalForwardedProps: other,
|
|
135
|
+
ownerState: ownerState,
|
|
136
|
+
className: [classes.root, className]
|
|
128
137
|
});
|
|
129
|
-
var setAutoHideTimer = useEventCallback(function (autoHideDurationParam) {
|
|
130
|
-
if (!onClose || autoHideDurationParam == null) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
clearTimeout(timerAutoHide.current);
|
|
134
|
-
timerAutoHide.current = setTimeout(function () {
|
|
135
|
-
handleClose(null, 'timeout');
|
|
136
|
-
}, autoHideDurationParam);
|
|
137
|
-
});
|
|
138
|
-
React.useEffect(function () {
|
|
139
|
-
if (open) {
|
|
140
|
-
setAutoHideTimer(autoHideDuration);
|
|
141
|
-
}
|
|
142
|
-
return function () {
|
|
143
|
-
clearTimeout(timerAutoHide.current);
|
|
144
|
-
};
|
|
145
|
-
}, [open, autoHideDuration, setAutoHideTimer]);
|
|
146
|
-
|
|
147
|
-
// Pause the timer when the user is interacting with the Snackbar
|
|
148
|
-
// or when the user hide the window.
|
|
149
|
-
var handlePause = function handlePause() {
|
|
150
|
-
clearTimeout(timerAutoHide.current);
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
// Restart the timer when the user is no longer interacting with the Snackbar
|
|
154
|
-
// or when the window is shown back.
|
|
155
|
-
var handleResume = React.useCallback(function () {
|
|
156
|
-
if (autoHideDuration != null) {
|
|
157
|
-
setAutoHideTimer(resumeHideDuration != null ? resumeHideDuration : autoHideDuration * 0.5);
|
|
158
|
-
}
|
|
159
|
-
}, [autoHideDuration, resumeHideDuration, setAutoHideTimer]);
|
|
160
|
-
var handleFocus = function handleFocus(event) {
|
|
161
|
-
if (onFocus) {
|
|
162
|
-
onFocus(event);
|
|
163
|
-
}
|
|
164
|
-
handlePause();
|
|
165
|
-
};
|
|
166
|
-
var handleMouseEnter = function handleMouseEnter(event) {
|
|
167
|
-
if (onMouseEnter) {
|
|
168
|
-
onMouseEnter(event);
|
|
169
|
-
}
|
|
170
|
-
handlePause();
|
|
171
|
-
};
|
|
172
|
-
var handleBlur = function handleBlur(event) {
|
|
173
|
-
if (onBlur) {
|
|
174
|
-
onBlur(event);
|
|
175
|
-
}
|
|
176
|
-
handleResume();
|
|
177
|
-
};
|
|
178
|
-
var handleMouseLeave = function handleMouseLeave(event) {
|
|
179
|
-
if (onMouseLeave) {
|
|
180
|
-
onMouseLeave(event);
|
|
181
|
-
}
|
|
182
|
-
handleResume();
|
|
183
|
-
};
|
|
184
|
-
var handleClickAway = function handleClickAway(event) {
|
|
185
|
-
if (onClose) {
|
|
186
|
-
onClose(event, 'clickaway');
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
138
|
var handleExited = function handleExited(node) {
|
|
190
139
|
setExited(true);
|
|
191
140
|
if (onExited) {
|
|
@@ -198,63 +147,15 @@ var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
198
147
|
onEnter(node, isAppearing);
|
|
199
148
|
}
|
|
200
149
|
};
|
|
201
|
-
React.useEffect(function () {
|
|
202
|
-
// TODO: window global should be refactored here
|
|
203
|
-
if (!disableWindowBlurListener && open) {
|
|
204
|
-
window.addEventListener('focus', handleResume);
|
|
205
|
-
window.addEventListener('blur', handlePause);
|
|
206
|
-
return function () {
|
|
207
|
-
window.removeEventListener('focus', handleResume);
|
|
208
|
-
window.removeEventListener('blur', handlePause);
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
return undefined;
|
|
212
|
-
}, [disableWindowBlurListener, handleResume, open]);
|
|
213
|
-
React.useEffect(function () {
|
|
214
|
-
if (!open) {
|
|
215
|
-
return undefined;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @param {KeyboardEvent} nativeEvent
|
|
220
|
-
*/
|
|
221
|
-
function handleKeyDown(nativeEvent) {
|
|
222
|
-
if (!nativeEvent.defaultPrevented) {
|
|
223
|
-
// IE11, Edge (prior to using Bink?) use 'Esc'
|
|
224
|
-
if (nativeEvent.key === 'Escape' || nativeEvent.key === 'Esc') {
|
|
225
|
-
// not calling `preventDefault` since we don't know if people may ignore this event e.g. a permanently open snackbar
|
|
226
|
-
if (onClose) {
|
|
227
|
-
onClose(nativeEvent, 'escapeKeyDown');
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
document.addEventListener('keydown', handleKeyDown);
|
|
233
|
-
return function () {
|
|
234
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
235
|
-
};
|
|
236
|
-
}, [exited, open, onClose]);
|
|
237
150
|
|
|
238
151
|
// So we only render active snackbars.
|
|
239
152
|
if (!open && exited) {
|
|
240
153
|
return null;
|
|
241
154
|
}
|
|
242
155
|
return /*#__PURE__*/_jsx(ClickAwayListener, _extends({
|
|
243
|
-
onClickAway:
|
|
156
|
+
onClickAway: onClickAway
|
|
244
157
|
}, ClickAwayListenerProps, {
|
|
245
|
-
children: /*#__PURE__*/_jsx(SnackbarRoot, _extends({
|
|
246
|
-
className: clsx(classes.root, className),
|
|
247
|
-
onBlur: handleBlur,
|
|
248
|
-
onFocus: handleFocus,
|
|
249
|
-
onMouseEnter: handleMouseEnter,
|
|
250
|
-
onMouseLeave: handleMouseLeave,
|
|
251
|
-
ownerState: ownerState,
|
|
252
|
-
ref: ref
|
|
253
|
-
// ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
|
|
254
|
-
// See https://github.com/mui/material-ui/issues/29080
|
|
255
|
-
,
|
|
256
|
-
role: "presentation"
|
|
257
|
-
}, other, {
|
|
158
|
+
children: /*#__PURE__*/_jsx(SnackbarRoot, _extends({}, rootProps, {
|
|
258
159
|
children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
|
|
259
160
|
appear: true,
|
|
260
161
|
in: open,
|