@bigbinary/neeto-molecules 1.0.94 → 1.0.96

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.
Files changed (39) hide show
  1. package/dist/CustomDomain.cjs.js +8 -10
  2. package/dist/CustomDomain.cjs.js.map +1 -1
  3. package/dist/CustomDomain.js +10 -13
  4. package/dist/CustomDomain.js.map +1 -1
  5. package/dist/CustomDomainDashboard.cjs.js +8 -10
  6. package/dist/CustomDomainDashboard.cjs.js.map +1 -1
  7. package/dist/CustomDomainDashboard.js +9 -12
  8. package/dist/CustomDomainDashboard.js.map +1 -1
  9. package/dist/IntegrationCard.cjs.js +223 -38
  10. package/dist/IntegrationCard.cjs.js.map +1 -1
  11. package/dist/IntegrationCard.js +227 -42
  12. package/dist/IntegrationCard.js.map +1 -1
  13. package/dist/IntegrationDisconnectAlert.cjs.js +22 -14
  14. package/dist/IntegrationDisconnectAlert.cjs.js.map +1 -1
  15. package/dist/IntegrationDisconnectAlert.js +19 -14
  16. package/dist/IntegrationDisconnectAlert.js.map +1 -1
  17. package/dist/IntegrationWalkthroughModal.cjs.js +17 -9
  18. package/dist/IntegrationWalkthroughModal.cjs.js.map +1 -1
  19. package/dist/IntegrationWalkthroughModal.js +14 -9
  20. package/dist/IntegrationWalkthroughModal.js.map +1 -1
  21. package/dist/IpRestriction.cjs.js +51 -50
  22. package/dist/IpRestriction.cjs.js.map +1 -1
  23. package/dist/IpRestriction.js +52 -51
  24. package/dist/IpRestriction.js.map +1 -1
  25. package/dist/NeetoWidget.cjs.js +5 -20
  26. package/dist/NeetoWidget.cjs.js.map +1 -1
  27. package/dist/NeetoWidget.js +5 -21
  28. package/dist/NeetoWidget.js.map +1 -1
  29. package/dist/Schedule.cjs.js +4 -10
  30. package/dist/Schedule.cjs.js.map +1 -1
  31. package/dist/Schedule.js +5 -11
  32. package/dist/Schedule.js.map +1 -1
  33. package/dist/ShareViaLink.cjs.js +7 -8
  34. package/dist/ShareViaLink.cjs.js.map +1 -1
  35. package/dist/ShareViaLink.js +7 -9
  36. package/dist/ShareViaLink.js.map +1 -1
  37. package/package.json +1 -1
  38. package/src/translations/en.json +11 -2
  39. package/types/IntegrationCard.d.ts +14 -5
@@ -1,68 +1,253 @@
1
1
  import React from 'react';
2
- import { noop } from '@bigbinary/neeto-commons-frontend/pure';
3
- import { Check, MenuVertical } from '@bigbinary/neeto-icons';
4
- import { Dropdown, Typography, Tag, Button } from '@bigbinary/neetoui';
2
+ import { noop, isNotEmpty } from '@bigbinary/neeto-commons-frontend/pure';
3
+ import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils';
4
+ import { Dropdown as Dropdown$1, Tag, Tooltip, Typography, Spinner, Button } from '@bigbinary/neetoui';
5
+ import { isNotNil } from 'ramda';
5
6
  import { useTranslation } from 'react-i18next';
7
+ import { MenuVertical, Warning, Check } from '@bigbinary/neeto-icons';
8
+
9
+ function _extends() {
10
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
11
+ for (var i = 1; i < arguments.length; i++) {
12
+ var source = arguments[i];
13
+ for (var key in source) {
14
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
15
+ target[key] = source[key];
16
+ }
17
+ }
18
+ }
19
+ return target;
20
+ };
21
+ return _extends.apply(this, arguments);
22
+ }
23
+
24
+ var classnames$1 = {exports: {}};
25
+
26
+ /*!
27
+ Copyright (c) 2018 Jed Watson.
28
+ Licensed under the MIT License (MIT), see
29
+ http://jedwatson.github.io/classnames
30
+ */
31
+
32
+ (function (module) {
33
+ /* global define */
34
+
35
+ (function () {
36
+
37
+ var hasOwn = {}.hasOwnProperty;
38
+
39
+ function classNames() {
40
+ var classes = [];
41
+
42
+ for (var i = 0; i < arguments.length; i++) {
43
+ var arg = arguments[i];
44
+ if (!arg) continue;
45
+
46
+ var argType = typeof arg;
47
+
48
+ if (argType === 'string' || argType === 'number') {
49
+ classes.push(arg);
50
+ } else if (Array.isArray(arg)) {
51
+ if (arg.length) {
52
+ var inner = classNames.apply(null, arg);
53
+ if (inner) {
54
+ classes.push(inner);
55
+ }
56
+ }
57
+ } else if (argType === 'object') {
58
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
59
+ classes.push(arg.toString());
60
+ continue;
61
+ }
62
+
63
+ for (var key in arg) {
64
+ if (hasOwn.call(arg, key) && arg[key]) {
65
+ classes.push(key);
66
+ }
67
+ }
68
+ }
69
+ }
70
+
71
+ return classes.join(' ');
72
+ }
73
+
74
+ if (module.exports) {
75
+ classNames.default = classNames;
76
+ module.exports = classNames;
77
+ } else {
78
+ window.classNames = classNames;
79
+ }
80
+ }());
81
+ } (classnames$1));
82
+
83
+ var classnames = classnames$1.exports;
84
+
85
+ var Menu = Dropdown$1.Menu,
86
+ MenuItem = Dropdown$1.MenuItem;
87
+ var Dropdown = function Dropdown(_ref) {
88
+ var customDropdown = _ref.customDropdown,
89
+ _ref$handleManage = _ref.handleManage,
90
+ handleManage = _ref$handleManage === void 0 ? noop : _ref$handleManage,
91
+ _ref$hideDisconnect = _ref.hideDisconnect,
92
+ hideDisconnect = _ref$hideDisconnect === void 0 ? false : _ref$hideDisconnect,
93
+ _ref$onDisconnect = _ref.onDisconnect,
94
+ onDisconnect = _ref$onDisconnect === void 0 ? noop : _ref$onDisconnect;
95
+ var _useTranslation = useTranslation(),
96
+ t = _useTranslation.t;
97
+ if (isNotNil(customDropdown)) {
98
+ return /*#__PURE__*/React.createElement("div", {
99
+ onClick: function onClick(e) {
100
+ return e.stopPropagation();
101
+ }
102
+ }, customDropdown);
103
+ }
104
+ var isManageable = isNotNil(handleManage);
105
+ if (!isManageable && hideDisconnect) {
106
+ return null;
107
+ }
108
+ return /*#__PURE__*/React.createElement("div", {
109
+ onClick: function onClick(e) {
110
+ return e.stopPropagation();
111
+ }
112
+ }, /*#__PURE__*/React.createElement(Dropdown$1, {
113
+ buttonStyle: "text",
114
+ icon: MenuVertical
115
+ }, /*#__PURE__*/React.createElement(Menu, null, isManageable && /*#__PURE__*/React.createElement(MenuItem.Button, {
116
+ onClick: handleManage
117
+ }, t("neetoMolecules.integrationCard.manage")), !hideDisconnect && /*#__PURE__*/React.createElement(MenuItem.Button, {
118
+ onClick: onDisconnect
119
+ }, t("neetoMolecules.integrationCard.disconnect")))));
120
+ };
121
+
122
+ var Status = function Status(_ref) {
123
+ var isExpired = _ref.isExpired;
124
+ var _useTranslation = useTranslation(),
125
+ t = _useTranslation.t;
126
+ var tagProps = isExpired ? {
127
+ icon: Warning,
128
+ label: t("neetoMolecules.integrationCard.tags.expired"),
129
+ style: "warning"
130
+ } : {
131
+ icon: Check,
132
+ label: t("neetoMolecules.integrationCard.tags.connected"),
133
+ style: "success"
134
+ };
135
+ return /*#__PURE__*/React.createElement(Tag, _extends({
136
+ className: "flex-row-reverse"
137
+ }, tagProps, {
138
+ "data-testid": "integration-status"
139
+ }));
140
+ };
6
141
 
