Skip to content

Commit

Permalink
chore(deps): update dependency prettier to v2 (#708) [skip ci]
Browse files Browse the repository at this point in the history
* chore(deps): update dependency prettier to v2

* Apply new prettier formatting to files

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Austin Green <agreen@zendesk.com>
  • Loading branch information
3 people committed Apr 9, 2020
1 parent 691914b commit 853c159
Show file tree
Hide file tree
Showing 31 changed files with 144 additions and 158 deletions.
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"printWidth": 100,
"singleQuote": true
"singleQuote": true,
"trailingComma": "none",
"arrowParens": "avoid"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"micromatch": "4.0.2",
"mockdate": "2.0.5",
"node-fetch": "2.6.0",
"prettier": "1.19.1",
"prettier": "2.0.4",
"prettier-package-json": "2.1.3",
"react": "16.13.0",
"react-docgen-typescript": "1.14.1",
Expand Down
5 changes: 3 additions & 2 deletions packages/accordions/src/styled/stepper/StyledIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ const sizeStyles = (props: IStyledIcon & ThemeProps<DefaultTheme>) => {
return css`
margin-bottom: ${props.isHorizontal && `${props.theme.space.base * 2}px`};
/* stylelint-disable-next-line property-no-unknown */
margin-${props.theme.rtl ? 'left' : 'right'}: ${!props.isHorizontal &&
`${props.theme.space.base * 3}px`};
margin-${props.theme.rtl ? 'left' : 'right'}: ${
!props.isHorizontal && `${props.theme.space.base * 3}px`
};
width: ${size};
min-width: ${size};
height: ${size};
Expand Down
6 changes: 3 additions & 3 deletions packages/avatars/src/styled/StyledAvatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ const badgeStyles = (props: IStyledAvatarProps & ThemeProps<DefaultTheme>) => {
content: ${content};
${props.status === 'active' &&
css`
animation: ${animation} ${TRANSITION_DURATION * 1.5}s ease-in-out;
`}
css`
animation: ${animation} ${TRANSITION_DURATION * 1.5}s ease-in-out;
`}
`;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/breadcrumbs/src/styled/StyledBreadcrumbItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const linkStyles = ({ isCurrent }: IStyledBreadcrumbItemProps) => css`
}
${isCurrent &&
`
`
& > :link,
& > :visited,
& > :link:hover,
Expand Down
5 changes: 3 additions & 2 deletions packages/buttons/src/elements/Anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ interface IAnchorProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
* @component
* @name Anchor
*/
const Anchor: React.FunctionComponent<IAnchorProps &
React.RefAttributes<HTMLAnchorElement>> = React.forwardRef<HTMLAnchorElement, IAnchorProps>(
const Anchor: React.FunctionComponent<
IAnchorProps & React.RefAttributes<HTMLAnchorElement>
> = React.forwardRef<HTMLAnchorElement, IAnchorProps>(
({ children, isExternal, ...otherProps }, ref) => {
return (
<StyledAnchor ref={ref} {...(otherProps as any)}>
Expand Down
43 changes: 21 additions & 22 deletions packages/buttons/src/elements/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,32 @@ interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
/**
* Accepts all `<button>` props
*/
const Button: React.FunctionComponent<IButtonProps &
React.RefAttributes<HTMLButtonElement>> = React.forwardRef<HTMLButtonElement, IButtonProps>(
(props, ref) => {
const buttonGroupContext = useButtonGroupContext();
const splitButtonContext = useSplitButtonContext();
const Button: React.FunctionComponent<
IButtonProps & React.RefAttributes<HTMLButtonElement>
> = React.forwardRef<HTMLButtonElement, IButtonProps>((props, ref) => {
const buttonGroupContext = useButtonGroupContext();
const splitButtonContext = useSplitButtonContext();

let computedProps = {
...props,
focusInset: props.focusInset || buttonGroupContext !== undefined || splitButtonContext
};
let computedProps = {
...props,
focusInset: props.focusInset || buttonGroupContext !== undefined || splitButtonContext
};

if (buttonGroupContext && !props.disabled) {
if (!props.value) {
throw new Error('"value" prop must be provided to Button when used within a ButtonGroup');
}

computedProps = buttonGroupContext.getButtonProps({
item: props.value,
focusRef: React.createRef(),
isSelected: props.value === buttonGroupContext.selectedItem,
...computedProps
});
if (buttonGroupContext && !props.disabled) {
if (!props.value) {
throw new Error('"value" prop must be provided to Button when used within a ButtonGroup');
}

return <StyledButton ref={ref} {...computedProps} {...computedProps} />;
computedProps = buttonGroupContext.getButtonProps({
item: props.value,
focusRef: React.createRef(),
isSelected: props.value === buttonGroupContext.selectedItem,
...computedProps
});
}
);

return <StyledButton ref={ref} {...computedProps} {...computedProps} />;
});

Button.propTypes = {
isDanger: PropTypes.bool,
Expand Down
8 changes: 3 additions & 5 deletions packages/buttons/src/elements/ChevronButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ interface IChevronButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
/**
* An `IconButton` with an embedded chevron icon
*/
const ChevronButton: React.FunctionComponent<IChevronButtonProps &
React.RefAttributes<HTMLButtonElement>> = React.forwardRef<
HTMLButtonElement,
IChevronButtonProps
>(({ ...buttonProps }, ref) => (
const ChevronButton: React.FunctionComponent<
IChevronButtonProps & React.RefAttributes<HTMLButtonElement>
> = React.forwardRef<HTMLButtonElement, IChevronButtonProps>(({ ...buttonProps }, ref) => (
<IconButton ref={ref} {...buttonProps}>
<ChevronDownIcon />
</IconButton>
Expand Down
5 changes: 3 additions & 2 deletions packages/buttons/src/elements/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ interface IIconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
/**
* Accepts all `<button>` props
*/
const IconButton: React.FunctionComponent<IIconButtonProps &
React.RefAttributes<HTMLButtonElement>> = React.forwardRef<HTMLButtonElement, IIconButtonProps>(
const IconButton: React.FunctionComponent<
IIconButtonProps & React.RefAttributes<HTMLButtonElement>
> = React.forwardRef<HTMLButtonElement, IIconButtonProps>(
({ children, isRotated, ...otherProps }, ref) => {
const focusInset = useSplitButtonContext();

Expand Down
4 changes: 2 additions & 2 deletions packages/datepickers/src/styled/StyledDay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const retrieveStyledDayColors = ({
color: ${color};
${!isSelected &&
!isDisabled &&
`
!isDisabled &&
`
:hover {
background-color: ${getColor('primaryHue', 600, theme, 0.08)};
color: ${getColor('primaryHue', 800, theme)};
Expand Down
7 changes: 1 addition & 6 deletions packages/dropdowns/examples/autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ function ExampleAutocomplete() {
const filterMatchingOptionsRef = React.useRef(
debounce(value => {
const matchingOptions = options.filter(option => {
return (
option
.trim()
.toLowerCase()
.indexOf(value.trim().toLowerCase()) !== -1
);
return option.trim().toLowerCase().indexOf(value.trim().toLowerCase()) !== -1;
});

setMatchingOptions(matchingOptions);
Expand Down
7 changes: 1 addition & 6 deletions packages/dropdowns/examples/multiselect.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,7 @@ function ExampleAutocomplete() {
const filterMatchingOptionsRef = React.useRef(
debounce(value => {
const matchingOptions = options.filter(option => {
return (
option
.trim()
.toLowerCase()
.indexOf(value.trim().toLowerCase()) !== -1
);
return option.trim().toLowerCase().indexOf(value.trim().toLowerCase()) !== -1;
});

setMatchingOptions(matchingOptions);
Expand Down
4 changes: 2 additions & 2 deletions packages/dropdowns/src/styled/items/StyledItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export const getItemPaddingHorizontal = (props: IStyledItemProps & ThemeProps<De
const getColorStyles = (props: IStyledItemProps & ThemeProps<DefaultTheme>) => {
return css`
background-color: ${props.isFocused &&
!props.disabled &&
getColor('primaryHue', 600, props.theme, 0.08)};
!props.disabled &&
getColor('primaryHue', 600, props.theme, 0.08)};
color: ${props.disabled
? getColor('neutralHue', 400, props.theme)
: props.theme.colors.foreground};
Expand Down
5 changes: 3 additions & 2 deletions packages/modals/src/styled/StyledFooter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ export const StyledFooter = styled.div.attrs<IStyledFooter>({
padding: ${props =>
props.isLarge
? `${props.theme.space.base * 8}px ${props.theme.space.base * 10}px`
: `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px ${props.theme.space.base *
8}px`};
: `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px ${
props.theme.space.base * 8
}px`};
${props => retrieveComponentStyles(COMPONENT_ID, props)};
`;
Expand Down
2 changes: 1 addition & 1 deletion packages/theming/src/utils/arrowStyles.example.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ initialState = {

const StyledDiv = styled.div`
box-shadow: ${state.boxShadow &&
DEFAULT_THEME.shadows.lg('8px', '12px', getColor('chromeHue', 600, DEFAULT_THEME, 0.15))};
DEFAULT_THEME.shadows.lg('8px', '12px', getColor('chromeHue', 600, DEFAULT_THEME, 0.15))};
border: ${state.border && `${DEFAULT_THEME.borders.sm} ${getColor('primaryHue')}`};
background-color: ${getColor('primaryHue', 200)};
Expand Down
2 changes: 1 addition & 1 deletion packages/theming/src/utils/arrowStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const positionStyles = (position: ARROW_POSITION, size: string, inset: string) =
&::before,
&::after {
${positionCss} /* [3] */
${positionCss}/* [3] */
}
`;
};
Expand Down
29 changes: 14 additions & 15 deletions packages/typography/src/elements/Code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,21 @@ export interface ICodeProps extends HTMLAttributes<HTMLDivElement> {
/**
* Accepts all `<code>` attributes and events
*/
const Code: React.FunctionComponent<ICodeProps &
React.RefAttributes<HTMLDivElement>> = React.forwardRef<HTMLDivElement, ICodeProps>(
({ size, hue, ...other }, ref) => {
let _size: 'sm' | 'md' | 'lg';

if (size === 'small') {
_size = 'sm';
} else if (size === 'medium') {
_size = 'md';
} else {
_size = 'lg';
}

return <StyledCode ref={ref} size={_size} hue={hue} {...other} />;
const Code: React.FunctionComponent<
ICodeProps & React.RefAttributes<HTMLDivElement>
> = React.forwardRef<HTMLDivElement, ICodeProps>(({ size, hue, ...other }, ref) => {
let _size: 'sm' | 'md' | 'lg';

if (size === 'small') {
_size = 'sm';
} else if (size === 'medium') {
_size = 'md';
} else {
_size = 'lg';
}
);

return <StyledCode ref={ref} size={_size} hue={hue} {...other} />;
});

Code.displayName = 'Code';

Expand Down
33 changes: 16 additions & 17 deletions packages/typography/src/elements/Ellipsis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,23 @@ interface IEllipsisProps extends HTMLAttributes<HTMLSpanElement> {
* text-overflow styling. Accepts all standard attributes and events for the
* provided `tag`.
*/
const Ellipsis: React.FunctionComponent<IEllipsisProps &
React.RefAttributes<HTMLDivElement>> = React.forwardRef<HTMLDivElement, IEllipsisProps>(
({ children, title, tag, ...other }, ref) => {
let textContent = undefined;

if (title !== undefined) {
textContent = title;
} else if (typeof children === 'string') {
textContent = children;
}

return (
<StyledEllipsis as={tag} ref={ref} title={textContent} {...other}>
{children}
</StyledEllipsis>
);
const Ellipsis: React.FunctionComponent<
IEllipsisProps & React.RefAttributes<HTMLDivElement>
> = React.forwardRef<HTMLDivElement, IEllipsisProps>(({ children, title, tag, ...other }, ref) => {
let textContent = undefined;

if (title !== undefined) {
textContent = title;
} else if (typeof children === 'string') {
textContent = children;
}
);

return (
<StyledEllipsis as={tag} ref={ref} title={textContent} {...other}>
{children}
</StyledEllipsis>
);
});

Ellipsis.displayName = 'Ellipsis';

Expand Down
9 changes: 5 additions & 4 deletions packages/typography/src/elements/LG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ interface ILGProps extends HTMLAttributes<HTMLDivElement> {
/**
* Accepts all standard attributes and events for the provided `tag`
*/
const LG: React.FunctionComponent<ILGProps &
React.RefAttributes<HTMLDivElement>> = React.forwardRef<HTMLDivElement, ILGProps>(
({ tag, ...other }, ref) => <StyledFont as={tag} ref={ref} size="lg" {...other} />
);
const LG: React.FunctionComponent<
ILGProps & React.RefAttributes<HTMLDivElement>
> = React.forwardRef<HTMLDivElement, ILGProps>(({ tag, ...other }, ref) => (
<StyledFont as={tag} ref={ref} size="lg" {...other} />
));

LG.displayName = 'LG';

Expand Down
9 changes: 5 additions & 4 deletions packages/typography/src/elements/MD.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ interface IMDProps extends HTMLAttributes<HTMLDivElement> {
/**
* Accepts all standard attributes and events for the provided `tag`
*/
const MD: React.FunctionComponent<IMDProps &
React.RefAttributes<HTMLDivElement>> = React.forwardRef<HTMLDivElement, IMDProps>(
({ tag, ...other }, ref) => <StyledFont as={tag} ref={ref} size="md" {...other} />
);
const MD: React.FunctionComponent<
IMDProps & React.RefAttributes<HTMLDivElement>
> = React.forwardRef<HTMLDivElement, IMDProps>(({ tag, ...other }, ref) => (
<StyledFont as={tag} ref={ref} size="md" {...other} />
));

MD.displayName = 'MD';

Expand Down
9 changes: 5 additions & 4 deletions packages/typography/src/elements/SM.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ interface ISMProps extends HTMLAttributes<HTMLDivElement> {
/**
* Accepts all standard attributes and events for the provided `tag`
*/
const SM: React.FunctionComponent<ISMProps &
React.RefAttributes<HTMLDivElement>> = React.forwardRef<HTMLDivElement, ISMProps>(
({ tag, ...other }, ref) => <StyledFont as={tag} ref={ref} size="sm" {...other} />
);
const SM: React.FunctionComponent<
ISMProps & React.RefAttributes<HTMLDivElement>
> = React.forwardRef<HTMLDivElement, ISMProps>(({ tag, ...other }, ref) => (
<StyledFont as={tag} ref={ref} size="sm" {...other} />
));

SM.displayName = 'SM';

Expand Down
9 changes: 5 additions & 4 deletions packages/typography/src/elements/XL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ interface IXLProps extends HTMLAttributes<HTMLDivElement> {
/**
* Accepts all standard attributes and events for the provided `tag`
*/
const XL: React.FunctionComponent<IXLProps &
React.RefAttributes<HTMLDivElement>> = React.forwardRef<HTMLDivElement, IXLProps>(
({ tag, ...other }, ref) => <StyledFont as={tag} ref={ref} size="xl" {...other} />
);
const XL: React.FunctionComponent<
IXLProps & React.RefAttributes<HTMLDivElement>
> = React.forwardRef<HTMLDivElement, IXLProps>(({ tag, ...other }, ref) => (
<StyledFont as={tag} ref={ref} size="xl" {...other} />
));

XL.displayName = 'XL';

Expand Down
9 changes: 5 additions & 4 deletions packages/typography/src/elements/XXL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ interface IXXLProps extends HTMLAttributes<HTMLDivElement> {
/**
* Accepts all standard attributes and events for the provided `tag`
*/
const XXL: React.FunctionComponent<IXXLProps &
React.RefAttributes<HTMLDivElement>> = React.forwardRef<HTMLDivElement, IXXLProps>(
({ tag, ...other }, ref) => <StyledFont as={tag} ref={ref} size="xxl" {...other} />
);
const XXL: React.FunctionComponent<
IXXLProps & React.RefAttributes<HTMLDivElement>
> = React.forwardRef<HTMLDivElement, IXXLProps>(({ tag, ...other }, ref) => (
<StyledFont as={tag} ref={ref} size="xxl" {...other} />
));

XXL.displayName = 'XXL';

Expand Down
9 changes: 5 additions & 4 deletions packages/typography/src/elements/XXXL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ interface IXXXLProps extends HTMLAttributes<HTMLDivElement> {
/**
* Accepts all standard attributes and events for the provided `tag`
*/
const XXXL: React.FunctionComponent<IXXXLProps &
React.RefAttributes<HTMLDivElement>> = React.forwardRef<HTMLDivElement, IXXXLProps>(
({ tag, ...other }, ref) => <StyledFont as={tag} ref={ref} size="xxxl" {...other} />
);
const XXXL: React.FunctionComponent<
IXXXLProps & React.RefAttributes<HTMLDivElement>
> = React.forwardRef<HTMLDivElement, IXXXLProps>(({ tag, ...other }, ref) => (
<StyledFont as={tag} ref={ref} size="xxxl" {...other} />
));

XXXL.displayName = 'XXXL';

Expand Down
Loading

0 comments on commit 853c159

Please sign in to comment.