@mui/material 5.14.7 → 5.14.9

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 (143) hide show
  1. package/Accordion/Accordion.d.ts +2 -2
  2. package/AccordionSummary/AccordionSummary.d.ts +22 -20
  3. package/AlertTitle/AlertTitle.d.ts +1 -0
  4. package/AppBar/AppBar.d.ts +33 -31
  5. package/Avatar/Avatar.d.ts +49 -50
  6. package/Backdrop/Backdrop.d.ts +87 -85
  7. package/Badge/Badge.d.ts +2 -2
  8. package/BottomNavigation/BottomNavigation.d.ts +35 -33
  9. package/BottomNavigationAction/BottomNavigationAction.d.ts +39 -37
  10. package/Breadcrumbs/Breadcrumbs.d.ts +70 -67
  11. package/Button/Button.d.ts +72 -73
  12. package/Button/Button.js +4 -1
  13. package/ButtonBase/ButtonBase.d.ts +83 -81
  14. package/ButtonGroup/ButtonGroup.d.ts +72 -70
  15. package/ButtonGroup/ButtonGroup.js +86 -54
  16. package/ButtonGroup/ButtonGroupButtonContext.d.ts +6 -0
  17. package/ButtonGroup/ButtonGroupButtonContext.js +9 -0
  18. package/ButtonGroup/buttonGroupClasses.d.ts +6 -0
  19. package/ButtonGroup/buttonGroupClasses.js +1 -1
  20. package/CHANGELOG.md +235 -38
  21. package/Card/Card.d.ts +19 -18
  22. package/CardActionArea/CardActionArea.d.ts +15 -13
  23. package/CardContent/CardContent.d.ts +18 -16
  24. package/CardHeader/CardHeader.d.ts +77 -67
  25. package/CardMedia/CardMedia.d.ts +30 -28
  26. package/Chip/Chip.d.ts +84 -82
  27. package/CircularProgress/CircularProgress.d.ts +1 -1
  28. package/CircularProgress/CircularProgress.js +1 -1
  29. package/Container/Container.d.ts +35 -33
  30. package/DialogContentText/DialogContentText.d.ts +14 -12
  31. package/DialogTitle/DialogTitle.d.ts +19 -16
  32. package/Divider/Divider.d.ts +49 -50
  33. package/Fab/Fab.d.ts +59 -56
  34. package/FormControl/FormControl.d.ts +74 -72
  35. package/FormHelperText/FormHelperText.d.ts +52 -50
  36. package/FormLabel/FormLabel.d.ts +7 -4
  37. package/Grid/Grid.d.ts +69 -68
  38. package/Hidden/Hidden.d.ts +10 -10
  39. package/Icon/Icon.d.ts +50 -48
  40. package/IconButton/IconButton.d.ts +52 -50
  41. package/ImageList/ImageList.d.ts +41 -39
  42. package/ImageListItem/ImageListItem.d.ts +28 -26
  43. package/ImageListItem/ImageListItem.js +2 -1
  44. package/InputAdornment/InputAdornment.d.ts +39 -37
  45. package/InputBase/InputBase.js +1 -1
  46. package/InputLabel/InputLabel.d.ts +58 -56
  47. package/InputLabel/InputLabel.js +2 -1
  48. package/Link/Link.d.ts +37 -39
  49. package/List/List.d.ts +34 -35
  50. package/ListItem/ListItem.d.ts +53 -49
  51. package/ListItemButton/ListItemButton.d.ts +9 -3
  52. package/ListSubheader/ListSubheader.d.ts +38 -36
  53. package/MenuItem/MenuItem.d.ts +47 -44
  54. package/MenuList/MenuList.d.ts +37 -35
  55. package/Modal/Modal.d.ts +172 -178
  56. package/Modal/Modal.js +1 -1
  57. package/PaginationItem/PaginationItem.d.ts +85 -83
  58. package/Paper/Paper.d.ts +2 -2
  59. package/README.md +9 -198
  60. package/Radio/Radio.js +3 -2
  61. package/Radio/radioClasses.d.ts +2 -0
  62. package/Radio/radioClasses.js +1 -1
  63. package/ScopedCssBaseline/ScopedCssBaseline.d.ts +25 -23
  64. package/Select/SelectInput.js +9 -5
  65. package/Skeleton/Skeleton.d.ts +42 -40
  66. package/Slider/Slider.d.ts +249 -247
  67. package/Slider/Slider.js +9 -86
  68. package/Stack/Stack.d.ts +39 -38
  69. package/Step/Step.d.ts +46 -44
  70. package/StepButton/StepButton.d.ts +27 -25
  71. package/Stepper/Stepper.d.ts +45 -44
  72. package/SvgIcon/SvgIcon.d.ts +77 -75
  73. package/SwipeableDrawer/SwipeableDrawer.js +4 -4
  74. package/Tab/Tab.d.ts +52 -50
  75. package/TabScrollButton/TabScrollButton.d.ts +3 -2
  76. package/Table/Table.d.ts +35 -33
  77. package/TableBody/TableBody.d.ts +18 -16
  78. package/TableContainer/TableContainer.d.ts +18 -16
  79. package/TableFooter/TableFooter.d.ts +18 -16
  80. package/TableHead/TableHead.d.ts +18 -16
  81. package/TablePagination/TablePagination.d.ts +113 -112
  82. package/TableRow/TableRow.d.ts +28 -26
  83. package/TableSortLabel/TableSortLabel.d.ts +40 -36
  84. package/Tabs/Tabs.d.ts +153 -150
  85. package/Tabs/Tabs.js +1 -4
  86. package/ToggleButton/ToggleButton.d.ts +72 -70
  87. package/Toolbar/Toolbar.d.ts +29 -27
  88. package/Typography/Typography.d.ts +2 -2
  89. package/index.js +1 -1
  90. package/legacy/Button/Button.js +4 -1
  91. package/legacy/ButtonGroup/ButtonGroup.js +81 -56
  92. package/legacy/ButtonGroup/ButtonGroupButtonContext.js +9 -0
  93. package/legacy/ButtonGroup/buttonGroupClasses.js +1 -1
  94. package/legacy/CircularProgress/CircularProgress.js +1 -1
  95. package/legacy/ImageListItem/ImageListItem.js +2 -1
  96. package/legacy/InputBase/InputBase.js +1 -1
  97. package/legacy/InputLabel/InputLabel.js +2 -1
  98. package/legacy/Modal/Modal.js +3 -1
  99. package/legacy/Radio/Radio.js +3 -2
  100. package/legacy/Radio/radioClasses.js +1 -1
  101. package/legacy/Select/SelectInput.js +9 -5
  102. package/legacy/Slider/Slider.js +9 -86
  103. package/legacy/SwipeableDrawer/SwipeableDrawer.js +4 -4
  104. package/legacy/Tabs/Tabs.js +1 -4
  105. package/legacy/index.js +1 -1
  106. package/legacy/useTouchRipple/useTouchRipple.js +4 -4
  107. package/modern/Button/Button.js +4 -1
  108. package/modern/ButtonGroup/ButtonGroup.js +86 -54
  109. package/modern/ButtonGroup/ButtonGroupButtonContext.js +9 -0
  110. package/modern/ButtonGroup/buttonGroupClasses.js +1 -1
  111. package/modern/CircularProgress/CircularProgress.js +1 -1
  112. package/modern/ImageListItem/ImageListItem.js +2 -1
  113. package/modern/InputBase/InputBase.js +1 -1
  114. package/modern/InputLabel/InputLabel.js +2 -1
  115. package/modern/Modal/Modal.js +1 -1
  116. package/modern/Radio/Radio.js +3 -2
  117. package/modern/Radio/radioClasses.js +1 -1
  118. package/modern/Select/SelectInput.js +8 -5
  119. package/modern/Slider/Slider.js +9 -86
  120. package/modern/SwipeableDrawer/SwipeableDrawer.js +4 -4
  121. package/modern/Tabs/Tabs.js +1 -4
  122. package/modern/index.js +1 -1
  123. package/node/Button/Button.js +4 -1
  124. package/node/ButtonGroup/ButtonGroup.js +86 -54
  125. package/node/ButtonGroup/ButtonGroupButtonContext.js +18 -0
  126. package/node/ButtonGroup/buttonGroupClasses.js +1 -1
  127. package/node/CircularProgress/CircularProgress.js +1 -1
  128. package/node/ImageListItem/ImageListItem.js +2 -1
  129. package/node/InputBase/InputBase.js +1 -1
  130. package/node/InputLabel/InputLabel.js +2 -1
  131. package/node/Modal/Modal.js +1 -1
  132. package/node/Radio/Radio.js +3 -2
  133. package/node/Radio/radioClasses.js +1 -1
  134. package/node/Select/SelectInput.js +9 -5
  135. package/node/Slider/Slider.js +3 -73
  136. package/node/SwipeableDrawer/SwipeableDrawer.js +4 -4
  137. package/node/Tabs/Tabs.js +1 -4
  138. package/node/index.js +1 -1
  139. package/node/useTouchRipple/useTouchRipple.js +4 -4
  140. package/package.json +16 -16
  141. package/umd/material-ui.development.js +258 -254
  142. package/umd/material-ui.production.min.js +18 -18
  143. package/useTouchRipple/useTouchRipple.js +4 -4