7
- var Menu = Dropdown.Menu,
8
- MenuItem = Dropdown.MenuItem;
9
142
  var IntegrationCard = function IntegrationCard(_ref) {
10
- var label = _ref.label,
11
- description = _ref.description,
12
- Icon = _ref.Icon,
143
+ var Icon = _ref.icon,
144
+ _ref$subIcons = _ref.subIcons,
145
+ subIcons = _ref$subIcons === void 0 ? [] : _ref$subIcons,
146
+ _ref$label = _ref.label,
147
+ label = _ref$label === void 0 ? "" : _ref$label,
148
+ _ref$description = _ref.description,
149
+ description = _ref$description === void 0 ? "" : _ref$description,
13
150
  _ref$className = _ref.className,
14
151
  className = _ref$className === void 0 ? "" : _ref$className,
15
- isConnected = _ref.isConnected,
16
- _ref$isStatusLoading = _ref.isStatusLoading,
17
- isStatusLoading = _ref$isStatusLoading === void 0 ? false : _ref$isStatusLoading,
18
- _ref$customDropdown = _ref.customDropdown,
19
- customDropdown = _ref$customDropdown === void 0 ? null : _ref$customDropdown,
152
+ _ref$onConnect = _ref.onConnect,
153
+ onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
20
154
  _ref$onDisconnect = _ref.onDisconnect,
21
155
  onDisconnect = _ref$onDisconnect === void 0 ? noop : _ref$onDisconnect,
22
- onConnect = _ref.onConnect,
23
156
  _ref$onManage = _ref.onManage,
24
- onManage = _ref$onManage === void 0 ? noop : _ref$onManage;
157
+ onManage = _ref$onManage === void 0 ? undefined : _ref$onManage,
158
+ _ref$isLoading = _ref.isLoading,
159
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
160
+ _ref$isConnected = _ref.isConnected,
161
+ isConnected = _ref$isConnected === void 0 ? false : _ref$isConnected,
162
+ _ref$isFailed = _ref.isFailed,
163
+ isFailed = _ref$isFailed === void 0 ? false : _ref$isFailed,
164
+ _ref$isExpired = _ref.isExpired,
165
+ isExpired = _ref$isExpired === void 0 ? false : _ref$isExpired,
166
+ _ref$disabled = _ref.disabled,
167
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
168
+ _ref$hidden = _ref.hidden,
169
+ hidden = _ref$hidden === void 0 ? false : _ref$hidden,
170
+ _ref$hideDisconnect = _ref.hideDisconnect,
171
+ hideDisconnect = _ref$hideDisconnect === void 0 ? false : _ref$hideDisconnect,
172
+ _ref$onClick = _ref.onClick,
173
+ onCardClick = _ref$onClick === void 0 ? undefined : _ref$onClick,
174
+ _ref$tooltipProps = _ref.tooltipProps,
175
+ tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
176
+ _ref$customDropdown = _ref.customDropdown,
177
+ customDropdown = _ref$customDropdown === void 0 ? null : _ref$customDropdown,
178
+ children = _ref.children;
25
179
  var _useTranslation = useTranslation(),
26
180
  t = _useTranslation.t;
27
- return /*#__PURE__*/React.createElement("div", {
28
- className: "outline-none neeto-ui-border-gray-300 neeto-ui-shadow-xs hover:neeto-ui-border-gray-500 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex flex-col border p-6 no-underline transition-colors ".concat(className)
181
+ if (hidden) return null;
182
+ var isCardClickable = isConnected && isNotNil(onCardClick);
183
+ var cardProps = isCardClickable ? {
184
+ onClick: onCardClick
185
+ } : {};
186
+ return /*#__PURE__*/React.createElement(Tooltip, _extends({
187
+ disabled: !disabled,
188
+ position: "top",
189
+ content: disabled && t("neetoMolecules.integrationCard.tooltip.integrationNotAvailable")
190
+ }, tooltipProps), /*#__PURE__*/React.createElement("div", _extends({
191
+ "data-testid": "integration-card",
192
+ className: classnames("outline-none neeto-ui-border-gray-300 neeto-ui-shadow-xs hover:neeto-ui-border-gray-500 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex flex-col border p-6 no-underline transition-colors", {
193
+ "hover:neeto-ui-bg-100 cursor-not-allowed opacity-50": disabled,
194
+ "cursor-pointer": isCardClickable
195
+ }, className)
196
+ }, cardProps), /*#__PURE__*/React.createElement("div", {
197
+ className: "flex flex-grow justify-between",
198
+ "data-cy": "integration-tabs"
29
199
  }, /*#__PURE__*/React.createElement("div", {
30
- className: "h-full"
200
+ className: "flex min-w-0 flex-col justify-end"
31
201
  }, /*#__PURE__*/React.createElement("div", {
32
- className: "mb-4"
202
+ className: "relative mb-4 flex h-8"
33
203
  }, Icon && /*#__PURE__*/React.createElement(Icon, {
34
- className: "neeto-ui-text-gray-700",
35
204
  size: 32
36
- })), /*#__PURE__*/React.createElement(Typography, {
37
- className: "neeto-ui-text-gray-800 mb-2",
205
+ })), /*#__PURE__*/React.createElement("div", {
206
+ className: "my-auto"
207
+ }, /*#__PURE__*/React.createElement(Typography, {
208
+ className: "mb-2",
209
+ "data-cy": "integration-card-label",
38
210
  style: "h4",
39
211
  weight: "semibold"
40
212
  }, label), /*#__PURE__*/React.createElement(Typography, {
41
- className: "neeto-ui-text-gray-700",
213
+ className: "break-words",
214
+ "data-cy": "".concat(joinHyphenCase(label), "-integration-description"),
42
215
  style: "body2"
43
- }, description)), /*#__PURE__*/React.createElement("div", {
216
+ }, description), children)), isNotEmpty(subIcons) && /*#__PURE__*/React.createElement("div", {
217
+ className: "flex h-24 flex-col gap-2"
218
+ }, subIcons.map(function (Icon, index) {
219
+ return /*#__PURE__*/React.createElement(Icon, {
220
+ className: "neeto-ui-text-gray-600",
221
+ key: index,
222
+ size: 24
223
+ });
224
+ }))), /*#__PURE__*/React.createElement("div", {
44
225
  className: "neeto-ui-border-gray-300 mt-4 w-full border-t pt-2"
45
- }, /*#__PURE__*/React.createElement("div", {
226
+ }, isLoading ? /*#__PURE__*/React.createElement("div", {
227
+ className: "mt-3 flex items-center justify-start"
228
+ }, /*#__PURE__*/React.createElement(Spinner, null)) : /*#__PURE__*/React.createElement("div", {
46
229
  className: "flex h-8 items-center justify-between"
47
- }, isConnected ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tag, {
48
- className: "flex-row-reverse",
49
- icon: Check,
50
- label: t("neetoMolecules.integrationCard.connected"),
51
- size: "small",
52
- style: "success"
53
- }), customDropdown || /*#__PURE__*/React.createElement(Dropdown, {
54
- buttonStyle: "text",
55
- icon: MenuVertical
56
- }, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(MenuItem.Button, {
57
- onClick: onManage
58
- }, t("neetoMolecules.integrationCard.manage")), /*#__PURE__*/React.createElement(MenuItem.Button, {
59
- onClick: onDisconnect
60
- }, t("neetoMolecules.integrationCard.disconnect"))))) : /*#__PURE__*/React.createElement(Button, {
61
- loading: isStatusLoading,
230
+ }, isConnected && /*#__PURE__*/React.createElement(Status, {
231
+ isExpired: isExpired
232
+ }), isFailed && /*#__PURE__*/React.createElement(Button, {
233
+ className: "neeto-ui-text-warning-500",
234
+ "data-cy": "connect-button",
235
+ disabled: disabled || isLoading,
236
+ label: t("neetoMolecules.integrationCard.tryAgain"),
237
+ style: "link",
238
+ onClick: onConnect
239
+ }), !isConnected && !isFailed && /*#__PURE__*/React.createElement(Button, {
240
+ "data-cy": "connect-button",
241
+ disabled: disabled || isLoading,
242
+ label: t("neetoMolecules.integrationCard.connect"),
62
243
  style: "link",
63
- label: isStatusLoading ? "" : t("neetoMolecules.integrationCard.connect"),
64
244
  onClick: onConnect
65
- }))));
245
+ }), (isConnected || isFailed) && /*#__PURE__*/React.createElement(Dropdown, {
246
+ customDropdown: customDropdown,
247
+ hideDisconnect: hideDisconnect,
248
+ onDisconnect: onDisconnect,
249
+ handleManage: onManage
250
+ })))));
66
251
  };
