@mui/material 5.14.1 → 5.14.2

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 (47) hide show
  1. package/Button/Button.js +1 -1
  2. package/CHANGELOG.md +61 -0
  3. package/Card/Card.d.ts +2 -2
  4. package/Chip/Chip.js +0 -2
  5. package/Dialog/Dialog.d.ts +1 -1
  6. package/Drawer/Drawer.d.ts +1 -1
  7. package/Fab/Fab.js +1 -1
  8. package/Link/Link.d.ts +7 -9
  9. package/ListItem/ListItem.js +1 -1
  10. package/ListItemButton/ListItemButton.js +1 -1
  11. package/MenuItem/MenuItem.js +1 -1
  12. package/OverridableComponent.d.ts +0 -7
  13. package/Paper/Paper.d.ts +30 -32
  14. package/Paper/index.d.ts +1 -1
  15. package/Popover/Popover.d.ts +1 -1
  16. package/README.md +1 -1
  17. package/Tabs/Tabs.js +39 -42
  18. package/Typography/Typography.d.ts +65 -66
  19. package/index.js +1 -1
  20. package/legacy/Button/Button.js +1 -1
  21. package/legacy/Chip/Chip.js +0 -2
  22. package/legacy/Fab/Fab.js +1 -1
  23. package/legacy/ListItem/ListItem.js +1 -1
  24. package/legacy/ListItemButton/ListItemButton.js +1 -1
  25. package/legacy/MenuItem/MenuItem.js +1 -1
  26. package/legacy/Tabs/Tabs.js +48 -48
  27. package/legacy/index.js +1 -1
  28. package/modern/Button/Button.js +1 -1
  29. package/modern/Chip/Chip.js +0 -2
  30. package/modern/Fab/Fab.js +1 -1
  31. package/modern/ListItem/ListItem.js +1 -1
  32. package/modern/ListItemButton/ListItemButton.js +1 -1
  33. package/modern/MenuItem/MenuItem.js +1 -1
  34. package/modern/Tabs/Tabs.js +39 -42
  35. package/modern/index.js +1 -1
  36. package/node/Button/Button.js +1 -1
  37. package/node/Chip/Chip.js +0 -2
  38. package/node/Fab/Fab.js +1 -1
  39. package/node/ListItem/ListItem.js +1 -1
  40. package/node/ListItemButton/ListItemButton.js +1 -1
  41. package/node/MenuItem/MenuItem.js +1 -1
  42. package/node/Tabs/Tabs.js +39 -42
  43. package/node/index.js +1 -1
  44. package/package.json +2 -2
  45. package/styles/props.d.ts +1 -1
  46. package/umd/material-ui.development.js +45 -50
  47. package/umd/material-ui.production.min.js +3 -3
package/Button/Button.js CHANGED
@@ -307,7 +307,7 @@ process.env.NODE_ENV !== "production" ? Button.propTypes /* remove-proptypes */
307
307
  * The component used for the root node.
308
308
  * Either a string to use a HTML element or a component.
309
309
  */
