@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
package/atoms/popup/popup.js
CHANGED
|
@@ -1,66 +1,41 @@
|
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
26
|
-
|
|
27
|
-
var _button = require('../button');
|
|
28
|
-
|
|
29
|
-
var _button2 = _interopRequireDefault(_button);
|
|
30
|
-
|
|
31
|
-
var _tokens = require('@desynova-digital/tokens');
|
|
32
|
-
|
|
33
|
-
var _loader = require('../../atoms/loader');
|
|
34
|
-
|
|
35
|
-
var _loader2 = _interopRequireDefault(_loader);
|
|
36
|
-
|
|
37
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
38
|
-
|
|
39
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
40
|
-
|
|
41
|
-
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; }
|
|
42
|
-
|
|
43
|
-
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; }
|
|
44
|
-
|
|
45
|
-
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
46
|
-
// import {colors} from '../../../tokens'
|
|
47
|
-
|
|
48
|
-
|
|
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 _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
18
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
19
|
+
var _tokens = require("@desynova-digital/tokens");
|
|
20
|
+
var _loader = _interopRequireDefault(require("../../atoms/loader"));
|
|
21
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5; // import {colors} from '../../../tokens'
|
|
22
|
+
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); }
|
|
23
|
+
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; }
|
|
24
|
+
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)); }
|
|
25
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
49
26
|
var propTypes = {
|
|
50
|
-
title:
|
|
51
|
-
showPopup:
|
|
52
|
-
messageBody:
|
|
53
|
-
popupContent:
|
|
54
|
-
acceptButtonText:
|
|
55
|
-
cancelButtonText:
|
|
56
|
-
onAcceptClick:
|
|
57
|
-
onCancelClick:
|
|
58
|
-
theme:
|
|
27
|
+
title: _propTypes["default"].string,
|
|
28
|
+
showPopup: _propTypes["default"].bool,
|
|
29
|
+
messageBody: _propTypes["default"].string,
|
|
30
|
+
popupContent: _propTypes["default"].string,
|
|
31
|
+
acceptButtonText: _propTypes["default"].string,
|
|
32
|
+
cancelButtonText: _propTypes["default"].string,
|
|
33
|
+
onAcceptClick: _propTypes["default"].func,
|
|
34
|
+
onCancelClick: _propTypes["default"].func,
|
|
35
|
+
theme: _propTypes["default"].string
|
|
59
36
|
};
|
|
60
|
-
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
var CancelButton = (0, _styledComponents2.default)(_button2.default)(_templateObject2, function (props) {
|
|
37
|
+
var AcceptButton = (0, _styledComponents["default"])(_button["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0;\n"])));
|
|
38
|
+
var CancelButton = (0, _styledComponents["default"])(_button["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0;\n background: ", ";\n border-color: ", ";\n color: ", ";\n transition: all 0.4s ease-in-out;\n &:hover {\n background: ", ";\n border-color: ", ";\n box-shadow: none;\n color: ", ";\n }\n"])), function (props) {
|
|
64
39
|
return _tokens.colors[props.theme].popup.cancleButtonBackground;
|
|
65
40
|
}, function (props) {
|
|
66
41
|
return _tokens.colors[props.theme].popup.cancleButtonBackground;
|
|
@@ -71,181 +46,121 @@ var CancelButton = (0, _styledComponents2.default)(_button2.default)(_templateOb
|
|
|
71
46
|
}, function (props) {
|
|
72
47
|
return _tokens.colors[props.theme].popup.cancleHoverText;
|
|
73
48
|
});
|
|
74
|
-
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
var PopupOverlay = _styledComponents2.default.div(_templateObject4, function (props) {
|
|
49
|
+
var PopupBlock = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: 1000;\n"])));
|
|
50
|
+
var PopupOverlay = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n background: ", ";\n width: 100%;\n height: 100%;\n"])), function (props) {
|
|
78
51
|
return _tokens.colors[props.theme].popup.overlayColor;
|
|
79
52
|
});
|
|
80
|
-
var PopupBox =
|
|
53
|
+
var PopupBox = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n z-index: 3;\n max-width: 650px;\n min-width: 440px;\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n -ms-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n\n width: 440px;\n border-radius: 10px;\n background: ", ";\n\n .popup-header {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n box-sizing: border-box;\n padding: 40px;\n\n .header-title {\n font-family: SFUIText-Light;\n font-size: 18px;\n line-height: 1;\n color: ", ";\n }\n .display-flex {\n display: flex;\n .pr-20 {\n padding-right: 20px;\n }\n }\n .cursor-p {\n cursor: pointer;\n }\n\n .count-wrapper {\n font-size: 14px;\n line-height: 24px;\n color: #afb2ba;\n font-family: 'SFUIText-Light';\n }\n ", " {\n margin: 0;\n background: transparent;\n border-color: transparent;\n padding: 0;\n path {\n fill: ", ";\n }\n &:hover {\n background: transparent;\n border-color: transparent;\n }\n }\n }\n .popup-body {\n padding: 0 40px 40px 40px;\n .popup-action-block {\n margin: 0 auto;\n display: flex;\n justify-content: center;\n\n button {\n padding: 10px 0;\n margin: 0 10px;\n min-width: 150px;\n }\n }\n .popup-message {\n font-family: SFUIText-Light;\n font-size: 14px;\n line-height: 1.5;\n text-align: center;\n color: ", ";\n margin-bottom: 40px;\n }\n }\n\n .loading-box {\n position: absolute;\n top: 0px;\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0px;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: wait;\n background-color: rgb(21 21 21 / 60%);\n border-radius: 10px;\n }\n"])), function (props) {
|
|
81
54
|
return _tokens.colors[props.theme].popup.popupBoxBackground;
|
|
82
55
|
}, function (props) {
|
|
83
56
|
return _tokens.colors[props.theme].popup.messageText;
|
|
84
|
-
},
|
|
57
|
+
}, _button["default"].Element, function (props) {
|
|
85
58
|
return _tokens.colors[props.theme].popup.cancleIconColor;
|
|
86
59
|
}, _tokens.colors.common.base.white);
|
|
87
|
-
|
|
88
|
-
var Popup = function (_Component) {
|
|
89
|
-
_inherits(Popup, _Component);
|
|
90
|
-
|
|
60
|
+
var Popup = /*#__PURE__*/function (_Component) {
|
|
91
61
|
function Popup(props) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return _possibleConstructorReturn(this, (Popup.__proto__ || Object.getPrototypeOf(Popup)).call(this, props));
|
|
62
|
+
(0, _classCallCheck2["default"])(this, Popup);
|
|
63
|
+
return _callSuper(this, Popup, [props]);
|
|
95
64
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
key:
|
|
65
|
+
(0, _inherits2["default"])(Popup, _Component);
|
|
66
|
+
return (0, _createClass2["default"])(Popup, [{
|
|
67
|
+
key: "acceptClick",
|
|
99
68
|
value: function acceptClick() {
|
|
100
69
|
var onAcceptClick = this.props.onAcceptClick;
|
|
101
|
-
|
|
102
70
|
onAcceptClick();
|
|
103
71
|
}
|
|
104
72
|
}, {
|
|
105
|
-
key:
|
|
73
|
+
key: "cancelClick",
|
|
106
74
|
value: function cancelClick() {
|
|
107
75
|
var onCancelClick = this.props.onCancelClick;
|
|
108
|
-
|
|
109
76
|
onCancelClick();
|
|
110
77
|
}
|
|
111
78
|
}, {
|
|
112
|
-
key:
|
|
79
|
+
key: "render",
|
|
113
80
|
value: function render() {
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
messageBody ? _react2.default.createElement(
|
|
191
|
-
'p',
|
|
192
|
-
{ className: 'popup-message' },
|
|
193
|
-
messageBody
|
|
194
|
-
) : null,
|
|
195
|
-
popupContent ? _react2.default.createElement(
|
|
196
|
-
'div',
|
|
197
|
-
{ className: 'popup-content' },
|
|
198
|
-
popupContent
|
|
199
|
-
) : null,
|
|
200
|
-
_react2.default.createElement(
|
|
201
|
-
'div',
|
|
202
|
-
{ className: 'popup-action-block' },
|
|
203
|
-
cancelButtonText ? _react2.default.createElement(
|
|
204
|
-
CancelButton,
|
|
205
|
-
{
|
|
206
|
-
display: 'rounded',
|
|
207
|
-
onClick: function onClick() {
|
|
208
|
-
_this2.cancelClick();
|
|
209
|
-
},
|
|
210
|
-
theme: this.props.theme
|
|
211
|
-
},
|
|
212
|
-
cancelButtonText
|
|
213
|
-
) : null,
|
|
214
|
-
acceptButtonText ? _react2.default.createElement(
|
|
215
|
-
AcceptButton,
|
|
216
|
-
{
|
|
217
|
-
theme: this.props.theme,
|
|
218
|
-
display: 'rounded',
|
|
219
|
-
onClick: function onClick() {
|
|
220
|
-
_this2.acceptClick();
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
acceptButtonText
|
|
224
|
-
) : null
|
|
225
|
-
)
|
|
226
|
-
),
|
|
227
|
-
loading ? _react2.default.createElement(
|
|
228
|
-
'div',
|
|
229
|
-
{ className: 'loading-box' },
|
|
230
|
-
typeof loading == 'boolean' ? _react2.default.createElement(_loader2.default, { theme: this.props.theme, loaderName: loaderName ? loaderName : null }) : loading
|
|
231
|
-
) : null
|
|
232
|
-
)
|
|
233
|
-
) : null
|
|
234
|
-
);
|
|
81
|
+
var _this = this;
|
|
82
|
+
var _this$props = this.props,
|
|
83
|
+
theme = _this$props.theme,
|
|
84
|
+
title = _this$props.title,
|
|
85
|
+
showPopup = _this$props.showPopup,
|
|
86
|
+
messageBody = _this$props.messageBody,
|
|
87
|
+
popupContent = _this$props.popupContent,
|
|
88
|
+
acceptButtonText = _this$props.acceptButtonText,
|
|
89
|
+
cancelButtonText = _this$props.cancelButtonText,
|
|
90
|
+
loading = _this$props.loading,
|
|
91
|
+
loaderName = _this$props.loaderName,
|
|
92
|
+
showSharedUsers = _this$props.showSharedUsers,
|
|
93
|
+
sharedUserCount = _this$props.sharedUserCount,
|
|
94
|
+
openPopup = _this$props.openPopup;
|
|
95
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, showPopup ? /*#__PURE__*/_react["default"].createElement(PopupBlock, {
|
|
96
|
+
theme: this.props.theme
|
|
97
|
+
}, /*#__PURE__*/_react["default"].createElement(PopupOverlay, {
|
|
98
|
+
theme: this.props.theme
|
|
99
|
+
}), /*#__PURE__*/_react["default"].createElement(PopupBox, {
|
|
100
|
+
theme: this.props.theme
|
|
101
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
102
|
+
className: "popup-header"
|
|
103
|
+
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
104
|
+
className: "header-title"
|
|
105
|
+
}, title), /*#__PURE__*/_react["default"].createElement("div", {
|
|
106
|
+
className: "display-flex"
|
|
107
|
+
}, showSharedUsers && sharedUserCount > 0 ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
108
|
+
className: "display-flex pr-20 cursor-p",
|
|
109
|
+
onClick: function onClick() {
|
|
110
|
+
openPopup('SHARED_USERS');
|
|
111
|
+
}
|
|
112
|
+
}, /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
113
|
+
appearance: "cta",
|
|
114
|
+
iconWidth: 18,
|
|
115
|
+
iconHeight: 18,
|
|
116
|
+
icon: "users",
|
|
117
|
+
iconBackground: false,
|
|
118
|
+
theme: this.props.theme
|
|
119
|
+
}), /*#__PURE__*/_react["default"].createElement("p", {
|
|
120
|
+
className: "count-wrapper"
|
|
121
|
+
}, sharedUserCount)) : null, /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
122
|
+
theme: this.props.theme,
|
|
123
|
+
appearance: "cta",
|
|
124
|
+
iconWidth: 12,
|
|
125
|
+
iconHeight: 12,
|
|
126
|
+
icon: "cross",
|
|
127
|
+
iconBackground: false,
|
|
128
|
+
onClick: function onClick() {
|
|
129
|
+
_this.cancelClick();
|
|
130
|
+
}
|
|
131
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
132
|
+
className: "popup-body"
|
|
133
|
+
}, messageBody ? /*#__PURE__*/_react["default"].createElement("p", {
|
|
134
|
+
className: "popup-message"
|
|
135
|
+
}, messageBody) : null, popupContent ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
136
|
+
className: "popup-content"
|
|
137
|
+
}, popupContent) : null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
138
|
+
className: "popup-action-block"
|
|
139
|
+
}, cancelButtonText ? /*#__PURE__*/_react["default"].createElement(CancelButton, {
|
|
140
|
+
display: "rounded",
|
|
141
|
+
onClick: function onClick() {
|
|
142
|
+
_this.cancelClick();
|
|
143
|
+
},
|
|
144
|
+
theme: this.props.theme
|
|
145
|
+
}, cancelButtonText) : null, acceptButtonText ? /*#__PURE__*/_react["default"].createElement(AcceptButton, {
|
|
146
|
+
theme: this.props.theme,
|
|
147
|
+
display: "rounded",
|
|
148
|
+
onClick: function onClick() {
|
|
149
|
+
_this.acceptClick();
|
|
150
|
+
}
|
|
151
|
+
}, acceptButtonText) : null)), loading ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
152
|
+
className: "loading-box"
|
|
153
|
+
}, typeof loading == 'boolean' ? /*#__PURE__*/_react["default"].createElement(_loader["default"], {
|
|
154
|
+
theme: this.props.theme,
|
|
155
|
+
loaderName: loaderName ? loaderName : null
|
|
156
|
+
}) : loading) : null)) : null);
|
|
235
157
|
}
|
|
236
158
|
}]);
|
|
237
|
-
|
|
238
|
-
return Popup;
|
|
239
|
-
}(_react.Component);
|
|
240
|
-
|
|
241
|
-
// Popup.propTypes = propTypes;
|
|
242
|
-
|
|
159
|
+
}(_react.Component); // Popup.propTypes = propTypes;
|
|
243
160
|
Popup.propTypes = {
|
|
244
|
-
theme:
|
|
161
|
+
theme: _propTypes["default"].oneOf(['light', 'dark', 'nexc'])
|
|
245
162
|
};
|
|
246
|
-
|
|
247
163
|
Popup.defaultProps = {
|
|
248
164
|
theme: 'dark'
|
|
249
165
|
};
|
|
250
|
-
|
|
251
|
-
exports.default = Popup;
|
|
166
|
+
var _default = exports["default"] = Popup;
|
|
@@ -1,136 +1,102 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var _react2 =
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
console.log('onAcceptClick func() called...');
|
|
32
|
-
},
|
|
33
|
-
onCancelClick: function onCancelClick() {
|
|
34
|
-
console.log('onCancelClick func() called...');
|
|
35
|
-
},
|
|
36
|
-
theme: 'dark',
|
|
37
|
-
showSharedUsers: true,
|
|
38
|
-
sharedUserCount: 5,
|
|
39
|
-
openPopup: function openPopup(view) {
|
|
40
|
-
return console.log(view);
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
)
|
|
44
|
-
);
|
|
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 _popup = _interopRequireDefault(require("./popup"));
|
|
8
|
+
(0, _react2.storiesOf)('Popup').add('dark theme', function () {
|
|
9
|
+
return /*#__PURE__*/_react["default"].createElement(_storyHelpers.Example, {
|
|
10
|
+
title: "Appearances Dark",
|
|
11
|
+
background: "dark"
|
|
12
|
+
}, /*#__PURE__*/_react["default"].createElement(_storyHelpers.Stack, null, /*#__PURE__*/_react["default"].createElement(_popup["default"], {
|
|
13
|
+
showPopup: true,
|
|
14
|
+
title: 'hi i am popup Title!!!',
|
|
15
|
+
messageBody: 'Did you like this popup?',
|
|
16
|
+
acceptButtonText: 'Yes',
|
|
17
|
+
cancelButtonText: 'No',
|
|
18
|
+
onAcceptClick: function onAcceptClick() {
|
|
19
|
+
console.log('onAcceptClick func() called...');
|
|
20
|
+
},
|
|
21
|
+
onCancelClick: function onCancelClick() {
|
|
22
|
+
console.log('onCancelClick func() called...');
|
|
23
|
+
},
|
|
24
|
+
theme: 'dark',
|
|
25
|
+
showSharedUsers: true,
|
|
26
|
+
sharedUserCount: 5,
|
|
27
|
+
openPopup: function openPopup(view) {
|
|
28
|
+
return console.log(view);
|
|
29
|
+
}
|
|
30
|
+
})));
|
|
45
31
|
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
openPopup: function openPopup(view) {
|
|
70
|
-
return console.log(view);
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
)
|
|
74
|
-
);
|
|
32
|
+
(0, _react2.storiesOf)('Popup').add('nexc theme', function () {
|
|
33
|
+
return /*#__PURE__*/_react["default"].createElement(_storyHelpers.Example, {
|
|
34
|
+
title: "Appearances Dark",
|
|
35
|
+
background: "dark"
|
|
36
|
+
}, /*#__PURE__*/_react["default"].createElement(_storyHelpers.Stack, null, /*#__PURE__*/_react["default"].createElement(_popup["default"], {
|
|
37
|
+
showPopup: true,
|
|
38
|
+
title: 'hi i am popup Title!!!',
|
|
39
|
+
messageBody: 'Did you like this popup?',
|
|
40
|
+
acceptButtonText: 'Yes',
|
|
41
|
+
cancelButtonText: 'No',
|
|
42
|
+
onAcceptClick: function onAcceptClick() {
|
|
43
|
+
console.log('onAcceptClick func() called...');
|
|
44
|
+
},
|
|
45
|
+
onCancelClick: function onCancelClick() {
|
|
46
|
+
console.log('onCancelClick func() called...');
|
|
47
|
+
},
|
|
48
|
+
theme: 'nexc',
|
|
49
|
+
showSharedUsers: true,
|
|
50
|
+
sharedUserCount: 5,
|
|
51
|
+
openPopup: function openPopup(view) {
|
|
52
|
+
return console.log(view);
|
|
53
|
+
}
|
|
54
|
+
})));
|
|
75
55
|
});
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
console.log('onCancelClick func() called...');
|
|
95
|
-
},
|
|
96
|
-
theme: 'light'
|
|
97
|
-
})
|
|
98
|
-
)
|
|
99
|
-
);
|
|
56
|
+
(0, _react2.storiesOf)('Popup').add('light theme', function () {
|
|
57
|
+
return /*#__PURE__*/_react["default"].createElement(_storyHelpers.Example, {
|
|
58
|
+
title: "Appearances light",
|
|
59
|
+
background: "light"
|
|
60
|
+
}, /*#__PURE__*/_react["default"].createElement(_storyHelpers.Stack, null, /*#__PURE__*/_react["default"].createElement(_popup["default"], {
|
|
61
|
+
showPopup: true,
|
|
62
|
+
title: 'hi i am popup Title!!!',
|
|
63
|
+
messageBody: 'Did you like this popup?',
|
|
64
|
+
acceptButtonText: 'Yes',
|
|
65
|
+
cancelButtonText: 'No',
|
|
66
|
+
onAcceptClick: function onAcceptClick() {
|
|
67
|
+
console.log('onAcceptClick func() called...');
|
|
68
|
+
},
|
|
69
|
+
onCancelClick: function onCancelClick() {
|
|
70
|
+
console.log('onCancelClick func() called...');
|
|
71
|
+
},
|
|
72
|
+
theme: 'light'
|
|
73
|
+
})));
|
|
100
74
|
});
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
},
|
|
129
|
-
onCancelClick: function onCancelClick() {
|
|
130
|
-
console.log('onCancelClick func() called...');
|
|
131
|
-
},
|
|
132
|
-
theme: 'dark'
|
|
133
|
-
})
|
|
134
|
-
)
|
|
135
|
-
);
|
|
75
|
+
(0, _react2.storiesOf)('Popup').add('popup-with div', function () {
|
|
76
|
+
return /*#__PURE__*/_react["default"].createElement(_storyHelpers.Example, {
|
|
77
|
+
title: "Appearances Dark",
|
|
78
|
+
background: "dark"
|
|
79
|
+
}, /*#__PURE__*/_react["default"].createElement(_storyHelpers.Stack, null, /*#__PURE__*/_react["default"].createElement(_popup["default"], {
|
|
80
|
+
showPopup: true,
|
|
81
|
+
title: 'hi i am popup Title!!!'
|
|
82
|
+
// messageBody= {'Did you like this popup?'}
|
|
83
|
+
,
|
|
84
|
+
popupContent: /*#__PURE__*/_react["default"].createElement("div", {
|
|
85
|
+
style: {
|
|
86
|
+
height: '300px',
|
|
87
|
+
background: 'red',
|
|
88
|
+
width: '100%'
|
|
89
|
+
}
|
|
90
|
+
}, "HI")
|
|
91
|
+
// acceptButtonText= {'Yes'}
|
|
92
|
+
// cancelButtonText= {'No'}
|
|
93
|
+
,
|
|
94
|
+
onAcceptClick: function onAcceptClick() {
|
|
95
|
+
console.log('onAcceptClick func() called...');
|
|
96
|
+
},
|
|
97
|
+
onCancelClick: function onCancelClick() {
|
|
98
|
+
console.log('onCancelClick func() called...');
|
|
99
|
+
},
|
|
100
|
+
theme: 'dark'
|
|
101
|
+
})));
|
|
136
102
|
});
|