67
252
 
68
253
  export { IntegrationCard as default };
@@ -1 +1 @@
1
- {"version":3,"file":"IntegrationCard.js","sources":["../src/components/IntegrationCard/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { noop } from \"neetocommons/pure\";\nimport { Check, MenuVertical } from \"neetoicons\";\nimport { Typography, Button, Tag, Dropdown } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nconst { Menu, MenuItem } = Dropdown;\n\nconst IntegrationCard = ({\n label,\n description,\n Icon,\n className = \"\",\n isConnected,\n isStatusLoading = false,\n customDropdown = null,\n onDisconnect = noop,\n onConnect,\n onManage = noop,\n}) => {\n const { t } = useTranslation();\n\n return (\n <div\n className={`outline-none neeto-ui-border-gray-300 neeto-ui-shadow-xs hover:neeto-ui-border-gray-500 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex flex-col border p-6 no-underline transition-colors ${className}`}\n >\n <div className=\"h-full\">\n <div className=\"mb-4\">\n {Icon && <Icon className=\"neeto-ui-text-gray-700\" size={32} />}\n </div>\n <Typography\n className=\"neeto-ui-text-gray-800 mb-2\"\n style=\"h4\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n <Typography className=\"neeto-ui-text-gray-700\" style=\"body2\">\n {description}\n </Typography>\n </div>\n <div className=\"neeto-ui-border-gray-300 mt-4 w-full border-t pt-2\">\n <div className=\"flex h-8 items-center justify-between\">\n {isConnected ? (\n <>\n <Tag\n className=\"flex-row-reverse\"\n icon={Check}\n label={t(\"neetoMolecules.integrationCard.connected\")}\n size=\"small\"\n style=\"success\"\n />\n {customDropdown || (\n <Dropdown buttonStyle=\"text\" icon={MenuVertical}>\n <Menu>\n <MenuItem.Button onClick={onManage}>\n {t(\"neetoMolecules.integrationCard.manage\")}\n </MenuItem.Button>\n <MenuItem.Button onClick={onDisconnect}>\n {t(\"neetoMolecules.integrationCard.disconnect\")}\n </MenuItem.Button>\n </Menu>\n </Dropdown>\n )}\n </>\n ) : (\n <Button\n loading={isStatusLoading}\n style=\"link\"\n label={\n isStatusLoading\n ? \"\"\n : t(\"neetoMolecules.integrationCard.connect\")\n }\n onClick={onConnect}\n />\n )}\n </div>\n </div>\n </div>\n );\n};\n\nIntegrationCard.propTypes = {\n /**\n * The label to be displayed on the card.\n */\n label: PropTypes.string,\n /**\n * The description of the card.\n */\n description: PropTypes.string,\n /**\n * The icon to be displayed on the card.\n */\n Icon: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),\n /**\n * To specify additional class names.\n */\n className: PropTypes.string,\n /**\n * To specify whether the integration is connected or not.\n */\n isConnected: PropTypes.bool,\n /**\n * To specify whether the integration is loading or not.\n */\n isStatusLoading: PropTypes.bool,\n /**\n * Displays a dropdown component next to the status.\n */\n customDropdown: PropTypes.element,\n /**\n * Handler function that is triggered when the integration is disconnected.\n */\n onDisconnect: PropTypes.func,\n /**\n * Handler function that is triggered when the integration is connected.\n */\n onConnect: PropTypes.func,\n /**\n * Handler function that is triggered when the manage button in default dropdown is clicked.\n */\n onManage: PropTypes.func,\n};\n\nexport default IntegrationCard;\n"],"names":["Menu","Dropdown","MenuItem","IntegrationCard","_ref","label","description","Icon","_ref$className","className","isConnected","_ref$isStatusLoading","isStatusLoading","_ref$customDropdown","customDropdown","_ref$onDisconnect","onDisconnect","noop","onConnect","_ref$onManage","onManage","_useTranslation","useTranslation","t","React","createElement","concat","size","Typography","style","weight","Fragment","Tag","icon","Check","buttonStyle","MenuVertical","Button","onClick","loading"],"mappings":";;;;;;AAQA,IAAQA,IAAI,GAAeC,QAAQ,CAA3BD,IAAI;EAAEE,QAAQ,GAAKD,QAAQ,CAArBC,QAAQ,CAAA;AAEtB,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAW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AAA;AAAS,GAAA,EAChCG,CAAC,CAAC,uCAAuC,CAAC,CAC3B,eAClBC,KAAA,CAAAC,aAAA,CAACvB,QAAQ,CAACmC,MAAM,EAAA;AAACC,IAAAA,OAAO,EAAEtB,YAAAA;AAAa,GAAA,EACpCO,CAAC,CAAC,2CAA2C,CAAC,CAC/B,CACb,CAEV,CACA,gBAEHC,KAAA,CAAAC,aAAA,CAACY,MAAM,EAAA;AACLE,IAAAA,OAAO,EAAE3B,eAAgB;AACzBiB,IAAAA,KAAK,EAAC,MAAM;IACZxB,KAAK,EACHO,eAAe,GACX,EAAE,GACFW,CAAC,CAAC,wCAAwC,CAC/C;AACDe,IAAAA,OAAO,EAAEpB,SAAAA;GAEZ,CAAA,CACG,CACF,CACF,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"IntegrationCard.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/classnames/index.js","../src/components/IntegrationCard/Dropdown.jsx","../src/components/IntegrationCard/Status.jsx","../src/components/IntegrationCard/index.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React from \"react\";\n\nimport { noop } from \"neetocommons/pure\";\nimport { MenuVertical } from \"neetoicons\";\nimport { Dropdown as NeetoUIDropdown } from \"neetoui\";\nimport { isNotNil } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nconst { Menu, MenuItem } = NeetoUIDropdown;\n\nconst Dropdown = ({\n customDropdown,\n handleManage = noop,\n hideDisconnect = false,\n onDisconnect = noop,\n}) => {\n const { t } = useTranslation();\n\n if (isNotNil(customDropdown)) {\n return <div onClick={e => e.stopPropagation()}>{customDropdown}</div>;\n }\n\n const isManageable = isNotNil(handleManage);\n\n if (!isManageable && hideDisconnect) {\n return null;\n }\n\n return (\n <div onClick={e => e.stopPropagation()}>\n <NeetoUIDropdown buttonStyle=\"text\" icon={MenuVertical}>\n <Menu>\n {isManageable && (\n <MenuItem.Button onClick={handleManage}>\n {t(\"neetoMolecules.integrationCard.manage\")}\n </MenuItem.Button>\n )}\n {!hideDisconnect && (\n <MenuItem.Button onClick={onDisconnect}>\n {t(\"neetoMolecules.integrationCard.disconnect\")}\n </MenuItem.Button>\n )}\n </Menu>\n </NeetoUIDropdown>\n </div>\n );\n};\n\nexport default Dropdown;\n","import React from \"react\";\n\nimport { Check, Warning } from \"neetoicons\";\nimport { Tag } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst Status = ({ isExpired }) => {\n const { t } = useTranslation();\n\n const tagProps = isExpired\n ? {\n icon: Warning,\n label: t(\"neetoMolecules.integrationCard.tags.expired\"),\n style: \"warning\",\n }\n : {\n icon: Check,\n label: t(\"neetoMolecules.integrationCard.tags.connected\"),\n style: \"success\",\n };\n\n return (\n <Tag\n className=\"flex-row-reverse\"\n {...tagProps}\n data-testid=\"integration-status\"\n />\n );\n};\n\nexport default Status;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { isNotEmpty, noop } from \"neetocommons/pure\";\nimport { joinHyphenCase } from \"neetocommons/utils\";\nimport { Typography, Button, Spinner, Tooltip } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { isNotNil } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport Dropdown from \"./Dropdown\";\nimport Status from \"./Status\";\n\nconst IntegrationCard = ({\n icon: Icon,\n subIcons = [],\n label = \"\",\n description = \"\",\n className = \"\",\n onConnect = noop,\n onDisconnect = noop,\n onManage = undefined,\n isLoading = false,\n isConnected = false,\n isFailed = false,\n isExpired = false,\n disabled = false,\n hidden = false,\n hideDisconnect = false,\n onClick: onCardClick = undefined,\n tooltipProps = {},\n customDropdown = null,\n children,\n}) => {\n const { t } = useTranslation();\n\n if (hidden) return null;\n\n const isCardClickable = isConnected && isNotNil(onCardClick);\n\n const cardProps = isCardClickable ? { onClick: onCardClick } : {};\n\n return (\n <Tooltip\n disabled={!disabled}\n position=\"top\"\n content={\n disabled &&\n t(\"neetoMolecules.integrationCard.tooltip.integrationNotAvailable\")\n }\n {...tooltipProps}\n >\n <div\n data-testid=\"integration-card\"\n className={classnames(\n \"outline-none neeto-ui-border-gray-300 neeto-ui-shadow-xs hover:neeto-ui-border-gray-500 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex flex-col border p-6 no-underline transition-colors\",\n {\n \"hover:neeto-ui-bg-100 cursor-not-allowed opacity-50\": disabled,\n \"cursor-pointer\": isCardClickable,\n },\n className\n )}\n {...cardProps}\n >\n <div\n className=\"flex flex-grow justify-between\"\n data-cy=\"integration-tabs\"\n >\n <div className=\"flex min-w-0 flex-col justify-end\">\n <div className=\"relative mb-4 flex h-8\">\n {Icon && <Icon size={32} />}\n </div>\n <div className=\"my-auto\">\n <Typography\n className=\"mb-2\"\n data-cy=\"integration-card-label\"\n style=\"h4\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n <Typography\n className=\"break-words\"\n data-cy={`${joinHyphenCase(label)}-integration-description`}\n style=\"body2\"\n >\n {description}\n </Typography>\n {children}\n </div>\n </div>\n {isNotEmpty(subIcons) && (\n <div className=\"flex h-24 flex-col gap-2\">\n {subIcons.map((Icon, index) => (\n <Icon\n className=\"neeto-ui-text-gray-600\"\n key={index}\n size={24}\n />\n ))}\n </div>\n )}\n </div>\n <div className=\"neeto-ui-border-gray-300 mt-4 w-full border-t pt-2\">\n {isLoading ? (\n <div className=\"mt-3 flex items-center justify-start\">\n <Spinner />\n </div>\n ) : (\n <div className=\"flex h-8 items-center justify-between\">\n {isConnected && <Status {...{ isExpired }} />}\n {isFailed && (\n <Button\n className=\"neeto-ui-text-warning-500\"\n data-cy=\"connect-button\"\n disabled={disabled || isLoading}\n label={t(\"neetoMolecules.integrationCard.tryAgain\")}\n style=\"link\"\n onClick={onConnect}\n />\n )}\n {!isConnected && !isFailed && (\n <Button\n data-cy=\"connect-button\"\n disabled={disabled || isLoading}\n label={t(\"neetoMolecules.integrationCard.connect\")}\n style=\"link\"\n onClick={onConnect}\n />\n )}\n {(isConnected || isFailed) && (\n <Dropdown\n {...{ customDropdown, hideDisconnect, onDisconnect }}\n handleManage={onManage}\n />\n )}\n </div>\n )}\n </div>\n </div>\n </Tooltip>\n );\n};\n\nIntegrationCard.propTypes = {\n /**\n * The icon component to be displayed on the card.\n */\n icon: PropTypes.elementType,\n /**\n * Array of sub-icons to be displayed on the card.\n */\n subIcons: PropTypes.arrayOf(PropTypes.elementType),\n /**\n * The label to be displayed on the card.\n */\n label: PropTypes.string,\n /**\n * The description of the card.\n */\n description: PropTypes.string,\n /**\n * Additional class names for styling the card.\n */\n className: PropTypes.string,\n /**\n * Handler function called when the integration is connected.\n */\n onConnect: PropTypes.func,\n /**\n * Handler function called when the manage dropdown is clicked.\n */\n onManage: PropTypes.func,\n /**\n * Handler function called when clicked on integration card.\n */\n onClick: PropTypes.func,\n /**\n * Handler function called when the disconnect dropdown is clicked.\n */\n onDisconnect: PropTypes.func,\n /**\n * Flag indicating if the integration is currently loading.\n */\n isLoading: PropTypes.bool,\n /**\n * Flag indicating if the integration is connected.\n */\n isConnected: PropTypes.bool,\n /**\n * Flag indicating if the integration has failed.\n */\n isFailed: PropTypes.bool,\n /**\n * Flag indicating if the integration has expired.\n */\n isExpired: PropTypes.bool,\n /**\n * Flag indicating if the integration is disabled.\n */\n disabled: PropTypes.bool,\n /**\n * Flag indicating if the card should be hidden.\n */\n hidden: PropTypes.bool,\n /**\n * Flag indicating if the disconnect button should be hidden.\n */\n hideDisconnect: PropTypes.bool,\n /**\n * Additional props for customizing the tooltip wrapper.\n */\n tooltipProps: PropTypes.object,\n /**\n * Custom dropdown component to be rendered.\n */\n customDropdown: PropTypes.element,\n /**\n * Additional children elements to be rendered within the card.\n */\n children: PropTypes.node,\n};\n\nexport default IntegrationCard;\n"],"names":["Menu","NeetoUIDropdown","MenuItem","Dropdown","_ref","customDropdown","_ref$handleManage","handleManage","noop","_ref$hideDisconnect","hideDisconnect","_ref$onDisconnect","onDisconnect","_useTranslation","useTranslation","t","isNotNil","React","createElement","onClick","e","stopPropagation","isManageable","buttonStyle","icon","MenuVertical","Button","Status","isExpired","tagProps","Warning","label","style","Check","Tag","_extends","className","IntegrationCard","Icon","_ref$subIcons","subIcons","_ref$label","_ref$description","description","_ref$className","_ref$onConnect","onConnect","_ref$onManage","onManage","undefined","_ref$isLoading","isLoading","_ref$isConnected","isConnected","_ref$isFailed","isFailed","_ref$isExpired","_ref$disabled","disabled","_ref$hidden","hidden","_ref$onClick","onCardClick","_ref$tooltipProps","tooltipProps","_ref$customDropdown","children","isCardClickable","cardProps","Tooltip","position","content","classnames","size","Typography","weight","concat","joinHyphenCase","isNotEmpty","map","index","key","Spinner"],"mappings":";;;;;;;;AAAe,SAAS,QAAQ,GAAG;AACnC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,MAAM,EAAE;AACtE,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;AAC9B,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;AAC/D,UAAU,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACpC,SAAS;AACT,OAAO;AACP,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG,CAAC;AACJ,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzC;;;;;;;;;;;ACRA;AACA;AACA,CAAA,CAAC,YAAY;AAEb;AACA,EAAC,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AAEhC;EACC,SAAS,UAAU,GAAG;AACvB,GAAE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
+
3
5
  var React = require('react');