310
- component: PropTypes /* @typescript-to-proptypes-ignore */.elementType,
310
+ component: PropTypes.elementType,
311
311
  /**
312
312
  * If `true`, the component is disabled.
313
313
  * @default false
package/CHANGELOG.md CHANGED
@@ -1,5 +1,66 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.14.2
4
+
5
+ <!-- generated comparing v5.14.1..master -->
6
+
7
+ _Jul 25, 2023_
8
+
9
+ A big thanks to the 23 contributors who made this release possible.
10
+
11
+ ### @mui/material@5.14.2
12
+
13
+ - &#8203;<!-- 39 -->Revert "[core] Adds `component` prop to `OverrideProps` type (#35924)" (#38150) @michaldudak
14
+ - &#8203;<!-- 32 -->[Chip][material] Fix base cursor style to be "auto" not "default" (#38076) @DiegoAndai
15
+ - &#8203;<!-- 12 -->[Tabs] Refactor IntersectionObserver logic (#38133) @ZeeshanTamboli
16
+ - &#8203;<!-- 11 -->[Tabs] Fix and improve visibility of tab scroll buttons using the IntersectionObserver API (#36071) @SaidMarar
17
+
18
+ ### @mui/joy@5.0.0-alpha.89
19
+
20
+ - &#8203;<!-- 15 -->[Joy] Replace leftover `Joy-` prefix with `Mui-` (#38086) @siriwatknp
21
+ - &#8203;<!-- 14 -->[Skeleton][joy] Fix WebkitMaskImage CSS property (#38077) @Bestwebdesign
22
+ - &#8203;<!-- 13 -->[Link][Joy UI] Fix font inherit (#38124) @oliviertassinari
23
+
24
+ ### Docs
25
+
26
+ - &#8203;<!-- 37 -->[docs] Add listbox placement demo for Select (#38130) @sai6855
27
+ - &#8203;<!-- 36 -->[docs][base] Add Tailwind CSS & plain CSS demo on the Tabs page (#37910) @mnajdova
28
+ - &#8203;<!-- 35 -->[docs][base] Add Tailwind CSS & plain CSS demos on the Textarea page (#37943) @zanivan
29
+ - &#8203;<!-- 29 -->[docs] Fix Joy UI menu example (#38140) @harikrishnanp
30
+ - &#8203;<!-- 28 -->[docs] Remove translations section from contributing guide (#38125) @nikohoffren
31
+ - &#8203;<!-- 27 -->[docs] Fix Base UI Button Tailwind CSS padding @oliviertassinari
32
+ - &#8203;<!-- 26 -->[docs] Mention in hompage hero that Core is free (#38075) @mbrookes
33
+ - &#8203;<!-- 25 -->[docs] Fix a typo in notifications.json (#38078) @mbrookes
34
+ - &#8203;<!-- 24 -->[docs] Add Tailwind CSS & plain CSS demo on the table pagination page (#37937) @mnajdova
35
+ - &#8203;<!-- 23 -->[docs] Implement the new API display design (#37405) @alexfauquette
36
+ - &#8203;<!-- 22 -->[docs] Update migration installation code blocks (#38028) @danilo-leal
37
+ - &#8203;<!-- 21 -->[docs][joy] Revise the Joy UI Link page (#37829) @danilo-leal
38
+ - &#8203;<!-- 20 -->[docs][joy] Add playground for Card component (#37820) @Studio384
39
+ - &#8203;<!-- 19 -->[docs][joy] Add adjustments to the color inversion page (#37143) @danilo-leal
40
+ - &#8203;<!-- 18 -->[docs][material] Improve documentation about adding custom colors (#37743) @DiegoAndai
41
+ - &#8203;<!-- 17 -->[examples] Fix Joy UI Next.js App Router font loading (#38095) @IgnacioUtrilla
42
+ - &#8203;<!-- 16 -->[examples] Fix material-next-app-router Font Usage with next/font (#38026) @onderonur
43
+
44
+ ### Core
45
+
46
+ - &#8203;<!-- 34 -->[blog] Update Discord invite link in Toolpad beta announcement (#38143) @samuelsycamore
47
+ - &#8203;<!-- 33 -->[blog] Update discord server link (#38131) @prakhargupta1
48
+ - &#8203;<!-- 31 -->[core] Fix rsc-builder removing the first line (#38134) @michaldudak
49
+ - &#8203;<!-- 30 -->[core] Remove the deprecation rule in tslint (#38087) @michaldudak
50
+ - &#8203;<!-- 09 -->[website] Mobile navigation: Toolpad to Beta (#38146) @bharatkashyap
51
+ - &#8203;<!-- 08 -->[website] Fix typo on pricing page @oliviertassinari
52
+ - &#8203;<!-- 07 -->[website] Fix a few regression (#38050) @oliviertassinari
53
+ - &#8203;<!-- 06 -->[website] Update Demo footers on MUI X landing page (#38027) @richbustos
54
+ - &#8203;<!-- 05 -->[website] Fix 301 redirection to base index page @oliviertassinari
55
+ - &#8203;<!-- 04 -->[website] Fix Cell selection feature name (#38029) @oliviertassinari
56
+ - &#8203;<!-- 03 -->[website] Improve button look (#38052) @oliviertassinari
57
+ - &#8203;<!-- 02 -->[website] Link new core page to new Base UI landing page (#38030) @mj12albert
58
+ - &#8203;<!-- 01 -->[website] Polish pricing page (#37975) @oliviertassinari
59
+ - &#8203;<!-- 10 -->[test] Fail the CI when new unexpected files are created (#38039) @oliviertassinari
60
+ - &#8203;<!-- 09 -->[test] Fix linting error by matching main component demo name to filename (#38122) @ZeeshanTamboli
61
+
62
+ All contributors of this release in alphabetical order: @alexfauquette, @Bestwebdesign, @bharatkashyap, @danilo-leal, @DiegoAndai, @harikrishnanp, @IgnacioUtrilla, @mbrookes, @michaldudak, @mj12albert, @mnajdova, @nikohoffren, @oliviertassinari, @onderonur, @prakhargupta1, @richbustos, @sai6855, @SaidMarar, @samuelsycamore, @siriwatknp, @Studio384, @zanivan, @ZeeshanTamboli
63
+
3
64
  ## 5.14.1
4
65
 
5
66
  <!-- generated comparing v5.14.0..master -->
package/Card/Card.d.ts CHANGED
@@ -3,7 +3,7 @@ import { SxProps } from '@mui/system';
3
3
  import { DistributiveOmit } from '@mui/types';
4
4
  import { OverridableComponent, OverrideProps } from '@mui/material/OverridableComponent';
5
5
  import { Theme } from '..';
6
- import { PaperOwnProps } from '../Paper';
6
+ import { PaperProps } from '../Paper';
7
7
  import { CardClasses } from './cardClasses';
8
8
 
9
9
  // TODO: v6 remove this interface, it is not used
@@ -11,7 +11,7 @@ export interface CardPropsColorOverrides {}
11
11
 
12
12
  export interface CardTypeMap<P = {}, D extends React.ElementType = 'div'> {
13
13
  props: P &
14
- DistributiveOmit<PaperOwnProps, 'classes'> & {
14
+ DistributiveOmit<PaperProps, 'classes'> & {
15
15
  /**
16
16
  * Override or extend the styles applied to the component.
17
17
  */
