Skip to content

Commit b2165c1

Browse files
committed
[docs] Port mui#13428 to typescript
1 parent d86a071 commit b2165c1

File tree

3 files changed

+40
-6
lines changed

3 files changed

+40
-6
lines changed

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = [
2828
name: 'The main docs bundle',
2929
webpack: false,
3030
path: main.path,
31-
limit: '184.3 KB',
31+
limit: '184.6 KB',
3232
},
3333
{
3434
name: 'The docs home page',

docs/src/pages/demos/text-fields/CustomizedInputs.tsx

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ const styles = (theme: Theme) =>
3636
borderBottomColor: purple[500],
3737
},
3838
},
39+
cssOutlinedInput: {
40+
'&$cssFocused $notchedOutline': {
41+
borderColor: purple[500],
42+
},
43+
},
44+
notchedOutline: {},
3945
bootstrapRoot: {
4046
'label + &': {
4147
marginTop: theme.spacing.unit * 3,
@@ -87,26 +93,51 @@ function CustomizedInputs(props: Props) {
8793
<div className={classes.container}>
8894
<FormControl className={classes.margin}>
8995
<InputLabel
90-
htmlFor="custom-css-input"
91-
FormLabelClasses={{
96+
htmlFor="custom-css-standard-input"
97+
classes={{
9298
root: classes.cssLabel,
9399
focused: classes.cssFocused,
94100
}}
95101
>
96102
Custom CSS
97103
</InputLabel>
98104
<Input
99-
id="custom-css-input"
105+
id="custom-css-standard-input"
100106
classes={{
101107
underline: classes.cssUnderline,
102108
}}
103109
/>
104110
</FormControl>
111+
<TextField
112+
className={classes.margin}
113+
InputLabelProps={{
114+
classes: {
115+
root: classes.cssLabel,
116+
focused: classes.cssFocused,
117+
},
118+
}}
119+
InputProps={{
120+
classes: {
121+
root: classes.cssOutlinedInput,
122+
focused: classes.cssFocused,
123+
notchedOutline: classes.notchedOutline,
124+
},
125+
}}
126+
label="Custom CSS"
127+
variant="outlined"
128+
id="custom-css-outlined-input"
129+
/>
105130
<MuiThemeProvider theme={theme}>
106131
<TextField
107132
className={classes.margin}
108133
label="MuiThemeProvider"
109-
id="mui-theme-provider-input"
134+
id="mui-theme-provider-standard-input"
135+
/>
136+
<TextField
137+
className={classes.margin}
138+
label="MuiThemeProvider"
139+
variant="outlined"
140+
id="mui-theme-provider-outlined-input"
110141
/>
111142
</MuiThemeProvider>
112143
<FormControl className={classes.margin}>

packages/material-ui/src/InputLabel/InputLabel.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ export interface InputLabelProps extends StandardProps<FormLabelProps, InputLabe
1515

1616
export type InputLabelClassKey =
1717
| 'root'
18+
| 'focused'
19+
| 'disabled'
20+
| 'error'
21+
| 'required'
1822
| 'formControl'
1923
| 'marginDense'
2024
| 'shrink'
2125
| 'animated'
22-
| 'contained'
2326
| 'filled'
2427
| 'outlined';
2528

0 commit comments

Comments
 (0)