6
+ var pure = require('@bigbinary/neeto-commons-frontend/pure');
7
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
4
8
  var neetoui = require('@bigbinary/neetoui');
5
- var reactI18next = require('react-i18next');
6
9
 
7
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
11
 
@@ -52,30 +55,35 @@ function _objectWithoutProperties(source, excluded) {
52
55
  return target;
53
56
  }
54
57
 
55
- var _excluded = ["isOpen", "isDisconnecting", "title", "message", "onClose", "onDisconnect"];
58
+ var _excluded = ["t", "isOpen", "isDisconnecting", "title", "message", "onClose", "onDisconnect"];
56
59
  var IntegrationDisconnectAlert = function IntegrationDisconnectAlert(_ref) {
57
- var isOpen = _ref.isOpen,
58
- isDisconnecting = _ref.isDisconnecting,
59
- title = _ref.title,
60
+ var t = _ref.t,
61
+ _ref$isOpen = _ref.isOpen,
62
+ isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
63
+ _ref$isDisconnecting = _ref.isDisconnecting,
64
+ isDisconnecting = _ref$isDisconnecting === void 0 ? false : _ref$isDisconnecting,
65
+ _ref$title = _ref.title,
66
+ title = _ref$title === void 0 ? "" : _ref$title,
60
67
  _ref$message = _ref.message,
61
68
  message = _ref$message === void 0 ? "" : _ref$message,
62
- onClose = _ref.onClose,
63
- onDisconnect = _ref.onDisconnect,
69
+ _ref$onClose = _ref.onClose,
70
+ onClose = _ref$onClose === void 0 ? pure.noop : _ref$onClose,
71
+ _ref$onDisconnect = _ref.onDisconnect,
72
+ onDisconnect = _ref$onDisconnect === void 0 ? pure.noop : _ref$onDisconnect,
64
73
  otherProps = _objectWithoutProperties(_ref, _excluded);
65
- var _useTranslation = reactI18next.useTranslation(),
66
- t = _useTranslation.t;
67
74
  return /*#__PURE__*/React__default["default"].createElement(neetoui.Alert, _extends({
68
- closeOnEsc: true,
69
- closeOnOutsideClick: true,
70
- isOpen: isOpen,
71
75
  isSubmitting: isDisconnecting,
76
+ isOpen: isOpen,
72
77
  message: message,
78
+ onClose: onClose,
73
79
  title: title,
74
80
  submitButtonLabel: t("neetoMolecules.integrationDisconnectAlert.disconnect"),
75
- onClose: onClose,
76
81
  onSubmit: onDisconnect
77
82
  }, otherProps));
78
83
  };
