Skip to content

Commit

Permalink
[CircularProgress] Add static variant
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Feb 10, 2018
1 parent 938ac5f commit 10da9ba
Show file tree
Hide file tree
Showing 31 changed files with 212 additions and 195 deletions.
2 changes: 1 addition & 1 deletion docs/src/pages/demos/app-bar/ButtonAppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import MenuIcon from 'material-ui-icons/Menu';

const styles = {
root: {
width: '100%',
flexGrow: 1,
},
flex: {
flex: 1,
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/app-bar/MenuAppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Menu, { MenuItem } from 'material-ui/Menu';

const styles = {
root: {
width: '100%',
flexGrow: 1,
},
flex: {
flex: 1,
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/app-bar/SimpleAppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Typography from 'material-ui/Typography';

const styles = {
root: {
width: '100%',
flexGrow: 1,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ExpandMoreIcon from 'material-ui-icons/ExpandMore';

const styles = theme => ({
root: {
width: '100%',
flexGrow: 1,
},
heading: {
fontSize: theme.typography.pxToRem(15),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Divider from 'material-ui/Divider';

const styles = theme => ({
root: {
width: '100%',
flexGrow: 1,
},
heading: {
fontSize: theme.typography.pxToRem(15),
Expand All @@ -33,7 +33,7 @@ const styles = theme => ({
alignItems: 'center',
},
column: {
flexBasis: '33.3%',
flexBasis: '33.33%',
},
helper: {
borderLeft: `2px solid ${theme.palette.divider}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ExpandMoreIcon from 'material-ui-icons/ExpandMore';

const styles = theme => ({
root: {
width: '100%',
flexGrow: 1,
},
heading: {
fontSize: theme.typography.pxToRem(15),
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/progress/CircularDeterminate.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CircularProgress } from 'material-ui/Progress';

const styles = theme => ({
progress: {
margin: `0 ${theme.spacing.unit * 2}px`,
margin: theme.spacing.unit * 2,
},
});

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/progress/CircularIndeterminate.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import purple from 'material-ui/colors/purple';

const styles = theme => ({
progress: {
margin: `0 ${theme.spacing.unit * 2}px`,
margin: theme.spacing.unit * 2,
},
});

Expand Down
29 changes: 29 additions & 0 deletions docs/src/pages/demos/progress/CircularStatic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from 'material-ui/styles';
import { CircularProgress } from 'material-ui/Progress';

const styles = theme => ({
progress: {
margin: theme.spacing.unit * 2,
},
});

function CircularStatic(props) {
const { classes } = props;
return (
<div>
<CircularProgress className={classes.progress} variant="static" value={5} />
<CircularProgress className={classes.progress} variant="static" value={25} />
<CircularProgress className={classes.progress} variant="static" value={50} />
<CircularProgress className={classes.progress} variant="static" value={75} />
<CircularProgress className={classes.progress} variant="static" value={100} />
</div>
);
}

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

export default withStyles(styles)(CircularStatic);
3 changes: 1 addition & 2 deletions docs/src/pages/demos/progress/LinearBuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { LinearProgress } from 'material-ui/Progress';

const styles = {
root: {
width: '100%',
marginTop: 30,
flexGrow: 1,
},
};

Expand Down
3 changes: 1 addition & 2 deletions docs/src/pages/demos/progress/LinearDeterminate.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { LinearProgress } from 'material-ui/Progress';

const styles = {
root: {
width: '100%',
marginTop: 30,
flexGrow: 1,
},
};

Expand Down
3 changes: 1 addition & 2 deletions docs/src/pages/demos/progress/LinearIndeterminate.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { LinearProgress } from 'material-ui/Progress';

const styles = {
root: {
width: '100%',
marginTop: 30,
flexGrow: 1,
},
};

Expand Down
7 changes: 3 additions & 4 deletions docs/src/pages/demos/progress/LinearQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import PropTypes from 'prop-types';
import { withStyles } from 'material-ui/styles';
import { LinearProgress } from 'material-ui/Progress';

const styles = theme => ({
const styles = {
root: {
width: '100%',
marginTop: theme.spacing.unit * 3,
flexGrow: 1,
},
});
};

function LinearQuery(props) {
const { classes } = props;
Expand Down
8 changes: 6 additions & 2 deletions docs/src/pages/demos/progress/progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ For example, a refresh operation should display either a refresh bar or an activ

{{"demo": "pages/demos/progress/CircularDeterminate.js"}}

### Circular Static

{{"demo": "pages/demos/progress/CircularStatic.js"}}

## Linear

### Linear Indeterminate
Expand All @@ -38,11 +42,11 @@ For example, a refresh operation should display either a refresh bar or an activ

{{"demo": "pages/demos/progress/LinearDeterminate.js"}}

### Buffer
### Linear Buffer

{{"demo": "pages/demos/progress/LinearBuffer.js"}}

### Query
### Linear Query

{{"demo": "pages/demos/progress/LinearQuery.js"}}

Expand Down
3 changes: 1 addition & 2 deletions docs/src/pages/layout/AutoGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import Grid from 'material-ui/Grid';
const styles = theme => ({
root: {
flexGrow: 1,
marginTop: 30,
},
paper: {
padding: 16,
padding: theme.spacing.unit * 2,
textAlign: 'center',
color: theme.palette.text.secondary,
},
Expand Down
62 changes: 26 additions & 36 deletions docs/src/pages/layout/BreakpointDown.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,61 +8,51 @@ import withWidth from 'material-ui/utils/withWidth';
import Typography from 'material-ui/Typography';

const styles = theme => ({
container: {
root: {
flexGrow: 1,
paddingTop: 30,
},
container: {
display: 'flex',
flexWrap: 'wrap',
position: 'relative',
},
paper: {
padding: 16,
padding: theme.spacing.unit * 2,
textAlign: 'center',
color: theme.palette.text.secondary,
minHeight: 54,
flexBasis: 0,
flexGrow: 1,
maxWidth: '100%',
margin: 12,
},
typography: {
position: 'absolute',
left: 0,
top: 0,
padding: 5,
flex: '1 0 auto',
margin: theme.spacing.unit,
},
});

function BreakpointDown(props) {
const { classes } = props;

return (
<div className={classes.container}>
<Typography variant="subheading" className={classes.typography}>
Current width: {props.width}
</Typography>
<Hidden xsDown>
<Paper className={classes.paper}>xsDown</Paper>
</Hidden>
<Hidden smDown>
<Paper className={classes.paper}>smDown</Paper>
</Hidden>
<Hidden mdDown>
<Paper className={classes.paper}>mdDown</Paper>
</Hidden>
<Hidden lgDown>
<Paper className={classes.paper}>lgDown</Paper>
</Hidden>
<Hidden xlDown>
<Paper className={classes.paper}>xlDown</Paper>
</Hidden>
<div className={classes.root}>
<Typography variant="subheading">Current width: {props.width}</Typography>
<div className={classes.container}>
<Hidden xsDown>
<Paper className={classes.paper}>xsDown</Paper>
</Hidden>
<Hidden smDown>
<Paper className={classes.paper}>smDown</Paper>
</Hidden>
<Hidden mdDown>
<Paper className={classes.paper}>mdDown</Paper>
</Hidden>
<Hidden lgDown>
<Paper className={classes.paper}>lgDown</Paper>
</Hidden>
<Hidden xlDown>
<Paper className={classes.paper}>xlDown</Paper>
</Hidden>
</div>
</div>
);
}

BreakpointDown.propTypes = {
classes: PropTypes.object.isRequired,
width: PropTypes.string,
width: PropTypes.string.isRequired,
};

export default compose(withStyles(styles), withWidth())(BreakpointDown);
50 changes: 20 additions & 30 deletions docs/src/pages/layout/BreakpointOnly.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,45 @@ import withWidth from 'material-ui/utils/withWidth';
import Typography from 'material-ui/Typography';

const styles = theme => ({
container: {
root: {
flexGrow: 1,
paddingTop: 30,
},
container: {
display: 'flex',
flexWrap: 'wrap',
position: 'relative',
},
paper: {
padding: 16,
padding: theme.spacing.unit * 2,
textAlign: 'center',
color: theme.palette.text.secondary,
minHeight: 54,
flexBasis: 0,
flexGrow: 1,
maxWidth: '100%',
margin: 12,
},
typography: {
position: 'absolute',
left: 0,
top: 0,
padding: 5,
flex: '1 0 auto',
margin: theme.spacing.unit,
},
});

function BreakpointOnly(props) {
const { classes } = props;

return (
<div className={classes.container}>
<Typography variant="subheading" className={classes.typography}>
Current width: {props.width}
</Typography>
<Hidden only="lg">
<Paper className={classes.paper}>Hidden on lg</Paper>
</Hidden>
<Hidden only="sm">
<Paper className={classes.paper}>Hidden on sm</Paper>
</Hidden>
<Hidden only={['sm', 'lg']}>
<Paper className={classes.paper}>Hidden on sm and lg</Paper>
</Hidden>
<div className={classes.root}>
<Typography variant="subheading">Current width: {props.width}</Typography>
<div className={classes.container}>
<Hidden only="lg">
<Paper className={classes.paper}>Hidden on lg</Paper>
</Hidden>
<Hidden only="sm">
<Paper className={classes.paper}>Hidden on sm</Paper>
</Hidden>
<Hidden only={['sm', 'lg']}>
<Paper className={classes.paper}>Hidden on sm and lg</Paper>
</Hidden>
</div>
</div>
);
}

BreakpointOnly.propTypes = {
classes: PropTypes.object.isRequired,
width: PropTypes.string,
width: PropTypes.string.isRequired,
};

export default compose(withStyles(styles), withWidth())(BreakpointOnly);

0 comments on commit 10da9ba

Please sign in to comment.