From 6446233a366bd94cde9630d7d48391d23316d58d Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sat, 14 Dec 2019 13:59:16 +0100 Subject: [PATCH] update docs --- .../pages/components/cards/OutlinedCard.js | 53 +++++++++++++++++++ .../pages/components/cards/OutlinedCard.tsx | 53 +++++++++++++++++++ docs/src/pages/components/cards/SimpleCard.js | 6 +-- .../src/pages/components/cards/SimpleCard.tsx | 6 +-- docs/src/pages/components/cards/cards.md | 6 +++ docs/src/pages/components/paper/PaperSheet.js | 25 --------- .../src/pages/components/paper/PaperSheet.tsx | 27 ---------- .../src/pages/components/paper/SimplePaper.js | 26 +++++++++ .../pages/components/paper/SimplePaper.tsx | 28 ++++++++++ docs/src/pages/components/paper/Variants.js | 25 +++++++++ docs/src/pages/components/paper/Variants.tsx | 27 ++++++++++ docs/src/pages/components/paper/paper.md | 8 ++- docs/src/pages/system/shadows/shadows.md | 3 ++ .../material-ui/src/Snackbar/Snackbar.test.js | 2 +- 14 files changed, 231 insertions(+), 64 deletions(-) create mode 100644 docs/src/pages/components/cards/OutlinedCard.js create mode 100644 docs/src/pages/components/cards/OutlinedCard.tsx delete mode 100644 docs/src/pages/components/paper/PaperSheet.js delete mode 100644 docs/src/pages/components/paper/PaperSheet.tsx create mode 100644 docs/src/pages/components/paper/SimplePaper.js create mode 100644 docs/src/pages/components/paper/SimplePaper.tsx create mode 100644 docs/src/pages/components/paper/Variants.js create mode 100644 docs/src/pages/components/paper/Variants.tsx diff --git a/docs/src/pages/components/cards/OutlinedCard.js b/docs/src/pages/components/cards/OutlinedCard.js new file mode 100644 index 00000000000000..77855224dcaaf2 --- /dev/null +++ b/docs/src/pages/components/cards/OutlinedCard.js @@ -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 = ; + + return ( + + + + Word of the Day + + + be{bull}nev{bull}o{bull}lent + + + adjective + + + well meaning and kindly. +
+ {'"a benevolent smile"'} +
+
+ + + +
+ ); +} diff --git a/docs/src/pages/components/cards/OutlinedCard.tsx b/docs/src/pages/components/cards/OutlinedCard.tsx new file mode 100644 index 00000000000000..77855224dcaaf2 --- /dev/null +++ b/docs/src/pages/components/cards/OutlinedCard.tsx @@ -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 = ; + + return ( + + + + Word of the Day + + + be{bull}nev{bull}o{bull}lent + + + adjective + + + well meaning and kindly. +
+ {'"a benevolent smile"'} +
+
+ + + +
+ ); +} diff --git a/docs/src/pages/components/cards/SimpleCard.js b/docs/src/pages/components/cards/SimpleCard.js index 67e3d4d0f19c3b..20bedec76119e9 100644 --- a/docs/src/pages/components/cards/SimpleCard.js +++ b/docs/src/pages/components/cards/SimpleCard.js @@ -34,11 +34,7 @@ export default function SimpleCard() { Word of the Day - be - {bull} - nev - {bull}o{bull} - lent + be{bull}nev{bull}o{bull}lent adjective diff --git a/docs/src/pages/components/cards/SimpleCard.tsx b/docs/src/pages/components/cards/SimpleCard.tsx index 67e3d4d0f19c3b..20bedec76119e9 100644 --- a/docs/src/pages/components/cards/SimpleCard.tsx +++ b/docs/src/pages/components/cards/SimpleCard.tsx @@ -34,11 +34,7 @@ export default function SimpleCard() { Word of the Day - be - {bull} - nev - {bull}o{bull} - lent + be{bull}nev{bull}o{bull}lent adjective diff --git a/docs/src/pages/components/cards/cards.md b/docs/src/pages/components/cards/cards.md index 6db8353754af80..fc1e4bd428b697 100644 --- a/docs/src/pages/components/cards/cards.md +++ b/docs/src/pages/components/cards/cards.md @@ -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. diff --git a/docs/src/pages/components/paper/PaperSheet.js b/docs/src/pages/components/paper/PaperSheet.js deleted file mode 100644 index 8cb768be97aa17..00000000000000 --- a/docs/src/pages/components/paper/PaperSheet.js +++ /dev/null @@ -1,25 +0,0 @@ -import React from 'react'; -import { makeStyles } from '@material-ui/core/styles'; -import Paper from '@material-ui/core/Paper'; -import Typography from '@material-ui/core/Typography'; - -const useStyles = makeStyles(theme => ({ - root: { - padding: theme.spacing(3, 2), - }, -})); - -export default function PaperSheet() { - const classes = useStyles(); - - return ( - - - This is a sheet of paper. - - - Paper can be used to build surface or other elements for your application. - - - ); -} diff --git a/docs/src/pages/components/paper/PaperSheet.tsx b/docs/src/pages/components/paper/PaperSheet.tsx deleted file mode 100644 index 2efd7ae68e15c3..00000000000000 --- a/docs/src/pages/components/paper/PaperSheet.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import { Theme, createStyles, makeStyles } from '@material-ui/core/styles'; -import Paper from '@material-ui/core/Paper'; -import Typography from '@material-ui/core/Typography'; - -const useStyles = makeStyles((theme: Theme) => - createStyles({ - root: { - padding: theme.spacing(3, 2), - }, - }), -); - -export default function PaperSheet() { - const classes = useStyles(); - - return ( - - - This is a sheet of paper. - - - Paper can be used to build surface or other elements for your application. - - - ); -} diff --git a/docs/src/pages/components/paper/SimplePaper.js b/docs/src/pages/components/paper/SimplePaper.js new file mode 100644 index 00000000000000..5922fe21e2303c --- /dev/null +++ b/docs/src/pages/components/paper/SimplePaper.js @@ -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 ( +
+ + + +
+ ); +} diff --git a/docs/src/pages/components/paper/SimplePaper.tsx b/docs/src/pages/components/paper/SimplePaper.tsx new file mode 100644 index 00000000000000..e917cad2f8b8f8 --- /dev/null +++ b/docs/src/pages/components/paper/SimplePaper.tsx @@ -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 ( +
+ + + +
+ ); +} diff --git a/docs/src/pages/components/paper/Variants.js b/docs/src/pages/components/paper/Variants.js new file mode 100644 index 00000000000000..e74f8722746f59 --- /dev/null +++ b/docs/src/pages/components/paper/Variants.js @@ -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 ( +
+ + +
+ ); +} diff --git a/docs/src/pages/components/paper/Variants.tsx b/docs/src/pages/components/paper/Variants.tsx new file mode 100644 index 00000000000000..f1adabc2a93487 --- /dev/null +++ b/docs/src/pages/components/paper/Variants.tsx @@ -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 ( +
+ + +
+ ); +} diff --git a/docs/src/pages/components/paper/paper.md b/docs/src/pages/components/paper/paper.md index 2a7f189101707e..b9fb849005245e 100644 --- a/docs/src/pages/components/paper/paper.md +++ b/docs/src/pages/components/paper/paper.md @@ -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"}} diff --git a/docs/src/pages/system/shadows/shadows.md b/docs/src/pages/system/shadows/shadows.md index 4e7709bc70ee45..cc5675cb69cf00 100644 --- a/docs/src/pages/system/shadows/shadows.md +++ b/docs/src/pages/system/shadows/shadows.md @@ -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 diff --git a/packages/material-ui/src/Snackbar/Snackbar.test.js b/packages/material-ui/src/Snackbar/Snackbar.test.js index 0866dcda7e75fb..a5c276015e79ed 100644 --- a/packages/material-ui/src/Snackbar/Snackbar.test.js +++ b/packages/material-ui/src/Snackbar/Snackbar.test.js @@ -7,7 +7,7 @@ import describeConformance from '../test-utils/describeConformance'; import Snackbar from './Snackbar'; import Grow from '../Grow'; -describe.only('', () => { +describe('', () => { let mount; let classes; const render = createClientRender({ strict: false });