@mui/material 5.15.4 → 5.15.6
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.d.ts +30 -2
- package/Accordion/Accordion.js +39 -6
- package/AccordionSummary/accordionSummaryClasses.d.ts +4 -1
- package/Alert/Alert.d.ts +4 -2
- package/Alert/Alert.js +1 -1
- package/Avatar/Avatar.js +32 -15
- package/Badge/Badge.js +1 -1
- package/CHANGELOG.md +398 -242
- package/Divider/Divider.d.ts +1 -0
- package/Divider/Divider.js +1 -0
- package/Divider/dividerClasses.d.ts +6 -2
- package/PaginationItem/PaginationItem.js +1 -1
- package/PaginationItem/paginationItemClasses.d.ts +20 -4
- package/PaginationItem/paginationItemClasses.js +1 -1
- package/README.md +5 -5
- package/Rating/Rating.js +2 -10
- package/SpeedDial/SpeedDial.js +1 -9
- package/TablePagination/TablePagination.d.ts +1 -1
- package/index.js +1 -1
- package/legacy/Accordion/Accordion.js +44 -7
- package/legacy/Alert/Alert.js +1 -1
- package/legacy/Avatar/Avatar.js +32 -15
- package/legacy/Badge/Badge.js +1 -1
- package/legacy/Divider/Divider.js +1 -0
- package/legacy/PaginationItem/PaginationItem.js +1 -1
- package/legacy/PaginationItem/paginationItemClasses.js +1 -1
- package/legacy/Rating/Rating.js +2 -10
- package/legacy/SpeedDial/SpeedDial.js +1 -9
- package/legacy/index.js +1 -1
- package/legacy/styles/createTheme.js +13 -1
- package/legacy/utils/types.js +1 -0
- package/legacy/utils/useSlot.js +71 -0
- package/legacy/zero-styled/index.js +2 -0
- package/modern/Accordion/Accordion.js +39 -6
- package/modern/Alert/Alert.js +1 -1
- package/modern/Avatar/Avatar.js +32 -15
- package/modern/Badge/Badge.js +1 -1
- package/modern/Divider/Divider.js +1 -0
- package/modern/PaginationItem/PaginationItem.js +1 -1
- package/modern/PaginationItem/paginationItemClasses.js +1 -1
- package/modern/Rating/Rating.js +2 -10
- package/modern/SpeedDial/SpeedDial.js +1 -9
- package/modern/index.js +1 -1
- package/modern/styles/createTheme.js +15 -1
- package/modern/utils/types.js +1 -0
- package/modern/utils/useSlot.js +82 -0
- package/modern/zero-styled/index.js +2 -0
- package/node/Accordion/Accordion.js +39 -6
- package/node/Alert/Alert.js +1 -1
- package/node/Avatar/Avatar.js +32 -15
- package/node/Badge/Badge.js +3 -3
- package/node/Divider/Divider.js +1 -0
- package/node/PaginationItem/PaginationItem.js +1 -1
- package/node/PaginationItem/paginationItemClasses.js +1 -1
- package/node/Rating/Rating.js +2 -10
- package/node/SpeedDial/SpeedDial.js +2 -10
- package/node/index.js +1 -1
- package/node/styles/createTheme.js +15 -1
- package/node/utils/types.js +5 -0
- package/node/utils/useSlot.js +88 -0
- package/node/zero-styled/index.js +13 -0
- package/package.json +6 -6
- package/styles/createTheme.d.ts +1 -0
- package/styles/createTheme.js +15 -1
- package/umd/material-ui.development.js +647 -516
- package/umd/material-ui.production.min.js +4 -4
- package/utils/types.d.ts +27 -0
- package/utils/types.js +1 -0
- package/utils/useSlot.d.ts +84 -0
- package/utils/useSlot.js +82 -0
- package/zero-styled/index.d.ts +2 -0
- package/zero-styled/index.js +2 -0
- package/zero-styled/package.json +6 -0
package/Divider/Divider.d.ts
CHANGED
package/Divider/Divider.js
CHANGED
|
@@ -221,6 +221,7 @@ process.env.NODE_ENV !== "production" ? Divider.propTypes /* remove-proptypes */
|
|
|
221
221
|
/**
|
|
222
222
|
* If `true`, the divider will have a lighter color.
|
|
223
223
|
* @default false
|
|
224
|
+
* @deprecated Use <Divider sx={{ bgcolor: '#eee' }} /> (or any color) instead.
|
|
224
225
|
*/
|
|
225
226
|
light: PropTypes.bool,
|
|
226
227
|
/**
|
|
@@ -7,7 +7,9 @@ export interface DividerClasses {
|
|
|
7
7
|
inset: string;
|
|
8
8
|
/** Styles applied to the root element if `variant="fullWidth"`. */
|
|
9
9
|
fullWidth: string;
|
|
10
|
-
/** Styles applied to the root element if `light={true}`.
|
|
10
|
+
/** Styles applied to the root element if `light={true}`.
|
|
11
|
+
* @deprecated
|
|
12
|
+
*/
|
|
11
13
|
light: string;
|
|
12
14
|
/** Styles applied to the root element if `variant="middle"`. */
|
|
13
15
|
middle: string;
|
|
@@ -17,7 +19,9 @@ export interface DividerClasses {
|
|
|
17
19
|
flexItem: string;
|
|
18
20
|
/** Styles applied to the root element if divider have text. */
|
|
19
21
|
withChildren: string;
|
|
20
|
-
/** Styles applied to the root element if divider have text and `orientation="vertical"`.
|
|
22
|
+
/** Styles applied to the root element if divider have text and `orientation="vertical"`.
|
|
23
|
+
* @deprecated Combine the [.MuiDivider-withChildren](/material-ui/api/divider/#divider-classes-withChildren) and [.MuiDivider-vertical](/material-ui/api/divider/#divider-classes-vertical) classes instead.
|
|
24
|
+
*/
|
|
21
25
|
withChildrenVertical: string;
|
|
22
26
|
/** Styles applied to the root element if `textAlign="right" orientation="horizontal"`. */
|
|
23
27
|
textAlignRight: string;
|
|
@@ -38,7 +38,7 @@ const useUtilityClasses = ownerState => {
|
|
|
38
38
|
variant
|
|
39
39
|
} = ownerState;
|
|
40
40
|
const slots = {
|
|
41
|
-
root: ['root', `size${capitalize(size)}`, variant, shape, color !== 'standard' && `${variant}${capitalize(color)}`, disabled && 'disabled', selected && 'selected', {
|
|
41
|
+
root: ['root', `size${capitalize(size)}`, variant, shape, color !== 'standard' && `color${capitalize(color)}`, color !== 'standard' && `${variant}${capitalize(color)}`, disabled && 'disabled', selected && 'selected', {
|
|
42
42
|
page: 'page',
|
|
43
43
|
first: 'firstLast',
|
|
44
44
|
last: 'firstLast',
|
|
@@ -9,15 +9,27 @@ export interface PaginationItemClasses {
|
|
|
9
9
|
sizeLarge: string;
|
|
10
10
|
/** Styles applied to the root element if `variant="text"`. */
|
|
11
11
|
text: string;
|
|
12
|
-
/** Styles applied to the root element if `variant="text"` and `color="primary"`.
|
|
12
|
+
/** Styles applied to the root element if `variant="text"` and `color="primary"`.
|
|
13
|
+
* @deprecated Combine the [.MuiPaginationItem-text](/material-ui/api/pagination-item/#pagination-item-classes-text)
|
|
14
|
+
* and [.MuiPaginationItem-colorPrimary](/material-ui/api/pagination-item/#pagination-item-classes-colorPrimary) classes instead.
|
|
15
|
+
*/
|
|
13
16
|
textPrimary: string;
|
|
14
|
-
/** Styles applied to the root element if `variant="text"` and `color="secondary"`.
|
|
17
|
+
/** Styles applied to the root element if `variant="text"` and `color="secondary"`.
|
|
18
|
+
* @deprecated Combine the [.MuiPaginationItem-text](/material-ui/api/pagination-item/#pagination-item-classes-text)
|
|
19
|
+
* and [.MuiPaginationItem-colorSecondary](/material-ui/api/pagination-item/#pagination-item-classes-colorSecondary) classes instead.
|
|
20
|
+
*/
|
|
15
21
|
textSecondary: string;
|
|
16
22
|
/** Styles applied to the root element if `variant="outlined"`. */
|
|
17
23
|
outlined: string;
|
|
18
|
-
/** Styles applied to the root element if `variant="outlined"` and `color="primary"`.
|
|
24
|
+
/** Styles applied to the root element if `variant="outlined"` and `color="primary"`.
|
|
25
|
+
* @deprecated Combine the [.MuiPaginationItem-outlined](/material-ui/api/pagination-item/#pagination-item-classes-outlined)
|
|
26
|
+
* and [.MuiPaginationItem-colorPrimary](/material-ui/api/pagination-item/#pagination-item-classes-colorPrimary) classes instead.
|
|
27
|
+
*/
|
|
19
28
|
outlinedPrimary: string;
|
|
20
|
-
/** Styles applied to the root element if `variant="outlined"` and `color="secondary"`.
|
|
29
|
+
/** Styles applied to the root element if `variant="outlined"` and `color="secondary"`.
|
|
30
|
+
* @deprecated Combine the [.MuiPaginationItem-outlined](/material-ui/api/pagination-item/#pagination-item-classes-outlined)
|
|
31
|
+
* and [.MuiPaginationItem-colorSecondary](/material-ui/api/pagination-item/#pagination-item-classes-colorSecondary) classes instead.
|
|
32
|
+
*/
|
|
21
33
|
outlinedSecondary: string;
|
|
22
34
|
/** Styles applied to the root element if `rounded="true"`. */
|
|
23
35
|
rounded: string;
|
|
@@ -35,6 +47,10 @@ export interface PaginationItemClasses {
|
|
|
35
47
|
selected: string;
|
|
36
48
|
/** Styles applied to the icon to display. */
|
|
37
49
|
icon: string;
|
|
50
|
+
/** Styles applied to the root element if `color="primary"`. */
|
|
51
|
+
colorPrimary: string;
|
|
52
|
+
/** Styles applied to the root element if `color="secondary"`. */
|
|
53
|
+
colorSecondary: string;
|
|
38
54
|
}
|
|
39
55
|
export type PaginationItemClassKey = keyof PaginationItemClasses;
|
|
40
56
|
export declare function getPaginationItemUtilityClass(slot: string): string;
|
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
|
3
3
|
export function getPaginationItemUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiPaginationItem', slot);
|
|
5
5
|
}
|
|
6
|
-
const paginationItemClasses = generateUtilityClasses('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon']);
|
|
6
|
+
const paginationItemClasses = generateUtilityClasses('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon', 'colorPrimary', 'colorSecondary']);
|
|
7
7
|
export default paginationItemClasses;
|
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<!-- markdownlint-disable-next-line -->
|
|
2
2
|
<p align="center">
|
|
3
|
-
<a href="https://mui.com/material-ui/" rel="noopener" target="_blank"><img width="150" height="133" src="https://mui.com/static/logo.svg" alt="Material
|
|
3
|
+
<a href="https://mui.com/material-ui/" rel="noopener" target="_blank"><img width="150" height="133" src="https://mui.com/static/logo.svg" alt="Material UI logo"></a>
|
|
4
4
|
</p>
|
|
5
5
|
|
|
6
|
-
<h1 align="center">Material
|
|
6
|
+
<h1 align="center">Material UI</h1>
|
|
7
7
|
|
|
8
|
-
Material
|
|
8
|
+
Material UI is an open-source React component library that implements Google's [Material Design](https://m2.material.io/design/introduction/). It's comprehensive and can be used in production out of the box.
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
@@ -26,13 +26,13 @@ Use the "material-ui" tag on Stack Overflow to make it easier for the community
|
|
|
26
26
|
|
|
27
27
|
## Examples
|
|
28
28
|
|
|
29
|
-
Our documentation features [a collection of example projects using Material
|
|
29
|
+
Our documentation features [a collection of example projects using Material UI](https://mui.com/material-ui/getting-started/example-projects/).
|
|
30
30
|
|
|
31
31
|
## Contributing
|
|
32
32
|
|
|
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
|
-
Contributing to Material
|
|
35
|
+
Contributing to Material UI is about more than just issues and pull requests!
|
|
36
36
|
There are many other ways to [support MUI](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
|
package/Rating/Rating.js
CHANGED
|
@@ -7,7 +7,7 @@ const _excluded = ["value"],
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import { chainPropTypes, visuallyHidden } from '@mui/utils';
|
|
10
|
+
import { chainPropTypes, visuallyHidden, clamp } from '@mui/utils';
|
|
11
11
|
import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
|
|
12
12
|
import useTheme from '../styles/useTheme';
|
|
13
13
|
import { capitalize, useForkRef, useIsFocusVisible, useControlled, unstable_useId as useId } from '../utils';
|
|
@@ -18,15 +18,6 @@ import styled, { slotShouldForwardProp } from '../styles/styled';
|
|
|
18
18
|
import ratingClasses, { getRatingUtilityClass } from './ratingClasses';
|
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
-
function clamp(value, min, max) {
|
|
22
|
-
if (value < min) {
|
|
23
|
-
return min;
|
|
24
|
-
}
|
|
25
|
-
if (value > max) {
|
|
26
|
-
return max;
|
|
27
|
-
}
|
|
28
|
-
return value;
|
|
29
|
-
}
|
|
30
21
|
function getDecimalPrecision(num) {
|
|
31
22
|
const decimalPart = num.toString().split('.')[1];
|
|
32
23
|
return decimalPart ? decimalPart.length : 0;
|
|
@@ -84,6 +75,7 @@ const RatingRoot = styled('span', {
|
|
|
84
75
|
color: '#faaf00',
|
|
85
76
|
cursor: 'pointer',
|
|
86
77
|
textAlign: 'left',
|
|
78
|
+
width: 'min-content',
|
|
87
79
|
WebkitTapHighlightColor: 'transparent',
|
|
88
80
|
[`&.${ratingClasses.disabled}`]: {
|
|
89
81
|
opacity: (theme.vars || theme).palette.action.disabledOpacity,
|
package/SpeedDial/SpeedDial.js
CHANGED
|
@@ -10,6 +10,7 @@ import { isFragment } from 'react-is';
|
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import clsx from 'clsx';
|
|
12
12
|
import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
|
|
13
|
+
import { clamp } from '@mui/utils';
|
|
13
14
|
import styled from '../styles/styled';
|
|
14
15
|
import useThemeProps from '../styles/useThemeProps';
|
|
15
16
|
import useTheme from '../styles/useTheme';
|
|
@@ -44,15 +45,6 @@ function getOrientation(direction) {
|
|
|
44
45
|
}
|
|
45
46
|
return undefined;
|
|
46
47
|
}
|
|
47
|
-
function clamp(value, min, max) {
|
|
48
|
-
if (value < min) {
|
|
49
|
-
return min;
|
|
50
|
-
}
|
|
51
|
-
if (value > max) {
|
|
52
|
-
return max;
|
|
53
|
-
}
|
|
54
|
-
return value;
|
|
55
|
-
}
|
|
56
48
|
const dialRadius = 32;
|
|
57
49
|
const spacingActions = 16;
|
|
58
50
|
const SpeedDialRoot = styled('div', {
|
|
@@ -114,7 +114,7 @@ export interface TablePaginationOwnProps extends TablePaginationBaseProps {
|
|
|
114
114
|
* Use -1 for the value with a custom label to show all the rows.
|
|
115
115
|
* @default [10, 25, 50, 100]
|
|
116
116
|
*/
|
|
117
|
-
rowsPerPageOptions?:
|
|
117
|
+
rowsPerPageOptions?: ReadonlyArray<number | { value: number; label: string }>;
|
|
118
118
|
/**
|
|
119
119
|
* Props applied to the rows per page [`Select`](/material-ui/api/select/) element.
|
|
120
120
|
*
|
package/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import Collapse from '../Collapse';
|
|
|
17
17
|
import Paper from '../Paper';
|
|
18
18
|
import AccordionContext from './AccordionContext';
|
|
19
19
|
import useControlled from '../utils/useControlled';
|
|
20
|
+
import useSlot from '../utils/useSlot';
|
|
20
21
|
import accordionClasses, { getAccordionUtilityClass } from './accordionClasses';
|
|
21
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
23
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -122,10 +123,13 @@ var Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
|
|
|
122
123
|
onChange = props.onChange,
|
|
123
124
|
_props$square = props.square,
|
|
124
125
|
square = _props$square === void 0 ? false : _props$square,
|
|
125
|
-
_props$
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
_props$slots = props.slots,
|
|
127
|
+
slots = _props$slots === void 0 ? {} : _props$slots,
|
|
128
|
+
_props$slotProps = props.slotProps,
|
|
129
|
+
slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
|
|
130
|
+
TransitionComponentProp = props.TransitionComponent,
|
|
131
|
+
TransitionPropsProp = props.TransitionProps,
|
|
132
|
+
other = _objectWithoutProperties(props, ["children", "className", "defaultExpanded", "disabled", "disableGutters", "expanded", "onChange", "square", "slots", "slotProps", "TransitionComponent", "TransitionProps"]);
|
|
129
133
|
var _useControlled = useControlled({
|
|
130
134
|
controlled: expandedProp,
|
|
131
135
|
default: defaultExpanded,
|
|
@@ -160,6 +164,24 @@ var Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
|
|
|
160
164
|
expanded: expanded
|
|
161
165
|
});
|
|
162
166
|
var classes = useUtilityClasses(ownerState);
|
|
167
|
+
var backwardCompatibleSlots = _extends({
|
|
168
|
+
transition: TransitionComponentProp
|
|
169
|
+
}, slots);
|
|
170
|
+
var backwardCompatibleSlotProps = _extends({
|
|
171
|
+
transition: TransitionPropsProp
|
|
172
|
+
}, slotProps);
|
|
173
|
+
var _useSlot = useSlot('transition', {
|
|
174
|
+
elementType: Collapse,
|
|
175
|
+
externalForwardedProps: {
|
|
176
|
+
slots: backwardCompatibleSlots,
|
|
177
|
+
slotProps: backwardCompatibleSlotProps
|
|
178
|
+
},
|
|
179
|
+
ownerState: ownerState
|
|
180
|
+
}),
|
|
181
|
+
_useSlot2 = _slicedToArray(_useSlot, 2),
|
|
182
|
+
TransitionSlot = _useSlot2[0],
|
|
183
|
+
transitionProps = _useSlot2[1];
|
|
184
|
+
delete transitionProps.ownerState;
|
|
163
185
|
return /*#__PURE__*/_jsxs(AccordionRoot, _extends({
|
|
164
186
|
className: clsx(classes.root, className),
|
|
165
187
|
ref: ref,
|
|
@@ -169,10 +191,10 @@ var Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {
|
|
|
169
191
|
children: [/*#__PURE__*/_jsx(AccordionContext.Provider, {
|
|
170
192
|
value: contextValue,
|
|
171
193
|
children: summary
|
|
172
|
-
}), /*#__PURE__*/_jsx(
|
|
194
|
+
}), /*#__PURE__*/_jsx(TransitionSlot, _extends({
|
|
173
195
|
in: expanded,
|
|
174
196
|
timeout: "auto"
|
|
175
|
-
},
|
|
197
|
+
}, transitionProps, {
|
|
176
198
|
children: /*#__PURE__*/_jsx("div", {
|
|
177
199
|
"aria-labelledby": summary.props.id,
|
|
178
200
|
id: summary.props['aria-controls'],
|
|
@@ -236,6 +258,20 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
|
|
|
236
258
|
* @param {boolean} expanded The `expanded` state of the accordion.
|
|
237
259
|
*/
|
|
238
260
|
onChange: PropTypes.func,
|
|
261
|
+
/**
|
|
262
|
+
* The props used for each slot inside.
|
|
263
|
+
* @default {}
|
|
264
|
+
*/
|
|
265
|
+
slotProps: PropTypes.shape({
|
|
266
|
+
transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
267
|
+
}),
|
|
268
|
+
/**
|
|
269
|
+
* The components used for each slot inside.
|
|
270
|
+
* @default {}
|
|
271
|
+
*/
|
|
272
|
+
slots: PropTypes.shape({
|
|
273
|
+
transition: PropTypes.elementType
|
|
274
|
+
}),
|
|
239
275
|
/**
|
|
240
276
|
* If `true`, rounded corners are disabled.
|
|
241
277
|
* @default false
|
|
@@ -248,12 +284,13 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
|
|
|
248
284
|
/**
|
|
249
285
|
* The component used for the transition.
|
|
250
286
|
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
251
|
-
* @
|
|
287
|
+
* @deprecated Use `slots.transition` instead. This prop will be removed in v7.
|
|
252
288
|
*/
|
|
253
289
|
TransitionComponent: PropTypes.elementType,
|
|
254
290
|
/**
|
|
255
291
|
* Props applied to the transition element.
|
|
256
292
|
* By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition/) component.
|
|
293
|
+
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7.
|
|
257
294
|
*/
|
|
258
295
|
TransitionProps: PropTypes.object
|
|
259
296
|
} : void 0;
|
package/legacy/Alert/Alert.js
CHANGED
|
@@ -295,7 +295,7 @@ process.env.NODE_ENV !== "production" ? Alert.propTypes /* remove-proptypes */ =
|
|
|
295
295
|
* The severity of the alert. This defines the color and icon used.
|
|
296
296
|
* @default 'success'
|
|
297
297
|
*/
|
|
298
|
-
severity: PropTypes.oneOf(['error', 'info', 'success', 'warning']),
|
|
298
|
+
severity: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['error', 'info', 'success', 'warning']), PropTypes.string]),
|
|
299
299
|
/**
|
|
300
300
|
* The extra props for the slot components.
|
|
301
301
|
* You can override the existing props or add new ones.
|
package/legacy/Avatar/Avatar.js
CHANGED
|
@@ -30,9 +30,8 @@ var AvatarRoot = styled('div', {
|
|
|
30
30
|
return [styles.root, styles[ownerState.variant], ownerState.colorDefault && styles.colorDefault];
|
|
31
31
|
}
|
|
32
32
|
})(function (_ref) {
|
|
33
|
-
var theme = _ref.theme
|
|
34
|
-
|
|
35
|
-
return _extends({
|
|
33
|
+
var theme = _ref.theme;
|
|
34
|
+
return {
|
|
36
35
|
position: 'relative',
|
|
37
36
|
display: 'flex',
|
|
38
37
|
alignItems: 'center',
|
|
@@ -45,18 +44,36 @@ var AvatarRoot = styled('div', {
|
|
|
45
44
|
lineHeight: 1,
|
|
46
45
|
borderRadius: '50%',
|
|
47
46
|
overflow: 'hidden',
|
|
48
|
-
userSelect: 'none'
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
userSelect: 'none',
|
|
48
|
+
variants: [{
|
|
49
|
+
props: {
|
|
50
|
+
variant: 'rounded'
|
|
51
|
+
},
|
|
52
|
+
style: {
|
|
53
|
+
borderRadius: (theme.vars || theme).shape.borderRadius
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
props: {
|
|
57
|
+
variant: 'square'
|
|
58
|
+
},
|
|
59
|
+
style: {
|
|
60
|
+
borderRadius: 0
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
props: {
|
|
64
|
+
colorDefault: true
|
|
65
|
+
},
|
|
66
|
+
style: _extends({
|
|
67
|
+
color: (theme.vars || theme).palette.background.default
|
|
68
|
+
}, theme.vars ? {
|
|
69
|
+
backgroundColor: theme.vars.palette.Avatar.defaultBg
|
|
70
|
+
} : _extends({
|
|
71
|
+
backgroundColor: theme.palette.grey[400]
|
|
72
|
+
}, theme.applyDarkStyles({
|
|
73
|
+
backgroundColor: theme.palette.grey[600]
|
|
74
|
+
})))
|
|
75
|
+
}]
|
|
76
|
+
};
|
|
60
77
|
});
|
|
61
78
|
var AvatarImg = styled('img', {
|
|
62
79
|
name: 'MuiAvatar',
|
package/legacy/Badge/Badge.js
CHANGED
|
@@ -11,7 +11,7 @@ import { usePreviousProps } from '@mui/utils';
|
|
|
11
11
|
import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
|
|
12
12
|
import { useBadge } from '@mui/base/useBadge';
|
|
13
13
|
import { useSlotProps } from '@mui/base';
|
|
14
|
-
import styled from '../
|
|
14
|
+
import { styled } from '../zero-styled';
|
|
15
15
|
import useThemeProps from '../styles/useThemeProps';
|
|
16
16
|
import capitalize from '../utils/capitalize';
|
|
17
17
|
import badgeClasses, { getBadgeUtilityClass } from './badgeClasses';
|
|
@@ -226,6 +226,7 @@ process.env.NODE_ENV !== "production" ? Divider.propTypes /* remove-proptypes */
|
|
|
226
226
|
/**
|
|
227
227
|
* If `true`, the divider will have a lighter color.
|
|
228
228
|
* @default false
|
|
229
|
+
* @deprecated Use <Divider sx={{ bgcolor: '#eee' }} /> (or any color) instead.
|
|
229
230
|
*/
|
|
230
231
|
light: PropTypes.bool,
|
|
231
232
|
/**
|
|
@@ -34,7 +34,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
34
34
|
type = ownerState.type,
|
|
35
35
|
variant = ownerState.variant;
|
|
36
36
|
var slots = {
|
|
37
|
-
root: ['root', "size".concat(capitalize(size)), variant, shape, color !== 'standard' && "".concat(variant).concat(capitalize(color)), disabled && 'disabled', selected && 'selected', {
|
|
37
|
+
root: ['root', "size".concat(capitalize(size)), variant, shape, color !== 'standard' && "color".concat(capitalize(color)), color !== 'standard' && "".concat(variant).concat(capitalize(color)), disabled && 'disabled', selected && 'selected', {
|
|
38
38
|
page: 'page',
|
|
39
39
|
first: 'firstLast',
|
|
40
40
|
last: 'firstLast',
|
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
|
3
3
|
export function getPaginationItemUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiPaginationItem', slot);
|
|
5
5
|
}
|
|
6
|
-
var paginationItemClasses = generateUtilityClasses('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon']);
|
|
6
|
+
var paginationItemClasses = generateUtilityClasses('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon', 'colorPrimary', 'colorSecondary']);
|
|
7
7
|
export default paginationItemClasses;
|
package/legacy/Rating/Rating.js
CHANGED
|
@@ -7,7 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import { chainPropTypes, visuallyHidden } from '@mui/utils';
|
|
10
|
+
import { chainPropTypes, visuallyHidden, clamp } from '@mui/utils';
|
|
11
11
|
import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
|
|
12
12
|
import useTheme from '../styles/useTheme';
|
|
13
13
|
import { capitalize, useForkRef, useIsFocusVisible, useControlled, unstable_useId as useId } from '../utils';
|
|
@@ -18,15 +18,6 @@ import styled, { slotShouldForwardProp } from '../styles/styled';
|
|
|
18
18
|
import ratingClasses, { getRatingUtilityClass } from './ratingClasses';
|
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
-
function clamp(value, min, max) {
|
|
22
|
-
if (value < min) {
|
|
23
|
-
return min;
|
|
24
|
-
}
|
|
25
|
-
if (value > max) {
|
|
26
|
-
return max;
|
|
27
|
-
}
|
|
28
|
-
return value;
|
|
29
|
-
}
|
|
30
21
|
function getDecimalPrecision(num) {
|
|
31
22
|
var decimalPart = num.toString().split('.')[1];
|
|
32
23
|
return decimalPart ? decimalPart.length : 0;
|
|
@@ -78,6 +69,7 @@ var RatingRoot = styled('span', {
|
|
|
78
69
|
color: '#faaf00',
|
|
79
70
|
cursor: 'pointer',
|
|
80
71
|
textAlign: 'left',
|
|
72
|
+
width: 'min-content',
|
|
81
73
|
WebkitTapHighlightColor: 'transparent'
|
|
82
74
|
}, "&.".concat(ratingClasses.disabled), {
|
|
83
75
|
opacity: (theme.vars || theme).palette.action.disabledOpacity,
|
|
@@ -9,6 +9,7 @@ import { isFragment } from 'react-is';
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import clsx from 'clsx';
|
|
11
11
|
import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
|
|
12
|
+
import { clamp } from '@mui/utils';
|
|
12
13
|
import styled from '../styles/styled';
|
|
13
14
|
import useThemeProps from '../styles/useThemeProps';
|
|
14
15
|
import useTheme from '../styles/useTheme';
|
|
@@ -41,15 +42,6 @@ function getOrientation(direction) {
|
|
|
41
42
|
}
|
|
42
43
|
return undefined;
|
|
43
44
|
}
|
|
44
|
-
function clamp(value, min, max) {
|
|
45
|
-
if (value < min) {
|
|
46
|
-
return min;
|
|
47
|
-
}
|
|
48
|
-
if (value > max) {
|
|
49
|
-
return max;
|
|
50
|
-
}
|
|
51
|
-
return value;
|
|
52
|
-
}
|
|
53
45
|
var dialRadius = 32;
|
|
54
46
|
var spacingActions = 16;
|
|
55
47
|
var SpeedDialRoot = styled('div', {
|
package/legacy/index.js
CHANGED
|
@@ -37,7 +37,19 @@ function createTheme() {
|
|
|
37
37
|
shadows: shadows.slice(),
|
|
38
38
|
typography: createTypography(palette, typographyInput),
|
|
39
39
|
transitions: createTransitions(transitionsInput),
|
|
40
|
-
zIndex: _extends({}, zIndex)
|
|
40
|
+
zIndex: _extends({}, zIndex),
|
|
41
|
+
applyDarkStyles: function applyDarkStyles(css) {
|
|
42
|
+
if (this.vars) {
|
|
43
|
+
// If CssVarsProvider is used as a provider,
|
|
44
|
+
// returns ':where([data-mui-color-scheme="light|dark"]) &'
|
|
45
|
+
var selector = this.getColorSchemeSelector('dark').replace(/(\[[^\]]+\])/, ':where($1)');
|
|
46
|
+
return _defineProperty({}, selector, css);
|
|
47
|
+
}
|
|
48
|
+
if (this.palette.mode === 'dark') {
|
|
49
|
+
return css;
|
|
50
|
+
}
|
|
51
|
+
return {};
|
|
52
|
+
}
|
|
41
53
|
});
|
|
42
54
|
muiTheme = deepmerge(muiTheme, other);
|
|
43
55
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
|
+
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
7
|
+
import { appendOwnerState, resolveComponentProps, mergeSlotProps } from '@mui/base/utils';
|
|
8
|
+
/**
|
|
9
|
+
* An internal function to create a Material UI slot.
|
|
10
|
+
*
|
|
11
|
+
* This is an advanced version of Base UI `useSlotProps` because Material UI allows leaf component to be customized via `component` prop
|
|
12
|
+
* while Base UI does not need to support leaf component customization.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} name: name of the slot
|
|
15
|
+
* @param {object} parameters
|
|
16
|
+
* @returns {[Slot, slotProps]} The slot's React component and the slot's props
|
|
17
|
+
*
|
|
18
|
+
* Note: the returned slot's props
|
|
19
|
+
* - will never contain `component` prop.
|
|
20
|
+
* - might contain `as` prop.
|
|
21
|
+
*/
|
|
22
|
+
export default function useSlot(
|
|
23
|
+
/**
|
|
24
|
+
* The slot's name. All Material UI components should have `root` slot.
|
|
25
|
+
*
|
|
26
|
+
* If the name is `root`, the logic behaves differently from other slots,
|
|
27
|
+
* e.g. the `externalForwardedProps` are spread to `root` slot but not other slots.
|
|
28
|
+
*/
|
|
29
|
+
name, parameters) {
|
|
30
|
+
var className = parameters.className,
|
|
31
|
+
initialElementType = parameters.elementType,
|
|
32
|
+
ownerState = parameters.ownerState,
|
|
33
|
+
externalForwardedProps = parameters.externalForwardedProps,
|
|
34
|
+
getSlotOwnerState = parameters.getSlotOwnerState,
|
|
35
|
+
internalForwardedProps = parameters.internalForwardedProps,
|
|
36
|
+
useSlotPropsParams = _objectWithoutProperties(parameters, ["className", "elementType", "ownerState", "externalForwardedProps", "getSlotOwnerState", "internalForwardedProps"]);
|
|
37
|
+
var rootComponent = externalForwardedProps.component,
|
|
38
|
+
_externalForwardedPro = externalForwardedProps.slots,
|
|
39
|
+
slots = _externalForwardedPro === void 0 ? _defineProperty({}, name, undefined) : _externalForwardedPro,
|
|
40
|
+
_externalForwardedPro2 = externalForwardedProps.slotProps,
|
|
41
|
+
slotProps = _externalForwardedPro2 === void 0 ? _defineProperty({}, name, undefined) : _externalForwardedPro2,
|
|
42
|
+
other = _objectWithoutProperties(externalForwardedProps, ["component", "slots", "slotProps"]);
|
|
43
|
+
var elementType = slots[name] || initialElementType;
|
|
44
|
+
|
|
45
|
+
// `slotProps[name]` can be a callback that receives the component's ownerState.
|
|
46
|
+
// `resolvedComponentsProps` is always a plain object.
|
|
47
|
+
var resolvedComponentsProps = resolveComponentProps(slotProps[name], ownerState);
|
|
48
|
+
var _mergeSlotProps = mergeSlotProps(_extends({
|
|
49
|
+
className: className
|
|
50
|
+
}, useSlotPropsParams, {
|
|
51
|
+
externalForwardedProps: name === 'root' ? other : undefined,
|
|
52
|
+
externalSlotProps: resolvedComponentsProps
|
|
53
|
+
})),
|
|
54
|
+
_mergeSlotProps$props = _mergeSlotProps.props,
|
|
55
|
+
slotComponent = _mergeSlotProps$props.component,
|
|
56
|
+
mergedProps = _objectWithoutProperties(_mergeSlotProps$props, ["component"]),
|
|
57
|
+
internalRef = _mergeSlotProps.internalRef;
|
|
58
|
+
var ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, parameters.ref);
|
|
59
|
+
var slotOwnerState = getSlotOwnerState ? getSlotOwnerState(mergedProps) : {};
|
|
60
|
+
var finalOwnerState = _extends({}, ownerState, slotOwnerState);
|
|
61
|
+
var LeafComponent = name === 'root' ? slotComponent || rootComponent : slotComponent;
|
|
62
|
+
var props = appendOwnerState(elementType, _extends({}, name === 'root' && !rootComponent && !slots[name] && internalForwardedProps, name !== 'root' && !slots[name] && internalForwardedProps, mergedProps, LeafComponent && {
|
|
63
|
+
as: LeafComponent
|
|
64
|
+
}, {
|
|
65
|
+
ref: ref
|
|
66
|
+
}), finalOwnerState);
|
|
67
|
+
Object.keys(slotOwnerState).forEach(function (propName) {
|
|
68
|
+
delete props[propName];
|
|
69
|
+
});
|
|
70
|
+
return [elementType, props];
|
|
71
|
+
}
|