Skip to content

Commit 08e2bd1

Browse files
Merge branch 'master' into company
2 parents d47c4aa + 15cea51 commit 08e2bd1

File tree

124 files changed

+2104
-831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+2104
-831
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Please note that `@next` will only point to pre-releases; to get the latest stab
5050

5151
*3/3 slots available*
5252

53-
Diamond Sponsors are those who have pledged $2,000/month and more to Material-UI.
53+
Diamond Sponsors are those who have pledged $2,000/month or more to Material-UI.
5454
Please contact us at diamond@material-ui.com to subscribe to this tier.
5555

5656
### Gold 🏆
@@ -68,7 +68,7 @@ via [OpenCollective](https://opencollective.com/material-ui)
6868
<a data-ga-event-category="sponsors" data-ga-event-action="logo" data-ga-event-label="callemall" href="https://www.call-em-all.com" rel="noopener sponsored" target="_blank" style="margin-right: 16px;"><img src="https://images.opencollective.com/proxy/images?src=https%3A%2F%2Fopencollective-production.s3-us-west-1.amazonaws.com%2Ff4053300-e0ea-11e7-acf0-0fa7c0509f4e.png&height=100" alt="call-em-all" title="The easy way to message your group" width="100" loading="lazy"></a>
6969
</p>
7070

71-
Gold Sponsors are those who have pledged $500/month and more to Material-UI.
71+
Gold Sponsors are those who have pledged $500/month or more to Material-UI.
7272

7373
### There is more!
7474

docs/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
"flexsearch": "^0.6.30",
7373
"isomorphic-fetch": "^2.2.1",
7474
"json2mq": "^0.2.0",
75-
"jss": "^10.0.0",
76-
"jss-plugin-template": "^10.0.0",
75+
"jss": "^10.0.3",
76+
"jss-plugin-template": "^10.0.3",
7777
"jss-rtl": "^0.3.0",
7878
"lodash": "^4.17.15",
7979
"lz-string": "^1.4.4",

docs/pages/_document.js

-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ export default class MyDocument extends Document {
3535
return (
3636
<html lang={userLanguage}>
3737
<Head>
38-
{/* Use minimum-scale=1 to enable GPU rasterization. */}
39-
<meta
40-
name="viewport"
41-
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
42-
/>
4338
{/*
4439
manifest.json provides metadata used when your web app is added to the
4540
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/

docs/pages/api/alert-title.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react';
2+
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
3+
import markdown from './alert-title.md';
4+
5+
export default function Page() {
6+
return <MarkdownDocs markdown={markdown} />;
7+
}

docs/pages/api/alert-title.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
filename: /packages/material-ui-lab/src/AlertTitle/AlertTitle.js
3+
---
4+
5+
<!--- This documentation is automatically generated, do not try to edit it. -->
6+
7+
# AlertTitle API
8+
9+
<p class="description">The API documentation of the AlertTitle React component. Learn more about the props and the CSS customization points.</p>
10+
11+
## Import
12+
13+
```js
14+
import AlertTitle from '@material-ui/lab/AlertTitle';
15+
// or
16+
import { AlertTitle } from '@material-ui/lab';
17+
```
18+
19+
You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).
20+
21+
22+
23+
## Props
24+
25+
| Name | Type | Default | Description |
26+
|:-----|:-----|:--------|:------------|
27+
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the component. |
28+
| <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+
30+
The `ref` is forwarded to the root element.
31+
32+
Any other props supplied will be provided to the root element (native element).
33+
34+
## CSS
35+
36+
- Style sheet name: `MuiAlertTitle`.
37+
- Style sheet details:
38+
39+
- `root`
40+
41+
You can override the style of the component thanks to one of these customization points:
42+
43+
- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
44+
- With a [global class name](/customization/components/#overriding-styles-with-global-class-names).
45+
- With a theme and an [`overrides` property](/customization/globals/#css).
46+
47+
If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui-lab/src/AlertTitle/AlertTitle.js) for more detail.
48+

docs/pages/api/alert.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react';
2+
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
3+
import markdown from './alert.md';
4+
5+
export default function Page() {
6+
return <MarkdownDocs markdown={markdown} />;
7+
}

docs/pages/api/alert.md

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
filename: /packages/material-ui-lab/src/Alert/Alert.js
3+
---
4+
5+
<!--- This documentation is automatically generated, do not try to edit it. -->
6+
7+
# Alert API
8+
9+
<p class="description">The API documentation of the Alert React component. Learn more about the props and the CSS customization points.</p>
10+
11+
## Import
12+
13+
```js
14+
import Alert from '@material-ui/lab/Alert';
15+
// or
16+
import { Alert } from '@material-ui/lab';
17+
```
18+
19+
You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/).
20+
21+
22+
23+
## Props
24+
25+
| Name | Type | Default | Description |
26+
|:-----|:-----|:--------|:------------|
27+
| <span class="prop-name">action</span> | <span class="prop-type">node</span> | | The action to display. It renders after the message, at the end of the alert. |
28+
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the component. |
29+
| <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. |
30+
| <span class="prop-name">closeText</span> | <span class="prop-type">string</span> | <span class="prop-default">'Close'</span> | Override the default label for the *close popup* icon button.<br>For localization purposes, you can use the provided [translations](/guides/localization/). |
31+
| <span class="prop-name">color</span> | <span class="prop-type">'error'<br>&#124;&nbsp;'info'<br>&#124;&nbsp;'success'<br>&#124;&nbsp;'warning'</span> | | The main color for the alert. Unless provided, the value is taken from the `severity` prop. |
32+
| <span class="prop-name">icon</span> | <span class="prop-type">node</span> | | Override the icon displayed before the children. Unless provided, the icon is mapped to the value of the `severity` prop. |
33+
| <span class="prop-name">iconMapping</span> | <span class="prop-type">{ error?: node, info?: node, success?: node, warning?: node }</span> | <span class="prop-default">{ success: &lt;SuccessOutlinedIcon fontSize="inherit" />, warning: &lt;ReportProblemOutlinedIcon fontSize="inherit" />, error: &lt;ErrorOutlineIcon fontSize="inherit" />, info: &lt;InfoOutlinedIcon fontSize="inherit" />,}</span> | The component maps the `severity` prop to a range of different icons, for instance success to `<SuccessOutlined>`. If you wish to change this mapping, you can provide your own. Alternatively, you can use the `icon` prop to override the icon displayed. |
34+
| <span class="prop-name">onClose</span> | <span class="prop-type">func</span> | | Callback fired when the component requests to be closed. When provided and no `action` prop is set, a close icon button is displayed that triggers the callback when clicked.<br><br>**Signature:**<br>`function(event: object) => void`<br>*event:* The event source of the callback. |
35+
| <span class="prop-name">role</span> | <span class="prop-type">string</span> | <span class="prop-default">'alert'</span> | The ARIA role attribute of the element. |
36+
| <span class="prop-name">severity</span> | <span class="prop-type">'error'<br>&#124;&nbsp;'info'<br>&#124;&nbsp;'success'<br>&#124;&nbsp;'warning'</span> | <span class="prop-default">'success'</span> | The severity of the alert. This defines the color and icon used. |
37+
| <span class="prop-name">variant</span> | <span class="prop-type">'filled'<br>&#124;&nbsp;'outlined'<br>&#124;&nbsp;'standard'</span> | <span class="prop-default">'standard'</span> | The variant to use. |
38+
39+
The `ref` is forwarded to the root element.
40+
41+
Any other props supplied will be provided to the root element ([Paper](/api/paper/)).
42+
43+
## CSS
44+
45+
- Style sheet name: `MuiAlert`.
46+
- Style sheet details:
47+
48+
| Rule name | Global class | Description |
49+
|:-----|:-------------|:------------|
50+
| <span class="prop-name">root</span> | <span class="prop-name">.MuiAlert-root</span> | Styles applied to the root element.
51+
| <span class="prop-name">standardSuccess</span> | <span class="prop-name">.MuiAlert-standardSuccess</span> | Styles applied to the root element if `variant="standard"` and `color="success"`.
52+
| <span class="prop-name">standardInfo</span> | <span class="prop-name">.MuiAlert-standardInfo</span> | Styles applied to the root element if `variant="standard"` and `color="info"`.
53+
| <span class="prop-name">standardWarning</span> | <span class="prop-name">.MuiAlert-standardWarning</span> | Styles applied to the root element if `variant="standard"` and `color="warning"`.
54+
| <span class="prop-name">standardError</span> | <span class="prop-name">.MuiAlert-standardError</span> | Styles applied to the root element if `variant="standard"` and `color="error"`.
55+
| <span class="prop-name">outlinedSuccess</span> | <span class="prop-name">.MuiAlert-outlinedSuccess</span> | Styles applied to the root element if `variant="outlined"` and `color="success"`.
56+
| <span class="prop-name">outlinedInfo</span> | <span class="prop-name">.MuiAlert-outlinedInfo</span> | Styles applied to the root element if `variant="outlined"` and `color="info"`.
57+
| <span class="prop-name">outlinedWarning</span> | <span class="prop-name">.MuiAlert-outlinedWarning</span> | Styles applied to the root element if `variant="outlined"` and `color="warning"`.
58+
| <span class="prop-name">outlinedError</span> | <span class="prop-name">.MuiAlert-outlinedError</span> | Styles applied to the root element if `variant="outlined"` and `color="error"`.
59+
| <span class="prop-name">filledSuccess</span> | <span class="prop-name">.MuiAlert-filledSuccess</span> | Styles applied to the root element if `variant="filled"` and `color="success"`.
60+
| <span class="prop-name">filledInfo</span> | <span class="prop-name">.MuiAlert-filledInfo</span> | Styles applied to the root element if `variant="filled"` and `color="info"`.
61+
| <span class="prop-name">filledWarning</span> | <span class="prop-name">.MuiAlert-filledWarning</span> | Styles applied to the root element if `variant="filled"` and `color="warning"`.
62+
| <span class="prop-name">filledError</span> | <span class="prop-name">.MuiAlert-filledError</span> | Styles applied to the root element if `variant="filled"` and `color="error"`.
63+
| <span class="prop-name">icon</span> | <span class="prop-name">.MuiAlert-icon</span> | Styles applied to the icon wrapper element.
64+
| <span class="prop-name">message</span> | <span class="prop-name">.MuiAlert-message</span> | Styles applied to the message wrapper element.
65+
| <span class="prop-name">action</span> | <span class="prop-name">.MuiAlert-action</span> | Styles applied to the action wrapper element if `action` is provided.
66+
67+
You can override the style of the component thanks to one of these customization points:
68+
69+
- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes).
70+
- With a [global class name](/customization/components/#overriding-styles-with-global-class-names).
71+
- With a theme and an [`overrides` property](/customization/globals/#css).
72+
73+
If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui-lab/src/Alert/Alert.js) for more detail.
74+
75+
## Inheritance
76+
77+
The props of the [Paper](/api/paper/) component are also available.
78+
You can take advantage of this behavior to [target nested components](/guides/api/#spread).
79+
80+
## Demos
81+
82+
- [Alert](/components/alert/)
83+

docs/pages/api/snackbar-content.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
2424

2525
| Name | Type | Default | Description |
2626
|:-----|:-----|:--------|:------------|
27-
| <span class="prop-name">action</span> | <span class="prop-type">node</span> | | The action to display. |
27+
| <span class="prop-name">action</span> | <span class="prop-type">node</span> | | The action to display. It renders after the message, at the end of the snackbar. |
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. |
2929
| <span class="prop-name">message</span> | <span class="prop-type">node</span> | | The message to display. |
30-
| <span class="prop-name">role</span> | <span class="prop-type">'alert'<br>&#124;&nbsp;'alertdialog'</span> | <span class="prop-default">'alert'</span> | The role of the SnackbarContent. If the Snackbar requires focus to be closed, the `alertdialog` role should be used instead. |
30+
| <span class="prop-name">role</span> | <span class="prop-type">string</span> | <span class="prop-default">'alert'</span> | The ARIA role attribute of the element. |
3131

3232
The `ref` is forwarded to the root element.
3333

docs/pages/api/snackbar.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
2424

2525
| Name | Type | Default | Description |
2626
|:-----|:-----|:--------|:------------|
27-
| <span class="prop-name">action</span> | <span class="prop-type">node</span> | | The action to display. |
27+
| <span class="prop-name">action</span> | <span class="prop-type">node</span> | | The action to display. It renders after the message, at the end of the snackbar. |
2828
| <span class="prop-name">anchorOrigin</span> | <span class="prop-type">{ horizontal: 'left'<br>&#124;&nbsp;'center'<br>&#124;&nbsp;'right', vertical: 'top'<br>&#124;&nbsp;'bottom' }</span> | <span class="prop-default">{ vertical: 'bottom', horizontal: 'center' }</span> | The anchor of the `Snackbar`. |
29-
| <span class="prop-name">autoHideDuration</span> | <span class="prop-type">number</span> | | The number of milliseconds to wait before automatically calling the `onClose` function. `onClose` should then set the state of the `open` prop to hide the Snackbar. This behavior is disabled by default with the `null` value. |
29+
| <span class="prop-name">autoHideDuration</span> | <span class="prop-type">number</span> | <span class="prop-default">null</span> | The number of milliseconds to wait before automatically calling the `onClose` function. `onClose` should then set the state of the `open` prop to hide the Snackbar. This behavior is disabled by default with the `null` value. |
3030
| <span class="prop-name">children</span> | <span class="prop-type">element</span> | | Replace the `SnackbarContent` component. |
3131
| <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. |
3232
| <span class="prop-name">ClickAwayListenerProps</span> | <span class="prop-type">object</span> | | Props applied to the `ClickAwayListener` element. |

docs/pages/api/typography.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
3434
| <span class="prop-name">noWrap</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.<br>Note that text overflow can only happen with block or inline-block level elements (the element needs to have a width in order to overflow). |
3535
| <span class="prop-name">paragraph</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the text will have a bottom margin. |
3636
| <span class="prop-name">variant</span> | <span class="prop-type">'h1'<br>&#124;&nbsp;'h2'<br>&#124;&nbsp;'h3'<br>&#124;&nbsp;'h4'<br>&#124;&nbsp;'h5'<br>&#124;&nbsp;'h6'<br>&#124;&nbsp;'subtitle1'<br>&#124;&nbsp;'subtitle2'<br>&#124;&nbsp;'body1'<br>&#124;&nbsp;'body2'<br>&#124;&nbsp;'caption'<br>&#124;&nbsp;'button'<br>&#124;&nbsp;'overline'<br>&#124;&nbsp;'srOnly'<br>&#124;&nbsp;'inherit'</span> | <span class="prop-default">'body1'</span> | Applies the theme typography styles. |
37-
| <span class="prop-name">variantMapping</span> | <span class="prop-type">object</span> | <span class="prop-default">{ h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h4', h5: 'h5', h6: 'h6', subtitle1: 'h6', subtitle2: 'h6', body1: 'p', body2: 'p',}</span> | We are empirically mapping the variant prop to a range of different DOM element types. For instance, subtitle1 to `<h6>`. If you wish to change that mapping, you can provide your own. Alternatively, you can use the `component` prop. |
37+
| <span class="prop-name">variantMapping</span> | <span class="prop-type">object</span> | <span class="prop-default">{ h1: 'h1', h2: 'h2', h3: 'h3', h4: 'h4', h5: 'h5', h6: 'h6', subtitle1: 'h6', subtitle2: 'h6', body1: 'p', body2: 'p',}</span> | The component maps the variant prop to a range of different DOM element types. For instance, subtitle1 to `<h6>`. If you wish to change that mapping, you can provide your own. Alternatively, you can use the `component` prop. |
3838

3939
The `ref` is forwarded to the root element.
4040

docs/pages/components/alert.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
3+
4+
const req = require.context('docs/src/pages/components/alert', false, /\.(md|js|tsx)$/);
5+
const reqSource = require.context(
6+
'!raw-loader!../../src/pages/components/alert',
7+
false,
8+
/\.(js|tsx)$/,
9+
);
10+
const reqPrefix = 'pages/components/alert';
11+
12+
export default function Page() {
13+
return <MarkdownDocs req={req} reqSource={reqSource} reqPrefix={reqPrefix} />;
14+
}

docs/src/modules/components/EditPage.js

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import { useSelector } from 'react-redux';
4-
import { Router, useRouter } from 'next/router';
54
import Button from '@material-ui/core/Button';
6-
import { pathnameToLanguage } from 'docs/src/modules/utils/helpers';
75
import { SOURCE_CODE_ROOT_URL } from 'docs/src/modules/constants';
86

97
export default function EditPage(props) {
108
const { markdownLocation } = props;
119
const t = useSelector(state => state.options.t);
1210
const userLanguage = useSelector(state => state.options.userLanguage);
13-
const router = useRouter();
11+
const LOCALES = { zh: 'zh-CN', pt: 'pt-BR', es: 'es-ES' };
12+
const CROWDIN_ROOT_URL = 'https://translate.material-ui.com/project/material-ui-docs/';
13+
const crowdInLocale = LOCALES[userLanguage] || userLanguage;
14+
const crowdInPath = markdownLocation.substring(0, markdownLocation.lastIndexOf('/'));
1415

1516
return (
1617
<Button
17-
component={userLanguage === 'en' ? 'a' : 'button'}
18-
onClick={() => {
19-
if (userLanguage === 'en') {
20-
return;
21-
}
22-
23-
const { canonical } = pathnameToLanguage(Router._rewriteUrlForNextExport(router.asPath));
24-
window.location = `/aa${canonical}`;
25-
}}
26-
href={userLanguage === 'en' ? `${SOURCE_CODE_ROOT_URL}${markdownLocation}` : null}
18+
component="a"
19+
href={
20+
userLanguage === 'en'
21+
? `${SOURCE_CODE_ROOT_URL}${markdownLocation}`
22+
: `${CROWDIN_ROOT_URL}${crowdInLocale}#/staging${crowdInPath}`
23+
}
2724
target="_blank"
2825
rel="noopener nofollow"
2926
size="small"

docs/src/modules/components/Head.js

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ export default function Head(props) {
1212

1313
return (
1414
<NextHead>
15+
{/* Use minimum-scale=1 to enable GPU rasterization. */}
16+
<meta
17+
name="viewport"
18+
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
19+
/>
1520
<title>{title}</title>
1621
<meta name="description" content={description} />
1722
{/* Twitter */}

0 commit comments

Comments
 (0)