@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
|
@@ -16,8 +16,8 @@ import clsx from 'clsx';
|
|
|
16
16
|
import composeClasses from '@mui/utils/composeClasses';
|
|
17
17
|
import { keyframes, css } from '@mui/system';
|
|
18
18
|
import { darken, lighten } from '@mui/system/colorManipulator';
|
|
19
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
19
20
|
import capitalize from '../utils/capitalize';
|
|
20
|
-
import useTheme from '../styles/useTheme';
|
|
21
21
|
import styled from '../styles/styled';
|
|
22
22
|
import useThemeProps from '../styles/useThemeProps';
|
|
23
23
|
import { getLinearProgressUtilityClass } from './linearProgressClasses';
|
|
@@ -255,7 +255,7 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
|
|
|
255
255
|
variant
|
|
256
256
|
});
|
|
257
257
|
const classes = useUtilityClasses(ownerState);
|
|
258
|
-
const
|
|
258
|
+
const isRtl = useRtl();
|
|
259
259
|
const rootProps = {};
|
|
260
260
|
const inlineStyles = {
|
|
261
261
|
bar1: {},
|
|
@@ -267,7 +267,7 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
|
|
|
267
267
|
rootProps['aria-valuemin'] = 0;
|
|
268
268
|
rootProps['aria-valuemax'] = 100;
|
|
269
269
|
let transform = value - 100;
|
|
270
|
-
if (
|
|
270
|
+
if (isRtl) {
|
|
271
271
|
transform = -transform;
|
|
272
272
|
}
|
|
273
273
|
inlineStyles.bar1.transform = `translateX(${transform}%)`;
|
|
@@ -278,7 +278,7 @@ const LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inP
|
|
|
278
278
|
if (variant === 'buffer') {
|
|
279
279
|
if (valueBuffer !== undefined) {
|
|
280
280
|
let transform = (valueBuffer || 0) - 100;
|
|
281
|
-
if (
|
|
281
|
+
if (isRtl) {
|
|
282
282
|
transform = -transform;
|
|
283
283
|
}
|
|
284
284
|
inlineStyles.bar2.transform = `translateX(${transform}%)`;
|
package/Menu/Menu.js
CHANGED
|
@@ -11,10 +11,10 @@ import clsx from 'clsx';
|
|
|
11
11
|
import composeClasses from '@mui/utils/composeClasses';
|
|
12
12
|
import { useSlotProps } from '@mui/base/utils';
|
|
13
13
|
import HTMLElementType from '@mui/utils/HTMLElementType';
|
|
14
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
14
15
|
import MenuList from '../MenuList';
|
|
15
16
|
import Popover, { PopoverPaper } from '../Popover';
|
|
16
17
|
import styled, { rootShouldForwardProp } from '../styles/styled';
|
|
17
|
-
import useTheme from '../styles/useTheme';
|
|
18
18
|
import useThemeProps from '../styles/useThemeProps';
|
|
19
19
|
import { getMenuUtilityClass } from './menuClasses';
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -89,8 +89,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
89
89
|
} = props,
|
|
90
90
|
TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded),
|
|
91
91
|
other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
92
|
-
const
|
|
93
|
-
const isRtl = theme.direction === 'rtl';
|
|
92
|
+
const isRtl = useRtl();
|
|
94
93
|
const ownerState = _extends({}, props, {
|
|
95
94
|
autoFocus,
|
|
96
95
|
disableAutoFocusItem,
|
|
@@ -106,7 +105,9 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
|
|
|
106
105
|
const menuListActionsRef = React.useRef(null);
|
|
107
106
|
const handleEntering = (element, isAppearing) => {
|
|
108
107
|
if (menuListActionsRef.current) {
|
|
109
|
-
menuListActionsRef.current.adjustStyleForScrollbar(element,
|
|
108
|
+
menuListActionsRef.current.adjustStyleForScrollbar(element, {
|
|
109
|
+
direction: isRtl ? 'rtl' : 'ltr'
|
|
110
|
+
});
|
|
110
111
|
}
|
|
111
112
|
if (onEntering) {
|
|
112
113
|
onEntering(element, isAppearing);
|
package/MenuList/MenuList.js
CHANGED
|
@@ -107,13 +107,15 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
|
|
|
107
107
|
}
|
|
108
108
|
}, [autoFocus]);
|
|
109
109
|
React.useImperativeHandle(actions, () => ({
|
|
110
|
-
adjustStyleForScrollbar: (containerElement,
|
|
110
|
+
adjustStyleForScrollbar: (containerElement, {
|
|
111
|
+
direction
|
|
112
|
+
}) => {
|
|
111
113
|
// Let's ignore that piece of logic if users are already overriding the width
|
|
112
114
|
// of the menu.
|
|
113
115
|
const noExplicitWidth = !listRef.current.style.width;
|
|
114
116
|
if (containerElement.clientHeight < listRef.current.clientHeight && noExplicitWidth) {
|
|
115
117
|
const scrollbarSize = `${getScrollbarSize(ownerDocument(containerElement))}px`;
|
|
116
|
-
listRef.current.style[
|
|
118
|
+
listRef.current.style[direction === 'rtl' ? 'paddingLeft' : 'paddingRight'] = scrollbarSize;
|
|
117
119
|
listRef.current.style.width = `calc(100% + ${scrollbarSize})`;
|
|
118
120
|
}
|
|
119
121
|
return listRef.current;
|
|
@@ -11,7 +11,7 @@ export interface OverridableComponent<TypeMap extends OverridableTypeMap> {
|
|
|
11
11
|
// If you make any changes to this interface, please make sure to update the
|
|
12
12
|
// `OverridableComponent` type in `mui-types/index.d.ts` as well.
|
|
13
13
|
// Also, there are types in Base UI that have a similar shape to this interface
|
|
14
|
-
// (
|
|
14
|
+
// (for example SelectType, OptionType, etc.).
|
|
15
15
|
<RootComponent extends React.ElementType>(
|
|
16
16
|
props: {
|
|
17
17
|
/**
|
|
@@ -8,9 +8,9 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
10
|
import { alpha } from '@mui/system/colorManipulator';
|
|
11
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
11
12
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
13
|
import paginationItemClasses, { getPaginationItemUtilityClass } from './paginationItemClasses';
|
|
13
|
-
import useTheme from '../styles/useTheme';
|
|
14
14
|
import ButtonBase from '../ButtonBase';
|
|
15
15
|
import capitalize from '../utils/capitalize';
|
|
16
16
|
import FirstPageIcon from '../internal/svg-icons/FirstPage';
|
|
@@ -234,9 +234,9 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
|
|
|
234
234
|
type,
|
|
235
235
|
variant
|
|
236
236
|
});
|
|
237
|
-
const
|
|
237
|
+
const isRtl = useRtl();
|
|
238
238
|
const classes = useUtilityClasses(ownerState);
|
|
239
|
-
const normalizedIcons =
|
|
239
|
+
const normalizedIcons = isRtl ? {
|
|
240
240
|
previous: slots.next || components.next || NavigateNextIcon,
|
|
241
241
|
next: slots.previous || components.previous || NavigateBeforeIcon,
|
|
242
242
|
last: slots.first || components.first || FirstPageIcon,
|
package/Popper/Popper.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { PopperProps as BasePopperProps } from '@mui/base/Popper';
|
|
|
2
2
|
import { SxProps } from '@mui/system';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { Theme } from '../styles';
|
|
5
|
-
export
|
|
5
|
+
export interface PopperProps extends Omit<BasePopperProps, 'direction'> {
|
|
6
6
|
/**
|
|
7
7
|
* The component used for the root node.
|
|
8
8
|
* Either a string to use a HTML element or a component.
|
|
@@ -25,7 +25,7 @@ export type PopperProps = Omit<BasePopperProps, 'direction'> & {
|
|
|
25
25
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
26
26
|
*/
|
|
27
27
|
sx?: SxProps<Theme>;
|
|
28
|
-
}
|
|
28
|
+
}
|
|
29
29
|
/**
|
|
30
30
|
*
|
|
31
31
|
* Demos:
|
|
@@ -38,28 +38,5 @@ export type PopperProps = Omit<BasePopperProps, 'direction'> & {
|
|
|
38
38
|
*
|
|
39
39
|
* - [Popper API](https://mui.com/material-ui/api/popper/)
|
|
40
40
|
*/
|
|
41
|
-
declare const Popper: React.ForwardRefExoticComponent<
|
|
42
|
-
/**
|
|
43
|
-
* The component used for the root node.
|
|
44
|
-
* Either a string to use a HTML element or a component.
|
|
45
|
-
*/
|
|
46
|
-
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* The components used for each slot inside the Popper.
|
|
49
|
-
* Either a string to use a HTML element or a component.
|
|
50
|
-
* @default {}
|
|
51
|
-
*/
|
|
52
|
-
components?: {
|
|
53
|
-
Root?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
54
|
-
} | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* The props used for each slot inside the Popper.
|
|
57
|
-
* @default {}
|
|
58
|
-
*/
|
|
59
|
-
componentsProps?: BasePopperProps['slotProps'];
|
|
60
|
-
/**
|
|
61
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
62
|
-
*/
|
|
63
|
-
sx?: SxProps<Theme> | undefined;
|
|
64
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
declare const Popper: React.ForwardRefExoticComponent<PopperProps & React.RefAttributes<HTMLDivElement>>;
|
|
65
42
|
export default Popper;
|
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ Our documentation features [a collection of example projects using Material UI]
|
|
|
33
33
|
Read the [contributing guide](/CONTRIBUTING.md) to learn about our development process, how to propose bug fixes and improvements, and how to build and test your changes.
|
|
34
34
|
|
|
35
35
|
Contributing to Material UI is about more than just issues and pull requests!
|
|
36
|
-
There are many other ways to [support
|
|
36
|
+
There are many other ways to [support Material UI](https://mui.com/material-ui/getting-started/faq/#mui-is-awesome-how-can-i-support-the-project) beyond contributing to the code base.
|
|
37
37
|
|
|
38
38
|
## Changelog
|
|
39
39
|
|
|
@@ -41,7 +41,7 @@ The [changelog](https://github.com/mui/material-ui/releases) is regularly update
|
|
|
41
41
|
|
|
42
42
|
## Roadmap
|
|
43
43
|
|
|
44
|
-
Future plans and high-priority features and enhancements can be found in
|
|
44
|
+
Future plans and high-priority features and enhancements can be found in the [roadmap](https://mui.com/material-ui/discover-more/roadmap/).
|
|
45
45
|
|
|
46
46
|
## License
|
|
47
47
|
|
package/Rating/Rating.js
CHANGED
|
@@ -11,7 +11,7 @@ import clamp from '@mui/utils/clamp';
|
|
|
11
11
|
import visuallyHidden from '@mui/utils/visuallyHidden';
|
|
12
12
|
import chainPropTypes from '@mui/utils/chainPropTypes';
|
|
13
13
|
import composeClasses from '@mui/utils/composeClasses';
|
|
14
|
-
import
|
|
14
|
+
import { useRtl } from '@mui/system/RtlProvider';
|
|
15
15
|
import { capitalize, useForkRef, useIsFocusVisible, useControlled, unstable_useId as useId } from '../utils';
|
|
16
16
|
import Star from '../internal/svg-icons/Star';
|
|
17
17
|
import StarBorder from '../internal/svg-icons/StarBorder';
|
|
@@ -300,7 +300,7 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
|
|
|
300
300
|
name: 'Rating'
|
|
301
301
|
});
|
|
302
302
|
const valueRounded = roundValueToPrecision(valueDerived, precision);
|
|
303
|
-
const
|
|
303
|
+
const isRtl = useRtl();
|
|
304
304
|
const [{
|
|
305
305
|
hover,
|
|
306
306
|
focus
|
|
@@ -335,7 +335,7 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
|
|
|
335
335
|
width: containerWidth
|
|
336
336
|
} = rootNode.getBoundingClientRect();
|
|
337
337
|
let percent;
|
|
338
|
-
if (
|
|
338
|
+
if (isRtl) {
|
|
339
339
|
percent = (right - event.clientX) / containerWidth;
|
|
340
340
|
} else {
|
|
341
341
|
percent = (event.clientX - left) / containerWidth;
|
package/Select/Select.d.ts
CHANGED
|
@@ -148,7 +148,7 @@ export interface BaseSelectProps<Value = unknown>
|
|
|
148
148
|
* The variant to use.
|
|
149
149
|
* @default 'outlined'
|
|
150
150
|
*/
|
|
151
|
-
variant?:
|
|
151
|
+
variant?: SelectVariants;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
export interface FilledSelectProps extends Omit<FilledInputProps, 'value' | 'onChange'> {
|
|
@@ -172,20 +172,15 @@ export interface OutlinedSelectProps extends Omit<OutlinedInputProps, 'value' |
|
|
|
172
172
|
* The variant to use.
|
|
173
173
|
* @default 'outlined'
|
|
174
174
|
*/
|
|
175
|
-
variant
|
|
175
|
+
variant?: 'outlined';
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
export type SelectVariants = 'outlined' | 'standard' | 'filled';
|
|
179
179
|
|
|
180
|
-
export type SelectProps<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
(Variant extends 'filled'
|
|
185
|
-
? FilledSelectProps
|
|
186
|
-
: Variant extends 'standard'
|
|
187
|
-
? StandardSelectProps
|
|
188
|
-
: OutlinedSelectProps);
|
|
180
|
+
export type SelectProps<Value = unknown> =
|
|
181
|
+
| (FilledSelectProps & BaseSelectProps<Value>)
|
|
182
|
+
| (StandardSelectProps & BaseSelectProps<Value>)
|
|
183
|
+
| (OutlinedSelectProps & BaseSelectProps<Value>);
|
|
189
184
|
|
|
190
185
|
/**
|
|
191
186
|
*
|
|
@@ -198,15 +193,8 @@ export type SelectProps<
|
|
|
198
193
|
* - [Select API](https://mui.com/material-ui/api/select/)
|
|
199
194
|
* - inherits [OutlinedInput API](https://mui.com/material-ui/api/outlined-input/)
|
|
200
195
|
*/
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
props: {
|
|
204
|
-
/**
|
|
205
|
-
* The variant to use.
|
|
206
|
-
* @default 'outlined'
|
|
207
|
-
*/
|
|
208
|
-
variant?: Variant;
|
|
209
|
-
} & Omit<SelectProps<Value, Variant>, 'variant'>,
|
|
196
|
+
export default function Select<Value = unknown>(
|
|
197
|
+
props: SelectProps<Value>,
|
|
210
198
|
): JSX.Element & {
|
|
211
199
|
muiName: string;
|
|
212
200
|
};
|