}
label="Show"
diff --git a/docs/data/material/guides/server-rendering/server-rendering.md b/docs/data/material/guides/server-rendering/server-rendering.md
index a9283c73d6e6d5..f1f9e62e69760a 100644
--- a/docs/data/material/guides/server-rendering/server-rendering.md
+++ b/docs/data/material/guides/server-rendering/server-rendering.md
@@ -220,12 +220,5 @@ ReactDOM.hydrate(, document.querySelector('#root'));
## Reference implementations
-We host different reference implementations which you can find in the [GitHub repository](https://github.com/mui/material-ui) under the [`/examples`](https://github.com/mui/material-ui/tree/HEAD/examples) folder:
-
-- [The reference implementation of this tutorial](https://github.com/mui/material-ui/tree/HEAD/examples/material-ui-express-ssr)
-- [Gatsby](https://github.com/mui/material-ui/tree/HEAD/examples/material-ui-gatsby)
-- [Next.js](https://github.com/mui/material-ui/tree/HEAD/examples/material-ui-nextjs) ([TypeScript version](https://github.com/mui/material-ui/tree/HEAD/examples/material-ui-nextjs-ts))
-
-## Troubleshooting
-
-Check out the FAQ answer: [My App doesn't render correctly on the server](/material-ui/getting-started/faq/#my-app-doesnt-render-correctly-on-the-server).
+Here is [the reference implementation of this tutorial](https://github.com/mui/material-ui/tree/HEAD/examples/material-ui-express-ssr).
+You can more SSR implementations in the GitHub repository under the `/examples` folder, see [the other examples](/material-ui/getting-started/example-projects/).
diff --git a/docs/data/material/guides/understand-mui-packages/understand-mui-packages.md b/docs/data/material/guides/understand-mui-packages/understand-mui-packages.md
index 2e671da94c96e2..5f8b47f923f74a 100644
--- a/docs/data/material/guides/understand-mui-packages/understand-mui-packages.md
+++ b/docs/data/material/guides/understand-mui-packages/understand-mui-packages.md
@@ -22,7 +22,6 @@ The following is an up-to-date list of `@mui` public packages.
- `@mui/system`
- `@mui/styled-engine`
- `@mui/styled-engine-sc`
-- `@mui/styles`
### Understanding MUI's products
diff --git a/docs/pages/joy-ui/api/alert.json b/docs/pages/joy-ui/api/alert.json
index 572c2b95d75574..95451d45c2f00a 100644
--- a/docs/pages/joy-ui/api/alert.json
+++ b/docs/pages/joy-ui/api/alert.json
@@ -48,7 +48,7 @@
"name": "union",
"description": "'outlined'
| 'plain'
| 'soft'
| 'solid'
| string"
},
- "default": "'outlined'",
+ "default": "'soft'",
"additionalInfo": { "joy-variant": true }
}
},
diff --git a/docs/pages/joy-ui/api/card.json b/docs/pages/joy-ui/api/card.json
index d7f69219f122e8..e9fb4bd31addfa 100644
--- a/docs/pages/joy-ui/api/card.json
+++ b/docs/pages/joy-ui/api/card.json
@@ -44,7 +44,7 @@
"name": "union",
"description": "'outlined'
| 'plain'
| 'soft'
| 'solid'
| string"
},
- "default": "'plain'",
+ "default": "'outlined'",
"additionalInfo": { "joy-variant": true }
}
},
diff --git a/docs/pages/material-ui/api/radio.json b/docs/pages/material-ui/api/radio.json
index c6cc33f43ae4b1..877319f68f74fc 100644
--- a/docs/pages/material-ui/api/radio.json
+++ b/docs/pages/material-ui/api/radio.json
@@ -44,7 +44,7 @@
"name": "Radio",
"imports": ["import Radio from '@mui/material/Radio';", "import { Radio } from '@mui/material';"],
"styles": {
- "classes": ["root", "checked", "disabled", "colorPrimary", "colorSecondary"],
+ "classes": ["root", "checked", "disabled", "colorPrimary", "colorSecondary", "sizeSmall"],
"globalClasses": { "checked": "Mui-checked", "disabled": "Mui-disabled" },
"name": "MuiRadio"
},
diff --git a/docs/public/static/base-ui/with-tailwind-css/full-stack-radio.png b/docs/public/static/base-ui/with-tailwind-css/full-stack-radio.png
new file mode 100644
index 00000000000000..68901c77e149c2
Binary files /dev/null and b/docs/public/static/base-ui/with-tailwind-css/full-stack-radio.png differ
diff --git a/docs/src/modules/components/HighlightedCodeWithTabs.tsx b/docs/src/modules/components/HighlightedCodeWithTabs.tsx
index 6caaa932e96d5a..41cbf6cb6cd67d 100644
--- a/docs/src/modules/components/HighlightedCodeWithTabs.tsx
+++ b/docs/src/modules/components/HighlightedCodeWithTabs.tsx
@@ -44,7 +44,7 @@ const StyledTab = styled(Tab)<{ ownerState: { mounted: boolean } }>(({ theme, ow
cursor: 'pointer',
borderRadius: '8px',
position: 'relative',
- '&:not(:first-child)': {
+ '&:not(:first-of-type)': {
marginLeft: 0.5,
},
...(ownerState.mounted && {
diff --git a/docs/src/modules/components/MarkdownElement.js b/docs/src/modules/components/MarkdownElement.js
index e2787b7498da2b..e85b51473d8ced 100644
--- a/docs/src/modules/components/MarkdownElement.js
+++ b/docs/src/modules/components/MarkdownElement.js
@@ -281,12 +281,19 @@ const Root = styled('div')(
theme.shape?.borderRadius ?? lightTheme.shape.borderRadius
}px)`,
'& .MuiCallout-content': {
+ minWidth: 0, // Allows content to shrink. Useful when callout contains code block
display: 'flex',
flexDirection: 'column',
gap: 6,
'&>p, ul': {
marginBottom: 0,
},
+ '& .MuiCode-root': {
+ '&>pre': {
+ margin: 0,
+ marginTop: 4,
+ },
+ },
'&>ul': {
paddingLeft: 22,
},
@@ -448,9 +455,8 @@ const Root = styled('div')(
fontWeight: 500,
borderRadius: 6,
border: 'none',
- backgroundColor: 'transparent',
+ backgroundColor: '#0F1924', // using the code block one-off background color (defined in line 23)
color: '#FFF',
- opacity: 0.6,
transition: theme.transitions.create(['background', 'borderColor', 'display'], {
duration: theme.transitions.duration.shortest,
}),
@@ -463,12 +469,15 @@ const Root = styled('div')(
flexShrink: 0,
fontSize: '18px',
margin: 'auto',
+ opacity: 0.6,
},
'& .MuiCode-copied-icon': {
display: 'none',
},
'&:hover, &:focus': {
- opacity: 1,
+ '& svg': {
+ opacity: 1,
+ },
backgroundColor: lightTheme.palette.primaryDark[500],
'& .MuiCode-copyKeypress': {
display: 'block',
diff --git a/docs/translations/api-docs/radio/radio.json b/docs/translations/api-docs/radio/radio.json
index 665544d31ffb21..ea4e514bb7ae6b 100644
--- a/docs/translations/api-docs/radio/radio.json
+++ b/docs/translations/api-docs/radio/radio.json
@@ -54,6 +54,11 @@
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the root element",
"conditions": "color=\"secondary\"
"
+ },
+ "sizeSmall": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the root element",
+ "conditions": "size=\"small\"
"
}
}
}
diff --git a/package.json b/package.json
index d98bb18a8da52f..241bf020320f85 100644
--- a/package.json
+++ b/package.json
@@ -113,7 +113,6 @@
"@types/react-test-renderer": "^18.0.0",
"@types/sinon": "^10.0.16",
"@types/stylis": "^4.2.0",
- "@types/webpack": "^5.28.1",
"@types/yargs": "^17.0.24",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
diff --git a/packages/mui-base/src/TextareaAutosize/TextareaAutosize.tsx b/packages/mui-base/src/TextareaAutosize/TextareaAutosize.tsx
index 0d73e4ed0bd107..164dbd478a2bde 100644
--- a/packages/mui-base/src/TextareaAutosize/TextareaAutosize.tsx
+++ b/packages/mui-base/src/TextareaAutosize/TextareaAutosize.tsx
@@ -186,7 +186,18 @@ const TextareaAutosize = React.forwardRef(function TextareaAutosize(
};
React.useEffect(() => {
- const handleResize = debounce(() => {
+ const handleResize = () => {
+ renders.current = 0;
+
+ // If the TextareaAutosize component is replaced by Suspense with a fallback, the last
+ // ResizeObserver's handler that runs because of the change in the layout is trying to
+ // access a dom node that is no longer there (as the fallback component is being shown instead).
+ // See https://github.com/mui/material-ui/issues/32640
+ if (inputRef.current) {
+ syncHeightWithFlushSync();
+ }
+ };
+ const handleResizeWindow = debounce(() => {
renders.current = 0;
// If the TextareaAutosize component is replaced by Suspense with a fallback, the last
@@ -202,7 +213,7 @@ const TextareaAutosize = React.forwardRef(function TextareaAutosize(
const input = inputRef.current!;
const containerWindow = ownerWindow(input);
- containerWindow.addEventListener('resize', handleResize);
+ containerWindow.addEventListener('resize', handleResizeWindow);
if (typeof ResizeObserver !== 'undefined') {
resizeObserver = new ResizeObserver(handleResize);
@@ -210,8 +221,8 @@ const TextareaAutosize = React.forwardRef(function TextareaAutosize(
}
return () => {
- handleResize.clear();
- containerWindow.removeEventListener('resize', handleResize);
+ handleResizeWindow.clear();
+ containerWindow.removeEventListener('resize', handleResizeWindow);
if (resizeObserver) {
resizeObserver.disconnect();
}
diff --git a/packages/mui-icons-material/builder.mjs b/packages/mui-icons-material/builder.mjs
index d9b389575db4c4..536c23339a9bfa 100755
--- a/packages/mui-icons-material/builder.mjs
+++ b/packages/mui-icons-material/builder.mjs
@@ -1,6 +1,6 @@
+import path from 'path';
import fse from 'fs-extra';
import yargs from 'yargs';
-import path from 'path';
import { rimrafSync } from 'rimraf';
import Mustache from 'mustache';
import globAsync from 'fast-glob';
@@ -114,7 +114,7 @@ export function cleanPaths({ svgPath, data }) {
},
},
{ name: 'removeUnusedNS' },
- { name: 'cleanupIDs' },
+ { name: 'cleanupIds' },
{ name: 'cleanupNumericValues' },
{ name: 'cleanupListOfValues' },
{ name: 'moveElemsAttrsToGroup' },
@@ -138,7 +138,6 @@ export function cleanPaths({ svgPath, data }) {
plugins: [
{
name: 'svgAsReactFragment',
- type: 'visitor',
fn: () => {
return {
root: {
@@ -154,14 +153,15 @@ export function cleanPaths({ svgPath, data }) {
if (svg.children.length > 1) {
childrenAsArray = true;
svg.children.forEach((svgChild, index) => {
- svgChild.addAttr({ name: 'key', value: index });
+ svgChild.attributes.key = index;
// Original name will be restored later
// We just need a mechanism to convert the resulting
// svg string into an array of JSX elements
- svgChild.renameElem(`SVGChild:${svgChild.name}`);
+ svgChild.name = `SVGChild:${svgChild.name}`;
});
}
- root.spliceContent(0, svg.children.length, svg.children);
+
+ root.children = svg.children;
},
},
};
diff --git a/packages/mui-icons-material/package.json b/packages/mui-icons-material/package.json
index 875551f4f376e0..42a24787175b2a 100644
--- a/packages/mui-icons-material/package.json
+++ b/packages/mui-icons-material/package.json
@@ -62,7 +62,7 @@
"fs-extra": "^11.1.1",
"mustache": "^4.2.0",
"shx": "^0.3.4",
- "svgo": "^2.8.0",
+ "svgo": "^3.0.2",
"yargs": "^17.7.2"
},
"sideEffects": false,
diff --git a/packages/mui-joy/src/Alert/Alert.test.tsx b/packages/mui-joy/src/Alert/Alert.test.tsx
index 0ccb30dd20c302..8edc33de165dd9 100644
--- a/packages/mui-joy/src/Alert/Alert.test.tsx
+++ b/packages/mui-joy/src/Alert/Alert.test.tsx
@@ -32,10 +32,10 @@ describe('', () => {
it('soft by default', () => {
const { getByRole } = render();
- expect(getByRole('alert')).to.have.class(classes.variantOutlined);
+ expect(getByRole('alert')).to.have.class(classes.variantSoft);
});
- (['plain', 'soft', 'solid'] as const).forEach((variant) => {
+ (['plain', 'outlined', 'solid'] as const).forEach((variant) => {
it(`should render ${variant}`, () => {
const { getByRole } = render();
diff --git a/packages/mui-joy/src/Alert/Alert.tsx b/packages/mui-joy/src/Alert/Alert.tsx
index e41e4f121e70da..ae19e140577ce0 100644
--- a/packages/mui-joy/src/Alert/Alert.tsx
+++ b/packages/mui-joy/src/Alert/Alert.tsx
@@ -74,7 +74,6 @@ const AlertRoot = styled('div', {
alignItems: 'center',
padding: `var(--Alert-padding)`,
borderRadius: 'var(--Alert-radius)',
- boxShadow: theme.vars.shadow.xs,
...theme.typography[`body-${({ sm: 'xs', md: 'sm', lg: 'md' } as const)[ownerState.size!]}`],
fontWeight: theme.vars.fontWeight.md,
...theme.variants[ownerState.variant!]?.[ownerState.color!],
@@ -128,7 +127,7 @@ const Alert = React.forwardRef(function Alert(inProps, ref) {
color: colorProp = 'neutral',
invertedColors = false,
role = 'alert',
- variant = 'outlined',
+ variant = 'soft',
size = 'md',
startDecorator,
endDecorator,
@@ -277,7 +276,7 @@ Alert.propTypes /* remove-proptypes */ = {
]),
/**
* The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
- * @default 'outlined'
+ * @default 'soft'
*/
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
PropTypes.oneOf(['outlined', 'plain', 'soft', 'solid']),
diff --git a/packages/mui-joy/src/Alert/AlertProps.ts b/packages/mui-joy/src/Alert/AlertProps.ts
index b79749d972e662..8c1364e478f602 100644
--- a/packages/mui-joy/src/Alert/AlertProps.ts
+++ b/packages/mui-joy/src/Alert/AlertProps.ts
@@ -73,7 +73,7 @@ export interface AlertTypeMap {
sx?: SxProps;
/**
* The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
- * @default 'outlined'
+ * @default 'soft'
*/
variant?: OverridableStringUnion;
};
diff --git a/packages/mui-joy/src/Card/Card.test.tsx b/packages/mui-joy/src/Card/Card.test.tsx
index a291aeaf112e93..ae773620f6869e 100644
--- a/packages/mui-joy/src/Card/Card.test.tsx
+++ b/packages/mui-joy/src/Card/Card.test.tsx
@@ -29,10 +29,10 @@ describe('', () => {
describeJoyColorInversion(, { muiName: 'JoyCard', classes });
describe('prop: variant', () => {
- it('plain by default', () => {
+ it('outlined by default', () => {
const { getByTestId } = render(Hello World);
- expect(getByTestId('root')).to.have.class(classes.variantPlain);
+ expect(getByTestId('root')).to.have.class(classes.variantOutlined);
});
(['plain', 'outlined', 'soft', 'solid'] as const).forEach((variant) => {
diff --git a/packages/mui-joy/src/Card/Card.tsx b/packages/mui-joy/src/Card/Card.tsx
index c4caf13ebad36a..73607123bf9052 100644
--- a/packages/mui-joy/src/Card/Card.tsx
+++ b/packages/mui-joy/src/Card/Card.tsx
@@ -81,7 +81,6 @@ const CardRoot = styled('div', {
}),
padding: 'var(--Card-padding)',
borderRadius: 'var(--Card-radius)',
- boxShadow: theme.shadow.sm,
backgroundColor: theme.vars.palette.background.surface,
position: 'relative',
display: 'flex',
@@ -120,7 +119,7 @@ const Card = React.forwardRef(function Card(inProps, ref) {
component = 'div',
invertedColors = false,
size = 'md',
- variant = 'plain',
+ variant = 'outlined',
children,
orientation = 'vertical',
slots = {},
@@ -259,7 +258,7 @@ Card.propTypes /* remove-proptypes */ = {
]),
/**
* The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
- * @default 'plain'
+ * @default 'outlined'
*/
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
PropTypes.oneOf(['outlined', 'plain', 'soft', 'solid']),
diff --git a/packages/mui-joy/src/Card/CardProps.ts b/packages/mui-joy/src/Card/CardProps.ts
index 8c0c2dc9f3420c..1791beee9f6d7b 100644
--- a/packages/mui-joy/src/Card/CardProps.ts
+++ b/packages/mui-joy/src/Card/CardProps.ts
@@ -58,7 +58,7 @@ export interface CardTypeMap {
sx?: SxProps;
/**
* The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
- * @default 'plain'
+ * @default 'outlined'
*/
variant?: OverridableStringUnion;
} & CardSlotsAndSlotProps;
diff --git a/packages/mui-joy/src/Input/Input.tsx b/packages/mui-joy/src/Input/Input.tsx
index df621f9d7f0817..43e8830d12d2e5 100644
--- a/packages/mui-joy/src/Input/Input.tsx
+++ b/packages/mui-joy/src/Input/Input.tsx
@@ -84,6 +84,9 @@ export const StyledInputRoot = styled('div')<{ ownerState: InputOwnerState }>(
'--Button-radius': 'var(--Input-decoratorChildRadius)',
'--IconButton-radius': 'var(--Input-decoratorChildRadius)',
boxSizing: 'border-box',
+ ...(ownerState.variant !== 'plain' && {
+ boxShadow: theme.shadow.xs,
+ }),
minWidth: 0,
minHeight: 'var(--Input-minHeight)',
...(ownerState.fullWidth && {
diff --git a/packages/mui-joy/src/Select/Select.tsx b/packages/mui-joy/src/Select/Select.tsx
index e1c846e70c6e21..8870f2827c8813 100644
--- a/packages/mui-joy/src/Select/Select.tsx
+++ b/packages/mui-joy/src/Select/Select.tsx
@@ -125,6 +125,9 @@ const SelectRoot = styled('div', {
'--Button-radius': 'var(--Select-decoratorChildRadius)',
'--IconButton-radius': 'var(--Select-decoratorChildRadius)',
boxSizing: 'border-box',
+ ...(ownerState.variant !== 'plain' && {
+ boxShadow: theme.shadow.xs,
+ }),
minWidth: 0,
minHeight: 'var(--Select-minHeight)',
position: 'relative',
diff --git a/packages/mui-joy/src/Textarea/Textarea.tsx b/packages/mui-joy/src/Textarea/Textarea.tsx
index 3a2332e160f697..13cacbdd15eb93 100644
--- a/packages/mui-joy/src/Textarea/Textarea.tsx
+++ b/packages/mui-joy/src/Textarea/Textarea.tsx
@@ -88,6 +88,9 @@ const TextareaRoot = styled('div', {
'--Button-radius': 'var(--Textarea-decoratorChildRadius)',
'--IconButton-radius': 'var(--Textarea-decoratorChildRadius)',
boxSizing: 'border-box',
+ ...(ownerState.variant !== 'plain' && {
+ boxShadow: theme.shadow.xs,
+ }),
minWidth: 0,
minHeight: 'var(--Textarea-minHeight)',
cursor: 'text',
diff --git a/packages/mui-lab/src/LoadingButton/LoadingButton.d.ts b/packages/mui-lab/src/LoadingButton/LoadingButton.d.ts
index e32120739a270b..8603a50e117072 100644
--- a/packages/mui-lab/src/LoadingButton/LoadingButton.d.ts
+++ b/packages/mui-lab/src/LoadingButton/LoadingButton.d.ts
@@ -3,55 +3,57 @@ import { OverrideProps } from '@mui/material/OverridableComponent';
import { Theme } from '@mui/material/styles';
import { SxProps } from '@mui/system';
+export interface LoadingButtonOwnProps {
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial & {
+ /** Styles applied to the root element. */
+ root?: string;
+ /** Styles applied to the root element if `loading={true}`. */
+ loading?: string;
+ /** Styles applied to the loadingIndicator element. */
+ loadingIndicator?: string;
+ /** Styles applied to the loadingIndicator element if `loadingPosition="center"`. */
+ loadingIndicatorCenter?: string;
+ /** Styles applied to the loadingIndicator element if `loadingPosition="start"`. */
+ loadingIndicatorStart?: string;
+ /** Styles applied to the loadingIndicator element if `loadingPosition="end"`. */
+ loadingIndicatorEnd?: string;
+ /** Styles applied to the endIcon element if `loading={true}` and `loadingPosition="end"`. */
+ endIconLoadingEnd?: string;
+ /** Styles applied to the startIcon element if `loading={true}` and `loadingPosition="start"`. */
+ startIconLoadingStart?: string;
+ };
+ /**
+ * If `true`, the loading indicator is shown and the button becomes disabled.
+ * @default false
+ */
+ loading?: boolean;
+ /**
+ * Element placed before the children if the button is in loading state.
+ * The node should contain an element with `role="progressbar"` with an accessible name.
+ * By default we render a `CircularProgress` that is labelled by the button itself.
+ * @default
+ */
+ loadingIndicator?: React.ReactNode;
+ /**
+ * The loading indicator can be positioned on the start, end, or the center of the button.
+ * @default 'center'
+ */
+ loadingPosition?: 'start' | 'end' | 'center';
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export type LoadingButtonTypeMap<
- P = {},
- D extends React.ElementType = 'button',
+ AdditionalProps = {},
+ RootComponent extends React.ElementType = 'button',
> = ExtendButtonTypeMap<{
- props: P & {
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial & {
- /** Styles applied to the root element. */
- root?: string;
- /** Styles applied to the root element if `loading={true}`. */
- loading?: string;
- /** Styles applied to the loadingIndicator element. */
- loadingIndicator?: string;
- /** Styles applied to the loadingIndicator element if `loadingPosition="center"`. */
- loadingIndicatorCenter?: string;
- /** Styles applied to the loadingIndicator element if `loadingPosition="start"`. */
- loadingIndicatorStart?: string;
- /** Styles applied to the loadingIndicator element if `loadingPosition="end"`. */
- loadingIndicatorEnd?: string;
- /** Styles applied to the endIcon element if `loading={true}` and `loadingPosition="end"`. */
- endIconLoadingEnd?: string;
- /** Styles applied to the startIcon element if `loading={true}` and `loadingPosition="start"`. */
- startIconLoadingStart?: string;
- };
- /**
- * If `true`, the loading indicator is shown and the button becomes disabled.
- * @default false
- */
- loading?: boolean;
- /**
- * Element placed before the children if the button is in loading state.
- * The node should contain an element with `role="progressbar"` with an accessible name.
- * By default we render a `CircularProgress` that is labelled by the button itself.
- * @default
- */
- loadingIndicator?: React.ReactNode;
- /**
- * The loading indicator can be positioned on the start, end, or the center of the button.
- * @default 'center'
- */
- loadingPosition?: 'start' | 'end' | 'center';
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: D;
+ props: AdditionalProps & LoadingButtonOwnProps;
+ defaultComponent: RootComponent;
}>;
/**
@@ -68,8 +70,8 @@ export type LoadingButtonTypeMap<
declare const LoadingButton: ExtendButton;
export type LoadingButtonProps<
- D extends React.ElementType = LoadingButtonTypeMap['defaultComponent'],
- P = {},
-> = OverrideProps, D>;
+ RootComponent extends React.ElementType = LoadingButtonTypeMap['defaultComponent'],
+ AdditionalProps = {},
+> = OverrideProps, RootComponent>;
export default LoadingButton;
diff --git a/packages/mui-lab/src/Masonry/Masonry.d.ts b/packages/mui-lab/src/Masonry/Masonry.d.ts
index 2ceb37bca28cdd..7f338898e34051 100644
--- a/packages/mui-lab/src/Masonry/Masonry.d.ts
+++ b/packages/mui-lab/src/Masonry/Masonry.d.ts
@@ -3,44 +3,49 @@ import { OverridableComponent, OverrideProps } from '@mui/material/OverridableCo
import { Theme } from '@mui/material/styles';
import { MasonryClasses } from './masonryClasses';
-export interface MasonryTypeMap {
- props: P & {
- /**
- * The content of the component.
- */
- children: NonNullable;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * Number of columns.
- * @default 4
- */
- columns?: ResponsiveStyleValue;
- /**
- * The default number of columns of the component. This is provided for server-side rendering.
- */
- defaultColumns?: number;
- /**
- * The default height of the component in px. This is provided for server-side rendering.
- */
- defaultHeight?: number;
- /**
- * The default spacing of the component. Like `spacing`, it is a factor of the theme's spacing. This is provided for server-side rendering.
- */
- defaultSpacing?: number;
- /**
- * Defines the space between children. It is a factor of the theme's spacing.
- * @default 1
- */
- spacing?: ResponsiveStyleValue;
- /**
- * Allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: D;
+export interface MasonryOwnProps {
+ /**
+ * The content of the component.
+ */
+ children: NonNullable;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * Number of columns.
+ * @default 4
+ */
+ columns?: ResponsiveStyleValue;
+ /**
+ * The default number of columns of the component. This is provided for server-side rendering.
+ */
+ defaultColumns?: number;
+ /**
+ * The default height of the component in px. This is provided for server-side rendering.
+ */
+ defaultHeight?: number;
+ /**
+ * The default spacing of the component. Like `spacing`, it is a factor of the theme's spacing. This is provided for server-side rendering.
+ */
+ defaultSpacing?: number;
+ /**
+ * Defines the space between children. It is a factor of the theme's spacing.
+ * @default 1
+ */
+ spacing?: ResponsiveStyleValue;
+ /**
+ * Allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
+export interface MasonryTypeMap<
+ AdditionalProps = {},
+ RootComponent extends React.ElementType = 'div',
+> {
+ props: AdditionalProps & MasonryOwnProps;
+ defaultComponent: RootComponent;
}
/**
*
@@ -55,8 +60,8 @@ export interface MasonryTypeMap {
declare const Masonry: OverridableComponent;
export type MasonryProps<
- D extends React.ElementType = MasonryTypeMap['defaultComponent'],
- P = {},
-> = OverrideProps, D>;
+ RootComponent extends React.ElementType = MasonryTypeMap['defaultComponent'],
+ AdditionalProps = {},
+> = OverrideProps, RootComponent>;
export default Masonry;
diff --git a/packages/mui-lab/src/TabList/TabList.d.ts b/packages/mui-lab/src/TabList/TabList.d.ts
index 50b89137409906..cf7a6dd2381a44 100644
--- a/packages/mui-lab/src/TabList/TabList.d.ts
+++ b/packages/mui-lab/src/TabList/TabList.d.ts
@@ -3,17 +3,19 @@ import { TabsTypeMap } from '@mui/material/Tabs';
import { DistributiveOmit } from '@mui/types';
import { OverridableComponent, OverrideProps } from '@mui/material/OverridableComponent';
+interface TabListOwnProps extends DistributiveOmit {
+ /**
+ * A list of `` elements.
+ */
+ children?: React.ReactNode;
+}
+
export interface TabListTypeMap<
- P = {},
- D extends React.ElementType = TabsTypeMap['defaultComponent'],
+ AdditionalProps = {},
+ RootComponent extends React.ElementType = TabsTypeMap['defaultComponent'],
> {
- props: P & {
- /**
- * A list of `` elements.
- */
- children?: React.ReactNode;
- } & DistributiveOmit;
- defaultComponent: D;
+ props: AdditionalProps & TabListOwnProps;
+ defaultComponent: RootComponent;
}
/**
@@ -32,8 +34,8 @@ declare const TabList: OverridableComponent;
export type TabListClassKey = keyof NonNullable;
export type TabListProps<
- D extends React.ElementType = TabListTypeMap['defaultComponent'],
- P = {},
-> = OverrideProps, D>;
+ RootComponent extends React.ElementType = TabListTypeMap['defaultComponent'],
+ AdditionalProps = {},
+> = OverrideProps, RootComponent>;
export default TabList;
diff --git a/packages/mui-material-next/src/Chip/Chip.d.ts b/packages/mui-material-next/src/Chip/Chip.d.ts
index 5c42b0cf2c02d5..6050f86081318b 100644
--- a/packages/mui-material-next/src/Chip/Chip.d.ts
+++ b/packages/mui-material-next/src/Chip/Chip.d.ts
@@ -12,7 +12,7 @@ export interface ChipPropsColorOverrides {}
export interface ChipTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> {
props: AdditionalProps & {
/**
@@ -94,7 +94,7 @@ export interface ChipTypeMap<
*/
variant?: OverridableStringUnion<'filled' | 'outlined', ChipPropsVariantOverrides>;
};
- defaultComponent: DefaultComponent;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material-next/src/Input/Input.d.ts b/packages/mui-material-next/src/Input/Input.d.ts
index 9f92699c6a06dc..3cc269c639798f 100644
--- a/packages/mui-material-next/src/Input/Input.d.ts
+++ b/packages/mui-material-next/src/Input/Input.d.ts
@@ -203,10 +203,10 @@ export interface InputOwnProps {
export interface InputTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> {
props: AdditionalProps & InputOwnProps;
- defaultComponent: DefaultComponent;
+ defaultComponent: RootComponent;
}
export type InputProps<
diff --git a/packages/mui-material-next/src/Tab/Tab.d.ts b/packages/mui-material-next/src/Tab/Tab.d.ts
index ccf533f72e1fe2..50dd2de45ddf01 100644
--- a/packages/mui-material-next/src/Tab/Tab.d.ts
+++ b/packages/mui-material-next/src/Tab/Tab.d.ts
@@ -5,59 +5,61 @@ import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '@mui/material/ButtonB
import { OverrideProps } from '@mui/material/OverridableComponent';
import { TabClasses } from './tabClasses';
+export interface TabOwnProps {
+ /**
+ * This prop isn't supported.
+ * Use the `component` prop if you need to change the children structure.
+ */
+ children?: null;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * If `true`, the component is disabled.
+ * @default false
+ */
+ disabled?: boolean;
+ /**
+ * If `true`, the keyboard focus ripple is disabled.
+ * @default false
+ */
+ disableFocusRipple?: boolean;
+ /**
+ * The icon to display.
+ */
+ icon?: string | React.ReactElement;
+ /**
+ * The position of the icon relative to the label.
+ * @default 'top'
+ */
+ iconPosition?: 'top' | 'bottom' | 'start' | 'end';
+ /**
+ * The label element.
+ */
+ label?: React.ReactNode;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+ /**
+ * You can provide your own value. Otherwise, we fallback to the child position index.
+ */
+ value?: any;
+ /**
+ * Tab labels appear in a single row.
+ * They can use a second line if needed.
+ * @default false
+ */
+ wrapped?: boolean;
+}
+
export type TabTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> = ExtendButtonBaseTypeMap<{
- props: AdditionalProps & {
- /**
- * This prop isn't supported.
- * Use the `component` prop if you need to change the children structure.
- */
- children?: null;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * If `true`, the component is disabled.
- * @default false
- */
- disabled?: boolean;
- /**
- * If `true`, the keyboard focus ripple is disabled.
- * @default false
- */
- disableFocusRipple?: boolean;
- /**
- * The icon to display.
- */
- icon?: string | React.ReactElement;
- /**
- * The position of the icon relative to the label.
- * @default 'top'
- */
- iconPosition?: 'top' | 'bottom' | 'start' | 'end';
- /**
- * The label element.
- */
- label?: React.ReactNode;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- /**
- * You can provide your own value. Otherwise, we fallback to the child position index.
- */
- value?: any;
- /**
- * Tab labels appear in a single row.
- * They can use a second line if needed.
- * @default false
- */
- wrapped?: boolean;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & TabOwnProps;
+ defaultComponent: RootComponent;
}>;
/**
diff --git a/packages/mui-material-next/src/TablePagination/TablePagination.d.ts b/packages/mui-material-next/src/TablePagination/TablePagination.d.ts
index d86cbde6daa134..33c27a8c781729 100644
--- a/packages/mui-material-next/src/TablePagination/TablePagination.d.ts
+++ b/packages/mui-material-next/src/TablePagination/TablePagination.d.ts
@@ -38,116 +38,125 @@ export interface TablePaginationActionsProps extends React.HTMLAttributes {
- props: AdditionalProps &
- TablePaginationBaseProps & {
- /**
- * The component used for displaying the actions.
- * Either a string to use a HTML element or a component.
- * @default TablePaginationActions
- */
- ActionsComponent?: React.ElementType;
- /**
- * Props applied to the back arrow [`IconButton`](/material-ui/api/icon-button/) component.
- */
- backIconButtonProps?: Partial;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The total number of rows.
- *
- * To enable server side pagination for an unknown number of items, provide -1.
- */
- count: number;
- /**
- * Accepts a function which returns a string value that provides a user-friendly name for the current page.
- * This is important for screen reader users.
- *
- * For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
- * @param {string} type The link or button type to format ('first' | 'last' | 'next' | 'previous').
- * @returns {string}
- * @default function defaultGetAriaLabel(type) {
- * return `Go to ${type} page`;
- * }
- */
- getItemAriaLabel?: (type: 'first' | 'last' | 'next' | 'previous') => string;
- /**
- * Customize the displayed rows label. Invoked with a `{ from, to, count, page }`
- * object.
- *
- * For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
- * @default function defaultLabelDisplayedRows({ from, to, count }) {
- * return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
- * }
- */
- labelDisplayedRows?: (paginationInfo: LabelDisplayedRowsArgs) => React.ReactNode;
- /**
- * Customize the rows per page label.
- *
- * For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
- * @default 'Rows per page:'
- */
- labelRowsPerPage?: React.ReactNode;
- /**
- * Props applied to the next arrow [`IconButton`](/material-ui/api/icon-button/) element.
- */
- nextIconButtonProps?: Partial;
- /**
- * Callback fired when the page is changed.
- *
- * @param {React.MouseEvent | null} event The event source of the callback.
- * @param {number} page The page selected.
- */
- onPageChange: (event: React.MouseEvent | null, page: number) => void;
- /**
- * Callback fired when the number of rows per page is changed.
- *
- * @param {React.ChangeEvent} event The event source of the callback.
- */
- onRowsPerPageChange?: React.ChangeEventHandler;
- /**
- * The zero-based index of the current page.
- */
- page: number;
- /**
- * The number of rows per page.
- *
- * Set -1 to display all the rows.
- */
- rowsPerPage: number;
- /**
- * Customizes the options of the rows per page select field. If less than two options are
- * available, no select field will be displayed.
- * Use -1 for the value with a custom label to show all the rows.
- * @default [10, 25, 50, 100]
- */
- rowsPerPageOptions?: Array;
- /**
- * Props applied to the rows per page [`Select`](/material-ui/api/select/) element.
- * @default {}
- */
- SelectProps?: Partial;
- /**
- * If `true`, show the first-page button.
- * @default false
- */
- showFirstButton?: boolean;
- /**
- * If `true`, show the last-page button.
- * @default false
- */
- showLastButton?: boolean;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: DefaultComponent;
+/**
+ * This type is kept for compatibility. Use `TablePaginationOwnProps` instead.
+ */
+export type TablePaginationBaseProps = Omit;
+
+export interface TablePaginationOwnProps extends TablePaginationBaseProps {
+ /**
+ * The component used for displaying the actions.
+ * Either a string to use a HTML element or a component.
+ * @default TablePaginationActions
+ */
+ ActionsComponent?: React.ElementType;
+ /**
+ * Props applied to the back arrow [`IconButton`](/material-ui/api/icon-button/) component.
+ */
+ backIconButtonProps?: Partial;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The total number of rows.
+ *
+ * To enable server side pagination for an unknown number of items, provide -1.
+ */
+ count: number;
+ /**
+ * Accepts a function which returns a string value that provides a user-friendly name for the current page.
+ * This is important for screen reader users.
+ *
+ * For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
+ * @param {string} type The link or button type to format ('first' | 'last' | 'next' | 'previous').
+ * @returns {string}
+ * @default function defaultGetAriaLabel(type) {
+ * return `Go to ${type} page`;
+ * }
+ */
+ getItemAriaLabel?: (type: 'first' | 'last' | 'next' | 'previous') => string;
+ /**
+ * Customize the displayed rows label. Invoked with a `{ from, to, count, page }`
+ * object.
+ *
+ * For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
+ * @default function defaultLabelDisplayedRows({ from, to, count }) {
+ * return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
+ * }
+ */
+ labelDisplayedRows?: (paginationInfo: LabelDisplayedRowsArgs) => React.ReactNode;
+ /**
+ * Customize the rows per page label.
+ *
+ * For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
+ * @default 'Rows per page:'
+ */
+ labelRowsPerPage?: React.ReactNode;
+ /**
+ * Props applied to the next arrow [`IconButton`](/material-ui/api/icon-button/) element.
+ */
+ nextIconButtonProps?: Partial;
+ /**
+ * Callback fired when the page is changed.
+ *
+ * @param {React.MouseEvent | null} event The event source of the callback.
+ * @param {number} page The page selected.
+ */
+ onPageChange: (event: React.MouseEvent | null, page: number) => void;
+ /**
+ * Callback fired when the number of rows per page is changed.
+ *
+ * @param {React.ChangeEvent} event The event source of the callback.
+ */
+ onRowsPerPageChange?: React.ChangeEventHandler;
+ /**
+ * The zero-based index of the current page.
+ */
+ page: number;
+ /**
+ * The number of rows per page.
+ *
+ * Set -1 to display all the rows.
+ */
+ rowsPerPage: number;
+ /**
+ * Customizes the options of the rows per page select field. If less than two options are
+ * available, no select field will be displayed.
+ * Use -1 for the value with a custom label to show all the rows.
+ * @default [10, 25, 50, 100]
+ */
+ rowsPerPageOptions?: Array<
+ | number
+ | {
+ value: number;
+ label: string;
+ }
+ >;
+ /**
+ * Props applied to the rows per page [`Select`](/material-ui/api/select/) element.
+ * @default {}
+ */
+ SelectProps?: Partial;
+ /**
+ * If `true`, show the first-page button.
+ * @default false
+ */
+ showFirstButton?: boolean;
+ /**
+ * If `true`, show the last-page button.
+ * @default false
+ */
+ showLastButton?: boolean;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
+export interface TablePaginationTypeMap {
+ props: AdditionalProps & TablePaginationOwnProps;
+ defaultComponent: RootComponent;
}
/**
@@ -166,8 +175,6 @@ declare const TablePagination: OverridableComponent<
TablePaginationTypeMap<{}, React.JSXElementConstructor>
>;
-export type TablePaginationBaseProps = Omit;
-
export type TablePaginationProps<
RootComponent extends React.ElementType = React.JSXElementConstructor,
AdditionalProps = {},
diff --git a/packages/mui-material-next/src/Tabs/Tabs.d.ts b/packages/mui-material-next/src/Tabs/Tabs.d.ts
index 69c3457f219e51..66150dfa1be10e 100644
--- a/packages/mui-material-next/src/Tabs/Tabs.d.ts
+++ b/packages/mui-material-next/src/Tabs/Tabs.d.ts
@@ -6,130 +6,132 @@ import { OverridableComponent, OverrideProps } from '@mui/material/OverridableCo
import { TabScrollButtonProps } from '../TabScrollButton';
import { TabsClasses } from './tabsClasses';
+export interface TabsOwnProps {
+ /**
+ * Callback fired when the component mounts.
+ * This is useful when you want to trigger an action programmatically.
+ * It supports two actions: `updateIndicator()` and `updateScrollButtons()`
+ *
+ * @param {object} actions This object contains all possible actions
+ * that can be triggered programmatically.
+ */
+ action?: React.Ref;
+ /**
+ * If `true`, the scroll buttons aren't forced hidden on mobile.
+ * By default the scroll buttons are hidden on mobile and takes precedence over `scrollButtons`.
+ * @default false
+ */
+ allowScrollButtonsMobile?: boolean;
+ /**
+ * The label for the Tabs as a string.
+ */
+ 'aria-label'?: string;
+ /**
+ * An id or list of ids separated by a space that label the Tabs.
+ */
+ 'aria-labelledby'?: string;
+ /**
+ * If `true`, the tabs are centered.
+ * This prop is intended for large views.
+ * @default false
+ */
+ centered?: boolean;
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * Determines the color of the indicator.
+ * @default 'primary'
+ */
+ indicatorColor?: 'secondary' | 'primary';
+ /**
+ * Callback fired when the value changes.
+ *
+ * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
+ * @param {any} value We default to the index of the child (number)
+ */
+ onChange?: (event: React.SyntheticEvent, value: any) => void;
+ /**
+ * The component orientation (layout flow direction).
+ * @default 'horizontal'
+ */
+ orientation?: 'horizontal' | 'vertical';
+ /**
+ * The component used to render the scroll buttons.
+ * @default TabScrollButton
+ */
+ ScrollButtonComponent?: React.ElementType;
+ /**
+ * Determine behavior of scroll buttons when tabs are set to scroll:
+ *
+ * - `auto` will only present them when not all the items are visible.
+ * - `true` will always present them.
+ * - `false` will never present them.
+ *
+ * By default the scroll buttons are hidden on mobile.
+ * This behavior can be disabled with `allowScrollButtonsMobile`.
+ * @default 'auto'
+ */
+ scrollButtons?: 'auto' | true | false;
+ /**
+ * If `true` the selected tab changes on focus. Otherwise it only
+ * changes on activation.
+ */
+ selectionFollowsFocus?: boolean;
+ /**
+ * Props applied to the tab indicator element.
+ * @default {}
+ */
+ TabIndicatorProps?: React.HTMLAttributes;
+ /**
+ * Props applied to the [`TabScrollButton`](/material-ui/api/tab-scroll-button/) element.
+ * @default {}
+ */
+ TabScrollButtonProps?: Partial;
+ /**
+ * Determines the color of the `Tab`.
+ * @default 'primary'
+ */
+ textColor?: 'secondary' | 'primary' | 'inherit';
+ /**
+ * The value of the currently selected `Tab`.
+ * If you don't want any selected `Tab`, you can set this prop to `false`.
+ */
+ value?: any;
+ /**
+ * Determines additional display behavior of the tabs:
+ *
+ * - `scrollable` will invoke scrolling properties and allow for horizontally
+ * scrolling (or swiping) of the tab bar.
+ * -`fullWidth` will make the tabs grow to use all the available space,
+ * which should be used for small views, like on mobile.
+ * - `standard` will render the default state.
+ * @default 'standard'
+ */
+ variant?: 'standard' | 'scrollable' | 'fullWidth';
+ /**
+ * If `true`, the scrollbar is visible. It can be useful when displaying
+ * a long vertical list of tabs.
+ * @default false
+ */
+ visibleScrollbar?: boolean;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export interface TabsTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = typeof ButtonBase,
+ RootComponent extends React.ElementType = typeof ButtonBase,
> {
- props: AdditionalProps & {
- /**
- * Callback fired when the component mounts.
- * This is useful when you want to trigger an action programmatically.
- * It supports two actions: `updateIndicator()` and `updateScrollButtons()`
- *
- * @param {object} actions This object contains all possible actions
- * that can be triggered programmatically.
- */
- action?: React.Ref;
- /**
- * If `true`, the scroll buttons aren't forced hidden on mobile.
- * By default the scroll buttons are hidden on mobile and takes precedence over `scrollButtons`.
- * @default false
- */
- allowScrollButtonsMobile?: boolean;
- /**
- * The label for the Tabs as a string.
- */
- 'aria-label'?: string;
- /**
- * An id or list of ids separated by a space that label the Tabs.
- */
- 'aria-labelledby'?: string;
- /**
- * If `true`, the tabs are centered.
- * This prop is intended for large views.
- * @default false
- */
- centered?: boolean;
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * Determines the color of the indicator.
- * @default 'primary'
- */
- indicatorColor?: 'secondary' | 'primary';
- /**
- * Callback fired when the value changes.
- *
- * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
- * @param {any} value We default to the index of the child (number)
- */
- onChange?: (event: React.SyntheticEvent, value: any) => void;
- /**
- * The component orientation (layout flow direction).
- * @default 'horizontal'
- */
- orientation?: 'horizontal' | 'vertical';
- /**
- * The component used to render the scroll buttons.
- * @default TabScrollButton
- */
- ScrollButtonComponent?: React.ElementType;
- /**
- * Determine behavior of scroll buttons when tabs are set to scroll:
- *
- * - `auto` will only present them when not all the items are visible.
- * - `true` will always present them.
- * - `false` will never present them.
- *
- * By default the scroll buttons are hidden on mobile.
- * This behavior can be disabled with `allowScrollButtonsMobile`.
- * @default 'auto'
- */
- scrollButtons?: 'auto' | true | false;
- /**
- * If `true` the selected tab changes on focus. Otherwise it only
- * changes on activation.
- */
- selectionFollowsFocus?: boolean;
- /**
- * Props applied to the tab indicator element.
- * @default {}
- */
- TabIndicatorProps?: React.HTMLAttributes;
- /**
- * Props applied to the [`TabScrollButton`](/material-ui/api/tab-scroll-button/) element.
- * @default {}
- */
- TabScrollButtonProps?: Partial;
- /**
- * Determines the color of the `Tab`.
- * @default 'primary'
- */
- textColor?: 'secondary' | 'primary' | 'inherit';
- /**
- * The value of the currently selected `Tab`.
- * If you don't want any selected `Tab`, you can set this prop to `false`.
- */
- value?: any;
- /**
- * Determines additional display behavior of the tabs:
- *
- * - `scrollable` will invoke scrolling properties and allow for horizontally
- * scrolling (or swiping) of the tab bar.
- * -`fullWidth` will make the tabs grow to use all the available space,
- * which should be used for small views, like on mobile.
- * - `standard` will render the default state.
- * @default 'standard'
- */
- variant?: 'standard' | 'scrollable' | 'fullWidth';
- /**
- * If `true`, the scrollbar is visible. It can be useful when displaying
- * a long vertical list of tabs.
- * @default false
- */
- visibleScrollbar?: boolean;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & TabsOwnProps;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material/src/Accordion/Accordion.d.ts b/packages/mui-material/src/Accordion/Accordion.d.ts
index 7d443c40476f5b..ca9becea5b1f40 100644
--- a/packages/mui-material/src/Accordion/Accordion.d.ts
+++ b/packages/mui-material/src/Accordion/Accordion.d.ts
@@ -8,7 +8,7 @@ import { ExtendPaperTypeMap } from '../Paper/Paper';
export type AccordionTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> = ExtendPaperTypeMap<
{
props: AdditionalProps & {
@@ -65,7 +65,7 @@ export type AccordionTypeMap<
*/
TransitionProps?: TransitionProps;
};
- defaultComponent: DefaultComponent;
+ defaultComponent: RootComponent;
},
'onChange' | 'classes'
>;
diff --git a/packages/mui-material/src/AccordionSummary/AccordionSummary.d.ts b/packages/mui-material/src/AccordionSummary/AccordionSummary.d.ts
index c015565cb62e84..daeca9e2d9b184 100644
--- a/packages/mui-material/src/AccordionSummary/AccordionSummary.d.ts
+++ b/packages/mui-material/src/AccordionSummary/AccordionSummary.d.ts
@@ -5,29 +5,31 @@ import { OverrideProps } from '../OverridableComponent';
import { Theme } from '..';
import { AccordionSummaryClasses } from './accordionSummaryClasses';
+export interface AccordionSummaryOwnProps {
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The icon to display as the expand indicator.
+ */
+ expandIcon?: React.ReactNode;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export type AccordionSummaryTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> = ExtendButtonBaseTypeMap<{
- props: AdditionalProps & {
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The icon to display as the expand indicator.
- */
- expandIcon?: React.ReactNode;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & AccordionSummaryOwnProps;
+ defaultComponent: RootComponent;
}>;
/**
diff --git a/packages/mui-material/src/AppBar/AppBar.d.ts b/packages/mui-material/src/AppBar/AppBar.d.ts
index c6bc0104e0ced0..bd4c841ee99ec7 100644
--- a/packages/mui-material/src/AppBar/AppBar.d.ts
+++ b/packages/mui-material/src/AppBar/AppBar.d.ts
@@ -8,41 +8,43 @@ import { ExtendPaperTypeMap } from '../Paper/Paper';
export interface AppBarPropsColorOverrides {}
+export interface AppBarOwnProps {
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The color of the component.
+ * It supports both default and custom theme colors, which can be added as shown in the
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
+ * @default 'primary'
+ */
+ color?: OverridableStringUnion;
+ /**
+ * If true, the `color` prop is applied in dark mode.
+ * @default false
+ */
+ enableColorOnDark?: boolean;
+ /**
+ * The positioning type. The behavior of the different options is described
+ * [in the MDN web docs](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning).
+ * Note: `sticky` is not universally supported and will fall back to `static` when unavailable.
+ * @default 'fixed'
+ */
+ position?: 'fixed' | 'absolute' | 'sticky' | 'static' | 'relative';
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export type AppBarTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'header',
+ RootComponent extends React.ElementType = 'header',
> = ExtendPaperTypeMap<
{
- props: AdditionalProps & {
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The color of the component.
- * It supports both default and custom theme colors, which can be added as shown in the
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
- * @default 'primary'
- */
- color?: OverridableStringUnion;
- /**
- * If true, the `color` prop is applied in dark mode.
- * @default false
- */
- enableColorOnDark?: boolean;
- /**
- * The positioning type. The behavior of the different options is described
- * [in the MDN web docs](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning).
- * Note: `sticky` is not universally supported and will fall back to `static` when unavailable.
- * @default 'fixed'
- */
- position?: 'fixed' | 'absolute' | 'sticky' | 'static' | 'relative';
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & AppBarOwnProps;
+ defaultComponent: RootComponent;
},
'position' | 'color' | 'classes'
>;
diff --git a/packages/mui-material/src/Avatar/Avatar.d.ts b/packages/mui-material/src/Avatar/Avatar.d.ts
index 2b19c9cb69c307..daa7d9afa74b57 100644
--- a/packages/mui-material/src/Avatar/Avatar.d.ts
+++ b/packages/mui-material/src/Avatar/Avatar.d.ts
@@ -7,59 +7,58 @@ import { AvatarClasses } from './avatarClasses';
export interface AvatarPropsVariantOverrides {}
+export interface AvatarOwnProps {
+ /**
+ * Used in combination with `src` or `srcSet` to
+ * provide an alt attribute for the rendered `img` element.
+ */
+ alt?: string;
+ /**
+ * Used to render icon or text elements inside the Avatar if `src` is not set.
+ * This can be an element, or just a string.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes) applied to the `img` element if the component is used to display an image.
+ * It can be used to listen for the loading error event.
+ */
+ imgProps?: React.ImgHTMLAttributes & {
+ sx?: SxProps;
+ };
+ /**
+ * The `sizes` attribute for the `img` element.
+ */
+ sizes?: string;
+ /**
+ * The `src` attribute for the `img` element.
+ */
+ src?: string;
+ /**
+ * The `srcSet` attribute for the `img` element.
+ * Use this attribute for responsive image display.
+ */
+ srcSet?: string;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+ /**
+ * The shape of the avatar.
+ * @default 'circular'
+ */
+ variant?: OverridableStringUnion<'circular' | 'rounded' | 'square', AvatarPropsVariantOverrides>;
+}
+
export interface AvatarTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> {
- props: AdditionalProps & {
- /**
- * Used in combination with `src` or `srcSet` to
- * provide an alt attribute for the rendered `img` element.
- */
- alt?: string;
- /**
- * Used to render icon or text elements inside the Avatar if `src` is not set.
- * This can be an element, or just a string.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes) applied to the `img` element if the component is used to display an image.
- * It can be used to listen for the loading error event.
- */
- imgProps?: React.ImgHTMLAttributes & {
- sx?: SxProps;
- };
- /**
- * The `sizes` attribute for the `img` element.
- */
- sizes?: string;
- /**
- * The `src` attribute for the `img` element.
- */
- src?: string;
- /**
- * The `srcSet` attribute for the `img` element.
- * Use this attribute for responsive image display.
- */
- srcSet?: string;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- /**
- * The shape of the avatar.
- * @default 'circular'
- */
- variant?: OverridableStringUnion<
- 'circular' | 'rounded' | 'square',
- AvatarPropsVariantOverrides
- >;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & AvatarOwnProps;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material/src/Backdrop/Backdrop.d.ts b/packages/mui-material/src/Backdrop/Backdrop.d.ts
index 2e0457336f11cb..f383995b8a2cbc 100644
--- a/packages/mui-material/src/Backdrop/Backdrop.d.ts
+++ b/packages/mui-material/src/Backdrop/Backdrop.d.ts
@@ -8,94 +8,96 @@ import { OverridableComponent, OverrideProps } from '../OverridableComponent';
export interface BackdropComponentsPropsOverrides {}
+export interface BackdropOwnProps extends Partial> {
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * The components used for each slot inside.
+ *
+ * This prop is an alias for the `slots` prop.
+ * It's recommended to use the `slots` prop instead.
+ *
+ * @default {}
+ */
+ components?: {
+ Root?: React.ElementType;
+ };
+ /**
+ * The extra props for the slot components.
+ * You can override the existing props or add new ones.
+ *
+ * This prop is an alias for the `slotProps` prop.
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
+ *
+ * @default {}
+ */
+ componentsProps?: {
+ root?: React.HTMLAttributes & BackdropComponentsPropsOverrides;
+ };
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * If `true`, the backdrop is invisible.
+ * It can be used when rendering a popover or a custom select component.
+ * @default false
+ */
+ invisible?: boolean;
+ /**
+ * If `true`, the component is shown.
+ */
+ open: boolean;
+ /**
+ * The extra props for the slot components.
+ * You can override the existing props or add new ones.
+ *
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
+ *
+ * @default {}
+ */
+ slotProps?: {
+ root?: React.HTMLAttributes & BackdropComponentsPropsOverrides;
+ };
+ /**
+ * The components used for each slot inside.
+ *
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
+ *
+ * @default {}
+ */
+ slots?: {
+ root?: React.ElementType;
+ };
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+ /**
+ * The duration for the transition, in milliseconds.
+ * You may specify a single timeout for all transitions, or individually with an object.
+ */
+ transitionDuration?: TransitionProps['timeout'];
+ /**
+ * The component used for the transition.
+ * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
+ * @default Fade
+ */
+ TransitionComponent?: React.JSXElementConstructor<
+ TransitionProps & {
+ children: React.ReactElement;
+ }
+ >;
+}
+
export interface BackdropTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> {
- props: AdditionalProps &
- Partial> & {
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * The components used for each slot inside.
- *
- * This prop is an alias for the `slots` prop.
- * It's recommended to use the `slots` prop instead.
- *
- * @default {}
- */
- components?: {
- Root?: React.ElementType;
- };
- /**
- * The extra props for the slot components.
- * You can override the existing props or add new ones.
- *
- * This prop is an alias for the `slotProps` prop.
- * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
- *
- * @default {}
- */
- componentsProps?: {
- root?: React.HTMLAttributes & BackdropComponentsPropsOverrides;
- };
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * If `true`, the backdrop is invisible.
- * It can be used when rendering a popover or a custom select component.
- * @default false
- */
- invisible?: boolean;
- /**
- * If `true`, the component is shown.
- */
- open: boolean;
- /**
- * The extra props for the slot components.
- * You can override the existing props or add new ones.
- *
- * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
- *
- * @default {}
- */
- slotProps?: {
- root?: React.HTMLAttributes & BackdropComponentsPropsOverrides;
- };
- /**
- * The components used for each slot inside.
- *
- * This prop is an alias for the `components` prop, which will be deprecated in the future.
- *
- * @default {}
- */
- slots?: {
- root?: React.ElementType;
- };
-
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- /**
- * The duration for the transition, in milliseconds.
- * You may specify a single timeout for all transitions, or individually with an object.
- */
- transitionDuration?: TransitionProps['timeout'];
- /**
- * The component used for the transition.
- * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
- * @default Fade
- */
- TransitionComponent?: React.JSXElementConstructor<
- TransitionProps & { children: React.ReactElement }
- >;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & BackdropOwnProps;
+ defaultComponent: RootComponent;
}
type BackdropRootProps = NonNullable['root'];
diff --git a/packages/mui-material/src/Badge/Badge.d.ts b/packages/mui-material/src/Badge/Badge.d.ts
index 459a138d0ee768..7bd1094e6c8b05 100644
--- a/packages/mui-material/src/Badge/Badge.d.ts
+++ b/packages/mui-material/src/Badge/Badge.d.ts
@@ -147,11 +147,11 @@ export interface BadgeOwnProps {
}
export interface BadgeTypeMap<
- DefaultComponent extends React.ElementType = 'span',
+ RootComponent extends React.ElementType = 'span',
AdditionalProps = {},
> {
props: AdditionalProps & BadgeOwnProps;
- defaultComponent: DefaultComponent;
+ defaultComponent: RootComponent;
}
type BadgeRootProps = NonNullable['root'];
diff --git a/packages/mui-material/src/BottomNavigation/BottomNavigation.d.ts b/packages/mui-material/src/BottomNavigation/BottomNavigation.d.ts
index 3cbec3f280a31b..b335e6e536f47e 100644
--- a/packages/mui-material/src/BottomNavigation/BottomNavigation.d.ts
+++ b/packages/mui-material/src/BottomNavigation/BottomNavigation.d.ts
@@ -4,42 +4,44 @@ import { Theme } from '..';
import { OverridableComponent, OverrideProps } from '../OverridableComponent';
import { BottomNavigationClasses } from './bottomNavigationClasses';
+export interface BottomNavigationOwnProps {
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * Callback fired when the value changes.
+ *
+ * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
+ * @param {any} value We default to the index of the child.
+ */
+ onChange?: (event: React.SyntheticEvent, value: any) => void;
+ /**
+ * If `true`, all `BottomNavigationAction`s will show their labels.
+ * By default, only the selected `BottomNavigationAction` will show its label.
+ * @default false
+ */
+ showLabels?: boolean;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+ /**
+ * The value of the currently selected `BottomNavigationAction`.
+ */
+ value?: any;
+}
+
export interface BottomNavigationTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> {
- props: AdditionalProps & {
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * Callback fired when the value changes.
- *
- * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.
- * @param {any} value We default to the index of the child.
- */
- onChange?: (event: React.SyntheticEvent, value: any) => void;
- /**
- * If `true`, all `BottomNavigationAction`s will show their labels.
- * By default, only the selected `BottomNavigationAction` will show its label.
- * @default false
- */
- showLabels?: boolean;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- /**
- * The value of the currently selected `BottomNavigationAction`.
- */
- value?: any;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & BottomNavigationOwnProps;
+ defaultComponent: RootComponent;
}
/**
*
diff --git a/packages/mui-material/src/BottomNavigationAction/BottomNavigationAction.d.ts b/packages/mui-material/src/BottomNavigationAction/BottomNavigationAction.d.ts
index 08d850dddbece3..7b32550d882e61 100644
--- a/packages/mui-material/src/BottomNavigationAction/BottomNavigationAction.d.ts
+++ b/packages/mui-material/src/BottomNavigationAction/BottomNavigationAction.d.ts
@@ -5,46 +5,48 @@ import { ButtonBaseTypeMap, ExtendButtonBase, ExtendButtonBaseTypeMap } from '..
import { OverrideProps } from '../OverridableComponent';
import { BottomNavigationActionClasses } from './bottomNavigationActionClasses';
+export interface BottomNavigationActionOwnProps {
+ /**
+ * This prop isn't supported.
+ * Use the `component` prop if you need to change the children structure.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The icon to display.
+ */
+ icon?: React.ReactNode;
+ /**
+ * The label element.
+ */
+ label?: React.ReactNode;
+ /**
+ * If `true`, the `BottomNavigationAction` will show its label.
+ * By default, only the selected `BottomNavigationAction`
+ * inside `BottomNavigation` will show its label.
+ *
+ * The prop defaults to the value (`false`) inherited from the parent BottomNavigation component.
+ */
+ showLabel?: boolean;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+ /**
+ * You can provide your own value. Otherwise, we fallback to the child position index.
+ */
+ value?: any;
+}
+
export type BottomNavigationActionTypeMap<
AdditionalProps,
- DefaultComponent extends React.ElementType,
+ RootComponent extends React.ElementType,
> = ExtendButtonBaseTypeMap<{
- props: AdditionalProps & {
- /**
- * This prop isn't supported.
- * Use the `component` prop if you need to change the children structure.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The icon to display.
- */
- icon?: React.ReactNode;
- /**
- * The label element.
- */
- label?: React.ReactNode;
- /**
- * If `true`, the `BottomNavigationAction` will show its label.
- * By default, only the selected `BottomNavigationAction`
- * inside `BottomNavigation` will show its label.
- *
- * The prop defaults to the value (`false`) inherited from the parent BottomNavigation component.
- */
- showLabel?: boolean;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- /**
- * You can provide your own value. Otherwise, we fallback to the child position index.
- */
- value?: any;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & BottomNavigationActionOwnProps;
+ defaultComponent: RootComponent;
}>;
/**
diff --git a/packages/mui-material/src/Breadcrumbs/Breadcrumbs.d.ts b/packages/mui-material/src/Breadcrumbs/Breadcrumbs.d.ts
index 9ce23f7a8c06a2..123891f11e4fde 100644
--- a/packages/mui-material/src/Breadcrumbs/Breadcrumbs.d.ts
+++ b/packages/mui-material/src/Breadcrumbs/Breadcrumbs.d.ts
@@ -12,77 +12,79 @@ export interface BreadcrumbsOwnerState extends BreadcrumbsProps {
expanded: boolean;
}
-export interface BreadcrumbsTypeMap<
- AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'nav',
-> {
- props: AdditionalProps & {
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The components used for each slot inside the Breadcumb.
- * Either a string to use a HTML element or a component.
- * @default {}
- */
- slots?: {
- CollapsedIcon?: React.ElementType;
- };
+export interface BreadcrumbsOwnProps {
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The components used for each slot inside the Breadcumb.
+ * Either a string to use a HTML element or a component.
+ * @default {}
+ */
+ slots?: {
+ CollapsedIcon?: React.ElementType;
+ };
+ /**
+ * The props used for each slot inside the Breadcumb.
+ * @default {}
+ */
+ slotProps?: {
/**
- * The props used for each slot inside the Breadcumb.
+ * Props applied to the CollapsedIcon slot.
* @default {}
*/
- slotProps?: {
- /**
- * Props applied to the CollapsedIcon slot.
- * @default {}
- */
- collapsedIcon?: SlotComponentProps<
- typeof SvgIcon,
- BreadcrumbsCollapsedIconSlotPropsOverrides,
- BreadcrumbsOwnerState
- >;
- };
- /**
- * Override the default label for the expand button.
- *
- * For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
- * @default 'Show path'
- */
- expandText?: string;
- /**
- * If max items is exceeded, the number of items to show after the ellipsis.
- * @default 1
- */
- itemsAfterCollapse?: number;
- /**
- * If max items is exceeded, the number of items to show before the ellipsis.
- * @default 1
- */
- itemsBeforeCollapse?: number;
- /**
- * Specifies the maximum number of breadcrumbs to display. When there are more
- * than the maximum number, only the first `itemsBeforeCollapse` and last `itemsAfterCollapse`
- * will be shown, with an ellipsis in between.
- * @default 8
- */
- maxItems?: number;
- /**
- * Custom separator node.
- * @default '/'
- */
- separator?: React.ReactNode;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
+ collapsedIcon?: SlotComponentProps<
+ typeof SvgIcon,
+ BreadcrumbsCollapsedIconSlotPropsOverrides,
+ BreadcrumbsOwnerState
+ >;
};
- defaultComponent: DefaultComponent;
+ /**
+ * Override the default label for the expand button.
+ *
+ * For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
+ * @default 'Show path'
+ */
+ expandText?: string;
+ /**
+ * If max items is exceeded, the number of items to show after the ellipsis.
+ * @default 1
+ */
+ itemsAfterCollapse?: number;
+ /**
+ * If max items is exceeded, the number of items to show before the ellipsis.
+ * @default 1
+ */
+ itemsBeforeCollapse?: number;
+ /**
+ * Specifies the maximum number of breadcrumbs to display. When there are more
+ * than the maximum number, only the first `itemsBeforeCollapse` and last `itemsAfterCollapse`
+ * will be shown, with an ellipsis in between.
+ * @default 8
+ */
+ maxItems?: number;
+ /**
+ * Custom separator node.
+ * @default '/'
+ */
+ separator?: React.ReactNode;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
+export interface BreadcrumbsTypeMap<
+ AdditionalProps = {},
+ RootComponent extends React.ElementType = 'nav',
+> {
+ props: AdditionalProps & BreadcrumbsOwnProps;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material/src/Button/Button.d.ts b/packages/mui-material/src/Button/Button.d.ts
index 1bd7dd18ece3d6..a3a758f65be1dd 100644
--- a/packages/mui-material/src/Button/Button.d.ts
+++ b/packages/mui-material/src/Button/Button.d.ts
@@ -12,82 +12,81 @@ export interface ButtonPropsColorOverrides {}
export interface ButtonPropsSizeOverrides {}
+export interface ButtonOwnProps {
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The color of the component.
+ * It supports both default and custom theme colors, which can be added as shown in the
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
+ * @default 'primary'
+ */
+ color?: OverridableStringUnion<
+ 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning',
+ ButtonPropsColorOverrides
+ >;
+ /**
+ * If `true`, the component is disabled.
+ * @default false
+ */
+ disabled?: boolean;
+ /**
+ * If `true`, no elevation is used.
+ * @default false
+ */
+ disableElevation?: boolean;
+ /**
+ * If `true`, the keyboard focus ripple is disabled.
+ * @default false
+ */
+ disableFocusRipple?: boolean;
+ /**
+ * Element placed after the children.
+ */
+ endIcon?: React.ReactNode;
+ /**
+ * If `true`, the button will take up the full width of its container.
+ * @default false
+ */
+ fullWidth?: boolean;
+ /**
+ * The URL to link to when the button is clicked.
+ * If defined, an `a` element will be used as the root node.
+ */
+ href?: string;
+ /**
+ * The size of the component.
+ * `small` is equivalent to the dense button styling.
+ * @default 'medium'
+ */
+ size?: OverridableStringUnion<'small' | 'medium' | 'large', ButtonPropsSizeOverrides>;
+ /**
+ * Element placed before the children.
+ */
+ startIcon?: React.ReactNode;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+ /**
+ * The variant to use.
+ * @default 'text'
+ */
+ variant?: OverridableStringUnion<'text' | 'outlined' | 'contained', ButtonPropsVariantOverrides>;
+}
+
export type ButtonTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'button',
+ RootComponent extends React.ElementType = 'button',
> = ExtendButtonBaseTypeMap<{
- props: AdditionalProps & {
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The color of the component.
- * It supports both default and custom theme colors, which can be added as shown in the
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
- * @default 'primary'
- */
- color?: OverridableStringUnion<
- 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning',
- ButtonPropsColorOverrides
- >;
- /**
- * If `true`, the component is disabled.
- * @default false
- */
- disabled?: boolean;
- /**
- * If `true`, no elevation is used.
- * @default false
- */
- disableElevation?: boolean;
- /**
- * If `true`, the keyboard focus ripple is disabled.
- * @default false
- */
- disableFocusRipple?: boolean;
- /**
- * Element placed after the children.
- */
- endIcon?: React.ReactNode;
- /**
- * If `true`, the button will take up the full width of its container.
- * @default false
- */
- fullWidth?: boolean;
- /**
- * The URL to link to when the button is clicked.
- * If defined, an `a` element will be used as the root node.
- */
- href?: string;
- /**
- * The size of the component.
- * `small` is equivalent to the dense button styling.
- * @default 'medium'
- */
- size?: OverridableStringUnion<'small' | 'medium' | 'large', ButtonPropsSizeOverrides>;
- /**
- * Element placed before the children.
- */
- startIcon?: React.ReactNode;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- /**
- * The variant to use.
- * @default 'text'
- */
- variant?: OverridableStringUnion<
- 'text' | 'outlined' | 'contained',
- ButtonPropsVariantOverrides
- >;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & ButtonOwnProps;
+ defaultComponent: RootComponent;
}>;
/**
diff --git a/packages/mui-material/src/ButtonBase/ButtonBase.d.ts b/packages/mui-material/src/ButtonBase/ButtonBase.d.ts
index 6a6c256d87a48d..af1edc9aa88849 100644
--- a/packages/mui-material/src/ButtonBase/ButtonBase.d.ts
+++ b/packages/mui-material/src/ButtonBase/ButtonBase.d.ts
@@ -5,90 +5,92 @@ import { TouchRippleActions, TouchRippleProps } from './TouchRipple';
import { OverrideProps, OverridableComponent, OverridableTypeMap } from '../OverridableComponent';
import { ButtonBaseClasses } from './buttonBaseClasses';
+export interface ButtonBaseOwnProps {
+ /**
+ * A ref for imperative actions.
+ * It currently only supports `focusVisible()` action.
+ */
+ action?: React.Ref;
+ /**
+ * If `true`, the ripples are centered.
+ * They won't start at the cursor interaction position.
+ * @default false
+ */
+ centerRipple?: boolean;
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * If `true`, the component is disabled.
+ * @default false
+ */
+ disabled?: boolean;
+ /**
+ * If `true`, the ripple effect is disabled.
+ *
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
+ * @default false
+ */
+ disableRipple?: boolean;
+ /**
+ * If `true`, the touch ripple effect is disabled.
+ * @default false
+ */
+ disableTouchRipple?: boolean;
+ /**
+ * If `true`, the base button will have a keyboard focus ripple.
+ * @default false
+ */
+ focusRipple?: boolean;
+ /**
+ * This prop can help identify which element has keyboard focus.
+ * The class name will be applied when the element gains the focus through keyboard interaction.
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
+ * if needed.
+ */
+ focusVisibleClassName?: string;
+ /**
+ * The component used to render a link when the `href` prop is provided.
+ * @default 'a'
+ */
+ LinkComponent?: React.ElementType;
+ /**
+ * Callback fired when the component is focused with a keyboard.
+ * We trigger a `onFocus` callback too.
+ */
+ onFocusVisible?: React.FocusEventHandler;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+ /**
+ * @default 0
+ */
+ tabIndex?: NonNullable['tabIndex']>;
+ /**
+ * Props applied to the `TouchRipple` element.
+ */
+ TouchRippleProps?: Partial;
+ /**
+ * A ref that points to the `TouchRipple` element.
+ */
+ touchRippleRef?: React.Ref;
+}
+
export interface ButtonBaseTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'button',
+ RootComponent extends React.ElementType = 'button',
> {
- props: AdditionalProps & {
- /**
- * A ref for imperative actions.
- * It currently only supports `focusVisible()` action.
- */
- action?: React.Ref;
- /**
- * If `true`, the ripples are centered.
- * They won't start at the cursor interaction position.
- * @default false
- */
- centerRipple?: boolean;
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * If `true`, the component is disabled.
- * @default false
- */
- disabled?: boolean;
- /**
- * If `true`, the ripple effect is disabled.
- *
- * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
- * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
- * @default false
- */
- disableRipple?: boolean;
- /**
- * If `true`, the touch ripple effect is disabled.
- * @default false
- */
- disableTouchRipple?: boolean;
- /**
- * If `true`, the base button will have a keyboard focus ripple.
- * @default false
- */
- focusRipple?: boolean;
- /**
- * This prop can help identify which element has keyboard focus.
- * The class name will be applied when the element gains the focus through keyboard interaction.
- * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
- * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
- * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
- * if needed.
- */
- focusVisibleClassName?: string;
- /**
- * The component used to render a link when the `href` prop is provided.
- * @default 'a'
- */
- LinkComponent?: React.ElementType;
- /**
- * Callback fired when the component is focused with a keyboard.
- * We trigger a `onFocus` callback too.
- */
- onFocusVisible?: React.FocusEventHandler;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- /**
- * @default 0
- */
- tabIndex?: NonNullable['tabIndex']>;
- /**
- * Props applied to the `TouchRipple` element.
- */
- TouchRippleProps?: Partial;
- /**
- * A ref that points to the `TouchRipple` element.
- */
- touchRippleRef?: React.Ref;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & ButtonBaseOwnProps;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material/src/ButtonGroup/ButtonGroup.d.ts b/packages/mui-material/src/ButtonGroup/ButtonGroup.d.ts
index 458e7da7204f0b..9cbb6b1b51d3c9 100644
--- a/packages/mui-material/src/ButtonGroup/ButtonGroup.d.ts
+++ b/packages/mui-material/src/ButtonGroup/ButtonGroup.d.ts
@@ -9,79 +9,81 @@ export interface ButtonGroupPropsColorOverrides {}
export interface ButtonGroupPropsVariantOverrides {}
export interface ButtonGroupPropsSizeOverrides {}
+export interface ButtonGroupOwnProps {
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The color of the component.
+ * It supports both default and custom theme colors, which can be added as shown in the
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
+ * @default 'primary'
+ */
+ color?: OverridableStringUnion<
+ 'inherit' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
+ ButtonGroupPropsColorOverrides
+ >;
+ /**
+ * If `true`, the component is disabled.
+ * @default false
+ */
+ disabled?: boolean;
+ /**
+ * If `true`, no elevation is used.
+ * @default false
+ */
+ disableElevation?: boolean;
+ /**
+ * If `true`, the button keyboard focus ripple is disabled.
+ * @default false
+ */
+ disableFocusRipple?: boolean;
+ /**
+ * If `true`, the button ripple effect is disabled.
+ * @default false
+ */
+ disableRipple?: boolean;
+ /**
+ * If `true`, the buttons will take up the full width of its container.
+ * @default false
+ */
+ fullWidth?: boolean;
+ /**
+ * The component orientation (layout flow direction).
+ * @default 'horizontal'
+ */
+ orientation?: 'vertical' | 'horizontal';
+ /**
+ * The size of the component.
+ * `small` is equivalent to the dense button styling.
+ * @default 'medium'
+ */
+ size?: OverridableStringUnion<'small' | 'medium' | 'large', ButtonGroupPropsSizeOverrides>;
+ /**
+ * The variant to use.
+ * @default 'outlined'
+ */
+ variant?: OverridableStringUnion<
+ 'text' | 'outlined' | 'contained',
+ ButtonGroupPropsVariantOverrides
+ >;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export interface ButtonGroupTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> {
- props: AdditionalProps & {
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The color of the component.
- * It supports both default and custom theme colors, which can be added as shown in the
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
- * @default 'primary'
- */
- color?: OverridableStringUnion<
- 'inherit' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
- ButtonGroupPropsColorOverrides
- >;
- /**
- * If `true`, the component is disabled.
- * @default false
- */
- disabled?: boolean;
- /**
- * If `true`, no elevation is used.
- * @default false
- */
- disableElevation?: boolean;
- /**
- * If `true`, the button keyboard focus ripple is disabled.
- * @default false
- */
- disableFocusRipple?: boolean;
- /**
- * If `true`, the button ripple effect is disabled.
- * @default false
- */
- disableRipple?: boolean;
- /**
- * If `true`, the buttons will take up the full width of its container.
- * @default false
- */
- fullWidth?: boolean;
- /**
- * The component orientation (layout flow direction).
- * @default 'horizontal'
- */
- orientation?: 'vertical' | 'horizontal';
- /**
- * The size of the component.
- * `small` is equivalent to the dense button styling.
- * @default 'medium'
- */
- size?: OverridableStringUnion<'small' | 'medium' | 'large', ButtonGroupPropsSizeOverrides>;
- /**
- * The variant to use.
- * @default 'outlined'
- */
- variant?: OverridableStringUnion<
- 'text' | 'outlined' | 'contained',
- ButtonGroupPropsVariantOverrides
- >;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & ButtonGroupOwnProps;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material/src/Card/Card.d.ts b/packages/mui-material/src/Card/Card.d.ts
index a061e30d33494b..41d2f725d61c18 100644
--- a/packages/mui-material/src/Card/Card.d.ts
+++ b/packages/mui-material/src/Card/Card.d.ts
@@ -9,27 +9,28 @@ import { CardClasses } from './cardClasses';
// TODO: v6 remove this interface, it is not used
export interface CardPropsColorOverrides {}
+export interface CardOwnProps extends DistributiveOmit {
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * If `true`, the card will use raised styling.
+ * @default false
+ */
+ raised?: boolean;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export interface CardTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> {
- props: AdditionalProps &
- DistributiveOmit & {
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * If `true`, the card will use raised styling.
- * @default false
- */
- raised?: boolean;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & CardOwnProps;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material/src/CardActionArea/CardActionArea.d.ts b/packages/mui-material/src/CardActionArea/CardActionArea.d.ts
index 3f0cbbb26215ff..40a01c09c76910 100644
--- a/packages/mui-material/src/CardActionArea/CardActionArea.d.ts
+++ b/packages/mui-material/src/CardActionArea/CardActionArea.d.ts
@@ -5,22 +5,24 @@ import { ButtonBaseTypeMap, ExtendButtonBase, ExtendButtonBaseTypeMap } from '..
import { OverrideProps } from '../OverridableComponent';
import { CardActionAreaClasses } from './cardActionAreaClasses';
+export interface CardActionAreaOwnProps {
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ focusVisibleClassName?: string;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export type CardActionAreaTypeMap<
AdditionalProps,
- DefaultComponent extends React.ElementType,
+ RootComponent extends React.ElementType,
> = ExtendButtonBaseTypeMap<{
- props: AdditionalProps & {
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- focusVisibleClassName?: string;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & CardActionAreaOwnProps;
+ defaultComponent: RootComponent;
}>;
/**
diff --git a/packages/mui-material/src/CardContent/CardContent.d.ts b/packages/mui-material/src/CardContent/CardContent.d.ts
index e18c8a5333e731..3792c10c2d0ac5 100644
--- a/packages/mui-material/src/CardContent/CardContent.d.ts
+++ b/packages/mui-material/src/CardContent/CardContent.d.ts
@@ -4,25 +4,27 @@ import { OverridableComponent, OverrideProps } from '../OverridableComponent';
import { Theme } from '..';
import { CardContentClasses } from './cardContentClasses';
+export interface CardContentOwnProps {
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export interface CardContentTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> {
- props: AdditionalProps & {
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & CardContentOwnProps;
+ defaultComponent: RootComponent;
}
/**
*
diff --git a/packages/mui-material/src/CardHeader/CardHeader.d.ts b/packages/mui-material/src/CardHeader/CardHeader.d.ts
index ab924b7682f27d..cfa1cfd5942f4a 100644
--- a/packages/mui-material/src/CardHeader/CardHeader.d.ts
+++ b/packages/mui-material/src/CardHeader/CardHeader.d.ts
@@ -5,63 +5,73 @@ import { OverridableComponent, OverrideProps } from '../OverridableComponent';
import { Theme } from '..';
import { CardHeaderClasses } from './cardHeaderClasses';
+export interface CardHeaderOwnProps<
+ TitleTypographyComponent extends React.ElementType = 'span',
+ SubheaderTypographyComponent extends React.ElementType = 'span',
+> {
+ /**
+ * The action to display in the card header.
+ */
+ action?: React.ReactNode;
+ /**
+ * The Avatar element to display.
+ */
+ avatar?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * If `true`, `subheader` and `title` won't be wrapped by a Typography component.
+ * This can be useful to render an alternative Typography variant by wrapping
+ * the `title` text, and optional `subheader` text
+ * with the Typography component.
+ * @default false
+ */
+ disableTypography?: boolean;
+ /**
+ * The content of the component.
+ */
+ subheader?: React.ReactNode;
+ /**
+ * These props will be forwarded to the subheader
+ * (as long as disableTypography is not `true`).
+ */
+ subheaderTypographyProps?: TypographyProps<
+ SubheaderTypographyComponent,
+ {
+ component?: SubheaderTypographyComponent;
+ }
+ >;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+ /**
+ * The content of the component.
+ */
+ title?: React.ReactNode;
+ /**
+ * These props will be forwarded to the title
+ * (as long as disableTypography is not `true`).
+ */
+ titleTypographyProps?: TypographyProps<
+ TitleTypographyComponent,
+ {
+ component?: TitleTypographyComponent;
+ }
+ >;
+}
+
export interface CardHeaderTypeMap<
- Props = {},
- DefaultComponent extends React.ElementType = 'div',
+ AdditionalProps = {},
+ RootComponent extends React.ElementType = 'div',
TitleTypographyComponent extends React.ElementType = 'span',
SubheaderTypographyComponent extends React.ElementType = 'span',
> {
- props: Props & {
- /**
- * The action to display in the card header.
- */
- action?: React.ReactNode;
- /**
- * The Avatar element to display.
- */
- avatar?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * If `true`, `subheader` and `title` won't be wrapped by a Typography component.
- * This can be useful to render an alternative Typography variant by wrapping
- * the `title` text, and optional `subheader` text
- * with the Typography component.
- * @default false
- */
- disableTypography?: boolean;
- /**
- * The content of the component.
- */
- subheader?: React.ReactNode;
- /**
- * These props will be forwarded to the subheader
- * (as long as disableTypography is not `true`).
- */
- subheaderTypographyProps?: TypographyProps<
- SubheaderTypographyComponent,
- { component?: SubheaderTypographyComponent }
- >;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- /**
- * The content of the component.
- */
- title?: React.ReactNode;
- /**
- * These props will be forwarded to the title
- * (as long as disableTypography is not `true`).
- */
- titleTypographyProps?: TypographyProps<
- TitleTypographyComponent,
- { component?: TitleTypographyComponent }
- >;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps &
+ CardHeaderOwnProps;
+ defaultComponent: RootComponent;
}
/**
*
@@ -77,14 +87,14 @@ declare const CardHeader: OverridableCardHeader;
export interface OverridableCardHeader extends OverridableComponent {
<
- DefaultComponent extends React.ElementType = CardHeaderTypeMap['defaultComponent'],
- Props = {},
+ RootComponent extends React.ElementType = CardHeaderTypeMap['defaultComponent'],
+ AdditionalProps = {},
TitleTypographyComponent extends React.ElementType = 'span',
SubheaderTypographyComponent extends React.ElementType = 'span',
>(
props: CardHeaderPropsWithComponent<
- DefaultComponent,
- Props,
+ RootComponent,
+ AdditionalProps,
TitleTypographyComponent,
SubheaderTypographyComponent
>,
@@ -92,23 +102,23 @@ export interface OverridableCardHeader extends OverridableComponent = OverrideProps<
CardHeaderTypeMap<
- Props,
- DefaultComponent,
+ AdditionalProps,
+ RootComponent,
TitleTypographyComponent,
SubheaderTypographyComponent
>,
- DefaultComponent
+ RootComponent
>;
export type CardHeaderPropsWithComponent<
- DefaultComponent extends React.ElementType = CardHeaderTypeMap['defaultComponent'],
- Props = {},
+ RootComponent extends React.ElementType = CardHeaderTypeMap['defaultComponent'],
+ AdditionalProps = {},
TitleTypographyComponent extends React.ElementType = 'span',
SubheaderTypographyComponent extends React.ElementType = 'span',
> = {
@@ -116,10 +126,10 @@ export type CardHeaderPropsWithComponent<
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
- component?: DefaultComponent;
+ component?: RootComponent;
} & CardHeaderProps<
- DefaultComponent,
- Props,
+ RootComponent,
+ AdditionalProps,
TitleTypographyComponent,
SubheaderTypographyComponent
>;
diff --git a/packages/mui-material/src/CardMedia/CardMedia.d.ts b/packages/mui-material/src/CardMedia/CardMedia.d.ts
index f776c1bfa07aaf..59d56b2cfd5081 100644
--- a/packages/mui-material/src/CardMedia/CardMedia.d.ts
+++ b/packages/mui-material/src/CardMedia/CardMedia.d.ts
@@ -4,34 +4,36 @@ import { Theme } from '..';
import { OverridableComponent, OverrideProps } from '../OverridableComponent';
import { CardMediaClasses } from './cardMediaClasses';
-export interface CardMediaTypeMap {
- props: AdditionalProps & {
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * Image to be displayed as a background image.
- * Either `image` or `src` prop must be specified.
- * Note that caller must specify height otherwise the image will not be visible.
- */
- image?: string;
- /**
- * An alias for `image` property.
- * Available only with media components.
- * Media components: `video`, `audio`, `picture`, `iframe`, `img`.
- */
- src?: string;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: DefaultComponent;
+export interface CardMediaOwnProps {
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * Image to be displayed as a background image.
+ * Either `image` or `src` prop must be specified.
+ * Note that caller must specify height otherwise the image will not be visible.
+ */
+ image?: string;
+ /**
+ * An alias for `image` property.
+ * Available only with media components.
+ * Media components: `video`, `audio`, `picture`, `iframe`, `img`.
+ */
+ src?: string;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
+export interface CardMediaTypeMap {
+ props: AdditionalProps & CardMediaOwnProps;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material/src/Chip/Chip.d.ts b/packages/mui-material/src/Chip/Chip.d.ts
index 686b395cf3058b..ddb1241accf9e9 100644
--- a/packages/mui-material/src/Chip/Chip.d.ts
+++ b/packages/mui-material/src/Chip/Chip.d.ts
@@ -11,91 +11,93 @@ export interface ChipPropsSizeOverrides {}
export interface ChipPropsColorOverrides {}
+export interface ChipOwnProps {
+ /**
+ * The Avatar element to display.
+ */
+ avatar?: React.ReactElement;
+ /**
+ * This prop isn't supported.
+ * Use the `component` prop if you need to change the children structure.
+ */
+ children?: null;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * If `true`, the chip will appear clickable, and will raise when pressed,
+ * even if the onClick prop is not defined.
+ * If `false`, the chip will not appear clickable, even if onClick prop is defined.
+ * This can be used, for example,
+ * along with the component prop to indicate an anchor Chip is clickable.
+ * Note: this controls the UI and does not affect the onClick event.
+ */
+ clickable?: boolean;
+ /**
+ * The color of the component.
+ * It supports both default and custom theme colors, which can be added as shown in the
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
+ * @default 'default'
+ */
+ color?: OverridableStringUnion<
+ 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
+ ChipPropsColorOverrides
+ >;
+ /**
+ * Override the default delete icon element. Shown only if `onDelete` is set.
+ */
+ deleteIcon?: React.ReactElement;
+ /**
+ * If `true`, the component is disabled.
+ * @default false
+ */
+ disabled?: boolean;
+ /**
+ * Icon element.
+ */
+ icon?: React.ReactElement;
+ /**
+ * The content of the component.
+ */
+ label?: React.ReactNode;
+ /**
+ * Callback fired when the delete icon is clicked.
+ * If set, the delete icon will be shown.
+ */
+ onDelete?: React.EventHandler;
+ /**
+ * The size of the component.
+ * @default 'medium'
+ */
+ size?: OverridableStringUnion<'small' | 'medium', ChipPropsSizeOverrides>;
+ /**
+ * If `true`, allows the disabled chip to escape focus.
+ * If `false`, allows the disabled chip to receive focus.
+ * @default false
+ */
+ skipFocusWhenDisabled?: boolean;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+ /**
+ * @ignore
+ */
+ tabIndex?: number;
+ /**
+ * The variant to use.
+ * @default 'filled'
+ */
+ variant?: OverridableStringUnion<'filled' | 'outlined', ChipPropsVariantOverrides>;
+}
+
export interface ChipTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> {
- props: AdditionalProps & {
- /**
- * The Avatar element to display.
- */
- avatar?: React.ReactElement;
- /**
- * This prop isn't supported.
- * Use the `component` prop if you need to change the children structure.
- */
- children?: null;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * If `true`, the chip will appear clickable, and will raise when pressed,
- * even if the onClick prop is not defined.
- * If `false`, the chip will not appear clickable, even if onClick prop is defined.
- * This can be used, for example,
- * along with the component prop to indicate an anchor Chip is clickable.
- * Note: this controls the UI and does not affect the onClick event.
- */
- clickable?: boolean;
- /**
- * The color of the component.
- * It supports both default and custom theme colors, which can be added as shown in the
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
- * @default 'default'
- */
- color?: OverridableStringUnion<
- 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
- ChipPropsColorOverrides
- >;
- /**
- * Override the default delete icon element. Shown only if `onDelete` is set.
- */
- deleteIcon?: React.ReactElement;
- /**
- * If `true`, the component is disabled.
- * @default false
- */
- disabled?: boolean;
- /**
- * Icon element.
- */
- icon?: React.ReactElement;
- /**
- * The content of the component.
- */
- label?: React.ReactNode;
- /**
- * Callback fired when the delete icon is clicked.
- * If set, the delete icon will be shown.
- */
- onDelete?: React.EventHandler;
- /**
- * The size of the component.
- * @default 'medium'
- */
- size?: OverridableStringUnion<'small' | 'medium', ChipPropsSizeOverrides>;
- /**
- * If `true`, allows the disabled chip to escape focus.
- * If `false`, allows the disabled chip to receive focus.
- * @default false
- */
- skipFocusWhenDisabled?: boolean;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- /**
- * @ignore
- */
- tabIndex?: number;
- /**
- * The variant to use.
- * @default 'filled'
- */
- variant?: OverridableStringUnion<'filled' | 'outlined', ChipPropsVariantOverrides>;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & ChipOwnProps;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material/src/Container/Container.d.ts b/packages/mui-material/src/Container/Container.d.ts
index 8bd092b7d52557..9416144afe2943 100644
--- a/packages/mui-material/src/Container/Container.d.ts
+++ b/packages/mui-material/src/Container/Container.d.ts
@@ -4,42 +4,44 @@ import { Theme } from '../styles';
import { OverridableComponent, OverrideProps } from '../OverridableComponent';
import { ContainerClasses } from './containerClasses';
+export interface ContainerOwnProps {
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * If `true`, the left and right padding is removed.
+ * @default false
+ */
+ disableGutters?: boolean;
+ /**
+ * Set the max-width to match the min-width of the current breakpoint.
+ * This is useful if you'd prefer to design for a fixed set of sizes
+ * instead of trying to accommodate a fully fluid viewport.
+ * It's fluid by default.
+ * @default false
+ */
+ fixed?: boolean;
+ /**
+ * Determine the max-width of the container.
+ * The container width grows with the size of the screen.
+ * Set to `false` to disable `maxWidth`.
+ * @default 'lg'
+ */
+ maxWidth?: Breakpoint | false;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export interface ContainerTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> {
- props: AdditionalProps & {
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * If `true`, the left and right padding is removed.
- * @default false
- */
- disableGutters?: boolean;
- /**
- * Set the max-width to match the min-width of the current breakpoint.
- * This is useful if you'd prefer to design for a fixed set of sizes
- * instead of trying to accommodate a fully fluid viewport.
- * It's fluid by default.
- * @default false
- */
- fixed?: boolean;
- /**
- * Determine the max-width of the container.
- * The container width grows with the size of the screen.
- * Set to `false` to disable `maxWidth`.
- * @default 'lg'
- */
- maxWidth?: Breakpoint | false;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & ContainerOwnProps;
+ defaultComponent: RootComponent;
}
/**
*
diff --git a/packages/mui-material/src/DialogContentText/DialogContentText.d.ts b/packages/mui-material/src/DialogContentText/DialogContentText.d.ts
index fae69c4d85fa22..4241654030a832 100644
--- a/packages/mui-material/src/DialogContentText/DialogContentText.d.ts
+++ b/packages/mui-material/src/DialogContentText/DialogContentText.d.ts
@@ -5,21 +5,23 @@ import { OverrideProps, OverridableComponent } from '../OverridableComponent';
import { Theme } from '../styles';
import { DialogContentTextClasses } from './dialogContentTextClasses';
+export interface DialogContentTextOwnProps extends Omit {
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export interface DialogContentTextTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = TypographyTypeMap['defaultComponent'],
+ RootComponent extends React.ElementType = TypographyTypeMap['defaultComponent'],
> {
- props: AdditionalProps & {
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- } & Omit;
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & DialogContentTextOwnProps;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material/src/DialogTitle/DialogTitle.d.ts b/packages/mui-material/src/DialogTitle/DialogTitle.d.ts
index 5d86c4e3129c01..3bab5f2b0b185d 100644
--- a/packages/mui-material/src/DialogTitle/DialogTitle.d.ts
+++ b/packages/mui-material/src/DialogTitle/DialogTitle.d.ts
@@ -5,25 +5,27 @@ import { Theme } from '../styles';
import { TypographyTypeMap } from '../Typography';
import { DialogTitleClasses } from './dialogTitleClasses';
+export interface DialogTitleOwnProps extends Omit {
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export interface DialogTitleTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = TypographyTypeMap['defaultComponent'],
+ RootComponent extends React.ElementType = TypographyTypeMap['defaultComponent'],
> {
- props: AdditionalProps & {
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- } & Omit;
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & DialogTitleOwnProps;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material/src/Divider/Divider.d.ts b/packages/mui-material/src/Divider/Divider.d.ts
index 1b7be60ea2dcec..0c1244ba7490ca 100644
--- a/packages/mui-material/src/Divider/Divider.d.ts
+++ b/packages/mui-material/src/Divider/Divider.d.ts
@@ -7,59 +7,58 @@ import { DividerClasses } from './dividerClasses';
export interface DividerPropsVariantOverrides {}
+export interface DividerOwnProps {
+ /**
+ * Absolutely position the element.
+ * @default false
+ */
+ absolute?: boolean;
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * If `true`, a vertical divider will have the correct height when used in flex container.
+ * (By default, a vertical divider will have a calculated height of `0px` if it is the child of a flex container.)
+ * @default false
+ */
+ flexItem?: boolean;
+ /**
+ * If `true`, the divider will have a lighter color.
+ * @default false
+ */
+ light?: boolean;
+ /**
+ * The component orientation.
+ * @default 'horizontal'
+ */
+ orientation?: 'horizontal' | 'vertical';
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+ /**
+ * The text alignment.
+ * @default 'center'
+ */
+ textAlign?: 'center' | 'right' | 'left';
+ /**
+ * The variant to use.
+ * @default 'fullWidth'
+ */
+ variant?: OverridableStringUnion<'fullWidth' | 'inset' | 'middle', DividerPropsVariantOverrides>;
+}
+
export interface DividerTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'hr',
+ RootComponent extends React.ElementType = 'hr',
> {
- props: AdditionalProps & {
- /**
- * Absolutely position the element.
- * @default false
- */
- absolute?: boolean;
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * If `true`, a vertical divider will have the correct height when used in flex container.
- * (By default, a vertical divider will have a calculated height of `0px` if it is the child of a flex container.)
- * @default false
- */
- flexItem?: boolean;
- /**
- * If `true`, the divider will have a lighter color.
- * @default false
- */
- light?: boolean;
- /**
- * The component orientation.
- * @default 'horizontal'
- */
- orientation?: 'horizontal' | 'vertical';
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- /**
- * The text alignment.
- * @default 'center'
- */
- textAlign?: 'center' | 'right' | 'left';
- /**
- * The variant to use.
- * @default 'fullWidth'
- */
- variant?: OverridableStringUnion<
- 'fullWidth' | 'inset' | 'middle',
- DividerPropsVariantOverrides
- >;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & DividerOwnProps;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material/src/Fab/Fab.d.ts b/packages/mui-material/src/Fab/Fab.d.ts
index 5c272fee5541c4..8952dadb24eaba 100644
--- a/packages/mui-material/src/Fab/Fab.d.ts
+++ b/packages/mui-material/src/Fab/Fab.d.ts
@@ -1,3 +1,4 @@
+import * as React from 'react';
import { OverridableStringUnion } from '@mui/types';
import { SxProps } from '@mui/system';
import { PropTypes, Theme } from '..';
@@ -11,65 +12,67 @@ export interface FabPropsSizeOverrides {}
export interface FabPropsColorOverrides {}
+export interface FabOwnProps {
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The color of the component.
+ * It supports both default and custom theme colors, which can be added as shown in the
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
+ * @default 'default'
+ */
+ color?: OverridableStringUnion<
+ PropTypes.Color | 'success' | 'error' | 'info' | 'warning',
+ FabPropsColorOverrides
+ >;
+ /**
+ * If `true`, the component is disabled.
+ * @default false
+ */
+ disabled?: boolean;
+ /**
+ * If `true`, the keyboard focus ripple is disabled.
+ * @default false
+ */
+ disableFocusRipple?: boolean;
+ /**
+ * If `true`, the ripple effect is disabled.
+ */
+ disableRipple?: boolean;
+ /**
+ * The URL to link to when the button is clicked.
+ * If defined, an `a` element will be used as the root node.
+ */
+ href?: string;
+ /**
+ * The size of the component.
+ * `small` is equivalent to the dense button styling.
+ * @default 'large'
+ */
+ size?: OverridableStringUnion<'small' | 'medium' | 'large', FabPropsSizeOverrides>;
+ /**
+ * The variant to use.
+ * @default 'circular'
+ */
+ variant?: OverridableStringUnion<'circular' | 'extended', FabPropsVariantOverrides>;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export type FabTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'button',
+ RootComponent extends React.ElementType = 'button',
> = ExtendButtonBaseTypeMap<{
- props: AdditionalProps & {
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The color of the component.
- * It supports both default and custom theme colors, which can be added as shown in the
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
- * @default 'default'
- */
- color?: OverridableStringUnion<
- PropTypes.Color | 'success' | 'error' | 'info' | 'warning',
- FabPropsColorOverrides
- >;
- /**
- * If `true`, the component is disabled.
- * @default false
- */
- disabled?: boolean;
- /**
- * If `true`, the keyboard focus ripple is disabled.
- * @default false
- */
- disableFocusRipple?: boolean;
- /**
- * If `true`, the ripple effect is disabled.
- */
- disableRipple?: boolean;
- /**
- * The URL to link to when the button is clicked.
- * If defined, an `a` element will be used as the root node.
- */
- href?: string;
- /**
- * The size of the component.
- * `small` is equivalent to the dense button styling.
- * @default 'large'
- */
- size?: OverridableStringUnion<'small' | 'medium' | 'large', FabPropsSizeOverrides>;
- /**
- * The variant to use.
- * @default 'circular'
- */
- variant?: OverridableStringUnion<'circular' | 'extended', FabPropsVariantOverrides>;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & FabOwnProps;
+ defaultComponent: RootComponent;
}>;
/**
diff --git a/packages/mui-material/src/FormControl/FormControl.d.ts b/packages/mui-material/src/FormControl/FormControl.d.ts
index f3ff6f89bd990b..e16a6d1b2f51ff 100644
--- a/packages/mui-material/src/FormControl/FormControl.d.ts
+++ b/packages/mui-material/src/FormControl/FormControl.d.ts
@@ -8,81 +8,83 @@ import { FormControlClasses } from './formControlClasses';
export interface FormControlPropsSizeOverrides {}
export interface FormControlPropsColorOverrides {}
+export interface FormControlOwnProps {
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The color of the component.
+ * It supports both default and custom theme colors, which can be added as shown in the
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
+ * @default 'primary'
+ */
+ color?: OverridableStringUnion<
+ 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
+ FormControlPropsColorOverrides
+ >;
+ /**
+ * If `true`, the label, input and helper text should be displayed in a disabled state.
+ * @default false
+ */
+ disabled?: boolean;
+ /**
+ * If `true`, the label is displayed in an error state.
+ * @default false
+ */
+ error?: boolean;
+ /**
+ * If `true`, the component will take up the full width of its container.
+ * @default false
+ */
+ fullWidth?: boolean;
+ /**
+ * If `true`, the component is displayed in focused state.
+ */
+ focused?: boolean;
+ /**
+ * If `true`, the label is hidden.
+ * This is used to increase density for a `FilledInput`.
+ * Be sure to add `aria-label` to the `input` element.
+ * @default false
+ */
+ hiddenLabel?: boolean;
+ /**
+ * If `dense` or `normal`, will adjust vertical spacing of this and contained components.
+ * @default 'none'
+ */
+ margin?: 'dense' | 'normal' | 'none';
+ /**
+ * If `true`, the label will indicate that the `input` is required.
+ * @default false
+ */
+ required?: boolean;
+ /**
+ * The size of the component.
+ * @default 'medium'
+ */
+ size?: OverridableStringUnion<'small' | 'medium', FormControlPropsSizeOverrides>;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+ /**
+ * The variant to use.
+ * @default 'outlined'
+ */
+ variant?: 'standard' | 'outlined' | 'filled';
+}
+
export interface FormControlTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> {
- props: AdditionalProps & {
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The color of the component.
- * It supports both default and custom theme colors, which can be added as shown in the
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
- * @default 'primary'
- */
- color?: OverridableStringUnion<
- 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
- FormControlPropsColorOverrides
- >;
- /**
- * If `true`, the label, input and helper text should be displayed in a disabled state.
- * @default false
- */
- disabled?: boolean;
- /**
- * If `true`, the label is displayed in an error state.
- * @default false
- */
- error?: boolean;
- /**
- * If `true`, the component will take up the full width of its container.
- * @default false
- */
- fullWidth?: boolean;
- /**
- * If `true`, the component is displayed in focused state.
- */
- focused?: boolean;
- /**
- * If `true`, the label is hidden.
- * This is used to increase density for a `FilledInput`.
- * Be sure to add `aria-label` to the `input` element.
- * @default false
- */
- hiddenLabel?: boolean;
- /**
- * If `dense` or `normal`, will adjust vertical spacing of this and contained components.
- * @default 'none'
- */
- margin?: 'dense' | 'normal' | 'none';
- /**
- * If `true`, the label will indicate that the `input` is required.
- * @default false
- */
- required?: boolean;
- /**
- * The size of the component.
- * @default 'medium'
- */
- size?: OverridableStringUnion<'small' | 'medium', FormControlPropsSizeOverrides>;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- /**
- * The variant to use.
- * @default 'outlined'
- */
- variant?: 'standard' | 'outlined' | 'filled';
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & FormControlOwnProps;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material/src/FormHelperText/FormHelperText.d.ts b/packages/mui-material/src/FormHelperText/FormHelperText.d.ts
index 703f00bbd7b0d1..0869db3920d6b8 100644
--- a/packages/mui-material/src/FormHelperText/FormHelperText.d.ts
+++ b/packages/mui-material/src/FormHelperText/FormHelperText.d.ts
@@ -7,59 +7,61 @@ import { FormHelperTextClasses } from './formHelperTextClasses';
export interface FormHelperTextPropsVariantOverrides {}
+export interface FormHelperTextOwnProps {
+ /**
+ * The content of the component.
+ *
+ * If `' '` is provided, the component reserves one line height for displaying a future message.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * If `true`, the helper text should be displayed in a disabled state.
+ */
+ disabled?: boolean;
+ /**
+ * If `true`, helper text should be displayed in an error state.
+ */
+ error?: boolean;
+ /**
+ * If `true`, the helper text should use filled classes key.
+ */
+ filled?: boolean;
+ /**
+ * If `true`, the helper text should use focused classes key.
+ */
+ focused?: boolean;
+ /**
+ * If `dense`, will adjust vertical spacing. This is normally obtained via context from
+ * FormControl.
+ */
+ margin?: 'dense';
+ /**
+ * If `true`, the helper text should use required classes key.
+ */
+ required?: boolean;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+ /**
+ * The variant to use.
+ */
+ variant?: OverridableStringUnion<
+ 'standard' | 'outlined' | 'filled',
+ FormHelperTextPropsVariantOverrides
+ >;
+}
+
export interface FormHelperTextTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'p',
+ RootComponent extends React.ElementType = 'p',
> {
- props: AdditionalProps & {
- /**
- * The content of the component.
- *
- * If `' '` is provided, the component reserves one line height for displaying a future message.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * If `true`, the helper text should be displayed in a disabled state.
- */
- disabled?: boolean;
- /**
- * If `true`, helper text should be displayed in an error state.
- */
- error?: boolean;
- /**
- * If `true`, the helper text should use filled classes key.
- */
- filled?: boolean;
- /**
- * If `true`, the helper text should use focused classes key.
- */
- focused?: boolean;
- /**
- * If `dense`, will adjust vertical spacing. This is normally obtained via context from
- * FormControl.
- */
- margin?: 'dense';
- /**
- * If `true`, the helper text should use required classes key.
- */
- required?: boolean;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- /**
- * The variant to use.
- */
- variant?: OverridableStringUnion<
- 'standard' | 'outlined' | 'filled',
- FormHelperTextPropsVariantOverrides
- >;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & FormHelperTextOwnProps;
+ defaultComponent: RootComponent;
}
/**
*
diff --git a/packages/mui-material/src/FormLabel/FormLabel.d.ts b/packages/mui-material/src/FormLabel/FormLabel.d.ts
index f580b7fdeaf0cc..980c088469fb5d 100644
--- a/packages/mui-material/src/FormLabel/FormLabel.d.ts
+++ b/packages/mui-material/src/FormLabel/FormLabel.d.ts
@@ -7,6 +7,11 @@ import { FormLabelClasses } from './formLabelClasses';
export interface FormLabelPropsColorOverrides {}
+/**
+ * This type is kept for compatibility. Use `FormLabelOwnProps` instead.
+ */
+export type FormLabelBaseProps = React.LabelHTMLAttributes;
+
export interface FormLabelOwnProps {
/**
* The content of the component.
@@ -53,10 +58,10 @@ export interface FormLabelOwnProps {
export interface FormLabelTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'label',
+ RootComponent extends React.ElementType = 'label',
> {
props: AdditionalProps & FormLabelBaseProps & FormLabelOwnProps;
- defaultComponent: DefaultComponent;
+ defaultComponent: RootComponent;
}
/**
@@ -73,8 +78,6 @@ export interface FormLabelTypeMap<
*/
declare const FormLabel: OverridableComponent;
-export type FormLabelBaseProps = React.LabelHTMLAttributes;
-
export interface ExtendFormLabelTypeMap {
props: TypeMap['props'] & Pick;
defaultComponent: TypeMap['defaultComponent'];
diff --git a/packages/mui-material/src/Grid/Grid.d.ts b/packages/mui-material/src/Grid/Grid.d.ts
index 4639d6ce4fffe7..8df168eec79edb 100644
--- a/packages/mui-material/src/Grid/Grid.d.ts
+++ b/packages/mui-material/src/Grid/Grid.d.ts
@@ -83,77 +83,78 @@ type Breakpoints = IfEquals<
CustomBreakpoints
>;
+export interface GridOwnProps extends SystemProps, Breakpoints {
+ /**
+ * The content of the component.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The number of columns.
+ * @default 12
+ */
+ columns?: ResponsiveStyleValue;
+ /**
+ * Defines the horizontal space between the type `item` components.
+ * It overrides the value of the `spacing` prop.
+ */
+ columnSpacing?: ResponsiveStyleValue;
+ /**
+ * If `true`, the component will have the flex *container* behavior.
+ * You should be wrapping *items* with a *container*.
+ * @default false
+ */
+ container?: boolean;
+ /**
+ * Defines the `flex-direction` style property.
+ * It is applied for all screen sizes.
+ * @default 'row'
+ */
+ direction?: ResponsiveStyleValue;
+ /**
+ * If `true`, the component will have the flex *item* behavior.
+ * You should be wrapping *items* with a *container*.
+ * @default false
+ */
+ item?: boolean;
+ /**
+ * Defines the vertical space between the type `item` components.
+ * It overrides the value of the `spacing` prop.
+ */
+ rowSpacing?: ResponsiveStyleValue;
+ /**
+ * Defines the space between the type `item` components.
+ * It can only be used on a type `container` component.
+ * @default 0
+ */
+ spacing?: ResponsiveStyleValue;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+ /**
+ * Defines the `flex-wrap` style property.
+ * It's applied for all screen sizes.
+ * @default 'wrap'
+ */
+ wrap?: GridWrap;
+ /**
+ * If `true`, it sets `min-width: 0` on the item.
+ * Refer to the limitations section of the documentation to better understand the use case.
+ * @default false
+ */
+ zeroMinWidth?: boolean;
+}
+
export interface GridTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'div',
+ RootComponent extends React.ElementType = 'div',
> {
- props: AdditionalProps &
- SystemProps & {
- /**
- * The content of the component.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The number of columns.
- * @default 12
- */
- columns?: ResponsiveStyleValue;
- /**
- * Defines the horizontal space between the type `item` components.
- * It overrides the value of the `spacing` prop.
- */
- columnSpacing?: ResponsiveStyleValue;
- /**
- * If `true`, the component will have the flex *container* behavior.
- * You should be wrapping *items* with a *container*.
- * @default false
- */
- container?: boolean;
- /**
- * Defines the `flex-direction` style property.
- * It is applied for all screen sizes.
- * @default 'row'
- */
- direction?: ResponsiveStyleValue;
- /**
- * If `true`, the component will have the flex *item* behavior.
- * You should be wrapping *items* with a *container*.
- * @default false
- */
- item?: boolean;
- /**
- * Defines the vertical space between the type `item` components.
- * It overrides the value of the `spacing` prop.
- */
- rowSpacing?: ResponsiveStyleValue;
- /**
- * Defines the space between the type `item` components.
- * It can only be used on a type `container` component.
- * @default 0
- */
- spacing?: ResponsiveStyleValue;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- /**
- * Defines the `flex-wrap` style property.
- * It's applied for all screen sizes.
- * @default 'wrap'
- */
- wrap?: GridWrap;
- /**
- * If `true`, it sets `min-width: 0` on the item.
- * Refer to the limitations section of the documentation to better understand the use case.
- * @default false
- */
- zeroMinWidth?: boolean;
- } & Breakpoints;
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & GridOwnProps;
+ defaultComponent: RootComponent;
}
/**
diff --git a/packages/mui-material/src/Icon/Icon.d.ts b/packages/mui-material/src/Icon/Icon.d.ts
index d66a87825db304..e29f7a1121e673 100644
--- a/packages/mui-material/src/Icon/Icon.d.ts
+++ b/packages/mui-material/src/Icon/Icon.d.ts
@@ -9,57 +9,59 @@ export interface IconPropsSizeOverrides {}
export interface IconPropsColorOverrides {}
+export interface IconOwnProps {
+ /**
+ * The base class applied to the icon. Defaults to 'material-icons', but can be changed to any
+ * other base class that suits the icon font you're using (e.g. material-icons-rounded, fas, etc).
+ * @default 'material-icons'
+ */
+ baseClassName?: string;
+ /**
+ * The name of the icon font ligature.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The color of the component.
+ * It supports both default and custom theme colors, which can be added as shown in the
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
+ * @default 'inherit'
+ */
+ color?: OverridableStringUnion<
+ | 'inherit'
+ | 'action'
+ | 'disabled'
+ | 'primary'
+ | 'secondary'
+ | 'error'
+ | 'info'
+ | 'success'
+ | 'warning',
+ IconPropsColorOverrides
+ >;
+ /**
+ * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.
+ * @default 'medium'
+ */
+ fontSize?: OverridableStringUnion<
+ 'inherit' | 'large' | 'medium' | 'small',
+ IconPropsSizeOverrides
+ >;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export interface IconTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'span',
+ RootComponent extends React.ElementType = 'span',
> {
- props: AdditionalProps & {
- /**
- * The base class applied to the icon. Defaults to 'material-icons', but can be changed to any
- * other base class that suits the icon font you're using (e.g. material-icons-rounded, fas, etc).
- * @default 'material-icons'
- */
- baseClassName?: string;
- /**
- * The name of the icon font ligature.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The color of the component.
- * It supports both default and custom theme colors, which can be added as shown in the
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
- * @default 'inherit'
- */
- color?: OverridableStringUnion<
- | 'inherit'
- | 'action'
- | 'disabled'
- | 'primary'
- | 'secondary'
- | 'error'
- | 'info'
- | 'success'
- | 'warning',
- IconPropsColorOverrides
- >;
- /**
- * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.
- * @default 'medium'
- */
- fontSize?: OverridableStringUnion<
- 'inherit' | 'large' | 'medium' | 'small',
- IconPropsSizeOverrides
- >;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & IconOwnProps;
+ defaultComponent: RootComponent;
}
/**
*
diff --git a/packages/mui-material/src/IconButton/IconButton.d.ts b/packages/mui-material/src/IconButton/IconButton.d.ts
index a764796b81bb44..09b3c4d23c52eb 100644
--- a/packages/mui-material/src/IconButton/IconButton.d.ts
+++ b/packages/mui-material/src/IconButton/IconButton.d.ts
@@ -10,59 +10,61 @@ export interface IconButtonPropsColorOverrides {}
export interface IconButtonPropsSizeOverrides {}
+export interface IconButtonOwnProps {
+ /**
+ * The icon to display.
+ */
+ children?: React.ReactNode;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial;
+ /**
+ * The color of the component.
+ * It supports both default and custom theme colors, which can be added as shown in the
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
+ * @default 'default'
+ */
+ color?: OverridableStringUnion<
+ 'inherit' | 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
+ IconButtonPropsColorOverrides
+ >;
+ /**
+ * If `true`, the component is disabled.
+ * @default false
+ */
+ disabled?: boolean;
+ /**
+ * If `true`, the keyboard focus ripple is disabled.
+ * @default false
+ */
+ disableFocusRipple?: boolean;
+ /**
+ * If given, uses a negative margin to counteract the padding on one
+ * side (this is often helpful for aligning the left or right
+ * side of the icon with content above or below, without ruining the border
+ * size and shape).
+ * @default false
+ */
+ edge?: 'start' | 'end' | false;
+ /**
+ * The size of the component.
+ * `small` is equivalent to the dense button styling.
+ * @default 'medium'
+ */
+ size?: OverridableStringUnion<'small' | 'medium' | 'large', IconButtonPropsSizeOverrides>;
+ /**
+ * The system prop that allows defining system overrides as well as additional CSS styles.
+ */
+ sx?: SxProps;
+}
+
export type IconButtonTypeMap<
AdditionalProps = {},
- DefaultComponent extends React.ElementType = 'button',
+ RootComponent extends React.ElementType = 'button',
> = ExtendButtonBaseTypeMap<{
- props: AdditionalProps & {
- /**
- * The icon to display.
- */
- children?: React.ReactNode;
- /**
- * Override or extend the styles applied to the component.
- */
- classes?: Partial;
- /**
- * The color of the component.
- * It supports both default and custom theme colors, which can be added as shown in the
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
- * @default 'default'
- */
- color?: OverridableStringUnion<
- 'inherit' | 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning',
- IconButtonPropsColorOverrides
- >;
- /**
- * If `true`, the component is disabled.
- * @default false
- */
- disabled?: boolean;
- /**
- * If `true`, the keyboard focus ripple is disabled.
- * @default false
- */
- disableFocusRipple?: boolean;
- /**
- * If given, uses a negative margin to counteract the padding on one
- * side (this is often helpful for aligning the left or right
- * side of the icon with content above or below, without ruining the border
- * size and shape).
- * @default false
- */
- edge?: 'start' | 'end' | false;
- /**
- * The size of the component.
- * `small` is equivalent to the dense button styling.
- * @default 'medium'
- */
- size?: OverridableStringUnion<'small' | 'medium' | 'large', IconButtonPropsSizeOverrides>;
- /**
- * The system prop that allows defining system overrides as well as additional CSS styles.
- */
- sx?: SxProps;
- };
- defaultComponent: DefaultComponent;
+ props: AdditionalProps & IconButtonOwnProps;
+ defaultComponent: RootComponent;
}>;
/**
diff --git a/packages/mui-material/src/ImageList/ImageList.d.ts b/packages/mui-material/src/ImageList/ImageList.d.ts
index 86a93a2a399d8b..618e3cbc990531 100644
--- a/packages/mui-material/src/ImageList/ImageList.d.ts
+++ b/packages/mui-material/src/ImageList/ImageList.d.ts
@@ -7,48 +7,50 @@ import { ImageListClasses } from './imageListClasses';
export interface ImageListPropsVariantOverrides {}
+export interface ImageListOwnProps {
+ /**
+ * The content of the component, normally `ImageListItem`s.
+ */
+ children: NonNullable;
+ /**
+ * Override or extend the styles applied to the component.
+ */
+ classes?: Partial