package/Chip/Chip.js CHANGED
@@ -93,8 +93,6 @@ const ChipRoot = styled('div', {
93
93
  borderRadius: 32 / 2,
94
94
  whiteSpace: 'nowrap',
95
95
  transition: theme.transitions.create(['background-color', 'box-shadow']),
96
- // label will inherit this from root, then `clickable` class overrides this for both
97
- cursor: 'default',
98
96
  // We disable the focus ring for mouse, touch and keyboard users.
99
97
  outline: 0,
100
98
  textDecoration: 'none',
@@ -72,7 +72,7 @@ export interface DialogProps extends StandardProps<ModalProps, 'children'> {
72
72
  * Props applied to the [`Paper`](/material-ui/api/paper/) element.
73
73
  * @default {}
74
74
  */
75
- PaperProps?: Partial<PaperProps<React.ElementType>>;
75
+ PaperProps?: Partial<PaperProps>;
76
76
  /**
77
77
  * Determine the container for scrolling the dialog.
78
78
  * @default 'paper'
@@ -46,7 +46,7 @@ export interface DrawerProps extends StandardProps<ModalProps, 'open' | 'childre
46
46
  * Props applied to the [`Paper`](/material-ui/api/paper/) element.
47
47
  * @default {}
48
48
  */
49
- PaperProps?: Partial<PaperProps<React.ElementType>>;
49
+ PaperProps?: Partial<PaperProps>;
50
50
  /**
51
51
  * Props applied to the [`Slide`](/material-ui/api/slide/) element.
52
52
  */
package/Fab/Fab.js CHANGED
@@ -186,7 +186,7 @@ process.env.NODE_ENV !== "production" ? Fab.propTypes /* remove-proptypes */ = {
186
186
  * The component used for the root node.
187
187
  * Either a string to use a HTML element or a component.
188
188
  */
189
- component: PropTypes /* @typescript-to-proptypes-ignore */.elementType,
189
+ component: PropTypes.elementType,
190
190
  /**
191
191
  * If `true`, the component is disabled.
192
192
  * @default false
package/Link/Link.d.ts CHANGED
@@ -3,12 +3,12 @@ import { DistributiveOmit } from '@mui/types';
3
3
  import { SxProps } from '@mui/system';
4
4
  import { OverridableComponent, OverrideProps } from '../OverridableComponent';
5
5
  import { Theme } from '../styles';
6
- import { TypographyOwnProps } from '../Typography';
6
+ import { TypographyProps } from '../Typography';
7
7
  import { LinkClasses } from './linkClasses';
8
8
 
9
9
  export interface LinkTypeMap<P = {}, D extends React.ElementType = 'a'> {
10
10
  props: P &
11
- LinkBaseProps & {
11
+ DistributiveOmit<LinkBaseProps, 'classes'> & {
12
12
  /**
13
13
  * The content of the component.
14
14
  */
@@ -21,7 +21,7 @@ export interface LinkTypeMap<P = {}, D extends React.ElementType = 'a'> {
21
21
  * The color of the link.
22
22
  * @default 'primary'
23
23
  */
24
- color?: TypographyOwnProps['color'];
24
+ color?: TypographyProps['color'];
25
25
  /**
26
26
  * The system prop that allows defining system overrides as well as additional CSS styles.
27
27
  */
@@ -29,7 +29,7 @@ export interface LinkTypeMap<P = {}, D extends React.ElementType = 'a'> {
29
29
  /**
30
30
  * `classes` prop applied to the [`Typography`](/material-ui/api/typography/) element.
31
31
  */
32
- TypographyClasses?: TypographyOwnProps['classes'];
32
+ TypographyClasses?: TypographyProps['classes'];
33
33
  /**
34
34
  * Controls when the link should have an underline.
35
35
  * @default 'always'
@@ -39,7 +39,7 @@ export interface LinkTypeMap<P = {}, D extends React.ElementType = 'a'> {
39
39
  * Applies the theme typography styles.
40
40
  * @default 'inherit'
41
41
  */
42
- variant?: TypographyOwnProps['variant'];
42
+ variant?: TypographyProps['variant'];
43
43
  };
44
44
  defaultComponent: D;
45
45
  }
@@ -58,10 +58,8 @@ export interface LinkTypeMap<P = {}, D extends React.ElementType = 'a'> {
58
58
  */
59
59
  declare const Link: OverridableComponent<LinkTypeMap>;
60
60
 
61
- export type LinkBaseProps = DistributiveOmit<
62
- TypographyOwnProps,
63
- 'children' | 'color' | 'variant' | 'classes'
64
- >;
61
+ export type LinkBaseProps = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'color'> &
62
+ DistributiveOmit<TypographyProps, 'children' | 'component' | 'color' | 'ref' | 'variant'>;
65
63
 
66
64
  export type LinkProps<
67
65
  D extends React.ElementType = LinkTypeMap['defaultComponent'],
@@ -314,7 +314,7 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes /* remove-proptypes *
314
314
  * The component used for the root node.
315
315
  * Either a string to use a HTML element or a component.
316
316
  */
317
- component: PropTypes /* @typescript-to-proptypes-ignore */.elementType,
317
+ component: PropTypes.elementType,
318
318
  /**
319
319
  * The components used for each slot inside.
320
320
  *
@@ -193,7 +193,7 @@ process.env.NODE_ENV !== "production" ? ListItemButton.propTypes /* remove-propt
193
193
  * The component used for the root node.
194
194
  * Either a string to use a HTML element or a component.
195
195
  */
196
- component: PropTypes /* @typescript-to-proptypes-ignore */.elementType,
196
+ component: PropTypes.elementType,
197
197
  /**
198
198
  * If `true`, compact vertical padding designed for keyboard and mouse input is used.
199
199
  * The prop defaults to the value inherited from the parent List component.
@@ -209,7 +209,7 @@ process.env.NODE_ENV !== "production" ? MenuItem.propTypes /* remove-proptypes *
209
209
  * The component used for the root node.
210
210
  * Either a string to use a HTML element or a component.
211
211
  */
212
- component: PropTypes /* @typescript-to-proptypes-ignore */.elementType,
212
+ component: PropTypes.elementType,
213
213
  /**
214
214
  * If `true`, compact vertical padding designed for keyboard and mouse input is used.
215
215
  * The prop defaults to the value inherited from the parent Menu component.
@@ -34,13 +34,6 @@ export type OverrideProps<
34
34
  > = (
35
35
  & BaseProps<M>
36
36
  & DistributiveOmit<React.ComponentPropsWithRef<C>, keyof BaseProps<M>>
37
- & {
38
- /**
39
- * The component used for the root node.
40
- * Either a string to use a HTML element or a component.
41
- */
42
- component?: C
43
- }
44
37
  );
45
38
 
46
39
  /**
package/Paper/Paper.d.ts CHANGED
@@ -7,39 +7,37 @@ import { PaperClasses } from './paperClasses';
7
7
 
8
8
  export interface PaperPropsVariantOverrides {}
9
9
 
10
- export interface PaperOwnProps {
11
- /**
12
- * The content of the component.
13
- */
14
- children?: React.ReactNode;
15
- /**
16
- * Override or extend the styles applied to the component.
17
- */
18
- classes?: Partial<PaperClasses>;
19
- /**
20
- * Shadow depth, corresponds to `dp` in the spec.
21
- * It accepts values between 0 and 24 inclusive.
22
- * @default 1
23
- */
24
- elevation?: number;
25
- /**
26
- * If `true`, rounded corners are disabled.
27
- * @default false
28
- */
29
- square?: boolean;
30
- /**
31
- * The system prop that allows defining system overrides as well as additional CSS styles.
32
- */
33
- sx?: SxProps<Theme>;
34
- /**
35
- * The variant to use.
36
- * @default 'elevation'
37
- */
38
- variant?: OverridableStringUnion<'elevation' | 'outlined', PaperPropsVariantOverrides>;
39
- }
40
-
41
10
  export interface PaperTypeMap<P = {}, D extends React.ElementType = 'div'> {
42
- props: P & PaperOwnProps;
11
+ props: P & {
12
+ /**
13
+ * The content of the component.
14
+ */
15
+ children?: React.ReactNode;
16
+ /**
17
+ * Override or extend the styles applied to the component.
18
+ */
19
+ classes?: Partial<PaperClasses>;
20
+ /**
21
+ * Shadow depth, corresponds to `dp` in the spec.
22
+ * It accepts values between 0 and 24 inclusive.
23
+ * @default 1
24
+ */
25
+ elevation?: number;
26
+ /**
27
+ * If `true`, rounded corners are disabled.
28
+ * @default false
29
+ */
30
+ square?: boolean;
31
+ /**
32
+ * The system prop that allows defining system overrides as well as additional CSS styles.
33
+ */
34
+ sx?: SxProps<Theme>;
35
+ /**
36
+ * The variant to use.
37
+ * @default 'elevation'
38
+ */
39
+ variant?: OverridableStringUnion<'elevation' | 'outlined', PaperPropsVariantOverrides>;
40
+ };
43
41
  defaultComponent: D;
44
42
  }
45
43
 
package/Paper/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { default } from './Paper';
2
- export type { PaperProps, PaperPropsVariantOverrides, PaperTypeMap, PaperOwnProps } from './Paper';
2
+ export type { PaperProps, PaperPropsVariantOverrides, PaperTypeMap } from './Paper';
3
3
 
4
4
  export { default as paperClasses } from './paperClasses';
5
5
  export * from './paperClasses';
@@ -107,7 +107,7 @@ export interface PopoverProps
107
107
  *
108
108
  * @default {}
109
109
  */
110
- PaperProps?: Partial<PaperProps<React.ElementType>>;
110
+ PaperProps?: Partial<PaperProps>;
111
111
  /**
112
112
  * The components used for each slot inside.
113
113
  *
package/README.md CHANGED
@@ -131,7 +131,7 @@ Diamond Sponsors are those who have pledged \$1,500/month or more to MUI.
131
131
  via [OpenCollective](https://opencollective.com/mui) or via [Patreon](https://www.patreon.com/oliviertassinari)
132
132
 
133
133
  <p>
134
- <a href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://avatars.githubusercontent.com/u/30204434?s=192" alt="tidelift.com" title="Enterprise-ready open-source software" loading="lazy" /></a>
134
+ <a href="https://www.tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://avatars.githubusercontent.com/u/30204434?s=192" alt="tidelift.com" title="Enterprise-ready open-source software" loading="lazy" /></a>
135
135
  <a href="https://www.text-em-all.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img src="https://avatars.githubusercontent.com/u/1262264?s=192" alt="text-em-all.com" title="Mass Text Messaging & Automated Calling" height="96" width="96" loading="lazy"></a>
136
136
  <a href="https://open.spotify.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/spotify/f37ea28/logo/192.png" alt="Spotify" title="Music service to access to millions of songs" loading="lazy" /></a>
137
137
  <a href="https://megafamous.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://mui.com/static/sponsors/megafamous.png" alt="megafamous.com" title="The best place to buy Instagram followers & likes." loading="lazy" /></a>
package/Tabs/Tabs.js CHANGED
@@ -280,10 +280,9 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
280
280
  }
281
281
  const [mounted, setMounted] = React.useState(false);
282
282
  const [indicatorStyle, setIndicatorStyle] = React.useState(defaultIndicatorStyle);
283
- const [displayScroll, setDisplayScroll] = React.useState({
284
- start: false,
285
- end: false
286
- });
283
+ const [displayStartScroll, setDisplayStartScroll] = React.useState(false);
284
+ const [displayEndScroll, setDisplayEndScroll] = React.useState(false);
285
+ const [updateScrollObserver, setUpdateScrollObserver] = React.useState(false);
287
286
  const [scrollerStyle, setScrollerStyle] = React.useState({
288
287
  overflow: 'hidden',
289
288
  scrollbarWidth: 0
@@ -434,7 +433,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
434
433
  onChange: handleScrollbarSizeChange,
435
434
  className: clsx(classes.scrollableX, classes.hideScrollbar)
436
435
  }) : null;
437
- const scrollButtonsActive = displayScroll.start || displayScroll.end;
436
+ const scrollButtonsActive = displayStartScroll || displayEndScroll;
438
437
  const showScrollButtons = scrollable && (scrollButtons === 'auto' && scrollButtonsActive || scrollButtons === true);
439
438
  conditionalElements.scrollButtonStart = showScrollButtons ? /*#__PURE__*/_jsx(ScrollButtonComponent, _extends({
440
439
  slots: {
@@ -446,7 +445,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
446
445
  orientation: orientation,
447
446
  direction: isRtl ? 'right' : 'left',
448
447
  onClick: handleStartScrollClick,
449
- disabled: !displayScroll.start
448
+ disabled: !displayStartScroll
450
449
  }, TabScrollButtonProps, {
451
450
  className: clsx(classes.scrollButtons, TabScrollButtonProps.className)
452
451
  })) : null;
@@ -460,7 +459,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
460
459
  orientation: orientation,
461
460
  direction: isRtl ? 'left' : 'right',
462
461
  onClick: handleEndScrollClick,
463
- disabled: !displayScroll.end
462
+ disabled: !displayEndScroll
464
463
  }, TabScrollButtonProps, {
465
464
  className: clsx(classes.scrollButtons, TabScrollButtonProps.className)
466
465
  })) : null;
