Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InputLabel] Enable size prop overrides via TypeScript module augmentation #35460

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/mui-material/src/InputLabel/InputLabel.d.ts
@@ -1,10 +1,13 @@
import * as React from 'react';
import { SxProps } from '@mui/system';
import { OverridableStringUnion } from '@mui/types';
import { InternalStandardProps as StandardProps } from '..';
import { FormLabelProps } from '../FormLabel';
import { Theme } from '../styles';
import { InputLabelClasses } from './inputLabelClasses';

export interface InputLabelPropsSizeOverrides {}

export interface InputLabelProps extends StandardProps<FormLabelProps> {
/**
* The content of the component.
Expand Down Expand Up @@ -49,7 +52,7 @@ export interface InputLabelProps extends StandardProps<FormLabelProps> {
* The size of the component.
* @default 'normal'
*/
size?: 'small' | 'normal';
size?: OverridableStringUnion<'small' | 'normal', InputLabelPropsSizeOverrides>;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
Expand Down
5 changes: 4 additions & 1 deletion packages/mui-material/src/InputLabel/InputLabel.js
Expand Up @@ -210,7 +210,10 @@ InputLabel.propTypes /* remove-proptypes */ = {
* The size of the component.
* @default 'normal'
*/
size: PropTypes.oneOf(['normal', 'small']),
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
PropTypes.oneOf(['normal', 'small']),
PropTypes.string,
]),
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
Expand Down