Skip to content

Commit

Permalink
[Fab] Rename round -> circular for consistency (#21903)
Browse files Browse the repository at this point in the history
  • Loading branch information
kodai3 authored Aug 1, 2020
1 parent ceffdd9 commit de2af45
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/pages/api-docs/fab.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The `MuiFab` name can be used for providing [default props](/customization/globa
| <span class="prop-name">disableRipple</span> | <span class="prop-type">bool</span> | | If `true`, the ripple effect will be disabled. |
| <span class="prop-name">href</span> | <span class="prop-type">string</span> | | The URL to link to when the button is clicked. If defined, an `a` element will be used as the root node. |
| <span class="prop-name">size</span> | <span class="prop-type">'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'</span> | <span class="prop-default">'large'</span> | The size of the button. `small` is equivalent to the dense button styling. |
| <span class="prop-name">variant</span> | <span class="prop-type">'extended'<br>&#124;&nbsp;'round'</span> | <span class="prop-default">'round'</span> | The variant to use. |
| <span class="prop-name">variant</span> | <span class="prop-type">'circular'<br>&#124;&nbsp;'extended'</span> | <span class="prop-default">'circular'</span> | The variant to use. |

The `ref` is forwarded to the root element.

Expand Down
9 changes: 9 additions & 0 deletions docs/src/pages/guides/migration-v4/migration-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ This change affects almost all components where you're using the `component` pro
+<Accordion onChange={(event: React.SyntheticEvent, expanded: boolean) => {}} />
```

### Fab

- Rename `round` to `circular` for consistency. The possible values should be adjectives, not nouns:

```diff
-<Fab variant="round">
+<Fab variant="circular">
```

### Grid

- Rename `justify` prop with `justifyContent` to be aligned with the CSS property name.
Expand Down
6 changes: 3 additions & 3 deletions framer/Material-UI.framerfx/code/Fab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Props {
disabled: boolean;
href?: string;
size: 'large' | 'medium' | 'small';
variant: 'extended' | 'round';
variant: 'circular' | 'extended';
icon: string;
iconTheme: 'Filled' | 'Outlined' | 'Rounded' | 'TwoTone' | 'Sharp';
label: string;
Expand All @@ -34,7 +34,7 @@ Fab.defaultProps = {
color: 'default' as 'default',
disabled: false,
size: 'large' as 'large',
variant: 'round' as 'round',
variant: 'circular' as 'circular',
icon: 'add',
iconTheme: 'Filled' as 'Filled',
label: 'extended',
Expand Down Expand Up @@ -64,7 +64,7 @@ addPropertyControls(Fab, {
variant: {
type: ControlType.Enum,
title: 'Variant',
options: ['extended', 'round'],
options: ['circular', 'extended'],
},
icon: {
type: ControlType.String,
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/Fab/Fab.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export type FabTypeMap<P = {}, D extends React.ElementType = 'button'> = ExtendB
/**
* The variant to use.
*/
variant?: 'round' | 'extended';
variant?: 'circular' | 'extended';
};
defaultComponent: D;
classKey: FabClassKey;
Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui/src/Fab/Fab.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const Fab = React.forwardRef(function Fab(props, ref) {
disableFocusRipple = false,
focusVisibleClassName,
size = 'large',
variant = 'round',
variant = 'circular',
...other
} = props;

Expand Down Expand Up @@ -216,7 +216,7 @@ Fab.propTypes = {
/**
* The variant to use.
*/
variant: PropTypes.oneOf(['extended', 'round']),
variant: PropTypes.oneOf(['circular', 'extended']),
};

export default withStyles(styles, { name: 'MuiFab' })(Fab);

0 comments on commit de2af45

Please sign in to comment.