@@ -490,30 +489,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
490
489
  });
491
490
  const updateScrollButtonState = useEventCallback(() => {
492
491
  if (scrollable && scrollButtons !== false) {
493
- const {
494
- scrollTop,
495
- scrollHeight,
496
- clientHeight,
497
- scrollWidth,
498
- clientWidth
499
- } = tabsRef.current;
500
- let showStartScroll;
501
- let showEndScroll;
502
- if (vertical) {
503
- showStartScroll = scrollTop > 1;
504
- showEndScroll = scrollTop < scrollHeight - clientHeight - 1;
505
- } else {
506
- const scrollLeft = getNormalizedScrollLeft(tabsRef.current, theme.direction);
507
- // use 1 for the potential rounding error with browser zooms.
508
- showStartScroll = isRtl ? scrollLeft < scrollWidth - clientWidth - 1 : scrollLeft > 1;
509
- showEndScroll = !isRtl ? scrollLeft < scrollWidth - clientWidth - 1 : scrollLeft > 1;
510
- }
511
- if (showStartScroll !== displayScroll.start || showEndScroll !== displayScroll.end) {
512
- setDisplayScroll({
513
- start: showStartScroll,
514
- end: showEndScroll
515
- });
516
- }
492
+ setUpdateScrollObserver(!updateScrollObserver);
517
493
  }
518
494
  });
