@mui/lab 6.0.0-beta.22 → 6.0.0-beta.24

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/CHANGELOG.md CHANGED
@@ -1,5 +1,96 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 6.4.1
4
+
5
+ <!-- generated comparing v6.4.0..master -->
6
+
7
+ _Jan 21, 2025_
8
+
9
+ A big thanks to the 9 contributors who made this release possible.
10
+
11
+ ### `@mui/material@6.4.1`
12
+
13
+ - [ButtonBase] Export types used in ButtonBase props (#43530) @Janpot
14
+ - [Dialog] Add slots and slotProps (#44792) @sai6855
15
+ - [Drawer] Deprecate composed classes (#44870) @yash49
16
+ - [IconButton] Set default loading to `null` (#45057) @siriwatknp
17
+ - [ListItem] Add codemod for deprecated props (#45022) @sai6855
18
+ - [Modal] Add migration guide and codemod for deprecated props (#45021) @sai6855
19
+ - [TextField] Fix filled state to be synced with autofill (#44135) @DiegoAndai
20
+
21
+ ### `@mui/system@6.4.1`
22
+
23
+ - Fix dark mode flicker using `useEnhancedEffect` (#44812) @siriwatknp
24
+
25
+ ### `@mui/utils@6.4.1`
26
+
27
+ - Do not deep merge React component (#45058) @siriwatknp
28
+
29
+ ### Docs
30
+
31
+ - Fix typo (#45070) @Fullchee
32
+ - Improve Toolpad templates section (#44914) @bharatkashyap
33
+ - Fix expand / collapse icons orientation (#44989) @zanivan
34
+ - Rename "Base UI" to "MUI Base" in all text (#45060) @mj12albert
35
+ - Add @mui/base deprecation callout (#45030) @mj12albert
36
+ - Update @mui/base deprecation message (#45064) @mj12albert
37
+
38
+ ### Core
39
+
40
+ - [code-infra] Add "use client" directive to files with React APIs (#45036) @Janpot
41
+ - [docs] 301 redirect `/base-ui` to `base-ui.com` (#45061) @mj12albert
42
+
43
+ All contributors of this release in alphabetical order: @bharatkashyap, @DiegoAndai, @Fullchee, @Janpot, @mj12albert, @sai6855, @siriwatknp, @yash49, @zanivan
44
+
45
+ ## 6.4.0
46
+
47
+ <!-- generated comparing v6.3.1..master -->
48
+
49
+ _Jan 13, 2025_
50
+
51
+ A big thanks to the 16 contributors who made this release possible. Here are some highlights ✨:
52
+
53
+ - Added [`loading` prop](https://mui.com/material-ui/react-button/#loading-2) to the `Button` and `IconButton` components (#44637) @siriwatknp
54
+
55
+ ### `@mui/material@6.4.0`
56
+
57
+ - [Alert] complete `slots` and `slotProps` (#44971) @siriwatknp
58
+ - [Autocomplete] Sync runtime and TS types for key in grouped options (#44862) @aarongarciah
59
+ - [Button] Add `loading` prop (#44637) @siriwatknp
60
+ - [CardHeader] Deprecate `*TypographyProps` and complete `slots`, `slotProps` (#44729) @siriwatknp
61
+ - [CircularProgress] Improve indeterminate animation to be symmetric and smooth (#44934) @yashdev16
62
+ - [LinearProgress] Deprecate composed classes (#44933) @headironc
63
+ - [Link] Fix error for using custom palette with underline (#44927) @siriwatknp
64
+ - [Select] Do not set `aria-controls` when closed (#44919) @siddhantantil39
65
+ - [Select] Add missing root class (#44928) @sai6855
66
+ - [Slider] Set onChangeCommitted to receive the last argument passed to onChange (#44795) @good-jinu
67
+ - Add `mergeSlotProps` for extending components (#44809) @siriwatknp
68
+ - Update `mergeSlotProps` to merge `style` (#44959) @siriwatknp
69
+ - Fix slots typing for Tooltip and StepLabel (#44985) @siriwatknp
70
+ - Remove unnecessary blank lines (#44980) @sai6855
71
+
72
+ ### Docs
73
+
74
+ - [docs] Fix Dashboard sidenav sroll (#44876) @oliviertassinari
75
+ - [docs] Fix broken anchor link to w3.org (c51af8e) @oliviertassinari
76
+ - [docs] Add details on complementary Menu components (#44957) @samuelsycamore
77
+ - [docs] Remove misleading messaging on MD3 support (#44953) @mnajdova
78
+ - [docs] Fix code copy button obscuring on small screen sizes (#44861) @ZeeshanTamboli
79
+ - [docs] Remove more instances of Adobe XD (#44956) @samuelsycamore
80
+ - [docs] Remove Adobe XD chips, links, and mentions (#44909) @samuelsycamore
81
+ - [docs] Fix incorrect rendering in Typography docs (#44937) @iaziz11
82
+
83
+ ### Core
84
+
85
+ - [core] Remove redundant screenshots (#44877) @oliviertassinari
86
+ - [core] Remove Suspense and clock mocking from regressions and e2e tests (#44935) @DiegoAndai
87
+ - [code-infra] Allow react@18 on `@mui/internal-test-utils` (#45023) @LukasTy
88
+ - [code-infra] Stabilize flaky pigment progressbar tests (#44969) @Janpot
89
+ - [example] Update the CDN example to adapt React 19. (#44979) @IceOfSummer
90
+ - [figma] Clarify that Material UI Sync plugin is experimental (#44975) @oliviertassinari
91
+
92
+ All contributors of this release in alphabetical order: @aarongarciah, @DiegoAndai, @good-jinu, @headironc, @iaziz11, @IceOfSummer, @Janpot, @LukasTy, @mnajdova, @oliviertassinari, @sai6855, @samuelsycamore, @siddhantantil39, @siriwatknp, @yashdev16, @ZeeshanTamboli
93
+
3
94
  ## 6.3.1
4
95
 
5
96
  <!-- generated comparing v6.3.0..master -->
@@ -1,80 +1,2 @@
1
- import { ExtendButton, ExtendButtonTypeMap, ButtonClasses } from '@mui/material/Button';
2
- import { OverrideProps } from '@mui/material/OverridableComponent';
3
- import { Theme } from '@mui/material/styles';
4
- import { SxProps } from '@mui/system';
5
-
6
- export interface LoadingButtonOwnProps {
7
- /**
8
- * Override or extend the styles applied to the component.
9
- */
10
- classes?: Partial<ButtonClasses> & {
11
- /** Styles applied to the root element. */
12
- root?: string;
13
- /** Styles applied to the span element that wraps the children. */
14
- label?: string;
15
- /** Styles applied to the root element if `loading={true}`. */
16
- loading?: string;
17
- /** Styles applied to the loadingIndicator element. */
18
- loadingIndicator?: string;
19
- /** Styles applied to the loadingIndicator element if `loadingPosition="center"`. */
20
- loadingIndicatorCenter?: string;
21
- /** Styles applied to the loadingIndicator element if `loadingPosition="start"`. */
22
- loadingIndicatorStart?: string;
23
- /** Styles applied to the loadingIndicator element if `loadingPosition="end"`. */
24
- loadingIndicatorEnd?: string;
25
- /** Styles applied to the endIcon element if `loading={true}` and `loadingPosition="end"`. */
26
- endIconLoadingEnd?: string;
27
- /** Styles applied to the startIcon element if `loading={true}` and `loadingPosition="start"`. */
28
- startIconLoadingStart?: string;
29
- };
30
- /**
31
- * If `true`, the loading indicator is shown and the button becomes disabled.
32
- * @default false
33
- */
34
- loading?: boolean;
35
- /**
36
- * Element placed before the children if the button is in loading state.
37
- * The node should contain an element with `role="progressbar"` with an accessible name.
38
- * By default we render a `CircularProgress` that is labelled by the button itself.
39
- * @default <CircularProgress color="inherit" size={16} />
40
- */
41
- loadingIndicator?: React.ReactNode;
42
- /**
43
- * The loading indicator can be positioned on the start, end, or the center of the button.
44
- * @default 'center'
45
- */
46
- loadingPosition?: 'start' | 'end' | 'center';
47
- /**
48
- * The system prop that allows defining system overrides as well as additional CSS styles.
49
- */
50
- sx?: SxProps<Theme>;
51
- }
52
-
53
- export type LoadingButtonTypeMap<
54
- AdditionalProps = {},
55
- RootComponent extends React.ElementType = 'button',
56
- > = ExtendButtonTypeMap<{
57
- props: AdditionalProps & LoadingButtonOwnProps;
58
- defaultComponent: RootComponent;
59
- }>;
60
-
61
- /**
62
- *
63
- * Demos:
64
- *
65
- * - [Button Group](https://mui.com/material-ui/react-button-group/)
66
- * - [Button](https://mui.com/material-ui/react-button/)
67
- *
68
- * API:
69
- *
70
- * - [LoadingButton API](https://mui.com/material-ui/api/loading-button/)
71
- * - inherits [Button API](https://mui.com/material-ui/api/button/)
72
- */
73
- declare const LoadingButton: ExtendButton<LoadingButtonTypeMap>;
74
-
75
- export type LoadingButtonProps<
76
- RootComponent extends React.ElementType = LoadingButtonTypeMap['defaultComponent'],
77
- AdditionalProps = {},
78
- > = OverrideProps<LoadingButtonTypeMap<AdditionalProps, RootComponent>, RootComponent>;
79
-
80
- export default LoadingButton;
1
+ export { default } from '@mui/material/Button';
2
+ export * from '@mui/material/Button';
@@ -1,312 +1,23 @@
1
1
  'use client';
2
2
 
3
3
  import * as React from 'react';
4
- import PropTypes from 'prop-types';
5
- import { chainPropTypes } from '@mui/utils';
6
- import { capitalize, unstable_useId as useId, unstable_memoTheme as memoTheme } from '@mui/material/utils';
7
- import { unstable_composeClasses as composeClasses } from '@mui/base';
8
- import { useDefaultProps } from '@mui/material/DefaultPropsProvider';
9
4
  import Button from '@mui/material/Button';
10
- import { ButtonGroupContext } from '@mui/material/ButtonGroup';
11
- import CircularProgress from '@mui/material/CircularProgress';
12
- import resolveProps from '@mui/utils/resolveProps';
13
- import { styled } from "../zero-styled/index.js";
14
- import loadingButtonClasses, { getLoadingButtonUtilityClass } from "./loadingButtonClasses.js";
15
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
- const useUtilityClasses = ownerState => {
17
- const {
18
- loading,
19
- loadingPosition,
20
- classes
21
- } = ownerState;
22
- const slots = {
23
- root: ['root', loading && 'loading'],
24
- label: ['label'],
25
- startIcon: [loading && `startIconLoading${capitalize(loadingPosition)}`],
26
- endIcon: [loading && `endIconLoading${capitalize(loadingPosition)}`],
27
- loadingIndicator: ['loadingIndicator', loading && `loadingIndicator${capitalize(loadingPosition)}`]
28
- };
29
- const composedClasses = composeClasses(slots, getLoadingButtonUtilityClass, classes);
30
- return {
31
- ...classes,
32
- // forward the outlined, color, etc. classes to Button
33
- ...composedClasses
34
- };
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ let warnedOnce = false;
7
+ const warn = () => {
8
+ if (!warnedOnce) {
9
+ console.warn(['MUI: The LoadingButton component functionality is now part of the Button component from Material UI.', '', "You should use `import Button from '@mui/material/Button'`", "or `import { Button } from '@mui/material'`"].join('\n'));
10
+ warnedOnce = true;
11
+ }
35
12
  };
36
13
 
37
- // TODO use `import rootShouldForwardProp from '../styles/rootShouldForwardProp';` once move to core
38
- const rootShouldForwardProp = prop => prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as' && prop !== 'classes';
39
- const LoadingButtonRoot = styled(Button, {
40
- shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes',
41
- name: 'MuiLoadingButton',
42
- slot: 'Root',
43
- overridesResolver: (props, styles) => {
44
- return [styles.root, styles.startIconLoadingStart && {
45
- [`& .${loadingButtonClasses.startIconLoadingStart}`]: styles.startIconLoadingStart
46
- }, styles.endIconLoadingEnd && {
47
- [`& .${loadingButtonClasses.endIconLoadingEnd}`]: styles.endIconLoadingEnd
48
- }];
49
- }
50
- })(memoTheme(({
51
- theme
52
- }) => ({
53
- display: 'inline-flex',
54
- [`& .${loadingButtonClasses.startIconLoadingStart}, & .${loadingButtonClasses.endIconLoadingEnd}`]: {
55
- transition: theme.transitions.create(['opacity'], {
56
- duration: theme.transitions.duration.short
57
- }),
58
- opacity: 0
59
- },
60
- variants: [{
61
- props: {
62
- loadingPosition: 'center'
63
- },
64
- style: {
65
- transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color'], {
66
- duration: theme.transitions.duration.short
67
- }),
68
- [`&.${loadingButtonClasses.loading}`]: {
69
- color: 'transparent'
70
- }
71
- }
72
- }, {
73
- props: ({
74
- ownerState
75
- }) => ownerState.loadingPosition === 'start' && ownerState.fullWidth,
76
- style: {
77
- [`& .${loadingButtonClasses.startIconLoadingStart}, & .${loadingButtonClasses.endIconLoadingEnd}`]: {
78
- transition: theme.transitions.create(['opacity'], {
79
- duration: theme.transitions.duration.short
80
- }),
81
- opacity: 0,
82
- marginRight: -8
83
- }
84
- }
85
- }, {
86
- props: ({
87
- ownerState
88
- }) => ownerState.loadingPosition === 'end' && ownerState.fullWidth,
89
- style: {
90
- [`& .${loadingButtonClasses.startIconLoadingStart}, & .${loadingButtonClasses.endIconLoadingEnd}`]: {
91
- transition: theme.transitions.create(['opacity'], {
92
- duration: theme.transitions.duration.short
93
- }),
94
- opacity: 0,
95
- marginLeft: -8
96
- }
97
- }
98
- }]
99
- })));
100
- const LoadingButtonLoadingIndicator = styled('span', {
101
- name: 'MuiLoadingButton',
102
- slot: 'LoadingIndicator',
103
- overridesResolver: (props, styles) => {
104
- const {
105
- ownerState
106
- } = props;
107
- return [styles.loadingIndicator, styles[`loadingIndicator${capitalize(ownerState.loadingPosition)}`]];
108
- }
109
- })(memoTheme(({
110
- theme
111
- }) => ({
112
- position: 'absolute',
113
- visibility: 'visible',
114
- display: 'flex',
115
- variants: [{
116
- props: {
117
- loadingPosition: 'start',
118
- size: 'small'
119
- },
120
- style: {
121
- left: 10
122
- }
123
- }, {
124
- props: ({
125
- loadingPosition,
126
- ownerState
127
- }) => loadingPosition === 'start' && ownerState.size !== 'small',
128
- style: {
129
- left: 14
130
- }
131
- }, {
132
- props: {
133
- variant: 'text',
134
- loadingPosition: 'start'
135
- },
136
- style: {
137
- left: 6
138
- }
139
- }, {
140
- props: {
141
- loadingPosition: 'center'
142
- },
143
- style: {
144
- left: '50%',
145
- transform: 'translate(-50%)',
146
- color: (theme.vars || theme).palette.action.disabled
147
- }
148
- }, {
149
- props: {
150
- loadingPosition: 'end',
151
- size: 'small'
152
- },
153
- style: {
154
- right: 10
155
- }
156
- }, {
157
- props: ({
158
- loadingPosition,
159
- ownerState
160
- }) => loadingPosition === 'end' && ownerState.size !== 'small',
161
- style: {
162
- right: 14
163
- }
164
- }, {
165
- props: {
166
- variant: 'text',
167
- loadingPosition: 'end'
168
- },
169
- style: {
170
- right: 6
171
- }
172
- }, {
173
- props: ({
174
- ownerState
175
- }) => ownerState.loadingPosition === 'start' && ownerState.fullWidth,
176
- style: {
177
- position: 'relative',
178
- left: -10
179
- }
180
- }, {
181
- props: ({
182
- ownerState
183
- }) => ownerState.loadingPosition === 'end' && ownerState.fullWidth,
184
- style: {
185
- position: 'relative',
186
- right: -10
187
- }
188
- }]
189
- })));
190
- const LoadingButtonLabel = styled('span', {
191
- name: 'MuiLoadingButton',
192
- slot: 'Label',
193
- overridesResolver: (props, styles) => {
194
- return [styles.label];
195
- }
196
- })({
197
- display: 'inherit',
198
- alignItems: 'inherit',
199
- justifyContent: 'inherit'
200
- });
201
- const LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(inProps, ref) {
202
- const contextProps = React.useContext(ButtonGroupContext);
203
- const resolvedProps = resolveProps(contextProps, inProps);
204
- const props = useDefaultProps({
205
- props: resolvedProps,
206
- name: 'MuiLoadingButton'
207
- });
208
- const {
209
- children,
210
- disabled = false,
211
- id: idProp,
212
- loading = false,
213
- loadingIndicator: loadingIndicatorProp,
214
- loadingPosition = 'center',
215
- variant = 'text',
216
- ...other
217
- } = props;
218
- const id = useId(idProp);
219
- const loadingIndicator = loadingIndicatorProp ?? /*#__PURE__*/_jsx(CircularProgress, {
220
- "aria-labelledby": id,
221
- color: "inherit",
222
- size: 16
223
- });
224
- const ownerState = {
225
- ...props,
226
- disabled,
227
- loading,
228
- loadingIndicator,
229
- loadingPosition,
230
- variant
231
- };
232
- const classes = useUtilityClasses(ownerState);
233
- const loadingButtonLoadingIndicator = loading ? /*#__PURE__*/_jsx(LoadingButtonLoadingIndicator, {
234
- className: classes.loadingIndicator,
235
- ownerState: ownerState,
236
- children: loadingIndicator
237
- }) : null;
238
- return /*#__PURE__*/_jsxs(LoadingButtonRoot, {
239
- disabled: disabled || loading,
240
- id: id,
14
+ /**
15
+ * @ignore - do not document.
16
+ */
17
+ export default /*#__PURE__*/React.forwardRef(function DeprecatedLoadingButton(props, ref) {
18
+ warn();
19
+ return /*#__PURE__*/_jsx(Button, {
241
20
  ref: ref,
242
- ...other,
243
- variant: variant,
244
- classes: classes,
245
- ownerState: ownerState,
246
- children: [ownerState.loadingPosition === 'end' ? /*#__PURE__*/_jsx(LoadingButtonLabel, {
247
- className: classes.label,
248
- children: children
249
- }) : loadingButtonLoadingIndicator, ownerState.loadingPosition === 'end' ? loadingButtonLoadingIndicator : /*#__PURE__*/_jsx(LoadingButtonLabel, {
250
- className: classes.label,
251
- children: children
252
- })]
21
+ ...props
253
22
  });
254
- });
255
- process.env.NODE_ENV !== "production" ? LoadingButton.propTypes /* remove-proptypes */ = {
256
- // ┌────────────────────────────── Warning ──────────────────────────────┐
257
- // │ These PropTypes are generated from the TypeScript type definitions. │
258
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
259
- // └─────────────────────────────────────────────────────────────────────┘
260
- /**
261
- * The content of the component.
262
- */
263
- children: PropTypes.node,
264
- /**
265
- * Override or extend the styles applied to the component.
266
- */
267
- classes: PropTypes.object,
268
- /**
269
- * If `true`, the component is disabled.
270
- * @default false
271
- */
272
- disabled: PropTypes.bool,
273
- /**
274
- * @ignore
275
- */
276
- id: PropTypes.string,
277
- /**
278
- * If `true`, the loading indicator is shown and the button becomes disabled.
279
- * @default false
280
- */
281
- loading: PropTypes.bool,
282
- /**
283
- * Element placed before the children if the button is in loading state.
284
- * The node should contain an element with `role="progressbar"` with an accessible name.
285
- * By default we render a `CircularProgress` that is labelled by the button itself.
286
- * @default <CircularProgress color="inherit" size={16} />
287
- */
288
- loadingIndicator: PropTypes.node,
289
- /**
290
- * The loading indicator can be positioned on the start, end, or the center of the button.
291
- * @default 'center'
292
- */
293
- loadingPosition: chainPropTypes(PropTypes.oneOf(['start', 'end', 'center']), props => {
294
- if (props.loadingPosition === 'start' && !props.startIcon) {
295
- return new Error(`MUI: The loadingPosition="start" should be used in combination with startIcon.`);
296
- }
297
- if (props.loadingPosition === 'end' && !props.endIcon) {
298
- return new Error(`MUI: The loadingPosition="end" should be used in combination with endIcon.`);
299
- }
300
- return null;
301
- }),
302
- /**
303
- * The system prop that allows defining system overrides as well as additional CSS styles.
304
- */
305
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
306
- /**
307
- * The variant to use.
308
- * @default 'text'
309
- */
310
- variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['contained', 'outlined', 'text']), PropTypes.string])
311
- } : void 0;
312
- export default LoadingButton;
23
+ });
@@ -1,5 +1,2 @@
1
1
  export { default } from './LoadingButton';
2
2
  export * from './LoadingButton';
3
-
4
- export { default as loadingButtonClasses } from './loadingButtonClasses';
5
- export * from './loadingButtonClasses';
@@ -1,3 +1 @@
1
- export { default } from "./LoadingButton.js";
2
- export { default as loadingButtonClasses } from "./loadingButtonClasses.js";
3
- export * from "./loadingButtonClasses.js";
1
+ export { default } from "./LoadingButton.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
 
3
5
  /**
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/lab v6.0.0-beta.22
2
+ * @mui/lab v6.0.0-beta.24
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the