@desynova-digital/components 9.0.26 → 9.1.0
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.
- package/_helpers/globals.js +9 -10
- package/_helpers/pagination.js +10 -15
- package/_helpers/story-example.js +16 -39
- package/_helpers/story-helpers.js +15 -14
- package/_helpers/story-stack.js +22 -43
- package/_helpers/uniqueId.js +2 -5
- package/_helpers/utils.js +28 -4
- package/atoms/avatar/avatar.js +19 -42
- package/atoms/avatar/avatar.story.js +25 -58
- package/atoms/avatar/index.js +13 -11
- package/atoms/badge/badge.js +14 -37
- package/atoms/badge/badge.story.js +45 -103
- package/atoms/badge/index.js +12 -10
- package/atoms/button/button.js +85 -161
- package/atoms/button/button.story.js +354 -508
- package/atoms/button/index.js +5 -9
- package/atoms/card/card.js +26 -55
- package/atoms/card/card.story.js +39 -88
- package/atoms/card/index.js +12 -10
- package/atoms/cardStack/cardStack.js +88 -147
- package/atoms/cardStack/cardStack.story.js +106 -210
- package/atoms/cardStack/index.js +12 -10
- package/atoms/cardV2/cardV2.js +57 -106
- package/atoms/cardV2/cardV2.story.js +184 -232
- package/atoms/cardV2/content.js +154 -256
- package/atoms/cardV2/index.js +4 -8
- package/atoms/cardV2/thumbnail.js +138 -208
- package/atoms/cardV2/timeline.js +167 -123
- package/atoms/checkbox/checkbox.js +85 -157
- package/atoms/checkbox/checkbox.story.js +237 -365
- package/atoms/checkbox/index.js +4 -9
- package/atoms/customSelect/customSelect.js +136 -215
- package/atoms/customSelect/customSelect.story.js +745 -851
- package/atoms/customSelect/index.js +4 -8
- package/atoms/datePicker/datePicker.js +299 -431
- package/atoms/datePicker/datePicker.story.js +453 -501
- package/atoms/datePicker/index.js +4 -8
- package/atoms/dateTime/dateTime.js +3 -6
- package/atoms/dateTime/dateTime.story.js +17 -63
- package/atoms/dateTime/index.js +5 -9
- package/atoms/draftInputText/draftInputText.js +121 -189
- package/atoms/draftInputText/draftInputText.story.js +200 -249
- package/atoms/draftInputText/index.js +5 -9
- package/atoms/dropdown/dropdown.js +38 -66
- package/atoms/dropdown/dropdown.story.js +102 -262
- package/atoms/dropdown/index.js +4 -8
- package/atoms/dropdownList/dropdownList.js +78 -108
- package/atoms/dropdownList/dropdownList.story.js +1546 -1621
- package/atoms/dropdownList/index.js +4 -8
- package/atoms/graphs/barGraph/barGraph.js +95 -146
- package/atoms/graphs/barGraph/barGraph.story.js +65 -87
- package/atoms/graphs/barGraph/index.js +4 -8
- package/atoms/graphs/circleDonut/circleDonut.js +177 -229
- package/atoms/graphs/circleDonut/circleDonut.story.js +328 -394
- package/atoms/graphs/circleDonut/index.js +5 -9
- package/atoms/graphs/circleGraph/circleGraph.js +60 -90
- package/atoms/graphs/circleGraph/circleGraph.story.js +36 -54
- package/atoms/graphs/circleGraph/index.js +4 -8
- package/atoms/graphs/circleNested/circleNested.js +216 -262
- package/atoms/graphs/circleNested/circleNested.story.js +91 -116
- package/atoms/graphs/circleNested/index.js +5 -9
- package/atoms/graphs/pieChart/index.js +4 -8
- package/atoms/graphs/pieChart/pieChart.js +162 -191
- package/atoms/graphs/pieChart/pieChart.story.js +147 -176
- package/atoms/graphs/verticalBarGraph/index.js +5 -9
- package/atoms/graphs/verticalBarGraph/verticalBarGraph.js +75 -98
- package/atoms/graphs/verticalBarGraph/verticalBarGraph.story.js +26 -45
- package/atoms/icon/icon.js +41 -72
- package/atoms/icon/icon.story.js +831 -260
- package/atoms/icon/index.js +19 -12
- package/atoms/image/image.js +18 -32
- package/atoms/image/image.story.js +10 -19
- package/atoms/image/index.js +4 -8
- package/atoms/inputText/index.js +4 -8
- package/atoms/inputText/inputText.js +86 -131
- package/atoms/inputText/inputText.story.js +191 -255
- package/atoms/label/index.js +4 -8
- package/atoms/label/label.js +25 -50
- package/atoms/label/label.story.js +42 -83
- package/atoms/loader/CircleLoader.js +29 -63
- package/atoms/loader/ShimmerComponent/CollabShimmerCard.js +39 -50
- package/atoms/loader/ShimmerComponent/CollabShimmerCardTray.js +41 -42
- package/atoms/loader/ShimmerComponent/FiltersShimmer.js +30 -30
- package/atoms/loader/ShimmerComponent/GraphDetailShimmer.js +21 -34
- package/atoms/loader/ShimmerComponent/GraphTitleShimmer.js +30 -34
- package/atoms/loader/ShimmerComponent/GraphsComponentShimmer.js +23 -32
- package/atoms/loader/ShimmerComponent/Shimmer.js +24 -32
- package/atoms/loader/ThreeDotLoader.js +14 -29
- package/atoms/loader/index.js +13 -11
- package/atoms/loader/loader.js +34 -58
- package/atoms/loader/loader.story.js +48 -52
- package/atoms/loader/spinningLoader.js +23 -34
- package/atoms/popup/index.js +5 -9
- package/atoms/popup/popup.js +123 -208
- package/atoms/popup/popup.story.js +97 -131
- package/atoms/radio/index.js +18 -11
- package/atoms/radio/radio.js +58 -112
- package/atoms/radio/radio.story.js +197 -420
- package/atoms/select/index.js +4 -8
- package/atoms/select/select.js +48 -86
- package/atoms/sideBar/index.js +5 -9
- package/atoms/sideBar/sidebar.js +89 -140
- package/atoms/switch/index.js +4 -8
- package/atoms/switch/switch.js +56 -86
- package/atoms/switch/switch.story.js +268 -415
- package/atoms/tag/index.js +12 -10
- package/atoms/tag/tag.js +29 -63
- package/atoms/tag/tag.story.js +135 -209
- package/atoms/textarea/index.js +5 -9
- package/atoms/textarea/textarea.js +55 -99
- package/atoms/textarea/textarea.story.js +48 -41
- package/atoms/thematicBreak/index.js +12 -10
- package/atoms/thematicBreak/thematicBreak.js +20 -38
- package/atoms/thematicBreak/thematicBreak.story.js +25 -37
- package/atoms/timeCodeInput/index.js +4 -8
- package/atoms/timeCodeInput/timCodeInput.story.js +21 -35
- package/atoms/timeCodeInput/timeCodeInput.js +33 -51
- package/atoms/timer/index.js +5 -9
- package/atoms/timer/timer.js +57 -108
- package/atoms/timer/timer.story.js +13 -26
- package/atoms/toast/index.js +5 -9
- package/atoms/toast/toast.js +81 -116
- package/atoms/toast/toast.story.js +50 -76
- package/atoms/videoCard/index.js +12 -10
- package/atoms/videoCard/videoCard.js +265 -447
- package/atoms/videoCard/videoCard.story.js +495 -710
- package/components.js +411 -294
- package/index.js +350 -61
- package/molecules/carousel/carousel.js +121 -207
- package/molecules/carousel/carousel.story.js +240 -223
- package/molecules/carousel/index.js +5 -9
- package/molecules/errorScreen/CollabErrorScreen.js +35 -66
- package/molecules/errorScreen/TableErrorScreen.js +109 -102
- package/molecules/errorScreen/TableErrorScreen.jsx +7 -6
- package/molecules/errorScreen/errorScreen.js +41 -94
- package/molecules/filter/constants.js +1 -0
- package/molecules/filter/filter.js +378 -562
- package/molecules/filter/filter.story.js +79 -104
- package/molecules/filter/index.js +5 -9
- package/molecules/graphCard/graphCard.js +97 -193
- package/molecules/graphCard/graphCard.story.js +159 -191
- package/molecules/graphCard/index.js +4 -8
- package/molecules/graphCard/loader.js +28 -68
- package/molecules/graphDetailCard/graphDetailCard.js +115 -183
- package/molecules/graphDetailCard/graphDetailCard.story.js +218 -254
- package/molecules/graphDetailCard/index.js +5 -9
- package/molecules/pageHeader/index.js +12 -10
- package/molecules/pageHeader/pageHeader.js +38 -79
- package/molecules/pageHeader/pageHeader.story.js +34 -55
- package/molecules/pagination/index.js +4 -8
- package/molecules/pagination/pagination.js +126 -202
- package/molecules/pagination/pagination.story.js +40 -52
- package/molecules/richTextInput/RichTextInput.js +354 -0
- package/molecules/richTextInput/RichTextInput.story.js +50 -0
- package/molecules/richTextInput/index.js +9 -0
- package/molecules/table/index.js +4 -8
- package/molecules/table/table-column.js +10 -16
- package/molecules/table/table-header.js +31 -72
- package/molecules/table/table.js +743 -1075
- package/molecules/table/table.story.js +274 -304
- package/molecules/tabs/index.js +4 -8
- package/molecules/tabs/tabs.js +112 -184
- package/molecules/tabs/tabs.story.js +66 -133
- package/molecules/videoCardList/index.js +4 -8
- package/molecules/videoCardList/videoCardList.js +24 -41
- package/molecules/videoCardList/videoCardList.story.js +449 -664
- package/molecules/videoPlayer/index.js +4 -8
- package/molecules/videoPlayer/videoPlayer.js +1019 -1097
- package/molecules/videoPlayer/videoPlayer.story.js +10 -21
- package/package.json +2 -2
|
@@ -1,59 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
18
|
-
|
|
19
|
-
var _utils = require('../../_helpers/utils');
|
|
20
|
-
|
|
21
|
-
var _tokens = require('@desynova-digital/tokens');
|
|
22
|
-
|
|
23
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
|
|
25
|
-
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
26
|
-
|
|
27
|
-
var StyledInput = _styledComponents2.default.input(_templateObject, function (props) {
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
var _utils = require("../../_helpers/utils");
|
|
14
|
+
var _tokens = require("@desynova-digital/tokens");
|
|
15
|
+
var _templateObject;
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
18
|
+
var StyledInput = _styledComponents["default"].input(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n font-family: SFUIText-Regular;\n font-size: 12px;\n color: ", ";\n text-align: left;\n padding: 0;\n border: none;\n outline: none;\n background: transparent;\n &:hover {\n color: ", ";\n }\n width: ", ";\n"])), function (props) {
|
|
28
19
|
return props.isError ? '#FFFFFF' : '#ff0000';
|
|
29
20
|
}, function (props) {
|
|
30
|
-
return props.theme ?
|
|
21
|
+
return props.theme ? "".concat(_tokens.colors[props.theme].timeCodeInput.rgbthemeColor) : 'rgb(0 206 198)';
|
|
31
22
|
}, function (props) {
|
|
32
23
|
return props.width ? props.width : '72px';
|
|
33
24
|
});
|
|
34
|
-
|
|
35
25
|
var TimeCodeInput = function TimeCodeInput(_ref) {
|
|
36
26
|
var inputValue = _ref.inputValue,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
27
|
+
onFocus = _ref.onFocus,
|
|
28
|
+
onKeyDown = _ref.onKeyDown,
|
|
29
|
+
frameRate = _ref.frameRate,
|
|
30
|
+
initialTime = _ref.initialTime,
|
|
31
|
+
playerDuration = _ref.playerDuration,
|
|
32
|
+
elementRef = _ref.elementRef,
|
|
33
|
+
width = _ref.width,
|
|
34
|
+
_ref$theme = _ref.theme,
|
|
35
|
+
theme = _ref$theme === void 0 ? 'dark' : _ref$theme;
|
|
47
36
|
var _useState = (0, _react.useState)(inputValue || '00:00:00:00'),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
37
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
38
|
+
customInputValue = _useState2[0],
|
|
39
|
+
setCustomInputValue = _useState2[1];
|
|
52
40
|
var _useState3 = (0, _react.useState)(true),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
42
|
+
isValid = _useState4[0],
|
|
43
|
+
setIsValid = _useState4[1];
|
|
57
44
|
var onTimePickerChange = function onTimePickerChange(value, e) {
|
|
58
45
|
var inputTime = value;
|
|
59
46
|
var formattedTime = inputTime;
|
|
@@ -81,7 +68,6 @@ var TimeCodeInput = function TimeCodeInput(_ref) {
|
|
|
81
68
|
setCustomInputValue(e.target.value);
|
|
82
69
|
}
|
|
83
70
|
};
|
|
84
|
-
|
|
85
71
|
var checkIfTimeValid = function checkIfTimeValid(value) {
|
|
86
72
|
var isValid = false;
|
|
87
73
|
if (value) {
|
|
@@ -98,7 +84,6 @@ var TimeCodeInput = function TimeCodeInput(_ref) {
|
|
|
98
84
|
setIsValid(false);
|
|
99
85
|
return isValid;
|
|
100
86
|
};
|
|
101
|
-
|
|
102
87
|
(0, _react.useEffect)(function () {
|
|
103
88
|
var handleEscapeKey = function handleEscapeKey(event) {
|
|
104
89
|
if (event.key === 'Escape') {
|
|
@@ -114,7 +99,6 @@ var TimeCodeInput = function TimeCodeInput(_ref) {
|
|
|
114
99
|
document.removeEventListener('keydown', handleEscapeKey);
|
|
115
100
|
};
|
|
116
101
|
}, [inputValue]);
|
|
117
|
-
|
|
118
102
|
(0, _react.useImperativeHandle)(elementRef, function () {
|
|
119
103
|
return {
|
|
120
104
|
checkValidity: function checkValidity() {
|
|
@@ -122,8 +106,7 @@ var TimeCodeInput = function TimeCodeInput(_ref) {
|
|
|
122
106
|
}
|
|
123
107
|
};
|
|
124
108
|
});
|
|
125
|
-
|
|
126
|
-
return _react2.default.createElement(StyledInput, {
|
|
109
|
+
return /*#__PURE__*/_react["default"].createElement(StyledInput, {
|
|
127
110
|
theme: theme,
|
|
128
111
|
width: width,
|
|
129
112
|
ref: elementRef,
|
|
@@ -135,8 +118,7 @@ var TimeCodeInput = function TimeCodeInput(_ref) {
|
|
|
135
118
|
checkIfTimeValid(e.target.value);
|
|
136
119
|
},
|
|
137
120
|
isError: isValid,
|
|
138
|
-
maxLength:
|
|
121
|
+
maxLength: "11"
|
|
139
122
|
});
|
|
140
123
|
};
|
|
141
|
-
|
|
142
|
-
exports.default = TimeCodeInput;
|
|
124
|
+
var _default = exports["default"] = TimeCodeInput;
|
package/atoms/timer/index.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
var _timer = require(
|
|
8
|
-
|
|
9
|
-
var _timer2 = _interopRequireDefault(_timer);
|
|
10
|
-
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
13
|
-
exports.default = _timer2.default;
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _timer = _interopRequireDefault(require("./timer"));
|
|
9
|
+
var _default = exports["default"] = _timer["default"];
|
package/atoms/timer/timer.js
CHANGED
|
@@ -1,50 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var _propTypes = require(
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var _tokens = require('@desynova-digital/tokens');
|
|
24
|
-
|
|
25
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
-
|
|
27
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
28
|
-
|
|
29
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
30
|
-
|
|
31
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
32
|
-
|
|
33
|
-
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
34
|
-
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
|
+
var _tokens = require("@desynova-digital/tokens");
|
|
20
|
+
var _templateObject;
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
23
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
24
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
35
25
|
// import {colors} from '../../../tokens';
|
|
36
26
|
|
|
37
|
-
var TimerWrapper =
|
|
38
|
-
|
|
39
|
-
var Timer = function (_Component) {
|
|
40
|
-
_inherits(Timer, _Component);
|
|
41
|
-
|
|
27
|
+
var TimerWrapper = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n\n .timer-holder {\n text-align: center;\n margin-right: 20px;\n\n .time {\n font-size: 40px;\n font-family: SFUIText-Medium;\n line-height: 30px;\n margin-bottom: 5px;\n min-width: 55px;\n }\n\n .time-tag {\n font-size: 10px;\n font-family: SFUIText-Medium;\n color: #000;\n line-height: 10px;\n }\n }\n"])));
|
|
28
|
+
var Timer = /*#__PURE__*/function (_Component) {
|
|
42
29
|
function Timer(props) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
_this.componentDidMount = function () {
|
|
30
|
+
var _this;
|
|
31
|
+
(0, _classCallCheck2["default"])(this, Timer);
|
|
32
|
+
_this = _callSuper(this, Timer, [props]);
|
|
33
|
+
(0, _defineProperty2["default"])(_this, "componentDidMount", function () {
|
|
48
34
|
var timeObj = _this.getTimeLeft();
|
|
49
35
|
_this.setState({
|
|
50
36
|
time: {
|
|
@@ -55,11 +41,9 @@ var Timer = function (_Component) {
|
|
|
55
41
|
}, function () {
|
|
56
42
|
_this.startCountdown();
|
|
57
43
|
});
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
_this.getTimeLeft = function () {
|
|
44
|
+
});
|
|
45
|
+
(0, _defineProperty2["default"])(_this, "getTimeLeft", function () {
|
|
61
46
|
var endTime = _this.props.endTime;
|
|
62
|
-
|
|
63
47
|
var presentTime = new Date().getTime();
|
|
64
48
|
var timeLeft = endTime - presentTime;
|
|
65
49
|
var hours = Math.floor(timeLeft % (1000 * 60 * 60 * 24) / (1000 * 60 * 60));
|
|
@@ -70,9 +54,8 @@ var Timer = function (_Component) {
|
|
|
70
54
|
minutes: minutes,
|
|
71
55
|
seconds: seconds
|
|
72
56
|
};
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
_this.startCountdown = function () {
|
|
57
|
+
});
|
|
58
|
+
(0, _defineProperty2["default"])(_this, "startCountdown", function () {
|
|
76
59
|
if (!_this.countdownInterval) {
|
|
77
60
|
var self = _this;
|
|
78
61
|
_this.countdownInterval = setInterval(function () {
|
|
@@ -86,13 +69,11 @@ var Timer = function (_Component) {
|
|
|
86
69
|
});
|
|
87
70
|
}, 1000);
|
|
88
71
|
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
_this.componentWillUnmount = function () {
|
|
72
|
+
});
|
|
73
|
+
(0, _defineProperty2["default"])(_this, "componentWillUnmount", function () {
|
|
92
74
|
clearInterval(_this.countdownInterval);
|
|
93
75
|
_this.countdownInterval = null;
|
|
94
|
-
};
|
|
95
|
-
|
|
76
|
+
});
|
|
96
77
|
_this.state = {
|
|
97
78
|
time: {
|
|
98
79
|
hours: 0,
|
|
@@ -103,66 +84,34 @@ var Timer = function (_Component) {
|
|
|
103
84
|
_this.countdownInterval = null;
|
|
104
85
|
return _this;
|
|
105
86
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
key:
|
|
87
|
+
(0, _inherits2["default"])(Timer, _Component);
|
|
88
|
+
return (0, _createClass2["default"])(Timer, [{
|
|
89
|
+
key: "render",
|
|
109
90
|
value: function render() {
|
|
110
91
|
var time = this.state.time;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
'span',
|
|
131
|
-
{ className: 'timer-holder' },
|
|
132
|
-
_react2.default.createElement(
|
|
133
|
-
'p',
|
|
134
|
-
{ className: 'time' },
|
|
135
|
-
time.minutes > 9 ? time.minutes : '0' + time.minutes
|
|
136
|
-
),
|
|
137
|
-
_react2.default.createElement(
|
|
138
|
-
'p',
|
|
139
|
-
{ className: 'time-tag' },
|
|
140
|
-
'Min'
|
|
141
|
-
)
|
|
142
|
-
),
|
|
143
|
-
_react2.default.createElement(
|
|
144
|
-
'span',
|
|
145
|
-
{ className: 'timer-holder' },
|
|
146
|
-
_react2.default.createElement(
|
|
147
|
-
'p',
|
|
148
|
-
{ className: 'time' },
|
|
149
|
-
time.seconds > 9 ? time.seconds : '0' + time.seconds
|
|
150
|
-
),
|
|
151
|
-
_react2.default.createElement(
|
|
152
|
-
'p',
|
|
153
|
-
{ className: 'time-tag' },
|
|
154
|
-
'Sec'
|
|
155
|
-
)
|
|
156
|
-
)
|
|
157
|
-
);
|
|
92
|
+
return /*#__PURE__*/_react["default"].createElement(TimerWrapper, null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
93
|
+
className: "timer-holder"
|
|
94
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
95
|
+
className: "time"
|
|
96
|
+
}, time.hours > 9 ? time.hours : "0".concat(time.hours)), /*#__PURE__*/_react["default"].createElement("p", {
|
|
97
|
+
className: "time-tag"
|
|
98
|
+
}, "Hr")), /*#__PURE__*/_react["default"].createElement("span", {
|
|
99
|
+
className: "timer-holder"
|
|
100
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
101
|
+
className: "time"
|
|
102
|
+
}, time.minutes > 9 ? time.minutes : "0".concat(time.minutes)), /*#__PURE__*/_react["default"].createElement("p", {
|
|
103
|
+
className: "time-tag"
|
|
104
|
+
}, "Min")), /*#__PURE__*/_react["default"].createElement("span", {
|
|
105
|
+
className: "timer-holder"
|
|
106
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
107
|
+
className: "time"
|
|
108
|
+
}, time.seconds > 9 ? time.seconds : "0".concat(time.seconds)), /*#__PURE__*/_react["default"].createElement("p", {
|
|
109
|
+
className: "time-tag"
|
|
110
|
+
}, "Sec")));
|
|
158
111
|
}
|
|
159
112
|
}]);
|
|
160
|
-
|
|
161
|
-
return Timer;
|
|
162
113
|
}(_react.Component);
|
|
163
|
-
|
|
164
114
|
Timer.propTypes = {
|
|
165
|
-
endTime:
|
|
115
|
+
endTime: _propTypes["default"].number
|
|
166
116
|
};
|
|
167
|
-
|
|
168
|
-
exports.default = Timer;
|
|
117
|
+
var _default = exports["default"] = Timer;
|
|
@@ -1,27 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var _react2 =
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
(0, _react3.storiesOf)('Timer').add('default', function () {
|
|
18
|
-
return _react2.default.createElement(
|
|
19
|
-
_storyHelpers.Example,
|
|
20
|
-
{ title: 'Appearances' },
|
|
21
|
-
_react2.default.createElement(
|
|
22
|
-
_storyHelpers.Stack,
|
|
23
|
-
null,
|
|
24
|
-
_react2.default.createElement(_timer2.default, { endTime: 1573833600000 })
|
|
25
|
-
)
|
|
26
|
-
);
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _react = _interopRequireDefault(require("react"));
|
|
5
|
+
var _react2 = require("@storybook/react");
|
|
6
|
+
var _storyHelpers = require("../../_helpers/story-helpers");
|
|
7
|
+
var _timer = _interopRequireDefault(require("./timer"));
|
|
8
|
+
(0, _react2.storiesOf)('Timer').add('default', function () {
|
|
9
|
+
return /*#__PURE__*/_react["default"].createElement(_storyHelpers.Example, {
|
|
10
|
+
title: "Appearances"
|
|
11
|
+
}, /*#__PURE__*/_react["default"].createElement(_storyHelpers.Stack, null, /*#__PURE__*/_react["default"].createElement(_timer["default"], {
|
|
12
|
+
endTime: 1573833600000
|
|
13
|
+
})));
|
|
27
14
|
});
|
package/atoms/toast/index.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
var _toast = require(
|
|
8
|
-
|
|
9
|
-
var _toast2 = _interopRequireDefault(_toast);
|
|
10
|
-
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
13
|
-
exports.default = _toast2.default;
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _toast = _interopRequireDefault(require("./toast"));
|
|
9
|
+
var _default = exports["default"] = _toast["default"];
|