@mui/material 6.4.7 → 6.4.8

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.
Files changed (44) hide show
  1. package/Accordion/Accordion.d.ts +17 -2
  2. package/Accordion/Accordion.js +18 -6
  3. package/AccordionSummary/AccordionSummary.d.ts +59 -4
  4. package/AccordionSummary/AccordionSummary.js +67 -16
  5. package/CHANGELOG.md +47 -4
  6. package/ListItemText/ListItemText.d.ts +10 -0
  7. package/ListItemText/ListItemText.js +14 -5
  8. package/Snackbar/Snackbar.js +7 -1
  9. package/SpeedDial/SpeedDial.d.ts +10 -0
  10. package/SpeedDial/SpeedDial.js +40 -11
  11. package/SpeedDialAction/SpeedDialAction.js +1 -1
  12. package/TextareaAutosize/TextareaAutosize.js +26 -15
  13. package/Tooltip/Tooltip.d.ts +1 -13
  14. package/Tooltip/Tooltip.js +1 -1
  15. package/index.js +1 -1
  16. package/modern/Accordion/Accordion.js +18 -6
  17. package/modern/AccordionSummary/AccordionSummary.js +67 -16
  18. package/modern/ListItemText/ListItemText.js +14 -5
  19. package/modern/Snackbar/Snackbar.js +7 -1
  20. package/modern/SpeedDial/SpeedDial.js +40 -11
  21. package/modern/SpeedDialAction/SpeedDialAction.js +1 -1
  22. package/modern/TextareaAutosize/TextareaAutosize.js +26 -15
  23. package/modern/Tooltip/Tooltip.js +1 -1
  24. package/modern/index.js +1 -1
  25. package/modern/styles/ThemeProvider.js +11 -0
  26. package/modern/useScrollTrigger/useScrollTrigger.js +3 -0
  27. package/modern/version/index.js +2 -2
  28. package/node/Accordion/Accordion.js +18 -6
  29. package/node/AccordionSummary/AccordionSummary.js +67 -16
  30. package/node/ListItemText/ListItemText.js +14 -5
  31. package/node/Snackbar/Snackbar.js +7 -1
  32. package/node/SpeedDial/SpeedDial.js +40 -11
  33. package/node/SpeedDialAction/SpeedDialAction.js +1 -1
  34. package/node/TextareaAutosize/TextareaAutosize.js +25 -14
  35. package/node/Tooltip/Tooltip.js +1 -1
  36. package/node/index.js +1 -1
  37. package/node/styles/ThemeProvider.js +11 -0
  38. package/node/useScrollTrigger/useScrollTrigger.js +3 -0
  39. package/node/version/index.js +2 -2
  40. package/package.json +6 -6
  41. package/styles/ThemeProvider.js +11 -0
  42. package/useScrollTrigger/useScrollTrigger.d.ts +1 -1
  43. package/useScrollTrigger/useScrollTrigger.js +3 -0
  44. package/version/index.js +2 -2
@@ -841,7 +841,7 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes /* remove-proptypes */
841
841
  * Tooltip placement.
842
842
  * @default 'bottom'
843
843
  */
