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

[Select][FormControl] Make outlined variant the default one #24895

Merged
merged 13 commits into from
Apr 16, 2021
26 changes: 25 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
### [Versions](https://material-ui.com/versions/)

## HEAD

### Breaking changes

- [Select] Change default variant from standard to outlined (#24895) @petyosi
Standard has been removed from the Material Design guidelines. [This codemod](https://github.com/mui-org/material-ui/tree/next/packages/material-ui-codemod#variant-prop) will automatically update your code.

```diff
-<Select value="Standard" />
-<Select value="Outlined" variant="outlined" />
+<Select value="Standard" variant="standard" />
+<Select value="Outlined" />
```

- [FormControl] Change default variant from standard to outlined (#24895) @petyosi
Standard has been removed from the Material Design guidelines. [This codemod](https://github.com/mui-org/material-ui/tree/next/packages/material-ui-codemod#variant-prop) will automatically update your code.

```diff
-<FormControl value="Standard" />
-<FormControl value="Outlined" variant="outlined" />
+<FormControl value="Standard" variant="standard" />
+<FormControl value="Outlined" />
```

## 5.0.0-alpha.30

<!-- generated comparing v5.0.0-alpha.29..next -->
Expand Down Expand Up @@ -1569,7 +1593,7 @@ Big thanks to the 34 contributors who made this release possible. Here are some
#### Breaking changes

- [TextField] Change default variant from standard to outlined (#23503) @mbrookes
Standard has been removed from the Material Design guidelines. [This codemod](https://github.com/mui-org/material-ui/tree/next/packages/material-ui-codemod#textfield-variant-prop) will automatically update your code.
Standard has been removed from the Material Design guidelines. [This codemod](https://github.com/mui-org/material-ui/tree/next/packages/material-ui-codemod#variant-prop) will automatically update your code.

```diff
-<TextField value="Standard" />
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/api-docs/form-control.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"name": "enum",
"description": "'filled'<br>&#124;&nbsp;'outlined'<br>&#124;&nbsp;'standard'"
},
"default": "'standard'"
"default": "'outlined'"
}
},
"name": "FormControl",
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/api-docs/select.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"name": "enum",
"description": "'filled'<br>&#124;&nbsp;'outlined'<br>&#124;&nbsp;'standard'"
},
"default": "'standard'"
"default": "'outlined'"
}
},
"name": "Select",
Expand All @@ -52,7 +52,7 @@
"spread": true,
"forwardsRefTo": "HTMLDivElement",
"filename": "/packages/material-ui/src/Select/Select.js",
"inheritance": { "component": "Input", "pathname": "/api/input/" },
"inheritance": { "component": "OutlinedInput", "pathname": "/api/outlined-input/" },
"demos": "<ul><li><a href=\"/components/selects/\">Selects</a></li></ul>",
"styledComponent": true,
"cssComponent": false
Expand Down
10 changes: 8 additions & 2 deletions docs/src/pages/components/checkboxes/CheckboxesGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function CheckboxesGroup() {

return (
<Box sx={{ display: 'flex' }}>
<FormControl sx={{ m: 3 }} component="fieldset">
<FormControl sx={{ m: 3 }} component="fieldset" variant="standard">
<FormLabel component="legend">Assign responsibility</FormLabel>
<FormGroup>
<FormControlLabel
Expand All @@ -50,7 +50,13 @@ export default function CheckboxesGroup() {
</FormGroup>
<FormHelperText>Be careful</FormHelperText>
</FormControl>
<FormControl required error={error} component="fieldset" sx={{ m: 3 }}>
<FormControl
required
error={error}
component="fieldset"
sx={{ m: 3 }}
variant="standard"
>
<FormLabel component="legend">Pick two</FormLabel>
<FormGroup>
<FormControlLabel
Expand Down
10 changes: 8 additions & 2 deletions docs/src/pages/components/checkboxes/CheckboxesGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function CheckboxesGroup() {

return (
<Box sx={{ display: 'flex' }}>
<FormControl sx={{ m: 3 }} component="fieldset">
<FormControl sx={{ m: 3 }} component="fieldset" variant="standard">
<FormLabel component="legend">Assign responsibility</FormLabel>
<FormGroup>
<FormControlLabel
Expand All @@ -50,7 +50,13 @@ export default function CheckboxesGroup() {
</FormGroup>
<FormHelperText>Be careful</FormHelperText>
</FormControl>
<FormControl required error={error} component="fieldset" sx={{ m: 3 }}>
<FormControl
required
error={error}
component="fieldset"
sx={{ m: 3 }}
variant="standard"
>
<FormLabel component="legend">Pick two</FormLabel>
<FormGroup>
<FormControlLabel
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/popover/AnchorPlayground.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function AnchorPlayground() {
</FormControl>
</Grid>
<Grid item xs={12} sm={6}>
<FormControl>
<FormControl variant="standard">
<InputLabel htmlFor="position-top">anchorPosition.top</InputLabel>
<Input
id="position-top"
Expand All @@ -201,7 +201,7 @@ function AnchorPlayground() {
/>
</FormControl>
&nbsp;
<FormControl>
<FormControl variant="standard">
<InputLabel htmlFor="position-left">anchorPosition.left</InputLabel>
<Input
id="position-left"
Expand Down
7 changes: 6 additions & 1 deletion docs/src/pages/components/radio-buttons/ErrorRadios.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ export default function ErrorRadios() {

return (
<form onSubmit={handleSubmit}>
<FormControl sx={{ m: 3 }} component="fieldset" error={error}>
<FormControl
sx={{ m: 3 }}
component="fieldset"
error={error}
variant="standard"
>
<FormLabel component="legend">Pop quiz: Material-UI is...</FormLabel>
<RadioGroup
aria-label="quiz"
Expand Down
7 changes: 6 additions & 1 deletion docs/src/pages/components/radio-buttons/ErrorRadios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ export default function ErrorRadios() {

return (
<form onSubmit={handleSubmit}>
<FormControl sx={{ m: 3 }} component="fieldset" error={error}>
<FormControl
sx={{ m: 3 }}
component="fieldset"
error={error}
variant="standard"
>
<FormLabel component="legend">Pop quiz: Material-UI is...</FormLabel>
<RadioGroup
aria-label="quiz"
Expand Down
1 change: 1 addition & 0 deletions docs/src/pages/components/selects/BasicSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function BasicSelect() {
labelId="demo-simple-select-label"
id="demo-simple-select"
value={age}
label="Age"
onChange={handleChange}
>
<MenuItem value={10}>Ten</MenuItem>
Expand Down
1 change: 1 addition & 0 deletions docs/src/pages/components/selects/BasicSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function BasicSelect() {
labelId="demo-simple-select-label"
id="demo-simple-select"
value={age}
label="Age"
onChange={handleChange}
>
<MenuItem value={10}>Ten</MenuItem>
Expand Down
1 change: 1 addition & 0 deletions docs/src/pages/components/selects/ControlledOpenSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export default function ControlledOpenSelect() {
onClose={handleClose}
onOpen={handleOpen}
value={age}
label="Age"
onChange={handleChange}
>
<MenuItem value="">
Expand Down
1 change: 1 addition & 0 deletions docs/src/pages/components/selects/ControlledOpenSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default function ControlledOpenSelect() {
onClose={handleClose}
onOpen={handleOpen}
value={age}
label="Age"
onChange={handleChange}
>
<MenuItem value="">
Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/components/selects/CustomizedSelects.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export default function CustomizedSelects() {
};
return (
<div>
<FormControl className={classes.margin}>
<FormControl className={classes.margin} variant="standard">
<InputLabel htmlFor="demo-customized-textbox">Age</InputLabel>
<BootstrapInput id="demo-customized-textbox" />
</FormControl>
<FormControl className={classes.margin}>
<FormControl className={classes.margin} variant="standard">
<InputLabel id="demo-customized-select-label">Age</InputLabel>
<Select
labelId="demo-customized-select-label"
Expand All @@ -75,7 +75,7 @@ export default function CustomizedSelects() {
<MenuItem value={30}>Thirty</MenuItem>
</Select>
</FormControl>
<FormControl className={classes.margin}>
<FormControl className={classes.margin} variant="standard">
<InputLabel htmlFor="demo-customized-select-native">Age</InputLabel>
<NativeSelect
id="demo-customized-select-native"
Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/components/selects/CustomizedSelects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ export default function CustomizedSelects() {
};
return (
<div>
<FormControl className={classes.margin}>
<FormControl className={classes.margin} variant="standard">
<InputLabel htmlFor="demo-customized-textbox">Age</InputLabel>
<BootstrapInput id="demo-customized-textbox" />
</FormControl>
<FormControl className={classes.margin}>
<FormControl className={classes.margin} variant="standard">
<InputLabel id="demo-customized-select-label">Age</InputLabel>
<Select
labelId="demo-customized-select-label"
Expand All @@ -82,7 +82,7 @@ export default function CustomizedSelects() {
<MenuItem value={30}>Thirty</MenuItem>
</Select>
</FormControl>
<FormControl className={classes.margin}>
<FormControl className={classes.margin} variant="standard">
<InputLabel htmlFor="demo-customized-select-native">Age</InputLabel>
<NativeSelect
id="demo-customized-select-native"
Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/components/selects/DialogSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import InputLabel from '@material-ui/core/InputLabel';
import Input from '@material-ui/core/Input';
import OutlinedInput from '@material-ui/core/OutlinedInput';
import MenuItem from '@material-ui/core/MenuItem';
import FormControl from '@material-ui/core/FormControl';
import Select from '@material-ui/core/Select';
Expand Down Expand Up @@ -54,7 +54,7 @@ export default function DialogSelect() {
native
value={age}
onChange={handleChange}
input={<Input id="demo-dialog-native" />}
input={<OutlinedInput label="Age" id="demo-dialog-native" />}
>
<option aria-label="None" value="" />
<option value={10}>Ten</option>
Expand All @@ -69,7 +69,7 @@ export default function DialogSelect() {
id="demo-dialog-select"
value={age}
onChange={handleChange}
input={<Input />}
input={<OutlinedInput label="Age" />}
>
<MenuItem value="">
<em>None</em>
Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/components/selects/DialogSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import InputLabel from '@material-ui/core/InputLabel';
import Input from '@material-ui/core/Input';
import OutlinedInput from '@material-ui/core/OutlinedInput';
import MenuItem from '@material-ui/core/MenuItem';
import FormControl from '@material-ui/core/FormControl';
import Select from '@material-ui/core/Select';
Expand Down Expand Up @@ -56,7 +56,7 @@ export default function DialogSelect() {
native
value={age}
onChange={handleChange}
input={<Input id="demo-dialog-native" />}
input={<OutlinedInput label="Age" id="demo-dialog-native" />}
>
<option aria-label="None" value="" />
<option value={10}>Ten</option>
Expand All @@ -71,7 +71,7 @@ export default function DialogSelect() {
id="demo-dialog-select"
value={age}
onChange={handleChange}
input={<Input />}
input={<OutlinedInput label="Age" />}
>
<MenuItem value="">
<em>None</em>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/selects/GroupedSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function GroupedSelect() {
<div>
<FormControl className={classes.formControl}>
<InputLabel htmlFor="grouped-native-select">Grouping</InputLabel>
<Select native defaultValue="" id="grouped-native-select">
<Select native defaultValue="" id="grouped-native-select" label="Grouping">
<option aria-label="None" value="" />
<optgroup label="Category 1">
<option value={1}>Option 1</option>
Expand All @@ -34,7 +34,7 @@ export default function GroupedSelect() {
</FormControl>
<FormControl className={classes.formControl}>
<InputLabel htmlFor="grouped-select">Grouping</InputLabel>
<Select defaultValue="" id="grouped-select">
<Select defaultValue="" id="grouped-select" label="Grouping">
<MenuItem value="">
<em>None</em>
</MenuItem>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/selects/GroupedSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function GroupedSelect() {
<div>
<FormControl className={classes.formControl}>
<InputLabel htmlFor="grouped-native-select">Grouping</InputLabel>
<Select native defaultValue="" id="grouped-native-select">
<Select native defaultValue="" id="grouped-native-select" label="Grouping">
<option aria-label="None" value="" />
<optgroup label="Category 1">
<option value={1}>Option 1</option>
Expand All @@ -36,7 +36,7 @@ export default function GroupedSelect() {
</FormControl>
<FormControl className={classes.formControl}>
<InputLabel htmlFor="grouped-select">Grouping</InputLabel>
<Select defaultValue="" id="grouped-select">
<Select defaultValue="" id="grouped-select" label="Grouping">
<MenuItem value="">
<em>None</em>
</MenuItem>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/selects/MultipleSelect.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { makeStyles, useTheme } from '@material-ui/core/styles';
import Input from '@material-ui/core/Input';
import OutlinedInput from '@material-ui/core/OutlinedInput';
import InputLabel from '@material-ui/core/InputLabel';
import MenuItem from '@material-ui/core/MenuItem';
import FormControl from '@material-ui/core/FormControl';
Expand Down Expand Up @@ -66,7 +66,7 @@ export default function MultipleSelect() {
multiple
value={personName}
onChange={handleChange}
input={<Input />}
input={<OutlinedInput label="Name" />}
MenuProps={MenuProps}
>
{names.map((name) => (
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/selects/MultipleSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { createStyles, makeStyles, Theme, useTheme } from '@material-ui/core/styles';
import Input from '@material-ui/core/Input';
import OutlinedInput from '@material-ui/core/OutlinedInput';
import InputLabel from '@material-ui/core/InputLabel';
import MenuItem from '@material-ui/core/MenuItem';
import FormControl from '@material-ui/core/FormControl';
Expand Down Expand Up @@ -68,7 +68,7 @@ export default function MultipleSelect() {
multiple
value={personName}
onChange={handleChange}
input={<Input />}
input={<OutlinedInput label="Name" />}
MenuProps={MenuProps}
>
{names.map((name) => (
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/components/selects/MultipleSelectCheckmarks.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Input from '@material-ui/core/Input';
import OutlinedInput from '@material-ui/core/OutlinedInput';
import InputLabel from '@material-ui/core/InputLabel';
import MenuItem from '@material-ui/core/MenuItem';
import FormControl from '@material-ui/core/FormControl';
Expand Down Expand Up @@ -58,7 +58,7 @@ export default function MultipleSelectCheckmarks() {
multiple
value={personName}
onChange={handleChange}
input={<Input />}
input={<OutlinedInput label="Tag" />}
renderValue={(selected) => selected.join(', ')}
MenuProps={MenuProps}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles';
import Input from '@material-ui/core/Input';
import OutlinedInput from '@material-ui/core/OutlinedInput';
import InputLabel from '@material-ui/core/InputLabel';
import MenuItem from '@material-ui/core/MenuItem';
import FormControl from '@material-ui/core/FormControl';
Expand Down Expand Up @@ -60,7 +60,7 @@ export default function MultipleSelectCheckmarks() {
multiple
value={personName}
onChange={handleChange}
input={<Input />}
input={<OutlinedInput label="Tag" />}
renderValue={(selected) => selected.join(', ')}
MenuProps={MenuProps}
>
Expand Down
Loading