@@ -12,77 +12,79 @@ export interface BreadcrumbsOwnerState extends BreadcrumbsProps {
12
12
  expanded: boolean;
13
13
  }
14
14
 
15
- export interface BreadcrumbsTypeMap<
16
- AdditionalProps = {},
17
- DefaultComponent extends React.ElementType = 'nav',
18
- > {
19
- props: AdditionalProps & {
20
- /**
21
- * The content of the component.
22
- */
23
- children?: React.ReactNode;
24
- /**
25
- * Override or extend the styles applied to the component.
26
- */
27
- classes?: Partial<BreadcrumbsClasses>;
28
- /**
29
- * The components used for each slot inside the Breadcumb.
30
- * Either a string to use a HTML element or a component.
31
- * @default {}
32
- */
33
- slots?: {
34
- CollapsedIcon?: React.ElementType;
35
- };
15
+ export interface BreadcrumbsOwnProps {
16
+ /**
17
+ * The content of the component.
18
+ */
19
+ children?: React.ReactNode;
20
+ /**
21
+ * Override or extend the styles applied to the component.
22
+ */
23
+ classes?: Partial<BreadcrumbsClasses>;
24
+ /**
25
+ * The components used for each slot inside the Breadcumb.
26
+ * Either a string to use a HTML element or a component.
27
+ * @default {}
28
+ */
29
+ slots?: {
30
+ CollapsedIcon?: React.ElementType;
31
+ };
32
+ /**
33
+ * The props used for each slot inside the Breadcumb.
34
+ * @default {}
35
+ */
36
+ slotProps?: {
36
37
  /**
37
- * The props used for each slot inside the Breadcumb.
38
+ * Props applied to the CollapsedIcon slot.
38
39
  * @default {}
39
40
  */
40
- slotProps?: {
41
- /**
42
- * Props applied to the CollapsedIcon slot.
43
- * @default {}
44
- */
45
- collapsedIcon?: SlotComponentProps<
46
- typeof SvgIcon,
47
- BreadcrumbsCollapsedIconSlotPropsOverrides,
48
- BreadcrumbsOwnerState
49
- >;
50
- };
51
- /**
52
- * Override the default label for the expand button.
53
- *
54
- * For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
55
- * @default 'Show path'
56
- */
57
- expandText?: string;
58
- /**
59
- * If max items is exceeded, the number of items to show after the ellipsis.
60
- * @default 1
61
- */
62
- itemsAfterCollapse?: number;
63
- /**
64
- * If max items is exceeded, the number of items to show before the ellipsis.
65
- * @default 1
66
- */
67
- itemsBeforeCollapse?: number;
68
- /**
69
- * Specifies the maximum number of breadcrumbs to display. When there are more
70
- * than the maximum number, only the first `itemsBeforeCollapse` and last `itemsAfterCollapse`
71
- * will be shown, with an ellipsis in between.
72
- * @default 8
73
- */
74
- maxItems?: number;
75
- /**
76
- * Custom separator node.
77
- * @default '/'
78
- */
79
- separator?: React.ReactNode;
80
- /**
81
- * The system prop that allows defining system overrides as well as additional CSS styles.
82
- */
83
- sx?: SxProps<Theme>;
41
+ collapsedIcon?: SlotComponentProps<
42
+ typeof SvgIcon,
43
+ BreadcrumbsCollapsedIconSlotPropsOverrides,
44
+ BreadcrumbsOwnerState
45
+ >;
84
46
  };
85
- defaultComponent: DefaultComponent;
47
+ /**
48
+ * Override the default label for the expand button.
49
+ *
50
+ * For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
51
+ * @default 'Show path'
52
+ */
53
+ expandText?: string;
54
+ /**
55
+ * If max items is exceeded, the number of items to show after the ellipsis.
56
+ * @default 1
57
+ */
58
+ itemsAfterCollapse?: number;
59
+ /**
60
+ * If max items is exceeded, the number of items to show before the ellipsis.
61
+ * @default 1
62
+ */
63
+ itemsBeforeCollapse?: number;
64
+ /**
65
+ * Specifies the maximum number of breadcrumbs to display. When there are more
66
+ * than the maximum number, only the first `itemsBeforeCollapse` and last `itemsAfterCollapse`
67
+ * will be shown, with an ellipsis in between.
68
+ * @default 8
69
+ */
70
+ maxItems?: number;
71
+ /**
72
+ * Custom separator node.
73
+ * @default '/'
74
+ */
75
+ separator?: React.ReactNode;
76
+ /**
77
+ * The system prop that allows defining system overrides as well as additional CSS styles.
78
+ */
79
+ sx?: SxProps<Theme>;
80
+ }
81
+
82
+ export interface BreadcrumbsTypeMap<
83
+ AdditionalProps = {},
84
+ RootComponent extends React.ElementType = 'nav',
85
+ > {
86
+ props: AdditionalProps & BreadcrumbsOwnProps;
87
+ defaultComponent: RootComponent;
86
88
  }
87
89
 
88
90
  /**
@@ -94,6 +96,7 @@ export interface BreadcrumbsTypeMap<
94
96
  * API:
95
97
  *
96
98
  * - [Breadcrumbs API](https://mui.com/material-ui/api/breadcrumbs/)
99
+ * - inherits [Typography API](https://mui.com/material-ui/api/typography/)
97
100
  */
98
101
  declare const Breadcrumbs: OverridableComponent<BreadcrumbsTypeMap>;
99
102
 
@@ -12,82 +12,81 @@ export interface ButtonPropsColorOverrides {}
12
12
 
13
13
  export interface ButtonPropsSizeOverrides {}
14
14
 
15
+ export interface ButtonOwnProps {
16
+ /**
17
+ * The content of the component.
18
+ */
19
+ children?: React.ReactNode;
20
+ /**
21
+ * Override or extend the styles applied to the component.
22
+ */
23
+ classes?: Partial<ButtonClasses>;
24
+ /**
25
+ * The color of the component.
26
+ * It supports both default and custom theme colors, which can be added as shown in the
27
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
28
+ * @default 'primary'
29
+ */
30
+ color?: OverridableStringUnion<
31
+ 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning',
32
+ ButtonPropsColorOverrides
33
+ >;
34
+ /**
35
+ * If `true`, the component is disabled.
36
+ * @default false
37
+ */
38
+ disabled?: boolean;
39
+ /**
40
+ * If `true`, no elevation is used.
41
+ * @default false
42
+ */
43
+ disableElevation?: boolean;
44
+ /**
45
+ * If `true`, the keyboard focus ripple is disabled.
46
+ * @default false
47
+ */
48
+ disableFocusRipple?: boolean;
49
+ /**
50
+ * Element placed after the children.
51
+ */
52
+ endIcon?: React.ReactNode;
53
+ /**
54
+ * If `true`, the button will take up the full width of its container.
55
+ * @default false
56
+ */
57
+ fullWidth?: boolean;
58
+ /**
59
+ * The URL to link to when the button is clicked.
60
+ * If defined, an `a` element will be used as the root node.
61
+ */
62
+ href?: string;
63
+ /**
64
+ * The size of the component.
65
+ * `small` is equivalent to the dense button styling.
66
+ * @default 'medium'
67
+ */
68
+ size?: OverridableStringUnion<'small' | 'medium' | 'large', ButtonPropsSizeOverrides>;
69
+ /**
70
+ * Element placed before the children.
71
+ */
72
+ startIcon?: React.ReactNode;
73
+ /**
74
+ * The system prop that allows defining system overrides as well as additional CSS styles.
75
+ */
76
+ sx?: SxProps<Theme>;
77
+ /**
78
+ * The variant to use.
79
+ * @default 'text'
80
+ */
81
+ variant?: OverridableStringUnion<'text' | 'outlined' | 'contained', ButtonPropsVariantOverrides>;
82
+ }
83
+
15
84
  export type ButtonTypeMap<
16
85
  AdditionalProps = {},
17
- DefaultComponent extends React.ElementType = 'button',
86
+ RootComponent extends React.ElementType = 'button',
18
87
  > = ExtendButtonBaseTypeMap<{
19
- props: AdditionalProps & {
20
- /**
21
- * The content of the component.
22
- */
23
- children?: React.ReactNode;
24
- /**
25
- * Override or extend the styles applied to the component.
26
- */
27
- classes?: Partial<ButtonClasses>;
28
- /**
29
- * The color of the component.
30
- * It supports both default and custom theme colors, which can be added as shown in the
31
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
32
- * @default 'primary'
33
- */
34
- color?: OverridableStringUnion<
35
- 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning',
36
- ButtonPropsColorOverrides
37
- >;
38
- /**
39
- * If `true`, the component is disabled.
40
- * @default false
41
- */
42
- disabled?: boolean;
43
- /**
44
- * If `true`, no elevation is used.
45
- * @default false
46
- */
47
- disableElevation?: boolean;
48
- /**
49
- * If `true`, the keyboard focus ripple is disabled.
50
- * @default false
51
- */
52
- disableFocusRipple?: boolean;
53
- /**
54
- * Element placed after the children.
55
- */
56
- endIcon?: React.ReactNode;
57
- /**
58
- * If `true`, the button will take up the full width of its container.
59
- * @default false
60
- */
61
- fullWidth?: boolean;
62
- /**
63
- * The URL to link to when the button is clicked.
64
- * If defined, an `a` element will be used as the root node.
65
- */
66
- href?: string;
67
- /**
68
- * The size of the component.
69
- * `small` is equivalent to the dense button styling.
70
- * @default 'medium'
71
- */
72
- size?: OverridableStringUnion<'small' | 'medium' | 'large', ButtonPropsSizeOverrides>;
73
- /**
74
- * Element placed before the children.
75
- */
76
- startIcon?: React.ReactNode;
77
- /**
78
- * The system prop that allows defining system overrides as well as additional CSS styles.
79
- */
80
- sx?: SxProps<Theme>;
81
- /**
82
- * The variant to use.
83
- * @default 'text'
84
- */
85
- variant?: OverridableStringUnion<
86
- 'text' | 'outlined' | 'contained',
87
- ButtonPropsVariantOverrides
88
- >;
89
- };
90
- defaultComponent: DefaultComponent;
88
+ props: AdditionalProps & ButtonOwnProps;
89
+ defaultComponent: RootComponent;
91
90
  }>;
92
91
 
93
92
  /**
package/Button/Button.js CHANGED
@@ -15,6 +15,7 @@ import ButtonBase from '../ButtonBase';
15
15
  import capitalize from '../utils/capitalize';
16
16
  import buttonClasses, { getButtonUtilityClass } from './buttonClasses';
17
17
  import ButtonGroupContext from '../ButtonGroup/ButtonGroupContext';
18
+ import ButtonGroupButtonContext from '../ButtonGroup/ButtonGroupButtonContext';
18
19
  import { jsx as _jsx } from "react/jsx-runtime";
19
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
20
21
  const useUtilityClasses = ownerState => {
@@ -221,6 +222,7 @@ const ButtonEndIcon = styled('span', {
221
222
  const Button = /*#__PURE__*/React.forwardRef(function Button(inProps, ref) {
222
223
  // props priority: `inProps` > `contextProps` > `themeDefaultProps`
223
224
  const contextProps = React.useContext(ButtonGroupContext);
225
+ const buttonGroupButtonContextPositionClassName = React.useContext(ButtonGroupButtonContext);
224
226
  const resolvedProps = resolveProps(contextProps, inProps);
225
227
  const props = useThemeProps({
226
228
  props: resolvedProps,
@@ -265,9 +267,10 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(inProps, ref) {
265
267
  ownerState: ownerState,
266
268
  children: endIconProp
267
269
  });
270
+ const positionClassName = buttonGroupButtonContextPositionClassName || '';
268
271
  return /*#__PURE__*/_jsxs(ButtonRoot, _extends({
269
272
  ownerState: ownerState,
270
- className: clsx(contextProps.className, classes.root, className),
273
+ className: clsx(contextProps.className, classes.root, className, positionClassName),
271
274
  component: component,
272
275
  disabled: disabled,
273
276
  focusRipple: !disableFocusRipple,
@@ -5,90 +5,92 @@ import { TouchRippleActions, TouchRippleProps } from './TouchRipple';
5
5
  import { OverrideProps, OverridableComponent, OverridableTypeMap } from '../OverridableComponent';
6
6
  import { ButtonBaseClasses } from './buttonBaseClasses';
7
7
 
8
+ export interface ButtonBaseOwnProps {
9
+ /**
10
+ * A ref for imperative actions.
11
+ * It currently only supports `focusVisible()` action.
12
+ */
13
+ action?: React.Ref<ButtonBaseActions>;
14
+ /**
15
+ * If `true`, the ripples are centered.
16
+ * They won't start at the cursor interaction position.
17
+ * @default false
18
+ */
19
+ centerRipple?: boolean;
20
+ /**
21
+ * The content of the component.
22
+ */
23
+ children?: React.ReactNode;
24
+ /**
25
+ * Override or extend the styles applied to the component.
26
+ */
27
+ classes?: Partial<ButtonBaseClasses>;
28
+ /**
29
+ * If `true`, the component is disabled.
30
+ * @default false
31
+ */
32
+ disabled?: boolean;
33
+ /**
34
+ * If `true`, the ripple effect is disabled.
35
+ *
36
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
37
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
38
+ * @default false
39
+ */
40
+ disableRipple?: boolean;
41
+ /**
42
+ * If `true`, the touch ripple effect is disabled.
43
+ * @default false
44
+ */
45
+ disableTouchRipple?: boolean;
46
+ /**
47
+ * If `true`, the base button will have a keyboard focus ripple.
48
+ * @default false
49
+ */
50
+ focusRipple?: boolean;
51
+ /**
52
+ * This prop can help identify which element has keyboard focus.
53
+ * The class name will be applied when the element gains the focus through keyboard interaction.
54
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
55
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
56
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
57
+ * if needed.
58
+ */
59
+ focusVisibleClassName?: string;
60
+ /**
61
+ * The component used to render a link when the `href` prop is provided.
62
+ * @default 'a'
63
+ */
64
+ LinkComponent?: React.ElementType;
65
+ /**
66
+ * Callback fired when the component is focused with a keyboard.
67
+ * We trigger a `onFocus` callback too.
68
+ */
69
+ onFocusVisible?: React.FocusEventHandler<any>;
70
+ /**
71
+ * The system prop that allows defining system overrides as well as additional CSS styles.
72
+ */
73
+ sx?: SxProps<Theme>;
74
+ /**
75
+ * @default 0
76
+ */
77
+ tabIndex?: NonNullable<React.HTMLAttributes<any>['tabIndex']>;
78
+ /**
79
+ * Props applied to the `TouchRipple` element.
80
+ */
81
+ TouchRippleProps?: Partial<TouchRippleProps>;
82
+ /**
83
+ * A ref that points to the `TouchRipple` element.
84
+ */
85
+ touchRippleRef?: React.Ref<TouchRippleActions>;
86
+ }
87
+
8
88
  export interface ButtonBaseTypeMap<
9
89
  AdditionalProps = {},
10
- DefaultComponent extends React.ElementType = 'button',
90
+ RootComponent extends React.ElementType = 'button',
11
91
  > {
12
- props: AdditionalProps & {
13
- /**
14
- * A ref for imperative actions.
15
- * It currently only supports `focusVisible()` action.
16
- */
17
- action?: React.Ref<ButtonBaseActions>;
18
- /**
19
- * If `true`, the ripples are centered.
20
- * They won't start at the cursor interaction position.
21
- * @default false
22
- */
23
- centerRipple?: boolean;
24
- /**
25
- * The content of the component.
26
- */
27
- children?: React.ReactNode;
28
- /**
29
- * Override or extend the styles applied to the component.
30
- */
31
- classes?: Partial<ButtonBaseClasses>;
32
- /**
33
- * If `true`, the component is disabled.
34
- * @default false
35
- */
36
- disabled?: boolean;
37
- /**
38
- * If `true`, the ripple effect is disabled.
39
- *
40
- * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
41
- * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
42
- * @default false
43
- */
44
- disableRipple?: boolean;
45
- /**
46
- * If `true`, the touch ripple effect is disabled.
47
- * @default false
48
- */
49
- disableTouchRipple?: boolean;
50
- /**
51
- * If `true`, the base button will have a keyboard focus ripple.
52
- * @default false
53
- */
54
- focusRipple?: boolean;
55
- /**
56
- * This prop can help identify which element has keyboard focus.
57
- * The class name will be applied when the element gains the focus through keyboard interaction.
58
- * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
59
- * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
60
- * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
61
- * if needed.
62
- */
63
- focusVisibleClassName?: string;
64
- /**
65
- * The component used to render a link when the `href` prop is provided.
66
- * @default 'a'
67
- */
68
- LinkComponent?: React.ElementType;
69
- /**
70
- * Callback fired when the component is focused with a keyboard.
71
- * We trigger a `onFocus` callback too.
72
- */
73
- onFocusVisible?: React.FocusEventHandler<any>;
74
- /**
75
- * The system prop that allows defining system overrides as well as additional CSS styles.
76
- */
77
- sx?: SxProps<Theme>;
78
- /**
79
- * @default 0
80
- */
81
- tabIndex?: NonNullable<React.HTMLAttributes<any>['tabIndex']>;
82
- /**
83
- * Props applied to the `TouchRipple` element.
84
- */
85
- TouchRippleProps?: Partial<TouchRippleProps>;
86
- /**
87
- * A ref that points to the `TouchRipple` element.
88
- */
89
- touchRippleRef?: React.Ref<TouchRippleActions>;
90
- };
91
- defaultComponent: DefaultComponent;
92
+ props: AdditionalProps & ButtonBaseOwnProps;
93
+ defaultComponent: RootComponent;
92
94
  }
93
95
 
94
96
  /**
@@ -9,79 +9,81 @@ export interface ButtonGroupPropsColorOverrides {}
9
9
  export interface ButtonGroupPropsVariantOverrides {}
10
10
  export interface ButtonGroupPropsSizeOverrides {}
11
11
 
12
+ export interface ButtonGroupOwnProps {
13
+ /**
14
+ * The content of the component.
15
+ */
16
+ children?: React.ReactNode;
17
+ /**
18
+ * Override or extend the styles applied to the component.
19
+ */
20
+ classes?: Partial<ButtonGroupClasses>;
21
+ /**
22
+ * The color of the component.
23
+ * It supports both default and custom theme colors, which can be added as shown in the
24
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
25
+ * @default 'primary'
26
+ */
27
+ color?: OverridableStringUnion<
28
+ 'inherit' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
29
+ ButtonGroupPropsColorOverrides
30
+ >;
31
+ /**
32
+ * If `true`, the component is disabled.
33
+ * @default false
34
+ */
35
+ disabled?: boolean;
36
+ /**
37
+ * If `true`, no elevation is used.
38
+ * @default false
39
+ */
40
+ disableElevation?: boolean;
41
+ /**
42
+ * If `true`, the button keyboard focus ripple is disabled.
43
+ * @default false
44
+ */
45
+ disableFocusRipple?: boolean;
46
+ /**
47
+ * If `true`, the button ripple effect is disabled.
48
+ * @default false
49
+ */
50
+ disableRipple?: boolean;
51
+ /**
52
+ * If `true`, the buttons will take up the full width of its container.
53
+ * @default false
54
+ */
55
+ fullWidth?: boolean;
56
+ /**
57
+ * The component orientation (layout flow direction).
58
+ * @default 'horizontal'
59
+ */
60
+ orientation?: 'vertical' | 'horizontal';
61
+ /**
62
+ * The size of the component.
63
+ * `small` is equivalent to the dense button styling.
64
+ * @default 'medium'
65
+ */
66
+ size?: OverridableStringUnion<'small' | 'medium' | 'large', ButtonGroupPropsSizeOverrides>;
67
+ /**
68
+ * The variant to use.
69
+ * @default 'outlined'
70
+ */
71
+ variant?: OverridableStringUnion<
72
+ 'text' | 'outlined' | 'contained',
73
+ ButtonGroupPropsVariantOverrides
74
+ >;
75
+ /**
76
+ * The system prop that allows defining system overrides as well as additional CSS styles.
77
+ */
78
+ sx?: SxProps<Theme>;
79
+ }
80
+
12
81
  export interface ButtonGroupTypeMap<
13
82
  AdditionalProps = {},
14
- DefaultComponent extends React.ElementType = 'div',
83
+ RootComponent extends React.ElementType = 'div',
15
84
  > {
16
- props: AdditionalProps & {
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<ButtonGroupClasses>;
25
- /**
26
- * The color of the component.
27
- * It supports both default and custom theme colors, which can be added as shown in the
28
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
29
- * @default 'primary'
30
- */
31
- color?: OverridableStringUnion<
32
- 'inherit' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
33
- ButtonGroupPropsColorOverrides
34
- >;
35
- /**
36
- * If `true`, the component is disabled.
37
- * @default false
38
- */
39
- disabled?: boolean;
40
- /**
41
- * If `true`, no elevation is used.
42
- * @default false
43
- */
44
- disableElevation?: boolean;
45
- /**
46
- * If `true`, the button keyboard focus ripple is disabled.
47
- * @default false
48
- */
49
- disableFocusRipple?: boolean;
50
- /**
51
- * If `true`, the button ripple effect is disabled.
52
- * @default false
53
- */
54
- disableRipple?: boolean;
55
- /**
56
- * If `true`, the buttons will take up the full width of its container.
57
- * @default false
58
- */
59
- fullWidth?: boolean;
60
- /**
61
- * The component orientation (layout flow direction).
62
- * @default 'horizontal'
63
- */
64
- orientation?: 'vertical' | 'horizontal';
65
- /**
66
- * The size of the component.
67
- * `small` is equivalent to the dense button styling.
68
- * @default 'medium'
69
- */
70
- size?: OverridableStringUnion<'small' | 'medium' | 'large', ButtonGroupPropsSizeOverrides>;
71
- /**
72
- * The variant to use.
73
- * @default 'outlined'
74
- */
75
- variant?: OverridableStringUnion<
76
- 'text' | 'outlined' | 'contained',
77
- ButtonGroupPropsVariantOverrides
78
- >;
79
- /**
80
- * The system prop that allows defining system overrides as well as additional CSS styles.
81
- */
82
- sx?: SxProps<Theme>;
83
- };
84
- defaultComponent: DefaultComponent;
85
+ props: AdditionalProps & ButtonGroupOwnProps;
86
+ defaultComponent: RootComponent;
85
87
  }
86
88
 
87
89
  /**