Skip to content

Commit

Permalink
[core] Batch small changes (#24599)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jan 25, 2021
1 parent 416b32a commit 64fd0af
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .mocharc.js
Expand Up @@ -8,7 +8,7 @@ module.exports = {
'docs/.next/**',
],
recursive: true,
timeout: (process.env.CIRCLECI === 'true' ? 3 : 2) * 1000, // Circle CI has low-performance CPUs.
timeout: (process.env.CIRCLECI === 'true' ? 4 : 2) * 1000, // Circle CI has low-performance CPUs.
reporter: 'dot',
require: [require.resolve('./test/utils/setupBabel'), require.resolve('./test/utils/setupJSDOM')],
'watch-ignore': [
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/discover-more/roadmap/roadmap.md
Expand Up @@ -29,8 +29,8 @@ Here are the top priorities:

Our GitHub project's roadmap is where you can learn about what features we're working on, what stage they're at, and when we expect to bring them to you:

- [Material-UI community](https://github.com/mui-org/material-ui/projects/25)
- [Material-UI X](https://github.com/mui-org/material-ui-x/projects/1)
- [Material-UI community](https://github.com/mui-org/material-ui/projects/25). This repository focuses on empowering the creation of great design systems with React, as well as providing two ready to use themes (Material Design so far, another one coming in the near future).
- [Material-UI X](https://github.com/mui-org/material-ui-x/projects/1). This repository focuses on providing advanced React components.

## New components

Expand Down
12 changes: 10 additions & 2 deletions docs/src/pages/getting-started/templates/dashboard/Chart.js
Expand Up @@ -36,15 +36,23 @@ export default function Chart() {
left: 24,
}}
>
<XAxis dataKey="time" stroke={theme.palette.text.secondary} />
<YAxis stroke={theme.palette.text.secondary}>
<XAxis
dataKey="time"
stroke={theme.palette.text.secondary}
style={theme.typography.body2}
/>
<YAxis
stroke={theme.palette.text.secondary}
style={theme.typography.body2}
>
<Label
// @ts-expect-error https://github.com/recharts/recharts/issues/2400
angle={270}
position="left"
style={{
textAnchor: 'middle',
fill: theme.palette.text.primary,
...theme.typography.body1,
}}
>
Sales ($)
Expand Down
12 changes: 10 additions & 2 deletions docs/src/pages/getting-started/templates/dashboard/Chart.tsx
Expand Up @@ -36,15 +36,23 @@ export default function Chart() {
left: 24,
}}
>
<XAxis dataKey="time" stroke={theme.palette.text.secondary} />
<YAxis stroke={theme.palette.text.secondary}>
<XAxis
dataKey="time"
stroke={theme.palette.text.secondary}
style={theme.typography.body2}
/>
<YAxis
stroke={theme.palette.text.secondary}
style={theme.typography.body2}
>
<Label
// @ts-expect-error https://github.com/recharts/recharts/issues/2400
angle={270}
position="left"
style={{
textAnchor: 'middle',
fill: theme.palette.text.primary,
...theme.typography.body1,
}}
>
Sales ($)
Expand Down
3 changes: 1 addition & 2 deletions packages/material-ui/src/Autocomplete/Autocomplete.spec.tsx
@@ -1,6 +1,5 @@
import * as React from 'react';
import { InputLabelProps } from '@material-ui/core';
import { Autocomplete, AutocompleteProps } from '@material-ui/lab';
import { Autocomplete, AutocompleteProps, InputLabelProps } from '@material-ui/core';
import { expectType } from '@material-ui/types';

interface MyAutocompleteProps<
Expand Down
11 changes: 9 additions & 2 deletions packages/material-ui/src/Autocomplete/Autocomplete.test.js
Expand Up @@ -16,10 +16,17 @@ import Chip from '@material-ui/core/Chip';
import Autocomplete, { createFilterOptions } from '@material-ui/core/Autocomplete';

function checkHighlightIs(listbox, expected) {
const focused = listbox.querySelector('[role="option"][data-focus]');

if (expected) {
expect(listbox.querySelector('li[data-focus]')).to.have.text(expected);
if (focused) {
expect(focused).to.have.text(expected);
} else {
// No options selected
expect(null).to.equal(expected);
}
} else {
expect(listbox.querySelector('li[data-focus]')).to.equal(null);
expect(focused).to.equal(null);
}
}

Expand Down
7 changes: 4 additions & 3 deletions packages/material-ui/src/Avatar/Avatar.js
Expand Up @@ -140,7 +140,7 @@ const Avatar = React.forwardRef(function Avatar(inProps, ref) {
alt,
children: childrenProp,
className,
component: Component = 'div',
component = 'div',
imgProps,
sizes,
src,
Expand All @@ -158,8 +158,9 @@ const Avatar = React.forwardRef(function Avatar(inProps, ref) {

const styleProps = {
...props,
variant,
colorDefault: !hasImgNotFailing,
component,
variant,
};

const classes = useUtilityClasses(styleProps);
Expand All @@ -186,7 +187,7 @@ const Avatar = React.forwardRef(function Avatar(inProps, ref) {

return (
<AvatarRoot
as={Component}
as={component}
styleProps={styleProps}
className={clsx(classes.root, className)}
ref={ref}
Expand Down
5 changes: 3 additions & 2 deletions packages/material-ui/src/Container/Container.js
Expand Up @@ -87,7 +87,7 @@ const Container = React.forwardRef(function Container(inProps, ref) {
const props = useThemeProps({ props: inProps, name: 'MuiContainer' });
const {
className,
component: Component = 'div',
component = 'div',
disableGutters = false,
fixed = false,
maxWidth = 'lg',
Expand All @@ -96,6 +96,7 @@ const Container = React.forwardRef(function Container(inProps, ref) {

const styleProps = {
...props,
component,
disableGutters,
fixed,
maxWidth,
Expand All @@ -105,7 +106,7 @@ const Container = React.forwardRef(function Container(inProps, ref) {

return (
<ContainerRoot
as={Component}
as={component}
styleProps={styleProps}
className={clsx(classes.root, className)}
ref={ref}
Expand Down
9 changes: 5 additions & 4 deletions packages/material-ui/src/Paper/Paper.js
Expand Up @@ -67,18 +67,19 @@ const Paper = React.forwardRef(function Paper(inProps, ref) {

const {
className,
component: Component = 'div',
square = false,
component = 'div',
elevation = 1,
square = false,
variant = 'elevation',
...other
} = props;

const styleProps = {
...props,
variant,
component,
elevation,
square,
variant,
};

const classes = useUtilityClasses(styleProps);
Expand All @@ -98,7 +99,7 @@ const Paper = React.forwardRef(function Paper(inProps, ref) {

return (
<PaperRoot
as={Component}
as={component}
styleProps={styleProps}
className={clsx(classes.root, className)}
ref={ref}
Expand Down
6 changes: 3 additions & 3 deletions packages/material-ui/src/SvgIcon/SvgIcon.js
Expand Up @@ -73,7 +73,7 @@ const SvgIcon = React.forwardRef(function SvgIcon(inProps, ref) {
children,
className,
color = 'inherit',
component: Component = 'svg',
component = 'svg',
fontSize = 'medium',
htmlColor,
titleAccess,
Expand All @@ -84,7 +84,7 @@ const SvgIcon = React.forwardRef(function SvgIcon(inProps, ref) {
const styleProps = {
...props,
color,
component: Component,
component,
fontSize,
viewBox,
};
Expand All @@ -93,7 +93,7 @@ const SvgIcon = React.forwardRef(function SvgIcon(inProps, ref) {

return (
<SvgIconRoot
as={Component}
as={component}
className={clsx(classes.root, className)}
styleProps={styleProps}
focusable="false"
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/ToggleButton/ToggleButton.js
Expand Up @@ -75,7 +75,7 @@ const ToggleButton = React.forwardRef(function ToggleButton(props, ref) {
const handleChange = (event) => {
if (onClick) {
onClick(event, value);
if (event.isDefaultPrevented()) {
if (event.defaultPrevented) {
return;
}
}
Expand Down
6 changes: 6 additions & 0 deletions test/karma.conf.js
Expand Up @@ -18,6 +18,12 @@ module.exports = function setKarmaConfig(config) {
browserDisconnectTolerance: 1, // default 0
browserNoActivityTimeout: 300000, // default 10000
colors: true,
client: {
mocha: {
// Some BrowserStack browsers can be slow.
timeout: (process.env.CIRCLECI === 'true' ? 4 : 2) * 1000,
},
},
frameworks: ['mocha'],
files: [
{
Expand Down

0 comments on commit 64fd0af

Please sign in to comment.