Skip to content

Commit

Permalink
Matt review
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Nov 17, 2019
1 parent 12342e4 commit 459f8f5
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 45 deletions.
43 changes: 28 additions & 15 deletions docs/src/modules/components/Demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,32 @@ const styles = theme => ({
},
},
demo: {
position: 'relative',
outline: 0,
margin: 'auto',
borderRadius: theme.shape.borderRadius,
display: 'flex',
justifyContent: 'center',
border: `1px solid ${fade(theme.palette.action.active, 0.12)}`,
padding: 20,
[theme.breakpoints.up('sm')]: {
padding: theme.spacing(3),
borderRadius: theme.shape.borderRadius,
},
backgroundColor: theme.palette.background.level2,
padding: theme.spacing(2),
'& $demoInner': {
border: `1px solid ${fade(theme.palette.action.active, 0.12)}`,
borderRadius: theme.shape.borderRadius,
backgroundColor: theme.palette.background.paper,
},
},
demoBg: {
border: 'none',
backgroundColor: theme.palette.background.level2,
'& $demoInner': {
border: 'none',
borderRadius: 0,
backgroundColor: 'transparent',
padding: 0,
},
},
demoInner: {
position: 'relative',
display: 'flex',
justifyContent: 'center',
padding: theme.spacing(2),
},
demoHiddenHeader: {
paddingTop: theme.spacing(2),
Expand Down Expand Up @@ -298,12 +309,14 @@ function Demo(props) {
onMouseEnter={handleDemoHover}
onMouseLeave={handleDemoHover}
>
<DemoSandboxed
style={demoSandboxedStyle}
component={DemoComponent}
iframe={demoOptions.iframe}
name={demoName}
/>
<div className={classes.demoInner}>
<DemoSandboxed
style={demoSandboxedStyle}
component={DemoComponent}
iframe={demoOptions.iframe}
name={demoName}
/>
</div>
</div>
<div className={classes.anchorLink} id={`${demoName}.js`} />
<div className={classes.anchorLink} id={`${demoName}.tsx`} />
Expand Down
4 changes: 2 additions & 2 deletions docs/src/modules/components/DemoSandboxed.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Frame from 'react-frame-component';
import DemoErrorBoundary from 'docs/src/modules/components/DemoErrorBoundary';

const styles = theme => ({
root: {
frame: {
backgroundColor: theme.palette.background.default,
flexGrow: 1,
height: 400,
Expand Down Expand Up @@ -54,7 +54,7 @@ function DemoFrame(props) {
<NoSsr>
<Frame
ref={handleRef}
className={classes.root}
className={classes.frame}
contentDidMount={onContentDidMount}
contentDidUpdate={onContentDidUpdate}
{...other}
Expand Down
12 changes: 6 additions & 6 deletions docs/src/pages/components/app-bar/app-bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,33 @@ It can transform into a contextual action bar or be used as a navbar.

## Simple App Bar

{{"demo": "pages/components/app-bar/ButtonAppBar.js"}}
{{"demo": "pages/components/app-bar/ButtonAppBar.js", "bg": true}}

## App Bar with a primary search field

A primary searchbar.

{{"demo": "pages/components/app-bar/PrimarySearchAppBar.js"}}
{{"demo": "pages/components/app-bar/PrimarySearchAppBar.js", "bg": true}}

## App Bar with menu

{{"demo": "pages/components/app-bar/MenuAppBar.js"}}
{{"demo": "pages/components/app-bar/MenuAppBar.js", "bg": true}}

## App Bar with search field

A side searchbar.

{{"demo": "pages/components/app-bar/SearchAppBar.js"}}
{{"demo": "pages/components/app-bar/SearchAppBar.js", "bg": true}}

## Dense (desktop only)

{{"demo": "pages/components/app-bar/DenseAppBar.js"}}
{{"demo": "pages/components/app-bar/DenseAppBar.js", "bg": true}}

## Prominent

A prominent app bar.

{{"demo": "pages/components/app-bar/ProminentAppBar.js"}}
{{"demo": "pages/components/app-bar/ProminentAppBar.js", "bg": true}}

## Bottom App Bar

Expand Down
6 changes: 2 additions & 4 deletions docs/src/pages/components/click-away-listener/ClickAway.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const useStyles = makeStyles(theme => ({
wrapper: {
position: 'relative',
},
paper: {
div: {
position: 'absolute',
top: 28,
right: 0,
Expand Down Expand Up @@ -36,9 +36,7 @@ export default function ClickAway() {
Open menu dropdown
</button>
{open ? (
<div className={classes.paper}>
Click me, I will stay visible until you click outside.
</div>
<div className={classes.div}>Click me, I will stay visible until you click outside.</div>
) : null}
</div>
</ClickAwayListener>
Expand Down
6 changes: 2 additions & 4 deletions docs/src/pages/components/click-away-listener/ClickAway.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const useStyles = makeStyles((theme: Theme) =>
wrapper: {
position: 'relative',
},
paper: {
div: {
position: 'absolute',
top: 28,
right: 0,
Expand Down Expand Up @@ -38,9 +38,7 @@ export default function ClickAway() {
Open menu dropdown
</button>
{open ? (
<div className={classes.paper}>
Click me, I will stay visible until you click outside.
</div>
<div className={classes.div}>Click me, I will stay visible until you click outside.</div>
) : null}
</div>
</ClickAwayListener>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/modal/modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Alternatively, you can use [react-spring](https://github.com/react-spring/react-
React [doesn't support](https://github.com/facebook/react/issues/13097) the [`createPortal()`](https://reactjs.org/docs/portals.html) API on the server.
In order to display the modal, you need to disable the portal feature with the `disablePortal` prop:

{{"demo": "pages/components/modal/ServerModal.js"}}
{{"demo": "pages/components/modal/ServerModal.js", "bg": true}}

## Accessibility

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/components/text-fields/text-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ It supports standard, outlined and filled styling.

{{"demo": "pages/components/text-fields/BasicTextFields.js"}}

> **Note:** The standard variant of the `TextField` is no longer documented in the [Material Design guidelines](https://material.io/), but Material-UI will continue to support it.
Note: The standard variant of the `TextField` is no longer documented in the [Material Design guidelines](https://material.io/), but Material-UI will continue to support it.

## Form props

Expand Down
12 changes: 6 additions & 6 deletions docs/src/pages/components/tree-view/tree-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ Tree views can be used to represent a file system navigator displaying folders a

{{"demo": "pages/components/tree-view/FileSystemNavigator.js"}}

## Controlled

The tree view also offers a controlled API.

{{"demo": "pages/components/tree-view/ControlledTreeView.js"}}

## Customized tree view

### Custom icons, border and animation
Expand All @@ -21,12 +27,6 @@ Tree views can be used to represent a file system navigator displaying folders a

{{"demo": "pages/components/tree-view/GmailTreeView.js"}}

## Controlled

The tree view also offers a controlled API.

{{"demo": "pages/components/tree-view/ControlledTreeView.js"}}

## Accessibility

(WAI-ARIA: https://www.w3.org/TR/wai-aria-practices/#TreeView)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/styles/basics/NestedStylesHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { makeStyles } from '@material-ui/core/styles';

const useStyles = makeStyles({
root: {
padding: 16,
color: 'red',
'& p': {
margin: 0,
color: 'green',
'& span': {
color: 'blue',
Expand All @@ -19,7 +19,7 @@ export default function NestedStylesHook() {

return (
<div className={classes.root}>
This is red since it is inside the paper.
This is red since it is inside the root.
<p>
This is green since it is inside the paragraph{' '}
<span>and this is blue since it is inside the span</span>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/styles/basics/NestedStylesHook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { makeStyles } from '@material-ui/core/styles';

const useStyles = makeStyles({
root: {
padding: 16,
color: 'red',
'& p': {
margin: 0,
color: 'green',
'& span': {
color: 'blue',
Expand All @@ -19,7 +19,7 @@ export default function NestedStylesHook() {

return (
<div className={classes.root}>
This is red since it is inside the paper.
This is red since it is inside the root.
<p>
This is green since it is inside the paragraph{' '}
<span>and this is blue since it is inside the span</span>
Expand Down
3 changes: 1 addition & 2 deletions docs/src/pages/styles/basics/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ The following example uses the Hook API, but it works the same way with the othe
```js
const useStyles = makeStyles({
root: {
padding: 16,
color: 'red',
'& p': {
color: 'green',
Expand All @@ -144,7 +143,7 @@ const useStyles = makeStyles({
});
```

{{"demo": "pages/styles/basics/NestedStylesHook.js"}}
{{"demo": "pages/styles/basics/NestedStylesHook.js", "defaultCodeOpen": false}}

## Adapting based on props

Expand Down

0 comments on commit 459f8f5

Please sign in to comment.