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 | import TimelineContext from './TimelineContext';
|
9 | export const styles = () => ({
|
10 |
|
11 | root: {
|
12 | display: 'flex',
|
13 | flexDirection: 'column',
|
14 | padding: '6px 16px',
|
15 | flexGrow: 1
|
16 | },
|
17 |
|
18 |
|
19 | alignLeft: {},
|
20 |
|
21 |
|
22 | alignRight: {},
|
23 |
|
24 |
|
25 | alignAlternate: {}
|
26 | });
|
27 | const Timeline = React.forwardRef(function Timeline(props, ref) {
|
28 | const {
|
29 | align = 'left',
|
30 | classes,
|
31 | className
|
32 | } = props,
|
33 | other = _objectWithoutPropertiesLoose(props, ["align", "classes", "className"]);
|
34 |
|
35 | return React.createElement(TimelineContext.Provider, {
|
36 | value: {
|
37 | align
|
38 | }
|
39 | }, React.createElement("ul", _extends({
|
40 | className: clsx(classes.root, classes[`align${capitalize(align)}`], className),
|
41 | ref: ref
|
42 | }, other)));
|
43 | });
|
44 | process.env.NODE_ENV !== "production" ? Timeline.propTypes = {
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | |
51 |
|
52 |
|
53 | align: PropTypes.oneOf(['alternate', 'left', 'right']),
|
54 |
|
55 | |
56 |
|
57 |
|
58 | children: PropTypes.node,
|
59 |
|
60 | |
61 |
|
62 |
|
63 |
|
64 | classes: PropTypes.object,
|
65 |
|
66 | |
67 |
|
68 |
|
69 | className: PropTypes.string
|
70 | } : void 0;
|
71 | export default withStyles(styles, {
|
72 | name: 'MuiTimeline'
|
73 | })(Timeline); |
\ | No newline at end of file |