844
- placement: PropTypes.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
844
+ placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
845
845
  /**
846
846
  * The component used for the popper.
847
847
  * @deprecated use the `slots.popper` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.4.7
2
+ * @mui/material v6.4.8
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -185,6 +185,20 @@ const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref)
185
185
  slots: backwardCompatibleSlots,
186
186
  slotProps: backwardCompatibleSlotProps
187
187
  };
188
+ const [RootSlot, rootProps] = useSlot('root', {
189
+ elementType: AccordionRoot,
190
+ externalForwardedProps: {
191
+ ...externalForwardedProps,
192
+ ...other
193
+ },
194
+ className: clsx(classes.root, className),
195
+ shouldForwardComponentProp: true,
196
+ ownerState,
197
+ ref,
198
+ additionalProps: {
199
+ square
200
+ }
201
+ });
188
202
  const [AccordionHeadingSlot, accordionProps] = useSlot('heading', {
189
203
  elementType: AccordionHeading,
190
204
  externalForwardedProps,
@@ -196,12 +210,8 @@ const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref)
196
210
  externalForwardedProps,
197
211
  ownerState
198
212
  });
199
- return /*#__PURE__*/_jsxs(AccordionRoot, {
200
- className: clsx(classes.root, className),
201
- ref: ref,
202
- ownerState: ownerState,
203
- square: square,
204
- ...other,
213
+ return /*#__PURE__*/_jsxs(RootSlot, {
214
+ ...rootProps,
205
215
  children: [/*#__PURE__*/_jsx(AccordionHeadingSlot, {
206
216
  ...accordionProps,
207
217
  children: /*#__PURE__*/_jsx(AccordionContext.Provider, {
@@ -281,6 +291,7 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
281
291
  */
282
292
  slotProps: PropTypes.shape({
283
293
  heading: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
294
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
284
295
  transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
285
296
  }),
286
297
  /**
@@ -289,6 +300,7 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
289
300
  */
290
301
  slots: PropTypes.shape({
291
302
  heading: PropTypes.elementType,
303
+ root: PropTypes.elementType,
292
304
  transition: PropTypes.elementType
293
305
  }),
294
306
  /**
@@ -10,6 +10,7 @@ import { useDefaultProps } from "../DefaultPropsProvider/index.js";
10
10
  import ButtonBase from "../ButtonBase/index.js";
11
11
  import AccordionContext from "../Accordion/AccordionContext.js";
12
12
  import accordionSummaryClasses, { getAccordionSummaryUtilityClass } from "./accordionSummaryClasses.js";
13
+ import useSlot from "../utils/useSlot.js";
13
14
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
15
  const useUtilityClasses = ownerState => {
15
16
  const {
@@ -112,6 +113,8 @@ const AccordionSummary = /*#__PURE__*/React.forwardRef(function AccordionSummary
112
113
  expandIcon,
113
114
  focusVisibleClassName,
114
115
  onClick,
116
+ slots,
117
+ slotProps,
115
118
  ...other
116
119
  } = props;
117
120
  const {
@@ -135,24 +138,54 @@ const AccordionSummary = /*#__PURE__*/React.forwardRef(function AccordionSummary
135
138
  disableGutters
136
139
  };
137
140
  const classes = useUtilityClasses(ownerState);
138
- return /*#__PURE__*/_jsxs(AccordionSummaryRoot, {
139
- focusRipple: false,
140
- disableRipple: true,
141
- disabled: disabled,
142
- "aria-expanded": expanded,
141
+ const externalForwardedProps = {
142
+ slots,
143
+ slotProps
144
+ };
145
+ const [RootSlot, rootSlotProps] = useSlot('root', {
146
+ ref,
147
+ shouldForwardComponentProp: true,
143
148
  className: clsx(classes.root, className),
144
- focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),
145
- onClick: handleChange,
146
- ref: ref,
147
- ownerState: ownerState,
148
- ...other,
149
- children: [/*#__PURE__*/_jsx(AccordionSummaryContent, {
150
- className: classes.content,
151
- ownerState: ownerState,
149
+ elementType: AccordionSummaryRoot,
150
+ externalForwardedProps: {
151
+ ...externalForwardedProps,
152
+ ...other
153
+ },
154
+ ownerState,
155
+ additionalProps: {
156
+ focusRipple: false,
157
+ disableRipple: true,
158
+ disabled,
159
+ 'aria-expanded': expanded,
160
+ focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName)
161
+ },
162
+ getSlotProps: handlers => ({
163
+ ...handlers,
164
+ onClick: event => {
165
+ handlers.onClick?.(event);
166
+ handleChange(event);
167
+ }
168
+ })
169
+ });
170
+ const [ContentSlot, contentSlotProps] = useSlot('content', {
171
+ className: classes.content,
172
+ elementType: AccordionSummaryContent,
173
+ externalForwardedProps,
174
+ ownerState
175
+ });
176
+ const [ExpandIconWrapperSlot, expandIconWrapperSlotProps] = useSlot('expandIconWrapper', {
177
+ className: classes.expandIconWrapper,
178
+ elementType: AccordionSummaryExpandIconWrapper,
179
+ externalForwardedProps,
180
+ ownerState
181
+ });
182
+ return /*#__PURE__*/_jsxs(RootSlot, {
183
+ ...rootSlotProps,
184
+ children: [/*#__PURE__*/_jsx(ContentSlot, {
185
+ ...contentSlotProps,
152
186
  children: children
153
- }), expandIcon && /*#__PURE__*/_jsx(AccordionSummaryExpandIconWrapper, {
154
- className: classes.expandIconWrapper,
155
- ownerState: ownerState,
187
+ }), expandIcon && /*#__PURE__*/_jsx(ExpandIconWrapperSlot, {
188
+ ...expandIconWrapperSlotProps,
156
189
  children: expandIcon
157
190
  })]
158
191
  });
@@ -191,6 +224,24 @@ process.env.NODE_ENV !== "production" ? AccordionSummary.propTypes /* remove-pro
191
224
  * @ignore
192
225
  */
193
226
  onClick: PropTypes.func,
227
+ /**
228
+ * The props used for each slot inside.
229
+ * @default {}
230
+ */
231
+ slotProps: PropTypes.shape({
232
+ content: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
233
+ expandIconWrapper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
234
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
235
+ }),
236
+ /**
237
+ * The components used for each slot inside.
238
+ * @default {}
239
+ */
240
+ slots: PropTypes.shape({
241
+ content: PropTypes.elementType,
242
+ expandIconWrapper: PropTypes.elementType,
243
+ root: PropTypes.elementType
244
+ }),
194
245
  /**
195
246
  * The system prop that allows defining system overrides as well as additional CSS styles.
196
247
  */
@@ -107,6 +107,16 @@ const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps
107
107
  ...slotProps
108
108
  }
109
109
  };
110
+ const [RootSlot, rootSlotProps] = useSlot('root', {
111
+ className: clsx(classes.root, className),
112
+ elementType: ListItemTextRoot,
113
+ externalForwardedProps: {
114
+ ...externalForwardedProps,
115
+ ...other
116
+ },
117
+ ownerState,
118
+ ref
119
+ });
110
120
  const [PrimarySlot, primarySlotProps] = useSlot('primary', {
111
121
  className: classes.primary,
112
122
  elementType: Typography,
@@ -135,11 +145,8 @@ const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps
135
145
  children: secondary
136
146
  });
137
147
  }
138
- return /*#__PURE__*/_jsxs(ListItemTextRoot, {
139
- className: clsx(classes.root, className),
140
- ownerState: ownerState,
141
- ref: ref,
142
- ...other,
148
+ return /*#__PURE__*/_jsxs(RootSlot, {
149
+ ...rootSlotProps,
143
150
  children: [primary, secondary]
144
151
  });
145
152
  });
@@ -200,6 +207,7 @@ process.env.NODE_ENV !== "production" ? ListItemText.propTypes /* remove-proptyp
200
207
  */
201
208
  slotProps: PropTypes.shape({
202
209
  primary: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
210
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
203
211
  secondary: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
204
212
  }),
205
213
  /**
@@ -208,6 +216,7 @@ process.env.NODE_ENV !== "production" ? ListItemText.propTypes /* remove-proptyp
208
216
  */
209
217
  slots: PropTypes.shape({
210
218
  primary: PropTypes.elementType,
219
+ root: PropTypes.elementType,
211
220
  secondary: PropTypes.elementType
212
221
  }),
213
222
  /**
@@ -196,7 +196,10 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
196
196
  },
197
197
  ownerState
198
198
  });
199
- const [ClickAwaySlot, clickAwayListenerProps] = useSlot('clickAwayListener', {
199
+ const [ClickAwaySlot, {
200
+ ownerState: clickAwayOwnerStateProp,
201
+ ...clickAwayListenerProps
202
+ }] = useSlot('clickAwayListener', {
200
203
  elementType: ClickAwayListener,
201
204
  externalForwardedProps,
202
205
  getSlotProps: handlers => ({
@@ -245,6 +248,9 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
245
248
  }
246
249
  return /*#__PURE__*/_jsx(ClickAwaySlot, {
247
250
  ...clickAwayListenerProps,
251
+ ...(slots.clickAwayListener && {
252
+ ownerState: clickAwayOwnerStateProp
253
+ }),
248
254
  children: /*#__PURE__*/_jsx(Root, {
249
255
  ...rootProps,
250
256
  children: /*#__PURE__*/_jsx(TransitionSlot, {
@@ -372,22 +372,49 @@ const SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref)
372
372
  slots: backwardCompatibleSlots,
373
373
  slotProps: backwardCompatibleSlotProps
374
374
  };
375
+ const [RootSlot, rootSlotProps] = useSlot('root', {
376
+ elementType: SpeedDialRoot,
377
+ externalForwardedProps: {
378
+ ...externalForwardedProps,
379
+ ...other
380
+ },
381
+ ownerState,
382
+ ref,
383
+ className: clsx(classes.root, className),
384
+ additionalProps: {
385
+ role: 'presentation'
386
+ },
387
+ getSlotProps: handlers => ({
388
+ ...handlers,
389
+ onKeyDown: event => {
390
+ handlers.onKeyDown?.(event);
391
+ handleKeyDown(event);
392
+ },
393
+ onBlur: event => {
394
+ handlers.onBlur?.(event);
395
+ handleClose(event);
396
+ },
397
+ onFocus: event => {
398
+ handlers.onFocus?.(event);
399
+ handleOpen(event);
400
+ },
401
+ onMouseEnter: event => {
402
+ handlers.onMouseEnter?.(event);
403
+ handleOpen(event);
404
+ },
405
+ onMouseLeave: event => {
406
+ handlers.onMouseLeave?.(event);
407
+ handleClose(event);
408
+ }
409
+ })
410
+ });
375
411
  const [TransitionSlot, transitionProps] = useSlot('transition', {
376
412
  elementType: Zoom,
377
413
  externalForwardedProps,
378
414
  ownerState
379
415
  });
380
- return /*#__PURE__*/_jsxs(SpeedDialRoot, {
381
- className: clsx(classes.root, className),
382
- ref: ref,
383
- role: "presentation",
384
- onKeyDown: handleKeyDown,
385
- onBlur: handleClose,
386
- onFocus: handleOpen,
387
- onMouseEnter: handleOpen,
388
- onMouseLeave: handleClose,
389
- ownerState: ownerState,
390
- ...other,
416
+ return /*#__PURE__*/_jsxs(RootSlot, {
417
+ ...rootSlotProps,
391
418
  children: [/*#__PURE__*/_jsx(TransitionSlot, {
392
419
  in: !hidden,
393
420
  timeout: transitionDuration,
@@ -507,6 +534,7 @@ process.env.NODE_ENV !== "production" ? SpeedDial.propTypes /* remove-proptypes
507
534
  * @default {}
508
535
  */
509
536
  slotProps: PropTypes.shape({
537
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
510
538
  transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
511
539
  }),
512
540
  /**
@@ -514,6 +542,7 @@ process.env.NODE_ENV !== "production" ? SpeedDial.propTypes /* remove-proptypes
514
542
  * @default {}
515
543
  */
516
544
  slots: PropTypes.shape({
545
+ root: PropTypes.elementType,
517
546
  transition: PropTypes.elementType
518
547
  }),
519
548
  /**
@@ -341,7 +341,7 @@ process.env.NODE_ENV !== "production" ? SpeedDialAction.propTypes /* remove-prop
341
341
  * @default 'left'
342
342
  * @deprecated Use `slotProps.tooltip.placement` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
343
343
  */
344
- tooltipPlacement: PropTypes.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
344
+ tooltipPlacement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
345
345
  /**
346
346
  * Label to display in the tooltip.
347
347
  * @deprecated Use `slotProps.tooltip.title` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  import PropTypes from 'prop-types';
5
- import { unstable_debounce as debounce, unstable_useForkRef as useForkRef, unstable_useEnhancedEffect as useEnhancedEffect, unstable_ownerWindow as ownerWindow } from '@mui/utils';
5
+ import { unstable_debounce as debounce, unstable_useForkRef as useForkRef, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useEventCallback as useEventCallback, unstable_ownerWindow as ownerWindow } from '@mui/utils';
6
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
7
  function getStyleValue(value) {
8
8
  return parseInt(value, 10) || 0;
@@ -112,6 +112,15 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
112
112
  overflowing
113
113
  };
114
114
  }, [maxRows, minRows, props.placeholder]);
115
+ const didHeightChange = useEventCallback(() => {
116
+ const textarea = textareaRef.current;
117
+ const textareaStyles = calculateTextareaStyles();
118
+ if (!textarea || !textareaStyles || isEmpty(textareaStyles)) {
119
+ return false;
120
+ }
121
+ const outerHeightStyle = textareaStyles.outerHeightStyle;
122
+ return heightRef.current != null && heightRef.current !== outerHeightStyle;
123
+ });
115
124
  const syncHeight = React.useCallback(() => {
116
125
  const textarea = textareaRef.current;
117
126
  const textareaStyles = calculateTextareaStyles();
@@ -127,37 +136,39 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
127
136
  }, [calculateTextareaStyles]);
128
137
  const frameRef = React.useRef(-1);
129
138
  useEnhancedEffect(() => {
130
- const debounceHandleResize = debounce(() => syncHeight());
139
+ const debouncedHandleResize = debounce(syncHeight);
131
140
  const textarea = textareaRef?.current;
132
141
  if (!textarea) {
133
142
  return undefined;
134
143
  }
135
144
  const containerWindow = ownerWindow(textarea);
136
- containerWindow.addEventListener('resize', debounceHandleResize);
145
+ containerWindow.addEventListener('resize', debouncedHandleResize);
137
146
  let resizeObserver;
138
147
  if (typeof ResizeObserver !== 'undefined') {
139
148
  resizeObserver = new ResizeObserver(() => {
140
- // avoid "ResizeObserver loop completed with undelivered notifications" error
141
- // by temporarily unobserving the textarea element while manipulating the height
142
- // and reobserving one frame later
143
- resizeObserver.unobserve(textarea);
144
- cancelAnimationFrame(frameRef.current);
145
- syncHeight();
146
- frameRef.current = requestAnimationFrame(() => {
147
- resizeObserver.observe(textarea);
148
- });
149
+ if (didHeightChange()) {
150
+ // avoid "ResizeObserver loop completed with undelivered notifications" error
151
+ // by temporarily unobserving the textarea element while manipulating the height
152
+ // and reobserving one frame later
153
+ resizeObserver.unobserve(textarea);
154
+ cancelAnimationFrame(frameRef.current);
155
+ syncHeight();
156
+ frameRef.current = requestAnimationFrame(() => {
157
+ resizeObserver.observe(textarea);
158
+ });
159
+ }
149
160
  });
150
161
  resizeObserver.observe(textarea);
151
162
  }
152
163
  return () => {
153
- debounceHandleResize.clear();
164
+ debouncedHandleResize.clear();
154
165
  cancelAnimationFrame(frameRef.current);
155
- containerWindow.removeEventListener('resize', debounceHandleResize);
166
+ containerWindow.removeEventListener('resize', debouncedHandleResize);
156
167
  if (resizeObserver) {
157
168
  resizeObserver.disconnect();
158
169
  }
159
170
  };
160
- }, [calculateTextareaStyles, syncHeight]);
171
+ }, [calculateTextareaStyles, syncHeight, didHeightChange]);
161
172
  useEnhancedEffect(() => {
162
173
  syncHeight();
163
174
  });
@@ -841,7 +841,7 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes /* remove-proptypes */
841
841
  * Tooltip placement.
842
842
  * @default 'bottom'
843
843
  */
844
- placement: PropTypes.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
844
+ placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
845
845
  /**
846
846
  * The component used for the popper.
847
847
  * @deprecated use the `slots.popper` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.4.7
2
+ * @mui/material v6.4.8
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -17,6 +17,17 @@ export default function ThemeProvider({
17
17
  }
18
18
  const muiTheme = THEME_ID in theme ? theme[THEME_ID] : theme;
19
19
  if (!('colorSchemes' in muiTheme)) {
20
+ if (!('vars' in muiTheme)) {
21
+ // For non-CSS variables themes, set `vars` to null to prevent theme inheritance from the upper theme.
22
+ // The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
23
+ return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
24
+ theme: {
25
+ ...theme,
26
+ vars: null
27
+ },
28
+ ...props
29
+ });
30
+ }
20
31
  return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
21
32
  theme: theme,
22
33
  ...props
@@ -29,6 +29,9 @@ export default function useScrollTrigger(options = {}) {
29
29
  const store = React.useRef();
30
30
  const [trigger, setTrigger] = React.useState(() => getTrigger(store, other));
31
31
  React.useEffect(() => {
32
+ if (target === null) {
33
+ return setTrigger(false);
34
+ }
32
35
  const handleScroll = () => {
33
36
  setTrigger(getTrigger(store, {
34
37
  target,
@@ -1,6 +1,6 @@
1
- export const version = "6.4.7";
1
+ export const version = "6.4.8";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("4");
4
- export const patch = Number("7");
4
+ export const patch = Number("8");
5
5
  export const prerelease = undefined;
6
6
  export default version;
@@ -192,6 +192,20 @@ const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref)
192
192
  slots: backwardCompatibleSlots,
193
193
  slotProps: backwardCompatibleSlotProps
194
194
  };
195
+ const [RootSlot, rootProps] = (0, _useSlot.default)('root', {
196
+ elementType: AccordionRoot,
197
+ externalForwardedProps: {
198
+ ...externalForwardedProps,
199
+ ...other
200
+ },
201
+ className: (0, _clsx.default)(classes.root, className),
202
+ shouldForwardComponentProp: true,
203
+ ownerState,
204
+ ref,
205
+ additionalProps: {
206
+ square
207
+ }
208
+ });
195
209
  const [AccordionHeadingSlot, accordionProps] = (0, _useSlot.default)('heading', {
196
210
  elementType: AccordionHeading,
197
211
  externalForwardedProps,
@@ -203,12 +217,8 @@ const Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref)
203
217
  externalForwardedProps,
204
218
  ownerState
205
219
  });
206
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(AccordionRoot, {
207
- className: (0, _clsx.default)(classes.root, className),
208
- ref: ref,
209
- ownerState: ownerState,
210
- square: square,
211
- ...other,
220
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
221
+ ...rootProps,
212
222
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(AccordionHeadingSlot, {
213
223
  ...accordionProps,
214
224
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_AccordionContext.default.Provider, {
@@ -288,6 +298,7 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
288
298
  */
289
299
  slotProps: _propTypes.default.shape({
290
300
  heading: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
301
+ root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
291
302
  transition: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
292
303
  }),
293
304
  /**
@@ -296,6 +307,7 @@ process.env.NODE_ENV !== "production" ? Accordion.propTypes /* remove-proptypes
296
307
  */
297
308
  slots: _propTypes.default.shape({
298
309
  heading: _propTypes.default.elementType,
310
+ root: _propTypes.default.elementType,
299
311
  transition: _propTypes.default.elementType
300
312
  }),
301
313
  /**
@@ -17,6 +17,7 @@ var _DefaultPropsProvider = require("../DefaultPropsProvider");
17
17
  var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
18
18
  var _AccordionContext = _interopRequireDefault(require("../Accordion/AccordionContext"));
19
19
  var _accordionSummaryClasses = _interopRequireWildcard(require("./accordionSummaryClasses"));
20
+ var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
20
21
  var _jsxRuntime = require("react/jsx-runtime");
21
22
  const useUtilityClasses = ownerState => {
22
23
  const {
@@ -119,6 +120,8 @@ const AccordionSummary = /*#__PURE__*/React.forwardRef(function AccordionSummary
119
120
  expandIcon,
120
121
  focusVisibleClassName,
121
122
  onClick,
123
+ slots,
124
+ slotProps,
122
125
  ...other
123
126
  } = props;
124
127
  const {
@@ -142,24 +145,54 @@ const AccordionSummary = /*#__PURE__*/React.forwardRef(function AccordionSummary
142
145
  disableGutters
143
146
  };
144
147
  const classes = useUtilityClasses(ownerState);
145
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(AccordionSummaryRoot, {
146
- focusRipple: false,
147
- disableRipple: true,
148
- disabled: disabled,
149
- "aria-expanded": expanded,
148
+ const externalForwardedProps = {
149
+ slots,
150
+ slotProps
151
+ };
152
+ const [RootSlot, rootSlotProps] = (0, _useSlot.default)('root', {
153
+ ref,
154
+ shouldForwardComponentProp: true,
150
155
  className: (0, _clsx.default)(classes.root, className),
151
- focusVisibleClassName: (0, _clsx.default)(classes.focusVisible, focusVisibleClassName),
152
- onClick: handleChange,
153
- ref: ref,
154
- ownerState: ownerState,
155
- ...other,
156
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(AccordionSummaryContent, {
157
- className: classes.content,
158
- ownerState: ownerState,
156
+ elementType: AccordionSummaryRoot,
157
+ externalForwardedProps: {
158
+ ...externalForwardedProps,
159
+ ...other
160
+ },
161
+ ownerState,
162
+ additionalProps: {
163
+ focusRipple: false,
164
+ disableRipple: true,
165
+ disabled,
166
+ 'aria-expanded': expanded,
167
+ focusVisibleClassName: (0, _clsx.default)(classes.focusVisible, focusVisibleClassName)
168
+ },
169
+ getSlotProps: handlers => ({
170
+ ...handlers,
171
+ onClick: event => {
172
+ handlers.onClick?.(event);
173
+ handleChange(event);
174
+ }
175
+ })
176
+ });
177
+ const [ContentSlot, contentSlotProps] = (0, _useSlot.default)('content', {
178
+ className: classes.content,
179
+ elementType: AccordionSummaryContent,
180
+ externalForwardedProps,
181
+ ownerState
182
+ });
183
+ const [ExpandIconWrapperSlot, expandIconWrapperSlotProps] = (0, _useSlot.default)('expandIconWrapper', {
184
+ className: classes.expandIconWrapper,
185
+ elementType: AccordionSummaryExpandIconWrapper,
186
+ externalForwardedProps,
187
+ ownerState
188
+ });
189
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
190
+ ...rootSlotProps,
191
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ContentSlot, {
192
+ ...contentSlotProps,
159
193
  children: children
160
- }), expandIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(AccordionSummaryExpandIconWrapper, {
161
- className: classes.expandIconWrapper,
162
- ownerState: ownerState,
194
+ }), expandIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandIconWrapperSlot, {
195
+ ...expandIconWrapperSlotProps,
163
196
  children: expandIcon
164
197
  })]
165
198
  });
@@ -198,6 +231,24 @@ process.env.NODE_ENV !== "production" ? AccordionSummary.propTypes /* remove-pro
198
231
  * @ignore
199
232
  */
200
233
  onClick: _propTypes.default.func,
234
+ /**
235
+ * The props used for each slot inside.
236
+ * @default {}
237
+ */
238
+ slotProps: _propTypes.default.shape({
239
+ content: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
240
+ expandIconWrapper: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
241
+ root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
242
+ }),
243
+ /**
244
+ * The components used for each slot inside.
245
+ * @default {}
246
+ */
247
+ slots: _propTypes.default.shape({
248
+ content: _propTypes.default.elementType,
249
+ expandIconWrapper: _propTypes.default.elementType,
250
+ root: _propTypes.default.elementType
251
+ }),
201
252
  /**
202
253
  * The system prop that allows defining system overrides as well as additional CSS styles.
203
254
  */