519
495
  React.useEffect(() => {
@@ -526,7 +502,6 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
526
502
  // replaced by Suspense with a fallback, once React is updated to version 18
527
503
  if (tabsRef.current) {
528
504
  updateIndicatorState();
529
- updateScrollButtonState();
530
505
  }
531
506
  });
532
507
  const win = ownerWindow(tabsRef.current);
@@ -545,21 +520,44 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
545
520
  resizeObserver.disconnect();
546
521
  }
547
522
  };
548
- }, [updateIndicatorState, updateScrollButtonState]);
549
- const handleTabsScroll = React.useMemo(() => debounce(() => {
550
- updateScrollButtonState();
551
- }), [updateScrollButtonState]);
523
+ }, [updateIndicatorState]);
524
+
525
+ /**
526
+ * Toggle visibility of start and end scroll buttons
527
+ * Using IntersectionObserver on first and last Tabs.
528
+ */
552
529
  React.useEffect(() => {
553
- return () => {
554
- handleTabsScroll.clear();
555
- };
556
- }, [handleTabsScroll]);
530
+ const tabListChildren = Array.from(tabListRef.current.children);
531
+ const length = tabListChildren.length;
532
+ if (typeof IntersectionObserver !== 'undefined' && length > 0 && scrollable && scrollButtons !== false) {
533
+ const firstTab = tabListChildren[0];
534
+ const lastTab = tabListChildren[length - 1];
535
+ const observerOptions = {
536
+ root: tabsRef.current,
537
+ threshold: 0.99
538
+ };
539
+ const handleScrollButtonStart = entries => {
540
+ setDisplayStartScroll(!entries[0].isIntersecting);
541
+ };
542
+ const firstObserver = new IntersectionObserver(handleScrollButtonStart, observerOptions);
543
+ firstObserver.observe(firstTab);
544
+ const handleScrollButtonEnd = entries => {
545
+ setDisplayEndScroll(!entries[0].isIntersecting);
546
+ };
547
+ const lastObserver = new IntersectionObserver(handleScrollButtonEnd, observerOptions);
548
+ lastObserver.observe(lastTab);
549
+ return () => {
550
+ firstObserver.disconnect();
551
+ lastObserver.disconnect();
552
+ };
553
+ }
554
+ return undefined;
555
+ }, [scrollable, scrollButtons, updateScrollObserver, childrenProp == null ? void 0 : childrenProp.length]);
557
556
  React.useEffect(() => {
558
557
  setMounted(true);
559
558
  }, []);
