Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mui/material-ui
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2d76f9108970fe740271d758218bc0b507df04db
Choose a base ref
..
head repository: mui/material-ui
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c3d47a2b39c64f687a1ff5cdb6db3a9dd398fac0
Choose a head ref
Showing with 2,452 additions and 119 deletions.
  1. +1 −1 .size-limit.js
  2. +1 −1 docs/src/modules/components/AppDrawer.js
  3. +3 −3 docs/src/modules/components/AppFrame.js
  4. +1 −4 docs/src/modules/components/AppWrapper.js
  5. +50 −45 docs/src/modules/components/MarkdownDocs.js
  6. +4 −3 docs/src/modules/components/withRoot.js
  7. +120 −0 docs/src/pages/layouts/Layouts.js
  8. +152 −0 docs/src/pages/layouts/album/Album.js
  9. +19 −0 docs/src/pages/layouts/album/README.md
  10. +273 −0 docs/src/pages/layouts/blog/Blog.js
  11. +49 −0 docs/src/pages/layouts/blog/Markdown.js
  12. +21 −0 docs/src/pages/layouts/blog/README.md
  13. +53 −0 docs/src/pages/layouts/blog/blog-post.1.md
  14. +17 −0 docs/src/pages/layouts/blog/blog-post.2.md
  15. +17 −0 docs/src/pages/layouts/blog/blog-post.3.md
  16. +98 −0 docs/src/pages/layouts/checkout/AddressForm.js
  17. +163 −0 docs/src/pages/layouts/checkout/Checkout.js
  18. +44 −0 docs/src/pages/layouts/checkout/PaymentForm.js
  19. +21 −0 docs/src/pages/layouts/checkout/README.md
  20. +92 −0 docs/src/pages/layouts/checkout/Review.js
  21. +182 −0 docs/src/pages/layouts/dashboard/Dashboard.js
  22. +22 −0 docs/src/pages/layouts/dashboard/README.md
  23. +38 −0 docs/src/pages/layouts/dashboard/SimpleLineChart.js
  24. +74 −0 docs/src/pages/layouts/dashboard/SimpleTable.js
  25. +70 −0 docs/src/pages/layouts/dashboard/listItems.js
  26. +9 −0 docs/src/pages/layouts/layouts.md
  27. +213 −0 docs/src/pages/layouts/pricing/Pricing.js
  28. +19 −0 docs/src/pages/layouts/pricing/README.md
  29. +19 −0 docs/src/pages/layouts/sign-in/README.md
  30. +90 −0 docs/src/pages/layouts/sign-in/SignIn.js
  31. +2 −0 package.json
  32. +59 −56 pages/index.js
  33. +23 −0 pages/layouts.js
  34. +18 −0 pages/layouts/album.js
  35. +18 −0 pages/layouts/blog.js
  36. +18 −0 pages/layouts/checkout.js
  37. +18 −0 pages/layouts/dashboard.js
  38. +18 −0 pages/layouts/pricing.js
  39. +18 −0 pages/layouts/sign-in.js
  40. BIN static/images/layouts/album.png
  41. BIN static/images/layouts/blog.png
  42. BIN static/images/layouts/checkout.png
  43. BIN static/images/layouts/dashboard.png
  44. BIN static/images/layouts/pricing.png
  45. BIN static/images/layouts/sign-in.png
  46. BIN static/images/showcase/posters-galore.jpg
  47. BIN static/images/showcase/typekev.jpg
  48. +9 −0 test/regressions/index.js
  49. +316 −6 yarn.lock
