Skip to content

Commit

Permalink
Fix slots in types and proptypes
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Oct 6, 2023
1 parent ebc3807 commit 8e764ab
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/mui-material-next/src/FilledInput/FilledInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ FilledInput.propTypes /* remove-proptypes */ = {
slots: PropTypes.shape({
input: PropTypes.elementType,
root: PropTypes.elementType,
textarea: PropTypes.elementType,
}),
/**
* Start `InputAdornment` for this component.
Expand Down
21 changes: 20 additions & 1 deletion packages/mui-material-next/src/FilledInput/FilledInput.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Theme } from '../styles/Theme.types';
import { InputBaseProps } from '../InputBase/InputBase.types';
import { FilledInputClasses } from './filledInputClasses';

export type FilledInputOwnProps = StandardProps<InputBaseProps> & {
export type FilledInputOwnProps = StandardProps<Omit<InputBaseProps, 'slots'>> & {
/**
* Override or extend the styles applied to the component.
*/
Expand All @@ -23,12 +23,31 @@ export type FilledInputOwnProps = StandardProps<InputBaseProps> & {
* If `true`, the input will not have an underline.
*/
disableUnderline?: boolean;
/**
* The components used for each slot inside the InputBase.
* Either a string to use a HTML element or a component.
* @default {}
*/
slots?: FilledInputSlots;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
};

export interface FilledInputSlots {
/**
* The component that renders the root.
* @default 'div'
*/
root?: React.ElementType;
/**
* The component that renders the input.
* @default 'input'
*/
input?: React.ElementType;
}

export interface FilledInputTypeMap<
AdditionalProps = {},
RootComponentType extends React.ElementType = 'div',
Expand Down

0 comments on commit 8e764ab

Please sign in to comment.