84
+ var WrappedIntegrationDisconnectAlert = reactUtils.withT(IntegrationDisconnectAlert);
85
+ WrappedIntegrationDisconnectAlert.displayName = "IntegrationDisconnectAlert";
79
86
 
80
- module.exports = IntegrationDisconnectAlert;
87
+ exports.IntegrationDisconnectAlert = IntegrationDisconnectAlert;
88
+ exports["default"] = WrappedIntegrationDisconnectAlert;
81
89
  //# sourceMappingURL=IntegrationDisconnectAlert.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntegrationDisconnectAlert.cjs.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../src/components/IntegrationDisconnectAlert/index.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","import React from \"react\";\n\nimport { Alert } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nconst IntegrationDisconnectAlert = ({\n isOpen,\n isDisconnecting,\n title,\n message = \"\",\n onClose,\n onDisconnect,\n ...otherProps\n}) => {\n const { t } = useTranslation();\n\n return (\n <Alert\n closeOnEsc\n closeOnOutsideClick\n isOpen={isOpen}\n isSubmitting={isDisconnecting}\n message={message}\n title={title}\n submitButtonLabel={t(\n \"neetoMolecules.integrationDisconnectAlert.disconnect\"\n )}\n onClose={onClose}\n onSubmit={onDisconnect}\n {...otherProps}\n />\n );\n};\n\nIntegrationDisconnectAlert.propTypes = {\n /**\n * To show loading state when the confirmation is given for disconnecting\n */\n isDisconnecting: PropTypes.bool,\n /**\n * To specify whether the integration modal should be opened or closed.\n */\n isOpen: PropTypes.bool,\n /**\n * To show the title of the alert modal\n */\n title: PropTypes.string,\n /**\n * To show the description of the alert modal\n */\n message: PropTypes.string,\n /**\n * Handler function that is triggered when the close button is clicked.\n */\n onClose: PropTypes.func,\n /**\n * Handler function that is triggered when the disconnect button is clicked\n */\n onDisconnect: PropTypes.func,\n};\n\nexport default IntegrationDisconnectAlert;\n"],"names":["objectWithoutPropertiesLoose","IntegrationDisconnectAlert","_ref","isOpen","isDisconnecting","title","_ref$message","message","onClose","onDisconnect","otherProps","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","React","createElement","Alert","_extends","closeOnEsc","closeOnOutsideClick","isSubmitting","submitButtonLabel","onSubmit"],"mappings":";;;;;;;;;;AAAe,SAAS,QAAQ,GAAG;AACnC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,MAAM,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EAEb,IAAAC,eAAA,GAAcC,2BAAc,EAAE;IAAtBC,CAAC,GAAAF,eAAA,CAADE,CAAC,CAAA;AAET,EAAA,oBACEC,yBAAA,CAAAC,aAAA,CAACC,aAAK,EAAAC,QAAA,CAAA;IACJC,UAAU,EAAA,IAAA;IACVC,mBAAmB,EAAA,IAAA;AACnBlB,IAAAA,MAAM,EAAEA,MAAO;AACfmB,IAAAA,YAAY,EAAElB,eAAgB;AAC9BG,IAAAA,OAAO,EAAEA,OAAQ;AACjBF,IAAAA,KAAK,EAAEA,KAAM;AACbkB,IAAAA,iBAAiB,EAAER,CAAC,CAClB,sDAAsD,CACtD;AACFP,IAAAA,OAAO,EAAEA,OAAQ;AACjBgB,IAAAA,QAAQ,EAAEf,YAAAA;AAAa,GAAA,EACnBC,UAAU,CACd,CAAA,CAAA;AAEN;;;;"}
