@mui/material 5.15.12 → 5.15.14
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/Alert/Alert.d.ts +2 -2
- package/Autocomplete/Autocomplete.d.ts +1 -1
- package/Autocomplete/Autocomplete.js +117 -82
- package/Autocomplete/autocompleteClasses.d.ts +3 -3
- package/CHANGELOG.md +203 -51
- package/CircularProgress/CircularProgress.d.ts +1 -1
- package/CircularProgress/CircularProgress.js +1 -1
- package/Drawer/Drawer.js +9 -3
- package/Icon/Icon.d.ts +1 -1
- package/Icon/Icon.js +1 -1
- package/LinearProgress/LinearProgress.js +4 -4
- package/Menu/Menu.js +5 -4
- package/MenuList/MenuList.js +4 -2
- package/OverridableComponent.d.ts +1 -1
- package/PaginationItem/PaginationItem.js +3 -3
- package/Popper/Popper.d.ts +3 -26
- package/README.md +2 -2
- package/Rating/Rating.js +3 -3
- package/Select/Select.d.ts +8 -20
- package/Slider/Slider.js +406 -226
- package/SvgIcon/SvgIcon.js +1 -1
- package/Switch/Switch.js +61 -41
- package/TabScrollButton/TabScrollButton.js +2 -3
- package/TablePagination/TablePaginationActions.js +14 -14
- package/Tabs/Tabs.js +3 -2
- package/Tooltip/Tooltip.js +5 -4
- 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 +194 -164
- package/legacy/CircularProgress/CircularProgress.js +1 -1
- package/legacy/Drawer/Drawer.js +8 -3
- package/legacy/Icon/Icon.js +1 -1
- package/legacy/LinearProgress/LinearProgress.js +4 -4
- package/legacy/Menu/Menu.js +5 -4
- package/legacy/MenuList/MenuList.js +3 -2
- package/legacy/PaginationItem/PaginationItem.js +3 -3
- package/legacy/Rating/Rating.js +3 -3
- package/legacy/Slider/Slider.js +375 -194
- package/legacy/SvgIcon/SvgIcon.js +1 -1
- package/legacy/Switch/Switch.js +88 -59
- package/legacy/TabScrollButton/TabScrollButton.js +2 -3
- package/legacy/TablePagination/TablePaginationActions.js +14 -14
- package/legacy/Tabs/Tabs.js +3 -2
- package/legacy/Tooltip/Tooltip.js +7 -3
- package/legacy/index.js +1 -1
- package/legacy/styles/experimental_extendTheme.js +4 -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 +117 -82
- package/modern/CircularProgress/CircularProgress.js +1 -1
- package/modern/Drawer/Drawer.js +9 -3
- package/modern/Icon/Icon.js +1 -1
- package/modern/LinearProgress/LinearProgress.js +4 -4
- package/modern/Menu/Menu.js +5 -4
- package/modern/MenuList/MenuList.js +4 -2
- package/modern/PaginationItem/PaginationItem.js +3 -3
- package/modern/Rating/Rating.js +3 -3
- package/modern/Slider/Slider.js +339 -175
- package/modern/SvgIcon/SvgIcon.js +1 -1
- package/modern/Switch/Switch.js +61 -41
- package/modern/TabScrollButton/TabScrollButton.js +2 -3
- package/modern/TablePagination/TablePaginationActions.js +14 -14
- package/modern/Tabs/Tabs.js +3 -2
- package/modern/Tooltip/Tooltip.js +5 -4
- package/modern/index.js +1 -1
- package/modern/styles/experimental_extendTheme.js +4 -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 +129 -94
- package/node/CircularProgress/CircularProgress.js +1 -1
- package/node/Drawer/Drawer.js +9 -3
- package/node/Icon/Icon.js +1 -1
- package/node/LinearProgress/LinearProgress.js +4 -4
- package/node/Menu/Menu.js +5 -4
- package/node/MenuList/MenuList.js +4 -2
- package/node/PaginationItem/PaginationItem.js +3 -3
- package/node/Rating/Rating.js +3 -3
- package/node/Slider/Slider.js +416 -236
- package/node/SvgIcon/SvgIcon.js +1 -1
- package/node/Switch/Switch.js +66 -46
- package/node/TabScrollButton/TabScrollButton.js +2 -3
- package/node/TablePagination/TablePaginationActions.js +14 -14
- package/node/Tabs/Tabs.js +3 -2
- package/node/Tooltip/Tooltip.js +5 -4
- package/node/index.js +1 -1
- package/node/styles/experimental_extendTheme.js +4 -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/experimental_extendTheme.d.ts +1 -0
- package/styles/experimental_extendTheme.js +4 -1
- 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 +1048 -738
- package/umd/material-ui.production.min.js +2 -2
- package/usePagination/usePagination.js +1 -1
package/modern/Switch/Switch.js
CHANGED
|
@@ -12,11 +12,11 @@ import composeClasses from '@mui/utils/composeClasses';
|
|
|
12
12
|
import { alpha, darken, lighten } from '@mui/system/colorManipulator';
|
|
13
13
|
import capitalize from '../utils/capitalize';
|
|
14
14
|
import SwitchBase from '../internal/SwitchBase';
|
|
15
|
-
import
|
|
16
|
-
import styled from '../styles/styled';
|
|
15
|
+
import { styled, createUseThemeProps } from '../zero-styled';
|
|
17
16
|
import switchClasses, { getSwitchUtilityClass } from './switchClasses';
|
|
18
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
const useThemeProps = createUseThemeProps('MuiSwitch');
|
|
20
20
|
const useUtilityClasses = ownerState => {
|
|
21
21
|
const {
|
|
22
22
|
classes,
|
|
@@ -45,9 +45,7 @@ const SwitchRoot = styled('span', {
|
|
|
45
45
|
} = props;
|
|
46
46
|
return [styles.root, ownerState.edge && styles[`edge${capitalize(ownerState.edge)}`], styles[`size${capitalize(ownerState.size)}`]];
|
|
47
47
|
}
|
|
48
|
-
})(
|
|
49
|
-
ownerState
|
|
50
|
-
}) => _extends({
|
|
48
|
+
})({
|
|
51
49
|
display: 'inline-flex',
|
|
52
50
|
width: 34 + 12 * 2,
|
|
53
51
|
height: 14 + 12 * 2,
|
|
@@ -62,26 +60,42 @@ const SwitchRoot = styled('span', {
|
|
|
62
60
|
// For correct alignment with the text.
|
|
63
61
|
'@media print': {
|
|
64
62
|
colorAdjust: 'exact'
|
|
65
|
-
}
|
|
66
|
-
}, ownerState.edge === 'start' && {
|
|
67
|
-
marginLeft: -8
|
|
68
|
-
}, ownerState.edge === 'end' && {
|
|
69
|
-
marginRight: -8
|
|
70
|
-
}, ownerState.size === 'small' && {
|
|
71
|
-
width: 40,
|
|
72
|
-
height: 24,
|
|
73
|
-
padding: 7,
|
|
74
|
-
[`& .${switchClasses.thumb}`]: {
|
|
75
|
-
width: 16,
|
|
76
|
-
height: 16
|
|
77
63
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
64
|
+
variants: [{
|
|
65
|
+
props: {
|
|
66
|
+
edge: 'start'
|
|
67
|
+
},
|
|
68
|
+
style: {
|
|
69
|
+
marginLeft: -8
|
|
82
70
|
}
|
|
83
|
-
}
|
|
84
|
-
|
|
71
|
+
}, {
|
|
72
|
+
props: {
|
|
73
|
+
edge: 'end'
|
|
74
|
+
},
|
|
75
|
+
style: {
|
|
76
|
+
marginRight: -8
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
props: {
|
|
80
|
+
size: 'small'
|
|
81
|
+
},
|
|
82
|
+
style: {
|
|
83
|
+
width: 40,
|
|
84
|
+
height: 24,
|
|
85
|
+
padding: 7,
|
|
86
|
+
[`& .${switchClasses.thumb}`]: {
|
|
87
|
+
width: 16,
|
|
88
|
+
height: 16
|
|
89
|
+
},
|
|
90
|
+
[`& .${switchClasses.switchBase}`]: {
|
|
91
|
+
padding: 4,
|
|
92
|
+
[`&.${switchClasses.checked}`]: {
|
|
93
|
+
transform: 'translateX(16px)'
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}]
|
|
98
|
+
});
|
|
85
99
|
const SwitchSwitchBase = styled(SwitchBase, {
|
|
86
100
|
name: 'MuiSwitch',
|
|
87
101
|
slot: 'SwitchBase',
|
|
@@ -122,32 +136,38 @@ const SwitchSwitchBase = styled(SwitchBase, {
|
|
|
122
136
|
width: '300%'
|
|
123
137
|
}
|
|
124
138
|
}), ({
|
|
125
|
-
theme
|
|
126
|
-
|
|
127
|
-
}) => _extends({
|
|
139
|
+
theme
|
|
140
|
+
}) => ({
|
|
128
141
|
'&:hover': {
|
|
129
142
|
backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),
|
|
130
143
|
// Reset on touch devices, it doesn't add specificity
|
|
131
144
|
'@media (hover: none)': {
|
|
132
145
|
backgroundColor: 'transparent'
|
|
133
146
|
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
[
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
140
|
-
'@media (hover: none)': {
|
|
141
|
-
backgroundColor: 'transparent'
|
|
142
|
-
}
|
|
147
|
+
},
|
|
148
|
+
variants: [...Object.entries(theme.palette).filter(([, value]) => value.main && value.light) // check all the used fields in the style below
|
|
149
|
+
.map(([color]) => ({
|
|
150
|
+
props: {
|
|
151
|
+
color
|
|
143
152
|
},
|
|
144
|
-
|
|
145
|
-
|
|
153
|
+
style: {
|
|
154
|
+
[`&.${switchClasses.checked}`]: {
|
|
155
|
+
color: (theme.vars || theme).palette[color].main,
|
|
156
|
+
'&:hover': {
|
|
157
|
+
backgroundColor: theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(theme.palette[color].main, theme.palette.action.hoverOpacity),
|
|
158
|
+
'@media (hover: none)': {
|
|
159
|
+
backgroundColor: 'transparent'
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
[`&.${switchClasses.disabled}`]: {
|
|
163
|
+
color: theme.vars ? theme.vars.palette.Switch[`${color}DisabledColor`] : `${theme.palette.mode === 'light' ? lighten(theme.palette[color].main, 0.62) : darken(theme.palette[color].main, 0.55)}`
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
[`&.${switchClasses.checked} + .${switchClasses.track}`]: {
|
|
167
|
+
backgroundColor: (theme.vars || theme).palette[color].main
|
|
168
|
+
}
|
|
146
169
|
}
|
|
147
|
-
}
|
|
148
|
-
[`&.${switchClasses.checked} + .${switchClasses.track}`]: {
|
|
149
|
-
backgroundColor: (theme.vars || theme).palette[ownerState.color].main
|
|
150
|
-
}
|
|
170
|
+
}))]
|
|
151
171
|
}));
|
|
152
172
|
const SwitchTrack = styled('span', {
|
|
153
173
|
name: 'MuiSwitch',
|
|
@@ -9,10 +9,10 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import { useSlotProps } from '@mui/base/utils';
|
|
11
11
|
import composeClasses from '@mui/utils/composeClasses';
|
|
12
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
12
13
|
import KeyboardArrowLeft from '../internal/svg-icons/KeyboardArrowLeft';
|
|
13
14
|
import KeyboardArrowRight from '../internal/svg-icons/KeyboardArrowRight';
|
|
14
15
|
import ButtonBase from '../ButtonBase';
|
|
15
|
-
import useTheme from '../styles/useTheme';
|
|
16
16
|
import useThemeProps from '../styles/useThemeProps';
|
|
17
17
|
import styled from '../styles/styled';
|
|
18
18
|
import tabScrollButtonClasses, { getTabScrollButtonUtilityClass } from './tabScrollButtonClasses';
|
|
@@ -65,8 +65,7 @@ const TabScrollButton = /*#__PURE__*/React.forwardRef(function TabScrollButton(i
|
|
|
65
65
|
direction
|
|
66
66
|
} = props,
|
|
67
67
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
68
|
-
const
|
|
69
|
-
const isRtl = theme.direction === 'rtl';
|
|
68
|
+
const isRtl = useRtl();
|
|
70
69
|
const ownerState = _extends({
|
|
71
70
|
isRtl
|
|
72
71
|
}, props);
|
|
@@ -5,9 +5,9 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["backIconButtonProps", "count", "disabled", "getItemAriaLabel", "nextIconButtonProps", "onPageChange", "page", "rowsPerPage", "showFirstButton", "showLastButton", "slots", "slotProps"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
8
9
|
import KeyboardArrowLeft from '../internal/svg-icons/KeyboardArrowLeft';
|
|
9
10
|
import KeyboardArrowRight from '../internal/svg-icons/KeyboardArrowRight';
|
|
10
|
-
import useTheme from '../styles/useTheme';
|
|
11
11
|
import IconButton from '../IconButton';
|
|
12
12
|
import LastPageIconDefault from '../internal/svg-icons/LastPage';
|
|
13
13
|
import FirstPageIconDefault from '../internal/svg-icons/FirstPage';
|
|
@@ -33,7 +33,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
33
33
|
slotProps = {}
|
|
34
34
|
} = props,
|
|
35
35
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
36
|
-
const
|
|
36
|
+
const isRtl = useRtl();
|
|
37
37
|
const handleFirstPageButtonClick = event => {
|
|
38
38
|
onPageChange(event, 0);
|
|
39
39
|
};
|
|
@@ -54,14 +54,14 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
54
54
|
const LastButtonIcon = slots.lastButtonIcon ?? LastPageIconDefault;
|
|
55
55
|
const NextButtonIcon = slots.nextButtonIcon ?? KeyboardArrowRight;
|
|
56
56
|
const PreviousButtonIcon = slots.previousButtonIcon ?? KeyboardArrowLeft;
|
|
57
|
-
const FirstButtonSlot =
|
|
58
|
-
const PreviousButtonSlot =
|
|
59
|
-
const NextButtonSlot =
|
|
60
|
-
const LastButtonSlot =
|
|
61
|
-
const firstButtonSlotProps =
|
|
62
|
-
const previousButtonSlotProps =
|
|
63
|
-
const nextButtonSlotProps =
|
|
64
|
-
const lastButtonSlotProps =
|
|
57
|
+
const FirstButtonSlot = isRtl ? LastButton : FirstButton;
|
|
58
|
+
const PreviousButtonSlot = isRtl ? NextButton : PreviousButton;
|
|
59
|
+
const NextButtonSlot = isRtl ? PreviousButton : NextButton;
|
|
60
|
+
const LastButtonSlot = isRtl ? FirstButton : LastButton;
|
|
61
|
+
const firstButtonSlotProps = isRtl ? slotProps.lastButton : slotProps.firstButton;
|
|
62
|
+
const previousButtonSlotProps = isRtl ? slotProps.nextButton : slotProps.previousButton;
|
|
63
|
+
const nextButtonSlotProps = isRtl ? slotProps.previousButton : slotProps.nextButton;
|
|
64
|
+
const lastButtonSlotProps = isRtl ? slotProps.firstButton : slotProps.lastButton;
|
|
65
65
|
return /*#__PURE__*/_jsxs("div", _extends({
|
|
66
66
|
ref: ref
|
|
67
67
|
}, other, {
|
|
@@ -71,7 +71,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
71
71
|
"aria-label": getItemAriaLabel('first', page),
|
|
72
72
|
title: getItemAriaLabel('first', page)
|
|
73
73
|
}, firstButtonSlotProps, {
|
|
74
|
-
children:
|
|
74
|
+
children: isRtl ? /*#__PURE__*/_jsx(LastButtonIcon, _extends({}, slotProps.lastButtonIcon)) : /*#__PURE__*/_jsx(FirstButtonIcon, _extends({}, slotProps.firstButtonIcon))
|
|
75
75
|
})), /*#__PURE__*/_jsx(PreviousButtonSlot, _extends({
|
|
76
76
|
onClick: handleBackButtonClick,
|
|
77
77
|
disabled: disabled || page === 0,
|
|
@@ -79,7 +79,7 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
79
79
|
"aria-label": getItemAriaLabel('previous', page),
|
|
80
80
|
title: getItemAriaLabel('previous', page)
|
|
81
81
|
}, previousButtonSlotProps ?? backIconButtonProps, {
|
|
82
|
-
children:
|
|
82
|
+
children: isRtl ? /*#__PURE__*/_jsx(NextButtonIcon, _extends({}, slotProps.nextButtonIcon)) : /*#__PURE__*/_jsx(PreviousButtonIcon, _extends({}, slotProps.previousButtonIcon))
|
|
83
83
|
})), /*#__PURE__*/_jsx(NextButtonSlot, _extends({
|
|
84
84
|
onClick: handleNextButtonClick,
|
|
85
85
|
disabled: disabled || (count !== -1 ? page >= Math.ceil(count / rowsPerPage) - 1 : false),
|
|
@@ -87,14 +87,14 @@ const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePagin
|
|
|
87
87
|
"aria-label": getItemAriaLabel('next', page),
|
|
88
88
|
title: getItemAriaLabel('next', page)
|
|
89
89
|
}, nextButtonSlotProps ?? nextIconButtonProps, {
|
|
90
|
-
children:
|
|
90
|
+
children: isRtl ? /*#__PURE__*/_jsx(PreviousButtonIcon, _extends({}, slotProps.previousButtonIcon)) : /*#__PURE__*/_jsx(NextButtonIcon, _extends({}, slotProps.nextButtonIcon))
|
|
91
91
|
})), showLastButton && /*#__PURE__*/_jsx(LastButtonSlot, _extends({
|
|
92
92
|
onClick: handleLastPageButtonClick,
|
|
93
93
|
disabled: disabled || page >= Math.ceil(count / rowsPerPage) - 1,
|
|
94
94
|
"aria-label": getItemAriaLabel('last', page),
|
|
95
95
|
title: getItemAriaLabel('last', page)
|
|
96
96
|
}, lastButtonSlotProps, {
|
|
97
|
-
children:
|
|
97
|
+
children: isRtl ? /*#__PURE__*/_jsx(FirstButtonIcon, _extends({}, slotProps.firstButtonIcon)) : /*#__PURE__*/_jsx(LastButtonIcon, _extends({}, slotProps.lastButtonIcon))
|
|
98
98
|
}))]
|
|
99
99
|
}));
|
|
100
100
|
});
|
package/modern/Tabs/Tabs.js
CHANGED
|
@@ -10,6 +10,7 @@ import clsx from 'clsx';
|
|
|
10
10
|
import refType from '@mui/utils/refType';
|
|
11
11
|
import { useSlotProps } from '@mui/base/utils';
|
|
12
12
|
import composeClasses from '@mui/utils/composeClasses';
|
|
13
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
13
14
|
import styled from '../styles/styled';
|
|
14
15
|
import useThemeProps from '../styles/useThemeProps';
|
|
15
16
|
import useTheme from '../styles/useTheme';
|
|
@@ -209,7 +210,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
209
210
|
name: 'MuiTabs'
|
|
210
211
|
});
|
|
211
212
|
const theme = useTheme();
|
|
212
|
-
const isRtl =
|
|
213
|
+
const isRtl = useRtl();
|
|
213
214
|
const {
|
|
214
215
|
'aria-label': ariaLabel,
|
|
215
216
|
'aria-labelledby': ariaLabelledBy,
|
|
@@ -297,7 +298,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
|
|
|
297
298
|
clientWidth: tabsNode.clientWidth,
|
|
298
299
|
scrollLeft: tabsNode.scrollLeft,
|
|
299
300
|
scrollTop: tabsNode.scrollTop,
|
|
300
|
-
scrollLeftNormalized: getNormalizedScrollLeft(tabsNode,
|
|
301
|
+
scrollLeftNormalized: getNormalizedScrollLeft(tabsNode, isRtl ? 'rtl' : 'ltr'),
|
|
301
302
|
scrollWidth: tabsNode.scrollWidth,
|
|
302
303
|
top: rect.top,
|
|
303
304
|
bottom: rect.bottom,
|
|
@@ -11,6 +11,7 @@ import elementAcceptingRef from '@mui/utils/elementAcceptingRef';
|
|
|
11
11
|
import { appendOwnerState } from '@mui/base/utils';
|
|
12
12
|
import composeClasses from '@mui/utils/composeClasses';
|
|
13
13
|
import { alpha } from '@mui/system/colorManipulator';
|
|
14
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
14
15
|
import styled from '../styles/styled';
|
|
15
16
|
import useTheme from '../styles/useTheme';
|
|
16
17
|
import useThemeProps from '../styles/useThemeProps';
|
|
@@ -206,11 +207,11 @@ export function testReset() {
|
|
|
206
207
|
hystersisTimer.clear();
|
|
207
208
|
}
|
|
208
209
|
function composeEventHandler(handler, eventHandler) {
|
|
209
|
-
return event => {
|
|
210
|
+
return (event, ...params) => {
|
|
210
211
|
if (eventHandler) {
|
|
211
|
-
eventHandler(event);
|
|
212
|
+
eventHandler(event, ...params);
|
|
212
213
|
}
|
|
213
|
-
handler(event);
|
|
214
|
+
handler(event, ...params);
|
|
214
215
|
};
|
|
215
216
|
}
|
|
216
217
|
|
|
@@ -256,7 +257,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
256
257
|
children: childrenProp
|
|
257
258
|
});
|
|
258
259
|
const theme = useTheme();
|
|
259
|
-
const isRtl =
|
|
260
|
+
const isRtl = useRtl();
|
|
260
261
|
const [childNode, setChildNode] = React.useState();
|
|
261
262
|
const [arrowRef, setArrowRef] = React.useState(null);
|
|
262
263
|
const ignoreNonTouchEvents = React.useRef(false);
|
package/modern/index.js
CHANGED
|
@@ -38,7 +38,7 @@ function setColorChannel(obj, key) {
|
|
|
38
38
|
if (!(`${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[`${key}Channel`] = safeColorChannel(toRgb(obj[key]), `MUI: Can't create \`palette.${key}Channel\` because \`palette.${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.${key}Channel\` as a string (in rgb format,
|
|
41
|
+
obj[`${key}Channel`] = safeColorChannel(toRgb(obj[key]), `MUI: Can't create \`palette.${key}Channel\` because \`palette.${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.${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
|
const silent = fn => {
|
|
@@ -244,6 +244,9 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
244
244
|
|
|
245
245
|
// MUI X - DataGrid needs this token.
|
|
246
246
|
setColorChannel(palette.background, 'default');
|
|
247
|
+
|
|
248
|
+
// added for consistency with the `background.default` token
|
|
249
|
+
setColorChannel(palette.background, 'paper');
|
|
247
250
|
setColorChannel(palette.common, 'background');
|
|
248
251
|
setColorChannel(palette.common, 'onBackground');
|
|
249
252
|
setColorChannel(palette, 'divider');
|
package/modern/styles/styled.js
CHANGED
|
@@ -1,10 +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
|
-
export
|
|
6
|
+
import rootShouldForwardProp from './rootShouldForwardProp';
|
|
7
|
+
export { default as slotShouldForwardProp } from './slotShouldForwardProp';
|
|
8
|
+
export { default as rootShouldForwardProp } from './rootShouldForwardProp';
|
|
8
9
|
const styled = createStyled({
|
|
9
10
|
themeId: THEME_ID,
|
|
10
11
|
defaultTheme,
|
|
@@ -61,7 +61,7 @@ export default function usePagination(props = {}) {
|
|
|
61
61
|
endPages.length > 0 ? endPages[0] - 2 : count - 1);
|
|
62
62
|
|
|
63
63
|
// Basic list of items to render
|
|
64
|
-
//
|
|
64
|
+
// for example itemList = ['first', 'previous', 1, 'ellipsis', 4, 5, 6, 'ellipsis', 10, 'next', 'last']
|
|
65
65
|
const itemList = [...(showFirstButton ? ['first'] : []), ...(hidePrevButton ? [] : ['previous']), ...startPages,
|
|
66
66
|
// Start ellipsis
|
|
67
67
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -6,16 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _reactIs = require("react-is");
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
15
15
|
var _chainPropTypes = _interopRequireDefault(require("@mui/utils/chainPropTypes"));
|
|
16
16
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
17
|
-
var
|
|
18
|
-
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
17
|
+
var _zeroStyled = require("../zero-styled");
|
|
19
18
|
var _Collapse = _interopRequireDefault(require("../Collapse"));
|
|
20
19
|
var _Paper = _interopRequireDefault(require("../Paper"));
|
|
21
20
|
var _AccordionContext = _interopRequireDefault(require("./AccordionContext"));
|
|
@@ -26,6 +25,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
26
25
|
const _excluded = ["children", "className", "defaultExpanded", "disabled", "disableGutters", "expanded", "onChange", "square", "slots", "slotProps", "TransitionComponent", "TransitionProps"];
|
|
27
26
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
28
27
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
28
|
+
const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiAccordion');
|
|
29
29
|
const useUtilityClasses = ownerState => {
|
|
30
30
|
const {
|
|
31
31
|
classes,
|
|
@@ -40,7 +40,7 @@ const useUtilityClasses = ownerState => {
|
|
|
40
40
|
};
|
|
41
41
|
return (0, _composeClasses.default)(slots, _accordionClasses.getAccordionUtilityClass, classes);
|
|
42
42
|
};
|
|
43
|
-
const AccordionRoot = (0,
|
|
43
|
+
const AccordionRoot = (0, _zeroStyled.styled)(_Paper.default, {
|
|
44
44
|
name: 'MuiAccordion',
|
|
45
45
|
slot: 'Root',
|
|
46
46
|
overridesResolver: (props, styles) => {
|
|
@@ -99,30 +99,37 @@ const AccordionRoot = (0, _styled.default)(_Paper.default, {
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
}, ({
|
|
102
|
-
theme
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
102
|
+
theme
|
|
103
|
+
}) => ({
|
|
104
|
+
variants: [{
|
|
105
|
+
props: props => !props.square,
|
|
106
|
+
style: {
|
|
107
|
+
borderRadius: 0,
|
|
108
|
+
'&:first-of-type': {
|
|
109
|
+
borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,
|
|
110
|
+
borderTopRightRadius: (theme.vars || theme).shape.borderRadius
|
|
111
|
+
},
|
|
112
|
+
'&:last-of-type': {
|
|
113
|
+
borderBottomLeftRadius: (theme.vars || theme).shape.borderRadius,
|
|
114
|
+
borderBottomRightRadius: (theme.vars || theme).shape.borderRadius,
|
|
115
|
+
// Fix a rendering issue on Edge
|
|
116
|
+
'@supports (-ms-ime-align: auto)': {
|
|
117
|
+
borderBottomLeftRadius: 0,
|
|
118
|
+
borderBottomRightRadius: 0
|
|
119
|
+
}
|
|
120
|
+
}
|
|
117
121
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
}, {
|
|
123
|
+
props: props => !props.disableGutters,
|
|
124
|
+
style: {
|
|
125
|
+
[`&.${_accordionClasses.default.expanded}`]: {
|
|
126
|
+
margin: '16px 0'
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}]
|
|
123
130
|
}));
|
|
124
131
|
const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
|
|
125
|
-
const props = (
|
|
132
|
+
const props = useThemeProps({
|
|
126
133
|
props: inProps,
|
|
127
134
|
name: 'MuiAccordion'
|
|
128
135
|
});
|
|
@@ -6,19 +6,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
14
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
|
-
var
|
|
16
|
-
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
15
|
+
var _zeroStyled = require("../zero-styled");
|
|
17
16
|
var _accordionActionsClasses = require("./accordionActionsClasses");
|
|
18
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
18
|
const _excluded = ["className", "disableSpacing"];
|
|
20
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
+
const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiAccordionActions');
|
|
22
22
|
const useUtilityClasses = ownerState => {
|
|
23
23
|
const {
|
|
24
24
|
classes,
|
|
@@ -29,7 +29,7 @@ const useUtilityClasses = ownerState => {
|
|
|
29
29
|
};
|
|
30
30
|
return (0, _composeClasses.default)(slots, _accordionActionsClasses.getAccordionActionsUtilityClass, classes);
|
|
31
31
|
};
|
|
32
|
-
const AccordionActionsRoot = (0,
|
|
32
|
+
const AccordionActionsRoot = (0, _zeroStyled.styled)('div', {
|
|
33
33
|
name: 'MuiAccordionActions',
|
|
34
34
|
slot: 'Root',
|
|
35
35
|
overridesResolver: (props, styles) => {
|
|
@@ -38,20 +38,22 @@ const AccordionActionsRoot = (0, _styled.default)('div', {
|
|
|
38
38
|
} = props;
|
|
39
39
|
return [styles.root, !ownerState.disableSpacing && styles.spacing];
|
|
40
40
|
}
|
|
41
|
-
})(
|
|
42
|
-
ownerState
|
|
43
|
-
}) => (0, _extends2.default)({
|
|
41
|
+
})({
|
|
44
42
|
display: 'flex',
|
|
45
43
|
alignItems: 'center',
|
|
46
44
|
padding: 8,
|
|
47
|
-
justifyContent: 'flex-end'
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
justifyContent: 'flex-end',
|
|
46
|
+
variants: [{
|
|
47
|
+
props: props => !props.disableSpacing,
|
|
48
|
+
style: {
|
|
49
|
+
'& > :not(style) ~ :not(style)': {
|
|
50
|
+
marginLeft: 8
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}]
|
|
54
|
+
});
|
|
53
55
|
const AccordionActions = /*#__PURE__*/React.forwardRef(function AccordionActions(inProps, ref) {
|
|
54
|
-
const props = (
|
|
56
|
+
const props = useThemeProps({
|
|
55
57
|
props: inProps,
|
|
56
58
|
name: 'MuiAccordionActions'
|
|
57
59
|
});
|
|
@@ -12,13 +12,13 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
14
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
|
-
var
|
|
16
|
-
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
15
|
+
var _zeroStyled = require("../zero-styled");
|
|
17
16
|
var _accordionDetailsClasses = require("./accordionDetailsClasses");
|
|
18
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
18
|
const _excluded = ["className"];
|
|
20
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
+
const useThemeProps = (0, _zeroStyled.createUseThemeProps)('MuiAccordionDetails');
|
|
22
22
|
const useUtilityClasses = ownerState => {
|
|
23
23
|
const {
|
|
24
24
|
classes
|
|
@@ -28,7 +28,7 @@ const useUtilityClasses = ownerState => {
|
|
|
28
28
|
};
|
|
29
29
|
return (0, _composeClasses.default)(slots, _accordionDetailsClasses.getAccordionDetailsUtilityClass, classes);
|
|
30
30
|
};
|
|
31
|
-
const AccordionDetailsRoot = (0,
|
|
31
|
+
const AccordionDetailsRoot = (0, _zeroStyled.styled)('div', {
|
|
32
32
|
name: 'MuiAccordionDetails',
|
|
33
33
|
slot: 'Root',
|
|
34
34
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -38,7 +38,7 @@ const AccordionDetailsRoot = (0, _styled.default)('div', {
|
|
|
38
38
|
padding: theme.spacing(1, 2, 2)
|
|
39
39
|
}));
|
|
40
40
|
const AccordionDetails = /*#__PURE__*/React.forwardRef(function AccordionDetails(inProps, ref) {
|
|
41
|
-
const props = (
|
|
41
|
+
const props = useThemeProps({
|
|
42
42
|
props: inProps,
|
|
43
43
|
name: 'MuiAccordionDetails'
|
|
44
44
|
});
|