diff --git a/packages/mui-material-next/src/FilledInput/FilledInput.tsx b/packages/mui-material-next/src/FilledInput/FilledInput.tsx index 3032be5fb9546c..8594233a9e4660 100644 --- a/packages/mui-material-next/src/FilledInput/FilledInput.tsx +++ b/packages/mui-material-next/src/FilledInput/FilledInput.tsx @@ -309,11 +309,13 @@ interface FilledInputComponent { /** * The component used for the input node. * Either a string to use a HTML element or a component. + * @default 'input' */ inputComponent?: C; } & OverrideProps, ): JSX.Element | null; propTypes?: any; + muiName?: string; } FilledInput.propTypes /* remove-proptypes */ = { @@ -331,10 +333,6 @@ FilledInput.propTypes /* remove-proptypes */ = { * If `true`, the `input` element is focused during the first mount. */ autoFocus: PropTypes.bool, - /** - * @ignore - */ - children: PropTypes.node, /** * Override or extend the styles applied to the component. */ @@ -390,6 +388,7 @@ FilledInput.propTypes /* remove-proptypes */ = { /** * The component used for the input node. * Either a string to use a HTML element or a component. + * @default 'input' */ inputComponent: PropTypes /* @typescript-to-proptypes-ignore */.elementType, /** @@ -507,7 +506,6 @@ FilledInput.propTypes /* remove-proptypes */ = { value: PropTypes.any, } as any; -// @ts-ignore - internal logic to integrate with FormControl FilledInput.muiName = 'Input'; export default FilledInput; diff --git a/packages/mui-material-next/src/FilledInput/FilledInput.types.ts b/packages/mui-material-next/src/FilledInput/FilledInput.types.ts index 81a694f2085274..f6234ddf46def8 100644 --- a/packages/mui-material-next/src/FilledInput/FilledInput.types.ts +++ b/packages/mui-material-next/src/FilledInput/FilledInput.types.ts @@ -1,13 +1,12 @@ import { SxProps } from '@mui/system'; // eslint-disable-next-line no-restricted-imports import { InternalStandardProps as StandardProps } from '@mui/material'; -import { PolymorphicProps } from '@mui/base/utils'; -import { Simplify } from '@mui/types'; +import { OverrideProps, Simplify } from '@mui/types'; import { Theme } from '../styles/Theme.types'; import { InputBaseProps } from '../InputBase/InputBase.types'; import { FilledInputClasses } from './filledInputClasses'; -export type FilledInputOwnProps = StandardProps> & { +export type FilledInputOwnProps = StandardProps> & { /** * Override or extend the styles applied to the component. */ @@ -58,7 +57,10 @@ export interface FilledInputTypeMap< export type FilledInputProps< RootComponentType extends React.ElementType = FilledInputTypeMap['defaultComponent'], -> = PolymorphicProps, RootComponentType>; + AdditionalProps = {}, +> = OverrideProps, RootComponentType> & { + inputComponent?: React.ElementType; +}; export type FilledInputOwnerState = Simplify< FilledInputOwnProps & { diff --git a/packages/mui-material-next/src/InputBase/InputBase.tsx b/packages/mui-material-next/src/InputBase/InputBase.tsx index 2446f3c197cd93..fd8f85522ca6f3 100644 --- a/packages/mui-material-next/src/InputBase/InputBase.tsx +++ b/packages/mui-material-next/src/InputBase/InputBase.tsx @@ -546,6 +546,7 @@ interface InputBaseComponent { /** * The component used for the input node. * Either a string to use a HTML element or a component. + * @default 'input' */ inputComponent?: C; } & OverrideProps, @@ -627,6 +628,7 @@ InputBase.propTypes /* remove-proptypes */ = { /** * The component used for the input node. * Either a string to use a HTML element or a component. + * @default 'input' */ inputComponent: PropTypes.elementType, /**