1
+ {"version":3,"file":"IntegrationDisconnectAlert.cjs.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../src/components/IntegrationDisconnectAlert/index.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","import React from \"react\";\n\nimport { noop } from \"neetocommons/pure\";\nimport { withT } from \"neetocommons/react-utils\";\nimport { Alert } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nconst IntegrationDisconnectAlert = ({\n t,\n isOpen = false,\n isDisconnecting = false,\n title = \"\",\n message = \"\",\n onClose = noop,\n onDisconnect = noop,\n ...otherProps\n}) => (\n <Alert\n isSubmitting={isDisconnecting}\n {...{ isOpen, message, onClose, title }}\n submitButtonLabel={t(\n \"neetoMolecules.integrationDisconnectAlert.disconnect\"\n )}\n onSubmit={onDisconnect}\n {...otherProps}\n />\n);\n\nIntegrationDisconnectAlert.propTypes = {\n /**\n * To show loading state when the confirmation is given for disconnecting\n */\n isDisconnecting: PropTypes.bool,\n /**\n * To specify whether the integration modal should be opened or closed.\n */\n isOpen: PropTypes.bool,\n /**\n * To show the title of the alert modal\n */\n title: PropTypes.string,\n /**\n * To show the description of the alert modal\n */\n message: PropTypes.string,\n /**\n * Handler function that is triggered when the close button is clicked.\n */\n onClose: PropTypes.func,\n /**\n * Handler function that is triggered when the disconnect button is clicked\n */\n onDisconnect: PropTypes.func,\n};\n\nconst WrappedIntegrationDisconnectAlert = withT(IntegrationDisconnectAlert);\nWrappedIntegrationDisconnectAlert.displayName = \"IntegrationDisconnectAlert\";\n\nexport { IntegrationDisconnectAlert };\nexport default WrappedIntegrationDisconnectAlert;\n"],"names":["objectWithoutPropertiesLoose","IntegrationDisconnectAlert","_ref","t","_ref$isOpen","isOpen","_ref$isDisconnecting","isDisconnecting","_ref$title","title","_ref$message","message","_ref$onClose","onClose","noop","_ref$onDisconnect","onDisconnect","otherProps","_objectWithoutProperties","_excluded","React","createElement","Alert","_extends","isSubmitting","submitButtonLabel","onSubmit","WrappedIntegrationDisconnectAlert","withT","displayName"],"mappings":";;;;;;;;;;;;;AAAe,SAAS,QAAQ,GAAG;AACnC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,MAAM,EAAE;AACtE,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,MAAM,IAAI,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;AAC9B,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;AAC/D,UAAU,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACpC,SAAS;AACT,OAAO;AACP,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG,CAAC;AACJ,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzC;;ACbe,SAAS,6BAA6B,CAAC,MAAM,EAAE,QAAQ,EAAE;AACxE,EAAE,IAAI,MAAM,IAAI,IAAI,EAAE,OAAO,EAAE,CAAC;AAChC,EAAE,IAAI,MAAM,GAAG,EAAE,CAAC;AAClB,EAAE,IAAI,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACvC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AACb,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC1C,IAAI,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AACxB,IAAI,IAAI,QAAQ,CAAC,OA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to-commons-frontend/pure';
3
+ import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
2
4
  import { Alert } from '@bigbinary/neetoui';