2 changes: 1 addition & 1 deletion .size-limit.js
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ module.exports = [
name: 'The main bundle of the docs',
webpack: false,
path: getMainFile().path,
limit: '180 KB',
limit: '181 KB',
},
{
name: 'The home page of the docs',
2 changes: 1 addition & 1 deletion docs/src/modules/components/AppDrawer.js
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ function reduceChildRoutes({ props, activePage, items, page, depth }) {

if (page.children && page.children.length > 1) {
const title = pageToTitle(page);
const openImmediately = activePage.pathname.indexOf(page.pathname) === 0;
const openImmediately = activePage.pathname.indexOf(`${page.pathname}/`) === 0;

items.push(
<AppDrawerNavItem depth={depth} key={title} openImmediately={openImmediately} title={title}>
6 changes: 3 additions & 3 deletions docs/src/modules/components/AppFrame.js
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import IconButton from '@material-ui/core/IconButton';
import Tooltip from '@material-ui/core/Tooltip';
import CssBaseline from '@material-ui/core/CssBaseline';
import MenuIcon from '@material-ui/icons/Menu';
import ColorsIcon from '@material-ui/icons/InvertColors';
import LightbulbOutlineIcon from '@material-ui/docs/svgIcons/LightbulbOutline';
@@ -131,6 +132,7 @@ class AppFrame extends React.Component {
return (
<div className={classes.root}>
<NProgressBar />
<CssBaseline />
<AppBar className={appBarClassName}>
<Toolbar>
<IconButton
@@ -220,9 +222,7 @@ AppFrame.contextTypes = {
};

export default compose(
withStyles(styles, {
name: 'AppFrame',
}),
withStyles(styles),
connect(state => ({
uiTheme: state.theme,
})),
5 changes: 1 addition & 4 deletions docs/src/modules/components/AppWrapper.js
Original file line number Diff line number Diff line change
@@ -4,11 +4,9 @@ import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { MuiThemeProvider } from '@material-ui/core/styles';
import CssBaseline from '@material-ui/core/CssBaseline';
import JssProvider from 'react-jss/lib/JssProvider';
import { lightTheme, darkTheme, setPrismTheme } from '@material-ui/docs/MarkdownElement/prism';
import getPageContext, { updatePageContext } from 'docs/src/modules/styles/getPageContext';
import AppFrame from 'docs/src/modules/components/AppFrame';
import GoogleTag from 'docs/src/modules/components/GoogleTag';

// Inject the insertion-point-jss after docssearch
@@ -87,8 +85,7 @@ class AppWrapper extends React.Component {
generateClassName={pageContext.generateClassName}
>
<MuiThemeProvider theme={pageContext.theme} sheetsManager={pageContext.sheetsManager}>
<CssBaseline />
<AppFrame>{children}</AppFrame>
{children}
<GoogleTag />
</MuiThemeProvider>
</JssProvider>
95 changes: 50 additions & 45 deletions docs/src/modules/components/MarkdownDocs.js
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ import Head from 'docs/src/modules/components/Head';
import AppContent from 'docs/src/modules/components/AppContent';
import Demo from 'docs/src/modules/components/Demo';
import Carbon from 'docs/src/modules/components/Carbon';
import AppFrame from 'docs/src/modules/components/AppFrame';
import {
getHeaders,
getContents,
@@ -57,57 +58,61 @@ function MarkdownDocs(props, context) {
const section = markdownLocation.split('/')[4];

return (
<AppContent className={classes.root}>
<Head
title={`${headers.title || getTitle(markdown)} - Material-UI`}
description={getDescription(markdown)}
/>
<div className={classes.header}>
<Button component="a" href={`${SOURCE_CODE_ROOT_URL}${markdownLocation}`}>
{'Edit this page'}
</Button>
</div>
{disableCarbon ? null : <Carbon key={markdownLocation} />}
{contents.map((content, index) => {
const match = content.match(demoRegexp);

if (match && demos) {
const demoOptions = JSON.parse(`{${content}}`);

const name = demoOptions.demo;
warning(demos && demos[name], `Missing demo: ${name}.`);
<AppFrame>
<AppContent className={classes.root}>
<Head
title={`${headers.title || getTitle(markdown)} - Material-UI`}
description={getDescription(markdown)}
/>
<div className={classes.header}>
<Button component="a" href={`${SOURCE_CODE_ROOT_URL}${markdownLocation}`}>
{'Edit this page'}
</Button>
</div>
{disableCarbon ? null : <Carbon key={markdownLocation} />}
{contents.map((content, index) => {
const match = content.match(demoRegexp);

if (match && demos) {
const demoOptions = JSON.parse(`{${content}}`);

const name = demoOptions.demo;
warning(demos && demos[name], `Missing demo: ${name}.`);
return (
<Demo
key={content}
js={demos[name].js}
raw={demos[name].raw}
index={index}
demoOptions={demoOptions}
githubLocation={`${SOURCE_CODE_ROOT_URL}/docs/src/${name}`}
/>
);
}

return (
<Demo
key={content}
js={demos[name].js}
raw={demos[name].raw}
index={index}
demoOptions={demoOptions}
githubLocation={`${SOURCE_CODE_ROOT_URL}/docs/src/${name}`}
/>
<MarkdownElement className={classes.markdownElement} key={content} text={content} />
);
}

return <MarkdownElement className={classes.markdownElement} key={content} text={content} />;
})}
{headers.components.length > 0 ? (
<MarkdownElement
className={classes.markdownElement}
text={`
})}
{headers.components.length > 0 ? (
<MarkdownElement
className={classes.markdownElement}
text={`
## API
${headers.components
.map(
component =>
`- [&lt;${component} /&gt;](${section === 'lab' ? '/lab/api' : '/api'}/${kebabCase(
component,
)})`,
)
.join('\n')}
.map(
component =>
`- [&lt;${component} /&gt;](${
section === 'lab' ? '/lab/api' : '/api'
}/${kebabCase(component)})`,
)
.join('\n')}
`}
/>
) : null}
</AppContent>
/>
) : null}
</AppContent>
</AppFrame>
);
}

7 changes: 4 additions & 3 deletions docs/src/modules/components/withRoot.js
Original file line number Diff line number Diff line change
@@ -181,9 +181,11 @@ const pages = [
},
],
},
{
pathname: '/layouts',
},
{
pathname: '/premium-themes',
title: 'Premium Themes',
},
{
pathname: '/lab',
@@ -251,7 +253,7 @@ const pages = [
function findActivePage(currentPages, router) {
const activePage = find(currentPages, page => {
if (page.children) {
return router.pathname.indexOf(page.pathname) === 0;
return router.pathname.indexOf(`${page.pathname}/`) === 0;
}

// Should be an exact match if no children
@@ -298,7 +300,6 @@ function withRoot(Component) {

render() {
const { pageContext, ...other } = this.props;

return (
<React.StrictMode>
<Provider store={this.redux}>
120 changes: 120 additions & 0 deletions docs/src/pages/layouts/Layouts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Card from '@material-ui/core/Card';
import CardActions from '@material-ui/core/CardActions';
import CardContent from '@material-ui/core/CardContent';
import CardMedia from '@material-ui/core/CardMedia';
import Button from '@material-ui/core/Button';
import Grid from '@material-ui/core/Grid';
import Typography from '@material-ui/core/Typography';

const styles = {
item: {
flexGrow: 1,
},
card: {
height: '100%',
display: 'flex',
flexDirection: 'column',
flexGrow: 1,
},
cardContent: {
flexGrow: 1,
},
cardMedia: {
height: 0,
paddingTop: '65%',
},
};

const themes = [
{
name: 'Sign-in',
description: 'A simple sign-in page.',
src: '/static/images/layouts/sign-in.png',
href: '/layouts/sign-in',
source: 'https://github.com/mui-org/material-ui/tree/master/docs/src/pages/layouts/sign-in',
},
{
name: 'Album',
description: 'A reponsive album / gallery layout with a hero unit and footer.',
src: '/static/images/layouts/album.png',
href: '/layouts/album',
source: 'https://github.com/mui-org/material-ui/tree/master/docs/src/pages/layouts/album',
},
{
name: 'Blog',
description:
'A sophisticated blog layout. Markdown support is courtesy of react-markdown, ' +
'but is easily replaced.',
src: '/static/images/layouts/blog.png',
href: '/layouts/blog',
source: 'https://github.com/mui-org/material-ui/tree/master/docs/src/pages/layouts/blog',
},
{
name: 'Pricing',
description:
'Quickly build an effective pricing table for your potential customers with this layout.',
src: '/static/images/layouts/pricing.png',
href: '/layouts/pricing',
source: 'https://github.com/mui-org/material-ui/tree/master/docs/src/pages/layouts/pricing',
},
{
name: 'Checkout',
description:
'A step-by-step checkout page layout. ' +
'Adapt the number of steps to suit your needs, or make steps optional.',
src: '/static/images/layouts/checkout.png',
href: '/layouts/checkout',
source: 'https://github.com/mui-org/material-ui/tree/master/docs/src/pages/layouts/checkout',
},
{
name: 'Dashboard',
description:
'A minimal dasboard with taskbar and mini variant draw. ' +
'The chart is courtesy of Recharts, but it is simple to substitute an alternative.',
src: '/static/images/layouts/dashboard.png',
href: '/layouts/dashboard',
source: 'https://github.com/mui-org/material-ui/tree/master/docs/src/pages/layouts/dashboard',
},
];

function Layouts(props) {
const { classes } = props;
return (
<Grid container spacing={16}>
{themes.map(theme => (
<Grid item sm={6} md={4} className={classes.item} key={theme.name}>
<Card className={classes.card}>
<CardMedia
component="a"
href={theme.href}
className={classes.cardMedia}
image={theme.src}
title={theme.name}
target="_blank"
/>
<CardContent className={classes.cardContent}>
<Typography gutterBottom variant="headline" align="left" component="h2">
{theme.name}
</Typography>
<Typography component="p">{theme.description}</Typography>
</CardContent>
<CardActions>
<Button component="a" href={theme.source} size="small" color="primary">
Source code
</Button>
</CardActions>
</Card>
</Grid>
))}
</Grid>
);
}

Layouts.propTypes = {
classes: PropTypes.object.isRequired,
};

export default withStyles(styles)(Layouts);
Loading