1 | import _extends from "@babel/runtime/helpers/esm/extends";
|
2 | import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
3 | import * as React from 'react';
|
4 | import PropTypes from 'prop-types';
|
5 | import clsx from 'clsx';
|
6 | import { capitalize } from '@material-ui/core/utils';
|
7 | import { withStyles } from '@material-ui/core/styles';
|
8 | export const styles = theme => ({
|
9 |
|
10 | root: {
|
11 | display: 'flex',
|
12 | alignSelf: 'baseline',
|
13 | borderStyle: 'solid',
|
14 | borderWidth: 2,
|
15 | padding: 4,
|
16 | borderRadius: '50%',
|
17 | boxShadow: theme.shadows[2],
|
18 | marginTop: 8,
|
19 | marginBottom: 8
|
20 | },
|
21 |
|
22 |
|
23 | defaultGrey: {
|
24 | borderColor: 'transparent',
|
25 | color: theme.palette.grey[50],
|
26 | backgroundColor: theme.palette.grey[400]
|
27 | },
|
28 |
|
29 |
|
30 | outlinedGrey: {
|
31 | boxShadow: 'none',
|
32 | color: theme.palette.grey.contrastText,
|
33 | borderColor: theme.palette.grey[400],
|
34 | backgroundColor: 'transparent'
|
35 | },
|
36 |
|
37 |
|
38 | defaultPrimary: {
|
39 | borderColor: 'transparent',
|
40 | color: theme.palette.primary.contrastText,
|
41 | backgroundColor: theme.palette.primary.main
|
42 | },
|
43 |
|
44 |
|
45 | outlinedPrimary: {
|
46 | boxShadow: 'none',
|
47 | backgroundColor: 'transparent',
|
48 | borderColor: theme.palette.primary.main
|
49 | },
|
50 |
|
51 |
|
52 | defaultSecondary: {
|
53 | borderColor: 'transparent',
|
54 | color: theme.palette.secondary.contrastText,
|
55 | backgroundColor: theme.palette.secondary.main
|
56 | },
|
57 |
|
58 |
|
59 | outlinedSecondary: {
|
60 | boxShadow: 'none',
|
61 | backgroundColor: 'transparent',
|
62 | borderColor: theme.palette.secondary.main
|
63 | }
|
64 | });
|
65 | const TimelineDot = React.forwardRef(function TimelineDot(props, ref) {
|
66 | const {
|
67 | classes,
|
68 | className,
|
69 | color = 'grey',
|
70 | variant = 'default'
|
71 | } = props,
|
72 | other = _objectWithoutPropertiesLoose(props, ["classes", "className", "color", "variant"]);
|
73 |
|
74 | return React.createElement("span", _extends({
|
75 | className: clsx(classes.root, className, color !== 'inherit' && classes[`${variant}${capitalize(color)}`]),
|
76 | ref: ref
|
77 | }, other));
|
78 | });
|
79 | process.env.NODE_ENV !== "production" ? TimelineDot.propTypes = {
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | |
86 |
|
87 |
|
88 | children: PropTypes.node,
|
89 |
|
90 | |
91 |
|
92 |
|
93 |
|
94 | classes: PropTypes.object,
|
95 |
|
96 | |
97 |
|
98 |
|
99 | className: PropTypes.string,
|
100 |
|
101 | |
102 |
|
103 |
|
104 | color: PropTypes.oneOf(['grey', 'inherit', 'primary', 'secondary']),
|
105 |
|
106 | |
107 |
|
108 |
|
109 | variant: PropTypes.oneOf(['default', 'outlined'])
|
110 | } : void 0;
|
111 | export default withStyles(styles, {
|
112 | name: 'MuiTimelineDot'
|
113 | })(TimelineDot); |
\ | No newline at end of file |