Skip to content

Commit

Permalink
Merge branch 'master' into clean-up-firstcharmap
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyhallett committed Apr 1, 2020
2 parents 8e14896 + c253b28 commit cdf4eb7
Show file tree
Hide file tree
Showing 19 changed files with 79 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Diamond Sponsors are those who have pledged $1,500/month or more to Material-UI.
via [Patreon](https://www.patreon.com/oliviertassinari)

<p style="display: flex; justify-content: center;">
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="tidelift" href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=material_ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img width="96" src="https://github.com/tidelift.png?size=96" alt="tidelift" title="Enterprise-ready open source software" /></a>
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="tidelift" href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img width="96" src="https://github.com/tidelift.png?size=96" alt="tidelift" title="Enterprise-ready open source software" /></a>
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="bitsrc" href="https://bit.dev" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img width="96" src="https://github.com/teambit.png?size=96" alt="bitsrc" title="The fastest way to share code" /></a>
</p>

Expand Down
6 changes: 6 additions & 0 deletions docs/notifications.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@
"date": "2020-01-25",
"title": "New blog post",
"text": "<a style=\"color: inherit;\" target=\"_blank\" rel=\"noopener\" href=\"https://medium.com/material-ui/2019-in-review-and-beyond-34f85e29926\">2019 in review and beyond</a>. 2019 was a great year for Material-UI. It puts us on an exciting path to solve even greater challenges in the coming years!"
},
{
"id": 49,
"date": "2020-03-30",
"title": "Sketch",
"text": "<a style=\"color: inherit;\" target=\"_blank\" rel=\"noopener\" href=\"https://twitter.com/MaterialUI/status/1244519729978437633\">Introducing Material-UI for Sketch</a>. Today, we’re excited to introduce the Sketch symbols 💎 for Material-UI."
}
]
2 changes: 1 addition & 1 deletion docs/src/modules/components/Ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const inHouseAds = [
{
name: 'tidelift',
link:
'https://tidelift.com/subscription/managed-open-source-survey?utm_source=docs&utm_medium=referral&utm_campaign=enterprise&utm_content=ad',
'https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=enterprise&utm_content=ad',
img: '/static/in-house/tidelift.png',
description:
'<b>Material-UI for enterprise</b><br />Save time and reduce risk. Managed open source — backed by maintainers.',
Expand Down
1 change: 1 addition & 0 deletions docs/src/pages/components/selects/MultipleSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export default function MultipleSelect() {
return selected.join(', ');
}}
MenuProps={MenuProps}
inputProps={{ 'aria-label': 'Without label' }}
>
<MenuItem disabled value="">
<em>Placeholder</em>
Expand Down
1 change: 1 addition & 0 deletions docs/src/pages/components/selects/MultipleSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export default function MultipleSelect() {
return (selected as string[]).join(', ');
}}
MenuProps={MenuProps}
inputProps={{ 'aria-label': 'Without label' }}
>
<MenuItem disabled value="">
<em>Placeholder</em>
Expand Down
16 changes: 14 additions & 2 deletions docs/src/pages/components/selects/SimpleSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ export default function SimpleSelect() {
<FormHelperText>Some important helper text</FormHelperText>
</FormControl>
<FormControl className={classes.formControl}>
<Select value={age} onChange={handleChange} displayEmpty className={classes.selectEmpty}>
<Select
value={age}
onChange={handleChange}
displayEmpty
className={classes.selectEmpty}
inputProps={{ 'aria-label': 'Without label' }}
>
<MenuItem value="">
<em>None</em>
</MenuItem>
Expand Down Expand Up @@ -160,7 +166,13 @@ export default function SimpleSelect() {
<FormHelperText>Auto width</FormHelperText>
</FormControl>
<FormControl className={classes.formControl}>
<Select value={age} onChange={handleChange} displayEmpty className={classes.selectEmpty}>
<Select
value={age}
onChange={handleChange}
displayEmpty
className={classes.selectEmpty}
inputProps={{ 'aria-label': 'Without label' }}
>
<MenuItem value="" disabled>
Placeholder
</MenuItem>
Expand Down
16 changes: 14 additions & 2 deletions docs/src/pages/components/selects/SimpleSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ export default function SimpleSelect() {
<FormHelperText>Some important helper text</FormHelperText>
</FormControl>
<FormControl className={classes.formControl}>
<Select value={age} onChange={handleChange} displayEmpty className={classes.selectEmpty}>
<Select
value={age}
onChange={handleChange}
displayEmpty
className={classes.selectEmpty}
inputProps={{ 'aria-label': 'Without label' }}
>
<MenuItem value="">
<em>None</em>
</MenuItem>
Expand Down Expand Up @@ -162,7 +168,13 @@ export default function SimpleSelect() {
<FormHelperText>Auto width</FormHelperText>
</FormControl>
<FormControl className={classes.formControl}>
<Select value={age} onChange={handleChange} displayEmpty className={classes.selectEmpty}>
<Select
value={age}
onChange={handleChange}
displayEmpty
className={classes.selectEmpty}
inputProps={{ 'aria-label': 'Without label' }}
>
<MenuItem value="" disabled>
Placeholder
</MenuItem>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/discover-more/backers/backers.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Please contact us at [email protected] to subscribe to this tier.
via [Patreon](https://www.patreon.com/oliviertassinari)

<p style="display: flex; justify-content: center;">
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="tidelift" href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=material_ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img width="96" src="https://github.com/tidelift.png?size=96" alt="tidelift" title="Enterprise-ready open source software" /></a>
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="tidelift" href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=backers" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img width="96" src="https://github.com/tidelift.png?size=96" alt="tidelift" title="Enterprise-ready open source software" /></a>
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="bitsrc" href="https://bit.dev" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img width="96" src="https://github.com/teambit.png?size=96" alt="bitsrc" title="The fastest way to share code" /></a>
</p>

Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/getting-started/support/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ The Tidelift Subscription manages your dependencies for you:

The end result? All of the capabilities you expect from commercial-grade software, for the full breadth of open-source you use. That means less time grappling with esoteric open-source trivia, and more time building your own applications – and your business.

[Get more details](https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=material_ui&utm_medium=referral&utm_campaign=enterprise)
[Get more details](https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=enterprise)

[Request a demo](https://tidelift.com/subscription/request-a-demo?utm_source=material_ui&utm_medium=referral&utm_campaign=enterprise)
[Request a demo](https://tidelift.com/subscription/request-a-demo?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=enterprise)

### Custom work 🛠

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/landing/QuickWord.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Link from 'docs/src/modules/components/Link';
const backers = [
{
href:
'https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=material_ui&utm_medium=referral&utm_campaign=homepage',
'https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=homepage',
alt: 'tidelift',
title: 'Tidelift — Enterprise-ready open source software',
},
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/landing/backers.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The continued development and maintenance of Material-UI is made possible by the
### Gold 🏆

<p style="display: flex; justify-content: center;">
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="tidelift" href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=material_ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img width="96" src="https://github.com/tidelift.png?size=96" alt="tidelift" title="Enterprise-ready open source software" /></a>
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="tidelift" href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img width="96" src="https://github.com/tidelift.png?size=96" alt="tidelift" title="Enterprise-ready open source software" /></a>
<a data-ga-event-category="sponsor" data-ga-event-action="logo" data-ga-event-label="bitsrc" href="https://bit.dev" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img width="96" src="https://github.com/teambit.png?size=96" alt="bitsrc" title="The fastest way to share code" /></a>
</p>

Expand Down
13 changes: 13 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[build]
# Directory (relative to root of your repo) that contains the deploy-ready
# HTML files and assets generated by the build. If a base directory has
# been specified, include it in the publish directory path.
publish = "docs/export/"

# Default build command.
command = "yarn docs:build && yarn docs:export"

[build.environment]
YARN_VERSION = "1.21.1"
NODE_VERSION = "10"
NODE_OPTIONS = "--max_old_space_size=4096"
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ruleTester.run('restricted-path-imports', rule, {
"import { blue } from '@material-ui/core/colors'",
"import * as colors from '@material-ui/core/colors'",
"import * as colors from '@another/core/styles/withStyles'",
"import describeConformance from '@material-ui/core/test-utils/describeConformance'",
"import describeConformance from '@another/core/test-utils/describeConformance'",
],
invalid: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const styles = (theme) => {
display: 'flex',
minHeight: 8 * 6,
transition: theme.transitions.create(['min-height', 'background-color'], transition),
padding: '0 24px 0 24px',
padding: theme.spacing(0, 3),
'&:hover:not($disabled)': {
cursor: 'pointer',
},
Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui/src/InputBase/InputBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const styles = (theme) => {
// Mimics the default input display property used by browsers for an input.
...theme.typography.body1,
color: theme.palette.text.primary,
lineHeight: '1.1875em', // Reset (19px), match the native input line-height
lineHeight: '1.1876em', // Reset (19px), match the native input line-height
boxSizing: 'border-box', // Prevent padding issue with fullWidth.
position: 'relative',
cursor: 'text',
Expand Down Expand Up @@ -87,7 +87,7 @@ export const styles = (theme) => {
border: 0,
boxSizing: 'content-box',
background: 'none',
height: '1.1875em', // Reset (19px), match the native input line-height
height: '1.1876em', // Reset (19px), match the native input line-height
margin: 0, // Reset for Safari
WebkitTapHighlightColor: 'transparent',
display: 'block',
Expand Down
6 changes: 3 additions & 3 deletions packages/material-ui/src/Select/Select.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ describe('<Select />', () => {
it('should get selected element from arguments', () => {
const onChangeHandler = spy();
const { getAllByRole, getByRole } = render(
<Select onChange={onChangeHandler} value="1">
<Select onChange={onChangeHandler} value="0">
<MenuItem value="0" />
<MenuItem value="1" />
<MenuItem value="2" />
Expand Down Expand Up @@ -409,15 +409,15 @@ describe('<Select />', () => {
const { getByRole } = render(<Select value="" />);

// TODO what is the accessible name actually?
expect(getByRole('button')).to.have.attribute('aria-labelledby', ' ');
expect(getByRole('button')).to.not.have.attribute('aria-labelledby');
});

it('is labelled by itself when it has a name', () => {
const { getByRole } = render(<Select name="select" value="" />);

expect(getByRole('button')).to.have.attribute(
'aria-labelledby',
` ${getByRole('button').getAttribute('id')}`,
getByRole('button').getAttribute('id'),
);
});

Expand Down
12 changes: 11 additions & 1 deletion packages/material-ui/src/Select/SelectInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function isEmpty(display) {
*/
const SelectInput = React.forwardRef(function SelectInput(props, ref) {
const {
'aria-label': ariaLabel,
autoFocus,
autoWidth,
children,
Expand Down Expand Up @@ -139,6 +140,10 @@ const SelectInput = React.forwardRef(function SelectInput(props, ref) {
newValue = child.props.value;
}

if (value === newValue) {
return;
}

setValue(newValue);

if (onChange) {
Expand Down Expand Up @@ -320,8 +325,9 @@ const SelectInput = React.forwardRef(function SelectInput(props, ref) {
tabIndex={tabIndex}
role="button"
aria-expanded={open ? 'true' : undefined}
aria-labelledby={`${labelId || ''} ${buttonId || ''}`}
aria-haspopup="listbox"
aria-label={ariaLabel}
aria-labelledby={[labelId, buttonId].filter(Boolean).join(' ') || undefined}
onKeyDown={handleKeyDown}
onMouseDown={disabled || readOnly ? null : handleMouseDown}
onBlur={handleBlur}
Expand Down Expand Up @@ -379,6 +385,10 @@ const SelectInput = React.forwardRef(function SelectInput(props, ref) {
});

SelectInput.propTypes = {
/**
* @ignore
*/
'aria-label': PropTypes.string,
/**
* @ignore
*/
Expand Down
3 changes: 2 additions & 1 deletion packages/material-ui/src/TablePagination/TablePagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export const styles = (theme) => ({
caption: {
flexShrink: 0,
},
// TODO v5: `.selectRoot` should be merged with `.input`
/* Styles applied to the Select component root element. */
selectRoot: {
// `.selectRoot` should be merged with `.input` in v5.
marginRight: 32,
marginLeft: 8,
},
Expand Down Expand Up @@ -122,6 +122,7 @@ const TablePagination = React.forwardRef(function TablePagination(props, ref) {
input={<InputBase className={clsx(classes.input, classes.selectRoot)} />}
value={rowsPerPage}
onChange={onChangeRowsPerPage}
inputProps={{ 'aria-label': labelRowsPerPage }}
{...SelectProps}
>
{rowsPerPageOptions.map((rowsPerPageOption) => (
Expand Down
4 changes: 3 additions & 1 deletion packages/material-ui/src/styles/overrides.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import { OutlinedInputClassKey } from '../OutlinedInput';
import { PaperClassKey } from '../Paper';
import { PopoverClassKey } from '../Popover';
import { RadioClassKey } from '../Radio';
import { ScopedCssBaselineClassKey } from '../ScopedCssBaseline';
import { SelectClassKey } from '../Select';
import { SliderClassKey } from '../Slider';
import { SnackbarClassKey } from '../Snackbar';
Expand All @@ -83,8 +84,8 @@ import { SwitchClassKey } from '../Switch';
import { TabClassKey } from '../Tab';
import { TableBodyClassKey } from '../TableBody';
import { TableCellClassKey } from '../TableCell';
import { TableContainerClassKey } from '../TableContainer';
import { TableClassKey } from '../Table';
import { TableContainerClassKey } from '../TableContainer';
import { TableFooterClassKey } from '../TableFooter';
import { TableHeadClassKey } from '../TableHead';
import { TablePaginationClassKey } from '../TablePagination';
Expand Down Expand Up @@ -169,6 +170,7 @@ export interface ComponentNameToClassKey {
MuiPaper: PaperClassKey;
MuiPopover: PopoverClassKey;
MuiRadio: RadioClassKey;
MuiScopedCssBaseline: ScopedCssBaselineClassKey;
MuiSelect: SelectClassKey;
MuiSlider: SliderClassKey;
MuiSnackbar: SnackbarClassKey;
Expand Down

0 comments on commit cdf4eb7

Please sign in to comment.