@automattic/vip-design-system 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,7 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _jsxRuntime = require("theme-ui/jsx-runtime");
|
|
13
13
|
|
|
14
|
-
var _excluded = ["time"];
|
|
14
|
+
var _excluded = ["time", "first", "last"];
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
17
|
|
|
@@ -32,6 +32,10 @@ var VerticalLine = function VerticalLine() {
|
|
|
32
32
|
|
|
33
33
|
var Timeline = function Timeline(_ref) {
|
|
34
34
|
var time = _ref.time,
|
|
35
|
+
_ref$first = _ref.first,
|
|
36
|
+
first = _ref$first === void 0 ? false : _ref$first,
|
|
37
|
+
_ref$last = _ref.last,
|
|
38
|
+
last = _ref$last === void 0 ? false : _ref$last,
|
|
35
39
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
36
40
|
|
|
37
41
|
return (0, _jsxRuntime.jsxs)(_themeUi.Flex, _extends({}, props, {
|
|
@@ -41,22 +45,18 @@ var Timeline = function Timeline(_ref) {
|
|
|
41
45
|
justifyContent: 'space-evenly',
|
|
42
46
|
alignItems: 'center'
|
|
43
47
|
},
|
|
44
|
-
children: [(0, _jsxRuntime.jsx)(VerticalLine, {}), (0, _jsxRuntime.jsx)(_md.MdWatchLater, {
|
|
48
|
+
children: [!first && (0, _jsxRuntime.jsx)(VerticalLine, {}), (0, _jsxRuntime.jsx)(_md.MdWatchLater, {
|
|
45
49
|
sx: {
|
|
46
50
|
color: 'border'
|
|
47
51
|
},
|
|
48
52
|
size: 18
|
|
49
|
-
}), (0, _jsxRuntime.jsx)(VerticalLine, {})]
|
|
53
|
+
}), !last && (0, _jsxRuntime.jsx)(VerticalLine, {})]
|
|
50
54
|
}), (0, _jsxRuntime.jsx)(_themeUi.Flex, {
|
|
51
55
|
sx: {
|
|
52
56
|
alignItems: 'center',
|
|
53
57
|
ml: 2
|
|
54
58
|
},
|
|
55
|
-
children: (0, _jsxRuntime.jsx)(
|
|
56
|
-
as: "span",
|
|
57
|
-
sx: {
|
|
58
|
-
color: 'muted'
|
|
59
|
-
},
|
|
59
|
+
children: (0, _jsxRuntime.jsx)("span", {
|
|
60
60
|
children: time
|
|
61
61
|
})
|
|
62
62
|
})]
|
|
@@ -65,5 +65,7 @@ var Timeline = function Timeline(_ref) {
|
|
|
65
65
|
|
|
66
66
|
exports.Timeline = Timeline;
|
|
67
67
|
Timeline.propTypes = {
|
|
68
|
-
|
|
68
|
+
first: _propTypes["default"].bool,
|
|
69
|
+
time: _propTypes["default"].string,
|
|
70
|
+
last: _propTypes["default"].bool
|
|
69
71
|
};
|
package/build/system/index.js
CHANGED
|
@@ -99,6 +99,10 @@ var _Time = require("./Time");
|
|
|
99
99
|
|
|
100
100
|
exports.Time = _Time.Time;
|
|
101
101
|
|
|
102
|
+
var _Timeline = require("./Timeline");
|
|
103
|
+
|
|
104
|
+
exports.Timeline = _Timeline.Timeline;
|
|
105
|
+
|
|
102
106
|
var _Notification = require("./Notification");
|
|
103
107
|
|
|
104
108
|
exports.Notification = _Notification.Notification;
|
package/package.json
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** @jsxImportSource theme-ui */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* External dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { Flex } from 'theme-ui';
|
|
7
|
+
import { MdWatchLater } from 'react-icons/md';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
|
|
10
|
+
const VerticalLine = () => {
|
|
11
|
+
return (
|
|
12
|
+
<div
|
|
13
|
+
sx={ {
|
|
14
|
+
borderLeft: '2px solid',
|
|
15
|
+
borderColor: 'border',
|
|
16
|
+
height: 'calc( 50% - 16px )',
|
|
17
|
+
borderRadius: '2px',
|
|
18
|
+
} }>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const Timeline = ( { time, first = false, last = false, ...props } ) => (
|
|
24
|
+
<Flex { ...props }>
|
|
25
|
+
<Flex sx={ { flexDirection: 'column', justifyContent: 'space-evenly', alignItems: 'center' } }>
|
|
26
|
+
{ ! first && (
|
|
27
|
+
<VerticalLine />
|
|
28
|
+
) }
|
|
29
|
+
<MdWatchLater sx={ { color: 'border' } } size={ 18 }/>
|
|
30
|
+
{ ! last && (
|
|
31
|
+
<VerticalLine />
|
|
32
|
+
) }
|
|
33
|
+
</Flex>
|
|
34
|
+
<Flex sx={ { alignItems: 'center', ml: 2 } }>
|
|
35
|
+
<span>{ time }</span>
|
|
36
|
+
</Flex>
|
|
37
|
+
</Flex>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
Timeline.propTypes = {
|
|
41
|
+
first: PropTypes.bool,
|
|
42
|
+
time: PropTypes.string,
|
|
43
|
+
last: PropTypes.bool,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { Timeline };
|
package/src/system/index.js
CHANGED
|
@@ -41,6 +41,7 @@ import { Spinner } from './Spinner';
|
|
|
41
41
|
import { ResourceList, ResourceItem } from './ResourceList';
|
|
42
42
|
import { Tooltip } from './Tooltip';
|
|
43
43
|
import { Time } from './Time';
|
|
44
|
+
import { Timeline } from './Timeline';
|
|
44
45
|
import { Notification } from './Notification';
|
|
45
46
|
import { OptionRow } from './OptionRow';
|
|
46
47
|
import { Table, TableRow } from './Table';
|
|
@@ -93,6 +94,7 @@ export {
|
|
|
93
94
|
ToggleGroup,
|
|
94
95
|
TabItem,
|
|
95
96
|
Time,
|
|
97
|
+
Timeline,
|
|
96
98
|
Validation,
|
|
97
99
|
Wizard,
|
|
98
100
|
WizardStep,
|