Completely updated React, fixed #11, (hopefully)

This commit is contained in:
2018-03-04 19:11:49 -05:00
parent 6e0afd6e2a
commit 34e5f5139a
13674 changed files with 333464 additions and 473223 deletions

View File

@@ -0,0 +1,87 @@
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
export const styles = theme => ({
root: {
flex: '1 1 auto',
},
horizontal: {},
vertical: {
marginLeft: 12, // half icon
padding: `0 0 ${theme.spacing.unit}px`,
},
alternativeLabel: {
position: 'absolute',
top: theme.spacing.unit + 4,
left: 'calc(50% + 20px)',
right: 'calc(-50% + 20px)',
},
line: {
display: 'block',
borderColor: theme.palette.type === 'light' ? theme.palette.grey[400] : theme.palette.grey[600],
},
lineHorizontal: {
borderTopStyle: 'solid',
borderTopWidth: 1,
},
lineVertical: {
borderLeftStyle: 'solid',
borderLeftWidth: 1,
minHeight: theme.spacing.unit * 3,
},
});
/**
* @ignore - internal component.
*/
function StepConnector(props) {
const { alternativeLabel, className: classNameProp, classes, orientation, ...other } = props;
const className = classNames(
classes.root,
classes[orientation],
{
[classes.alternativeLabel]: alternativeLabel,
},
classNameProp,
);
const lineClassName = classNames(classes.line, {
[classes.lineHorizontal]: orientation === 'horizontal',
[classes.lineVertical]: orientation === 'vertical',
});
return (
<div className={className} {...other}>
<span className={lineClassName} />
</div>
);
}
StepConnector.propTypes = {
/**
* @ignore
* Set internally by Step when it's supplied with the alternativeLabel property.
*/
alternativeLabel: PropTypes.bool,
/**
* Useful to extend the style applied to the component.
*/
classes: PropTypes.object.isRequired,
/**
* @ignore
*/
className: PropTypes.string,
/**
* @ignore
*/
orientation: PropTypes.oneOf(['horizontal', 'vertical']),
};
StepConnector.defaultProps = {
alternativeLabel: false,
orientation: 'horizontal',
};
export default withStyles(styles, { name: 'MuiStepConnector' })(StepConnector);