Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Dec 14, 2019
1 parent 46641e6 commit 6446233
Show file tree
Hide file tree
Showing 14 changed files with 231 additions and 64 deletions.
53 changes: 53 additions & 0 deletions docs/src/pages/components/cards/OutlinedCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from 'react';
import { makeStyles } 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 Button from '@material-ui/core/Button';
import Typography from '@material-ui/core/Typography';

const useStyles = makeStyles({
card: {
minWidth: 275,
},
bullet: {
display: 'inline-block',
margin: '0 2px',
transform: 'scale(0.8)',
},
title: {
fontSize: 14,
},
pos: {
marginBottom: 12,
},
});

export default function OutlinedCard() {
const classes = useStyles();
const bull = <span className={classes.bullet}></span>;

return (
<Card className={classes.card} variant="outlined">
<CardContent>
<Typography className={classes.title} color="textSecondary" gutterBottom>
Word of the Day
</Typography>
<Typography variant="h5" component="h2">
be{bull}nev{bull}o{bull}lent
</Typography>
<Typography className={classes.pos} color="textSecondary">
adjective
</Typography>
<Typography variant="body2" component="p">
well meaning and kindly.
<br />
{'"a benevolent smile"'}
</Typography>
</CardContent>
<CardActions>
<Button size="small">Learn More</Button>
</CardActions>
</Card>
);
}
53 changes: 53 additions & 0 deletions docs/src/pages/components/cards/OutlinedCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from 'react';
import { makeStyles } 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 Button from '@material-ui/core/Button';
import Typography from '@material-ui/core/Typography';

const useStyles = makeStyles({
card: {
minWidth: 275,
},
bullet: {
display: 'inline-block',
margin: '0 2px',
transform: 'scale(0.8)',
},
title: {
fontSize: 14,
},
pos: {
marginBottom: 12,
},
});

export default function OutlinedCard() {
const classes = useStyles();
const bull = <span className={classes.bullet}></span>;

return (
<Card className={classes.card} variant="outlined">
<CardContent>
<Typography className={classes.title} color="textSecondary" gutterBottom>
Word of the Day
</Typography>
<Typography variant="h5" component="h2">
be{bull}nev{bull}o{bull}lent
</Typography>
<Typography className={classes.pos} color="textSecondary">
adjective
</Typography>
<Typography variant="body2" component="p">
well meaning and kindly.
<br />
{'"a benevolent smile"'}
</Typography>
</CardContent>
<CardActions>
<Button size="small">Learn More</Button>
</CardActions>
</Card>
);
}
6 changes: 1 addition & 5 deletions docs/src/pages/components/cards/SimpleCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ export default function SimpleCard() {
Word of the Day
</Typography>
<Typography variant="h5" component="h2">
be
{bull}
nev
{bull}o{bull}
lent
be{bull}nev{bull}o{bull}lent
</Typography>
<Typography className={classes.pos} color="textSecondary">
adjective
Expand Down
6 changes: 1 addition & 5 deletions docs/src/pages/components/cards/SimpleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ export default function SimpleCard() {
Word of the Day
</Typography>
<Typography variant="h5" component="h2">
be
{bull}
nev
{bull}o{bull}
lent
be{bull}nev{bull}o{bull}lent
</Typography>
<Typography className={classes.pos} color="textSecondary">
adjective
Expand Down
6 changes: 6 additions & 0 deletions docs/src/pages/components/cards/cards.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ Although cards can support multiple actions, UI controls, and an overflow menu,

{{"demo": "pages/components/cards/SimpleCard.js", "bg": true}}

### Outlined Card

Set `variant="outlined` to render an outlined card.

{{"demo": "pages/components/cards/OutlinedCard.js", "bg": true}}

## Complex Interaction

On desktop, card content can expand.
Expand Down
25 changes: 0 additions & 25 deletions docs/src/pages/components/paper/PaperSheet.js

This file was deleted.

27 changes: 0 additions & 27 deletions docs/src/pages/components/paper/PaperSheet.tsx

This file was deleted.

26 changes: 26 additions & 0 deletions docs/src/pages/components/paper/SimplePaper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';

const useStyles = makeStyles(theme => ({
root: {
display: 'flex',
'& > *': {
margin: theme.spacing(1),
width: theme.spacing(16),
height: theme.spacing(16),
},
},
}));

export default function SimplePaper() {
const classes = useStyles();

return (
<div className={classes.root}>
<Paper elevation={0} />
<Paper />
<Paper elevation={3} />
</div>
);
}
28 changes: 28 additions & 0 deletions docs/src/pages/components/paper/SimplePaper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import { Theme, createStyles, makeStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
display: 'flex',
'& > *': {
margin: theme.spacing(1),
width: theme.spacing(16),
height: theme.spacing(16),
},
},
}),
);

export default function SimplePaper() {
const classes = useStyles();

return (
<div className={classes.root}>
<Paper elevation={0} />
<Paper />
<Paper elevation={3} />
</div>
);
}
25 changes: 25 additions & 0 deletions docs/src/pages/components/paper/Variants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';

const useStyles = makeStyles(theme => ({
root: {
display: 'flex',
'& > *': {
margin: theme.spacing(1),
width: theme.spacing(16),
height: theme.spacing(16),
},
},
}));

export default function Variants() {
const classes = useStyles();

return (
<div className={classes.root}>
<Paper variant="outlined" />
<Paper variant="outlined" square />
</div>
);
}
27 changes: 27 additions & 0 deletions docs/src/pages/components/paper/Variants.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import { Theme, createStyles, makeStyles } from '@material-ui/core/styles';
import Paper from '@material-ui/core/Paper';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
display: 'flex',
'& > *': {
margin: theme.spacing(1),
width: theme.spacing(16),
height: theme.spacing(16),
},
},
}),
);

export default function Variants() {
const classes = useStyles();

return (
<div className={classes.root}>
<Paper variant="outlined" />
<Paper variant="outlined" square />
</div>
);
}
8 changes: 7 additions & 1 deletion docs/src/pages/components/paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@ components: Paper

The background of an application resembles the flat, opaque texture of a sheet of paper, and an application’s behavior mimics paper’s ability to be re-sized, shuffled, and bound together in multiple sheets.

{{"demo": "pages/components/paper/PaperSheet.js", "bg": true}}
{{"demo": "pages/components/paper/SimplePaper.js", "bg": true}}

## Variants

If you need an outlined surface, use the `variant` prop.

{{"demo": "pages/components/paper/Variants.js", "bg": "inline"}}
3 changes: 3 additions & 0 deletions docs/src/pages/system/shadows/shadows.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

## Example

The helpers allow you to control relative depth, or distance, between two surfaces along the z-axis.
By default, there is 25 elevation levels.

{{"demo": "pages/system/shadows/Demo.js", "defaultCodeOpen": false, "bg": true}}

```jsx
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/Snackbar/Snackbar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import describeConformance from '../test-utils/describeConformance';
import Snackbar from './Snackbar';
import Grow from '../Grow';

describe.only('<Snackbar />', () => {
describe('<Snackbar />', () => {
let mount;
let classes;
const render = createClientRender({ strict: false });
Expand Down

0 comments on commit 6446233

Please sign in to comment.