Skip to content

Commit 0ce81e0

Browse files
fix yarn proptypes generation
1 parent e15f32e commit 0ce81e0

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

docs/pages/api/avatar-group.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
2626
|:-----|:-----|:--------|:------------|
2727
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The avatars to stack. |
2828
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |
29-
| <span class="prop-name">spacing</span> | <span class="prop-type">'small'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'large'<br>&#124;&nbsp;number</span> | | Defines the spacing between `avatar` as `'large': -4px`, `'medium': -8px`, and `'small': -16px` or define a `number` as the spacing. |
30-
29+
| <span class="prop-name">spacing</span> | <span class="prop-type">'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;number</span> | <span class="prop-default">'medium'</span> | Spacing between avatars. |
3130

3231
The `ref` is forwarded to the root element.
3332

packages/material-ui-lab/src/AvatarGroup/AvatarGroup.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ export interface AvatarGroupProps
1515

1616
export type AvatarGroupClassKey = 'root' | 'avatar';
1717

18-
export default function AvatarGroup(props: AvatarGroupProps): JSX.Element | null;
18+
export default function AvatarGroup(props: AvatarGroupProps): JSX.Element;

packages/material-ui-lab/src/AvatarGroup/AvatarGroup.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import clsx from 'clsx';
55
import { withStyles } from '@material-ui/core/styles';
66

77
const SPACINGS = {
8-
large: -4,
9-
medium: -8,
10-
small: -16
8+
large: -4,
9+
small: -16,
1110
};
1211

1312
export const styles = theme => ({
@@ -18,11 +17,13 @@ export const styles = theme => ({
1817
/* Styles applied to the avatar elements. */
1918
avatar: {
2019
border: `2px solid ${theme.palette.background.default}`,
20+
marginLeft: -8,
2121
},
2222
});
2323

2424
const AvatarGroup = React.forwardRef(function AvatarGroup(props, ref) {
25-
const { children: childrenProp, classes, className, spacing, ...other } = props;
25+
const { children: childrenProp, classes, className, spacing = 'medium', ...other } = props;
26+
2627
const children = React.Children.toArray(childrenProp).filter(child => {
2728
if (process.env.NODE_ENV !== 'production') {
2829
if (isFragment(child)) {
@@ -45,7 +46,7 @@ const AvatarGroup = React.forwardRef(function AvatarGroup(props, ref) {
4546
className: clsx(child.props.className, classes.avatar),
4647
style: {
4748
zIndex: children.length - index,
48-
marginLeft: spacing ? (SPACINGS[spacing] ? SPACINGS[spacing] : spacing) : -8,
49+
marginLeft: spacing && SPACINGS[spacing] ? SPACINGS[spacing] : -spacing,
4950
...child.props.style,
5051
},
5152
});
@@ -68,14 +69,14 @@ AvatarGroup.propTypes = {
6869
* See [CSS API](#css) below for more details.
6970
*/
7071
classes: PropTypes.object,
71-
/**
72-
* Spacing between avatars.
73-
*/
74-
spacing: PropTypes.oneOfType([PropTypes.oneOf(['large', 'medium', 'small']), PropTypes.number]),
7572
/**
7673
* @ignore
7774
*/
7875
className: PropTypes.string,
76+
/**
77+
* Spacing between avatars.
78+
*/
79+
spacing: PropTypes.oneOfType([PropTypes.oneOf(['large', 'medium', 'small']), PropTypes.number]),
7980
};
8081

8182
export default withStyles(styles, { name: 'MuiAvatarGroup' })(AvatarGroup);

0 commit comments

Comments
 (0)