Skip to content

Commit

Permalink
Fix proptypes
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Oct 10, 2023
1 parent 1fe491e commit 1493a04
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 3 additions & 5 deletions packages/mui-material-next/src/FilledInput/FilledInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<FilledInputTypeMap, C>,
): JSX.Element | null;
propTypes?: any;
muiName?: string;
}

FilledInput.propTypes /* remove-proptypes */ = {
Expand All @@ -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.
*/
Expand Down Expand Up @@ -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,
/**
Expand Down Expand Up @@ -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;
10 changes: 6 additions & 4 deletions packages/mui-material-next/src/FilledInput/FilledInput.types.ts
Original file line number Diff line number Diff line change
@@ -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<Omit<InputBaseProps, 'slots'>> & {
export type FilledInputOwnProps = StandardProps<Omit<InputBaseProps, 'children' | 'slots'>> & {
/**
* Override or extend the styles applied to the component.
*/
Expand Down Expand Up @@ -58,7 +57,10 @@ export interface FilledInputTypeMap<

export type FilledInputProps<
RootComponentType extends React.ElementType = FilledInputTypeMap['defaultComponent'],
> = PolymorphicProps<FilledInputTypeMap<{}, RootComponentType>, RootComponentType>;
AdditionalProps = {},
> = OverrideProps<FilledInputTypeMap<AdditionalProps, RootComponentType>, RootComponentType> & {
inputComponent?: React.ElementType;
};

export type FilledInputOwnerState = Simplify<
FilledInputOwnProps & {
Expand Down
2 changes: 2 additions & 0 deletions packages/mui-material-next/src/InputBase/InputBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<InputBaseTypeMap, C>,
Expand Down Expand Up @@ -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,
/**
Expand Down

0 comments on commit 1493a04

Please sign in to comment.