3
- import { useTranslation } from 'react-i18next';
4
5
 
5
6
  function _extends() {
6
7
  _extends = Object.assign ? Object.assign.bind() : function (target) {
@@ -46,30 +47,34 @@ function _objectWithoutProperties(source, excluded) {
46
47
  return target;
47
48
  }
48
49
 
49
- var _excluded = ["isOpen", "isDisconnecting", "title", "message", "onClose", "onDisconnect"];
50
+ var _excluded = ["t", "isOpen", "isDisconnecting", "title", "message", "onClose", "onDisconnect"];
50
51
  var IntegrationDisconnectAlert = function IntegrationDisconnectAlert(_ref) {
51
- var isOpen = _ref.isOpen,
52
- isDisconnecting = _ref.isDisconnecting,
53
- title = _ref.title,
52
+ var t = _ref.t,
53
+ _ref$isOpen = _ref.isOpen,
54
+ isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
55
+ _ref$isDisconnecting = _ref.isDisconnecting,
56
+ isDisconnecting = _ref$isDisconnecting === void 0 ? false : _ref$isDisconnecting,
57
+ _ref$title = _ref.title,
58
+ title = _ref$title === void 0 ? "" : _ref$title,
54
59
  _ref$message = _ref.message,
55
60
  message = _ref$message === void 0 ? "" : _ref$message,
56
- onClose = _ref.onClose,
57
- onDisconnect = _ref.onDisconnect,
61
+ _ref$onClose = _ref.onClose,
62
+ onClose = _ref$onClose === void 0 ? noop : _ref$onClose,
63
+ _ref$onDisconnect = _ref.onDisconnect,
64
+ onDisconnect = _ref$onDisconnect === void 0 ? noop : _ref$onDisconnect,
58
65
  otherProps = _objectWithoutProperties(_ref, _excluded);
59
- var _useTranslation = useTranslation(),
60
- t = _useTranslation.t;
61
66
  return /*#__PURE__*/React.createElement(Alert, _extends({
62
- closeOnEsc: true,
63
- closeOnOutsideClick: true,
64
- isOpen: isOpen,
65
67
  isSubmitting: isDisconnecting,
68
+ isOpen: isOpen,
66
69
  message: message,
70
+ onClose: onClose,
67
71
  title: title,
68
72
  submitButtonLabel: t("neetoMolecules.integrationDisconnectAlert.disconnect"),
69
- onClose: onClose,
70
73
  onSubmit: onDisconnect
71
74
  }, otherProps));
72
75
  };
76
+ var WrappedIntegrationDisconnectAlert = withT(IntegrationDisconnectAlert);
77
+ WrappedIntegrationDisconnectAlert.displayName = "IntegrationDisconnectAlert";
73
78
 
74
- export { IntegrationDisconnectAlert as default };
79
+ export { IntegrationDisconnectAlert, WrappedIntegrationDisconnectAlert as default };
75
80
  //# sourceMappingURL=IntegrationDisconnectAlert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntegrationDisconnectAlert.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../src/components/IntegrationDisconnectAlert/index.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","import React from \"react\";\n\nimport { Alert } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nconst IntegrationDisconnectAlert = ({\n isOpen,\n isDisconnecting,\n title,\n message = \"\",\n onClose,\n onDisconnect,\n ...otherProps\n}) => {\n const { t } = useTranslation();\n\n return (\n <Alert\n closeOnEsc\n closeOnOutsideClick\n isOpen={isOpen}\n isSubmitting={isDisconnecting}\n message={message}\n title={title}\n submitButtonLabel={t(\n \"neetoMolecules.integrationDisconnectAlert.disconnect\"\n )}\n onClose={onClose}\n onSubmit={onDisconnect}\n {...otherProps}\n />\n );\n};\n\nIntegrationDisconnectAlert.propTypes = {\n /**\n * To show loading state when the confirmation is given for disconnecting\n */\n isDisconnecting: PropTypes.bool,\n /**\n * To specify whether the integration modal should be opened or closed.\n */\n isOpen: PropTypes.bool,\n /**\n * To show the title of the alert modal\n */\n title: PropTypes.string,\n /**\n * To show the description of the alert modal\n */\n message: PropTypes.string,\n /**\n * Handler function that is triggered when the close button is clicked.\n */\n onClose: PropTypes.func,\n /**\n * Handler function that is triggered when the disconnect button is clicked\n */\n onDisconnect: PropTypes.func,\n};\n\nexport default IntegrationDisconnectAlert;\n"],"names":["objectWithoutPropertiesLoose","IntegrationDisconnectAlert","_ref","isOpen","isDisconnecting","title","_ref$message","message","onClose","onDisconnect","otherProps","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","React","createElement","Alert","_extends","closeOnEsc","closeOnOutsideClick","isSubmitting","submitButtonLabel","onSubmit"],"mappings":";;;;AAAe,SAAS,QAAQ,GAAG;AACnC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,MAAM,EAAE;AACtE,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,MAAM,IAAI,MAAM,GAAG,SAA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AA,CAAA;IACJC,UAAU,EAAA,IAAA;IACVC,mBAAmB,EAAA,IAAA;AACnBlB,IAAAA,MAAM,EAAEA,MAAO;AACfmB,IAAAA,YAAY,EAAElB,eAAgB;AAC9BG,IAAAA,OAAO,EAAEA,OAAQ;AACjBF,IAAAA,KAAK,EAAEA,KAAM;AACbkB,IAAAA,iBAAiB,EAAER,CAAC,CAClB,sDAAsD,CACtD;AACFP,IAAAA,OAAO,EAAEA,OAAQ;AACjBgB,IAAAA,QAAQ,EAAEf,YAAAA;AAAa,GAAA,EACnBC,UAAU,CACd,CAAA,CAAA;AAEN;;;;"}
1
+ {"version":3,"file":"IntegrationDisconnectAlert.js","sources":["../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../src/components/IntegrationDisconnectAlert/index.jsx"],"sourcesContent":["export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","import React from \"react\";\n\nimport { noop } from \"neetocommons/pure\";\nimport { withT } from \"neetocommons/react-utils\";\nimport { Alert } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nconst IntegrationDisconnectAlert = ({\n t,\n isOpen = false,\n isDisconnecting = false,\n title = \"\",\n message = \"\",\n onClose = noop,\n onDisconnect = noop,\n ...otherProps\n}) => (\n <Alert\n isSubmitting={isDisconnecting}\n {...{ isOpen, message, onClose, title }}\n submitButtonLabel={t(\n \"neetoMolecules.integrationDisconnectAlert.disconnect\"\n )}\n onSubmit={onDisconnect}\n {...otherProps}\n />\n);\n\nIntegrationDisconnectAlert.propTypes = {\n /**\n * To show loading state when the confirmation is given for disconnecting\n */\n isDisconnecting: PropTypes.bool,\n /**\n * To specify whether the integration modal should be opened or closed.\n */\n isOpen: PropTypes.bool,\n /**\n * To show the title of the alert modal\n */\n title: PropTypes.string,\n /**\n * To show the description of the alert modal\n */\n message: PropTypes.string,\n /**\n * Handler function that is triggered when the close button is clicked.\n */\n onClose: PropTypes.func,\n /**\n * Handler function that is triggered when the disconnect button is clicked\n */\n onDisconnect: PropTypes.func,\n};\n\nconst WrappedIntegrationDisconnectAlert = withT(IntegrationDisconnectAlert);\nWrappedIntegrationDisconnectAlert.displayName = \"IntegrationDisconnectAlert\";\n\nexport { IntegrationDisconnectAlert };\nexport default WrappedIntegrationDisconnectAlert;\n"],"names":["objectWithoutPropertiesLoose","IntegrationDisconnectAlert","_ref","t","_ref$isOpen","isOpen","_ref$isDisconnecting","isDisconnecting","_ref$title","title","_ref$message","message","_ref$onClose","onClose","noop","_ref$onDisconnect","onDisconnect","otherProps","_objectWithoutProperties","_excluded","React","createElement","Alert","_extends","isSubmitting","submitButtonLabel","onSubmit","WrappedIntegrationDisconnectAlert","withT","displayName"],"mappings":";;;;;AAAe,SAAS,QAAQ,GAAG;AACnC,EAAE,QAAQ,GAAG,MAAM,CAA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AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,UAAA;IAAAE,YAAA,GAAAR,IAAA,CACVS,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,YAAA;IAAAE,YAAA,GAAAV,IAAA,CACZW,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAGE,KAAAA,CAAAA,GAAAA,IAAI,GAAAF,YAAA;IAAAG,iBAAA,GAAAb,IAAA,CACdc,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAGD,KAAAA,CAAAA,GAAAA,IAAI,GAAAC,iBAAA;AAChBE,IAAAA,UAAU,GAAAC,wBAAA,CAAAhB,IAAA,EAAAiB,SAAA,CAAA,CAAA;AAAA,EAAA,oBAEbC,KAAA,CAAAC,aAAA,CAACC,KAAK,EAAAC,QAAA,CAAA;AACJC,IAAAA,YAAY,EAAEjB,eAAgB;AACxBF,IAAAA,MAAM,EAANA,MAAM;AAAEM,IAAAA,OAAO,EAAPA,OAAO;AAAEE,IAAAA,OAAO,EAAPA,OAAO;AAAEJ,IAAAA,KAAK,EAALA,KAAK;AACrCgB,IAAAA,iBAAiB,EAAEtB,CAAC,CAClB,sDAAsD,CACtD;AACFuB,IAAAA,QAAQ,EAAEV,YAAAA;AAAa,GAAA,EACnBC,UAAU,CACd,CAAA,CAAA;AAAA,EACH;AA6BD,IAAMU,iCAAiC,GAAGC,KAAK,CAAC3B,0BAA0B,EAAC;AAC3E0B,iCAAiC,CAACE,WAAW,GAAG,4BAA4B;;;;"}
@@ -1,24 +1,29 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var React = require('react');
6
+ var pure = require('@bigbinary/neeto-commons-frontend/pure');
7
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
4
8
  var neetoui = require('@bigbinary/neetoui');
5
- var reactI18next = require('react-i18next');
6
9
 
7
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
11
 
9
12
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
13
 
11
14
  var IntegrationWalkthroughModal = function IntegrationWalkthroughModal(_ref) {
12
- var isOpen = _ref.isOpen,
13
- onClose = _ref.onClose,
14
- videoUrl = _ref.videoUrl,
15
+ var t = _ref.t,
16
+ _ref$isOpen = _ref.isOpen,
17
+ isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
18
+ _ref$onClose = _ref.onClose,
19
+ onClose = _ref$onClose === void 0 ? pure.noop : _ref$onClose,
20
+ _ref$videoUrl = _ref.videoUrl,
21
+ videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
15
22
  children = _ref.children;
16
- var _useTranslation = reactI18next.useTranslation(),
17
- t = _useTranslation.t;
18
23
  return /*#__PURE__*/React__default["default"].createElement(neetoui.Modal, {
19
24
  isOpen: isOpen,
20
- size: "large",
21
- onClose: onClose
25
+ onClose: onClose,
26
+ size: "large"
22
27
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Modal.Header, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
23
28
  style: "h2",
24
29
  weight: "semibold"
@@ -37,6 +42,9 @@ var IntegrationWalkthroughModal = function IntegrationWalkthroughModal(_ref) {
37
42
  onClick: onClose
38
43
  })));
39
44
  };
45
+ var WrappedIntegrationWalkthroughModal = reactUtils.withT(IntegrationWalkthroughModal);
46
+ WrappedIntegrationWalkthroughModal.displayName = "IntegrationWalkthroughModal";
40
47
 
41
- module.exports = IntegrationWalkthroughModal;
48
+ exports.IntegrationWalkthroughModal = IntegrationWalkthroughModal;
49
+ exports["default"] = WrappedIntegrationWalkthroughModal;
42
50
  //# sourceMappingURL=IntegrationWalkthroughModal.cjs.js.map