UNPKG

4.42 kBJavaScriptView Raw
1"use strict";
2
3var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
5var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
7Object.defineProperty(exports, "__esModule", {
8 value: true
9});
10exports.default = exports.styles = void 0;
11
12var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
14var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
16var React = _interopRequireWildcard(require("react"));
17
18var _propTypes = _interopRequireDefault(require("prop-types"));
19
20var _clsx = _interopRequireDefault(require("clsx"));
21
22var _utils = require("@material-ui/core/utils");
23
24var _styles = require("@material-ui/core/styles");
25
26var styles = function styles(theme) {
27 return {
28 /* Styles applied to the root element. */
29 root: {
30 display: 'flex',
31 alignSelf: 'baseline',
32 borderStyle: 'solid',
33 borderWidth: 2,
34 padding: 4,
35 borderRadius: '50%',
36 boxShadow: theme.shadows[2],
37 marginTop: 8,
38 marginBottom: 8
39 },
40
41 /* Styles applied to the root element if `color="grey"` and `variant="default"`. */
42 defaultGrey: {
43 borderColor: 'transparent',
44 color: theme.palette.grey[50],
45 backgroundColor: theme.palette.grey[400]
46 },
47
48 /* Styles applied to the root element if `color="grey"` and `variant="outlined"`. */
49 outlinedGrey: {
50 boxShadow: 'none',
51 color: theme.palette.grey.contrastText,
52 borderColor: theme.palette.grey[400],
53 backgroundColor: 'transparent'
54 },
55
56 /* Styles applied to the root element if `color="primary"` and `variant="default"`. */
57 defaultPrimary: {
58 borderColor: 'transparent',
59 color: theme.palette.primary.contrastText,
60 backgroundColor: theme.palette.primary.main
61 },
62
63 /* Styles applied to the root element if `color="primary"` and `variant="outlined"`. */
64 outlinedPrimary: {
65 boxShadow: 'none',
66 backgroundColor: 'transparent',
67 borderColor: theme.palette.primary.main
68 },
69
70 /* Styles applied to the root element if `color="secondary"` and `variant="default"`. */
71 defaultSecondary: {
72 borderColor: 'transparent',
73 color: theme.palette.secondary.contrastText,
74 backgroundColor: theme.palette.secondary.main
75 },
76
77 /* Styles applied to the root element if `color="secondary"` and `variant="outlined"`. */
78 outlinedSecondary: {
79 boxShadow: 'none',
80 backgroundColor: 'transparent',
81 borderColor: theme.palette.secondary.main
82 }
83 };
84};
85
86exports.styles = styles;
87var TimelineDot = /*#__PURE__*/React.forwardRef(function TimelineDot(props, ref) {
88 var classes = props.classes,
89 className = props.className,
90 _props$color = props.color,
91 color = _props$color === void 0 ? 'grey' : _props$color,
92 _props$variant = props.variant,
93 variant = _props$variant === void 0 ? 'default' : _props$variant,
94 other = (0, _objectWithoutProperties2.default)(props, ["classes", "className", "color", "variant"]);
95 return /*#__PURE__*/React.createElement("span", (0, _extends2.default)({
96 className: (0, _clsx.default)(classes.root, className, color !== 'inherit' && classes["".concat(variant).concat((0, _utils.capitalize)(color))]),
97 ref: ref
98 }, other));
99});
100process.env.NODE_ENV !== "production" ? TimelineDot.propTypes = {
101 // ----------------------------- Warning --------------------------------
102 // | These PropTypes are generated from the TypeScript type definitions |
103 // | To update them edit the d.ts file and run "yarn proptypes" |
104 // ----------------------------------------------------------------------
105
106 /**
107 * The content of the component.
108 */
109 children: _propTypes.default.node,
110
111 /**
112 * Override or extend the styles applied to the component.
113 * See [CSS API](#css) below for more details.
114 */
115 classes: _propTypes.default.object,
116
117 /**
118 * @ignore
119 */
120 className: _propTypes.default.string,
121
122 /**
123 * The dot can have a different colors.
124 */
125 color: _propTypes.default.oneOf(['grey', 'inherit', 'primary', 'secondary']),
126
127 /**
128 * The dot can appear filled or outlined.
129 */
130 variant: _propTypes.default.oneOf(['default', 'outlined'])
131} : void 0;
132
133var _default = (0, _styles.withStyles)(styles, {
134 name: 'MuiTimelineDot'
135})(TimelineDot);
136
137exports.default = _default;
\No newline at end of file