560
559
  React.useEffect(() => {
561
560
  updateIndicatorState();
562
- updateScrollButtonState();
563
561
  });
564
562
  React.useEffect(() => {
565
563
  // Don't animate on the first render.
@@ -653,7 +651,6 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
653
651
  [vertical ? `margin${isRtl ? 'Left' : 'Right'}` : 'marginBottom']: visibleScrollbar ? undefined : -scrollerStyle.scrollbarWidth
654
652
  },
655
653
  ref: tabsRef,
656
- onScroll: handleTabsScroll,
657
654
  children: [/*#__PURE__*/_jsx(FlexContainer, {
658
655
  "aria-label": ariaLabel,
659
656
  "aria-labelledby": ariaLabelledBy,
@@ -8,73 +8,72 @@ import { TypographyClasses } from './typographyClasses';
8
8
 
9
9
  export interface TypographyPropsVariantOverrides {}
10
10
 
11
- export interface TypographyOwnProps extends SystemProps<Theme> {
12
- /**
13
- * Set the text-align on the component.
14
- * @default 'inherit'
15
- */
16
- align?: 'inherit' | 'left' | 'center' | 'right' | 'justify';
17
- /**
18
- * The content of the component.
19
- */
20
- children?: React.ReactNode;
21
- /**
22
- * Override or extend the styles applied to the component.
23
- */
24
- classes?: Partial<TypographyClasses>;
25
- /**
26
- * If `true`, the text will have a bottom margin.
27
- * @default false
28
- */
29
- gutterBottom?: boolean;
30
- /**
31
- * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
32
- *
33
- * Note that text overflow can only happen with block or inline-block level elements
34
- * (the element needs to have a width in order to overflow).
35
- * @default false
36
- */
37
- noWrap?: boolean;
38
- /**
39
- * If `true`, the element will be a paragraph element.
40
- * @default false
41
- */
42
- paragraph?: boolean;
43
- /**
44
- * The system prop that allows defining system overrides as well as additional CSS styles.
45
- */
46
- sx?: SxProps<Theme>;
47
- /**
48
- * Applies the theme typography styles.
49
- * @default 'body1'
50
- */
51
- variant?: OverridableStringUnion<Variant | 'inherit', TypographyPropsVariantOverrides>;
52
- /**
53
- * The component maps the variant prop to a range of different HTML element types.
54
- * For instance, subtitle1 to `<h6>`.
55
- * If you wish to change that mapping, you can provide your own.
56
- * Alternatively, you can use the `component` prop.
57
- * @default {
58
- * h1: 'h1',
59
- * h2: 'h2',
60
- * h3: 'h3',
61
- * h4: 'h4',
62
- * h5: 'h5',
63
- * h6: 'h6',
64
- * subtitle1: 'h6',
65
- * subtitle2: 'h6',
66
- * body1: 'p',
67
- * body2: 'p',
68
- * inherit: 'p',
69
- * }
70
- */
71
- variantMapping?: Partial<
72
- Record<OverridableStringUnion<Variant | 'inherit', TypographyPropsVariantOverrides>, string>
73
- >;
74
- }
75
-
76
11
  export interface TypographyTypeMap<P = {}, D extends React.ElementType = 'span'> {
77
- props: P & TypographyOwnProps;
12
+ props: P &
13
+ SystemProps<Theme> & {
14
+ /**
15
+ * Set the text-align on the component.
16
+ * @default 'inherit'
17
+ */
18
+ align?: 'inherit' | 'left' | 'center' | 'right' | 'justify';
19
+ /**
20
+ * The content of the component.
21
+ */
22
+ children?: React.ReactNode;
23
+ /**
24
+ * Override or extend the styles applied to the component.
25
+ */
26
+ classes?: Partial<TypographyClasses>;
27
+ /**
28
+ * If `true`, the text will have a bottom margin.
29
+ * @default false
30
+ */
31
+ gutterBottom?: boolean;
32
+ /**
33
+ * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
34
+ *
35
+ * Note that text overflow can only happen with block or inline-block level elements
36
+ * (the element needs to have a width in order to overflow).
37
+ * @default false
38
+ */
39
+ noWrap?: boolean;
40
+ /**
41
+ * If `true`, the element will be a paragraph element.
42
+ * @default false
43
+ */
44
+ paragraph?: boolean;
45
+ /**
46
+ * The system prop that allows defining system overrides as well as additional CSS styles.
47
+ */
48
+ sx?: SxProps<Theme>;
49
+ /**
50
+ * Applies the theme typography styles.
51
+ * @default 'body1'
52
+ */
53
+ variant?: OverridableStringUnion<Variant | 'inherit', TypographyPropsVariantOverrides>;
54
+ /**
55
+ * The component maps the variant prop to a range of different HTML element types.
56
+ * For instance, subtitle1 to `<h6>`.
57
+ * If you wish to change that mapping, you can provide your own.
58
+ * Alternatively, you can use the `component` prop.
59
+ * @default {
60
+ * h1: 'h1',
61
+ * h2: 'h2',
62
+ * h3: 'h3',
63
+ * h4: 'h4',
64
+ * h5: 'h5',
65
+ * h6: 'h6',
66
+ * subtitle1: 'h6',
67
+ * subtitle2: 'h6',
68
+ * body1: 'p',
69
+ * body2: 'p',
70
+ * inherit: 'p',
71
+ * }
72
+ */
73
+ variantMapping?: Partial<
74
+ Record<OverridableStringUnion<Variant | 'inherit', TypographyPropsVariantOverrides>, string>
75
+ >;
76
+ };
78
77
  defaultComponent: D;
79
78
  }
80
79
 
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.14.1
2
+ * @mui/material v5.14.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -307,7 +307,7 @@ process.env.NODE_ENV !== "production" ? Button.propTypes /* remove-proptypes */
307
307
  * The component used for the root node.
308
308
  * Either a string to use a HTML element or a component.
309
309
  */
310
- component: PropTypes /* @typescript-to-proptypes-ignore */.elementType,
310
+ component: PropTypes.elementType,
311
311
  /**
312
312
  * If `true`, the component is disabled.
313
313
  * @default false
@@ -67,8 +67,6 @@ var ChipRoot = styled('div', {
67
67
  borderRadius: 32 / 2,
68
68
  whiteSpace: 'nowrap',
69
69
  transition: theme.transitions.create(['background-color', 'box-shadow']),
70
- // label will inherit this from root, then `clickable` class overrides this for both
71
- cursor: 'default',
72
70
  // We disable the focus ring for mouse, touch and keyboard users.
73
71
  outline: 0,
74
72
  textDecoration: 'none',
package/legacy/Fab/Fab.js CHANGED
@@ -186,7 +186,7 @@ process.env.NODE_ENV !== "production" ? Fab.propTypes /* remove-proptypes */ = {
186
186
  * The component used for the root node.
187
187
  * Either a string to use a HTML element or a component.
188
188
  */
189
- component: PropTypes /* @typescript-to-proptypes-ignore */.elementType,
189
+ component: PropTypes.elementType,
190
190
  /**
191
191
  * If `true`, the component is disabled.
192
192
  * @default false