@bigbinary/neeto-molecules 4.1.39 → 4.1.41
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/README.md +1 -0
- package/dist/FloatingActionMenu.js +75 -47
- package/dist/FloatingActionMenu.js.map +1 -1
- package/dist/Settings.js +79 -41
- package/dist/Settings.js.map +1 -1
- package/dist/SubscriptionUpgradeRequestModal.js +92 -0
- package/dist/SubscriptionUpgradeRequestModal.js.map +1 -0
- package/dist/cjs/FloatingActionMenu.js +75 -47
- package/dist/cjs/FloatingActionMenu.js.map +1 -1
- package/dist/cjs/Settings.js +79 -41
- package/dist/cjs/Settings.js.map +1 -1
- package/dist/cjs/SubscriptionUpgradeRequestModal.js +94 -0
- package/dist/cjs/SubscriptionUpgradeRequestModal.js.map +1 -0
- package/package.json +1 -1
- package/src/translations/en.json +7 -0
- package/types/FloatingActionMenu.d.ts +1 -0
package/dist/cjs/Settings.js
CHANGED
|
@@ -9,12 +9,11 @@ var ramda = require('ramda');
|
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
10
10
|
var Header = require('./Header.js');
|
|
11
11
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
12
|
+
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
12
13
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
13
14
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
14
|
-
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
15
|
-
var Check = require('@bigbinary/neeto-icons/Check');
|
|
16
|
-
var Tag = require('@bigbinary/neetoui/Tag');
|
|
17
15
|
var general = require('@bigbinary/neeto-commons-frontend/utils/general');
|
|
16
|
+
var Tag = require('@bigbinary/neetoui/Tag');
|
|
18
17
|
var reactRouterDom = require('react-router-dom');
|
|
19
18
|
var injectCss = require('./inject-css-B6qYtOJe.js');
|
|
20
19
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -41,9 +40,69 @@ var UNSUPPORTED_LINK_PROPS = ["staticContext", "tReady"];
|
|
|
41
40
|
var css = ".neeto-molecules-settings-link:active,.neeto-molecules-settings-link:hover{box-shadow:0 0 9.2px 0 rgba(29,33,59,.122)}.neeto-molecules-settings-link:active .neeto-molecules-settings-item-heading,.neeto-molecules-settings-link:hover .neeto-molecules-settings-item-heading{color:rgb(var(--neeto-ui-primary-500))}.neeto-molecules-settings-link:focus,.neeto-molecules-settings-link:focus-visible{border-color:rgb(var(--neeto-ui-primary-500));box-shadow:0 0 9.2px 0 rgba(29,33,59,.122)}.neeto-molecules-settings-link:focus .neeto-molecules-settings-item-heading,.neeto-molecules-settings-link:focus-visible .neeto-molecules-settings-item-heading{color:rgb(var(--neeto-ui-primary-500))}.neeto-molecules-settings-item [data-dark-mode-color=true]{fill:rgb(var(--neeto-ui-black))}.neeto-molecules-settings-item svg path{stroke-width:1.2px}";
|
|
42
41
|
injectCss.n(css,{});
|
|
43
42
|
|
|
44
|
-
var _excluded$1 = ["
|
|
43
|
+
var _excluded$1 = ["icon", "description", "label", "path", "href", "isConnected", "isMobileOrTablet", "className"];
|
|
45
44
|
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
46
45
|
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
46
|
+
var IntegrationItem$1 = function IntegrationItem(_ref) {
|
|
47
|
+
var _ref$icon = _ref.icon,
|
|
48
|
+
Icon = _ref$icon === void 0 ? null : _ref$icon,
|
|
49
|
+
description = _ref.description,
|
|
50
|
+
label = _ref.label,
|
|
51
|
+
path = _ref.path,
|
|
52
|
+
href = _ref.href,
|
|
53
|
+
isConnected = _ref.isConnected,
|
|
54
|
+
_ref$isMobileOrTablet = _ref.isMobileOrTablet,
|
|
55
|
+
isMobileOrTablet = _ref$isMobileOrTablet === void 0 ? false : _ref$isMobileOrTablet,
|
|
56
|
+
_ref$className = _ref.className,
|
|
57
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
58
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
59
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
60
|
+
t = _useTranslation.t;
|
|
61
|
+
var commonProps = _objectSpread$4({
|
|
62
|
+
"data-testid": "".concat(neetoCist.hyphenate(label).replace(/\./g, "-"), "-integration-card"),
|
|
63
|
+
className: classnames("neeto-molecules-settings-link relative neeto-ui-rounded-lg neeto-ui-border-gray-300 lg:flex-row flex-col flex cursor-pointer items-start gap-3 xl:gap-4 border px-6 md:py-8 py-6 no-underline outline-none transition-shadow duration-300 ease-in-out", className)
|
|
64
|
+
}, ramda.omit(UNSUPPORTED_LINK_PROPS, otherProps));
|
|
65
|
+
var LinkElement = href ? "a" : reactRouterDom.Link;
|
|
66
|
+
var linkProps = href ? _objectSpread$4({
|
|
67
|
+
href: href
|
|
68
|
+
}, commonProps) : _objectSpread$4({
|
|
69
|
+
to: path
|
|
70
|
+
}, commonProps);
|
|
71
|
+
return /*#__PURE__*/jsxRuntime.jsxs(LinkElement, _objectSpread$4(_objectSpread$4({}, linkProps), {}, {
|
|
72
|
+
children: [Icon && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
73
|
+
className: "neeto-ui-rounded-lg neeto-ui-shadow-xs neeto-ui-border-gray-200 mt-0.5 flex shrink-0 items-center justify-center border p-1.5 xl:p-2.5",
|
|
74
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
75
|
+
"data-testid": "".concat(general.joinHyphenCase(label), "-integration-icon"),
|
|
76
|
+
size: isMobileOrTablet ? 26 : 32
|
|
77
|
+
})
|
|
78
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
79
|
+
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
80
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
81
|
+
className: "neeto-molecules-settings-item-heading neeto-ui-text-black transition-color text-lg leading-6 duration-300 ease-in-out",
|
|
82
|
+
"data-testid": "settings-item-heading",
|
|
83
|
+
style: "h3",
|
|
84
|
+
weight: "semibold",
|
|
85
|
+
children: label
|
|
86
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
87
|
+
className: "neeto-ui-text-gray-600",
|
|
88
|
+
"data-testid": "settings-item-description",
|
|
89
|
+
style: "body2",
|
|
90
|
+
children: description
|
|
91
|
+
})]
|
|
92
|
+
}), isConnected && /*#__PURE__*/jsxRuntime.jsx(Tag, {
|
|
93
|
+
className: "neeto-ui-text-primary-800 absolute top-2 right-2",
|
|
94
|
+
"data-testid": "integration-status-tag",
|
|
95
|
+
indicatorStyle: "primary",
|
|
96
|
+
label: t("neetoMolecules.integrationCard.connected"),
|
|
97
|
+
style: "success"
|
|
98
|
+
})]
|
|
99
|
+
}));
|
|
100
|
+
};
|
|
101
|
+
var IntegrationItem = /*#__PURE__*/React.memo(reactRouterDom.withRouter(IntegrationItem$1));
|
|
102
|
+
|
|
103
|
+
var _excluded = ["label", "description", "icon", "path", "href", "dataTestid", "className", "children"];
|
|
104
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
105
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
47
106
|
var Item$1 = function Item(_ref) {
|
|
48
107
|
var label = _ref.label,
|
|
49
108
|
description = _ref.description,
|
|
@@ -55,18 +114,18 @@ var Item$1 = function Item(_ref) {
|
|
|
55
114
|
_ref$className = _ref.className,
|
|
56
115
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
57
116
|
children = _ref.children,
|
|
58
|
-
otherProps = _objectWithoutProperties(_ref, _excluded
|
|
59
|
-
var commonProps = _objectSpread$
|
|
117
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
118
|
+
var commonProps = _objectSpread$3({
|
|
60
119
|
"data-testid": dataTestid,
|
|
61
120
|
className: classnames("neeto-molecules-settings-link neeto-ui-rounded-lg neeto-ui-border-gray-300 flex cursor-pointer flex-col gap-y-4 border p-6 no-underline outline-none transition-shadow duration-300 ease-in-out group", className)
|
|
62
121
|
}, ramda.omit(UNSUPPORTED_LINK_PROPS, otherProps));
|
|
63
122
|
var LinkElement = href ? "a" : reactRouterDom.Link;
|
|
64
|
-
var linkProps = href ? _objectSpread$
|
|
123
|
+
var linkProps = href ? _objectSpread$3({
|
|
65
124
|
href: href
|
|
66
|
-
}, commonProps) : _objectSpread$
|
|
125
|
+
}, commonProps) : _objectSpread$3({
|
|
67
126
|
to: path
|
|
68
127
|
}, commonProps);
|
|
69
|
-
return /*#__PURE__*/jsxRuntime.jsxs(LinkElement, _objectSpread$
|
|
128
|
+
return /*#__PURE__*/jsxRuntime.jsxs(LinkElement, _objectSpread$3(_objectSpread$3({}, linkProps), {}, {
|
|
70
129
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
71
130
|
className: "neeto-molecules-settings-item",
|
|
72
131
|
"data-testid": "settings-item-".concat(general.joinHyphenCase(label)),
|
|
@@ -96,35 +155,6 @@ var Item$1 = function Item(_ref) {
|
|
|
96
155
|
};
|
|
97
156
|
var Item = /*#__PURE__*/React.memo(reactRouterDom.withRouter(Item$1));
|
|
98
157
|
|
|
99
|
-
var _excluded = ["t", "isConnected", "icon", "description", "label", "path"];
|
|
100
|
-
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
101
|
-
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
102
|
-
var IntegrationItem$1 = reactUtils.withT(function (_ref) {
|
|
103
|
-
var t = _ref.t,
|
|
104
|
-
isConnected = _ref.isConnected,
|
|
105
|
-
icon = _ref.icon,
|
|
106
|
-
description = _ref.description,
|
|
107
|
-
label = _ref.label,
|
|
108
|
-
path = _ref.path,
|
|
109
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
110
|
-
return /*#__PURE__*/jsxRuntime.jsx(Item, _objectSpread$3(_objectSpread$3({}, _objectSpread$3({
|
|
111
|
-
description: description,
|
|
112
|
-
icon: icon,
|
|
113
|
-
label: label,
|
|
114
|
-
path: path
|
|
115
|
-
}, otherProps)), {}, {
|
|
116
|
-
dataTestid: "".concat(neetoCist.hyphenate(label).replace(/\./g, "-"), "-integration-card"),
|
|
117
|
-
children: isConnected && /*#__PURE__*/jsxRuntime.jsx(Tag, {
|
|
118
|
-
className: "flex-row-reverse",
|
|
119
|
-
"data-testid": "integration-status-tag",
|
|
120
|
-
icon: Check,
|
|
121
|
-
label: t("neetoMolecules.integrationCard.connected"),
|
|
122
|
-
style: "success"
|
|
123
|
-
})
|
|
124
|
-
}));
|
|
125
|
-
});
|
|
126
|
-
var IntegrationItem = /*#__PURE__*/React.memo(IntegrationItem$1);
|
|
127
|
-
|
|
128
158
|
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
129
159
|
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
130
160
|
var Category = function Category(_ref) {
|
|
@@ -132,7 +162,10 @@ var Category = function Category(_ref) {
|
|
|
132
162
|
label = _ref.label,
|
|
133
163
|
id = _ref.id,
|
|
134
164
|
isIntegration = _ref.isIntegration;
|
|
165
|
+
var _useBreakpoints = reactUtils.useBreakpoints(),
|
|
166
|
+
isSize = _useBreakpoints.isSize;
|
|
135
167
|
var SettingsCard = isIntegration ? IntegrationItem : Item;
|
|
168
|
+
var isMobileOrTablet = isSize("mobile") || isSize("tablet");
|
|
136
169
|
var isLabelPresent = neetoCist.isPresent(label);
|
|
137
170
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
138
171
|
id: id,
|
|
@@ -140,16 +173,21 @@ var Category = function Category(_ref) {
|
|
|
140
173
|
"mb-7": isLabelPresent
|
|
141
174
|
}),
|
|
142
175
|
children: [isLabelPresent && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
143
|
-
className: "mb-6
|
|
176
|
+
className: "mt-2 mb-6",
|
|
144
177
|
component: "h2",
|
|
145
178
|
"data-testid": "settings-category-heading",
|
|
146
179
|
style: "h2",
|
|
147
180
|
weight: "semibold",
|
|
148
181
|
children: label
|
|
149
182
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
150
|
-
className: "grid grid-cols-1 gap-3 py-1 md:grid-cols-2 lg:grid-cols-2 lg:gap-4
|
|
183
|
+
className: classnames("grid grid-cols-1 gap-3 py-1 md:grid-cols-2 lg:grid-cols-2 lg:gap-4", {
|
|
184
|
+
"xl:grid-cols-2 2xl:grid-cols-3": isIntegration,
|
|
185
|
+
"xl:grid-cols-3 2xl:grid-cols-4": !isIntegration
|
|
186
|
+
}),
|
|
151
187
|
children: items.map(function (item) {
|
|
152
|
-
return /*#__PURE__*/jsxRuntime.jsx(SettingsCard, _objectSpread$2({}, item),
|
|
188
|
+
return /*#__PURE__*/jsxRuntime.jsx(SettingsCard, _objectSpread$2(_objectSpread$2({}, item), isIntegration && {
|
|
189
|
+
isMobileOrTablet: isMobileOrTablet
|
|
190
|
+
}), item.label);
|
|
153
191
|
})
|
|
154
192
|
})]
|
|
155
193
|
});
|
package/dist/cjs/Settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.js","sources":["../../src/components/Settings/constants.js","../../src/components/Settings/Item.jsx","../../src/components/Settings/IntegrationItem.jsx","../../src/components/Settings/Category.jsx","../../src/components/Settings/utils.js","../../src/components/Settings/index.jsx"],"sourcesContent":["export const UNSUPPORTED_LINK_PROPS = [\"staticContext\", \"tReady\"];\n","import { memo } from \"react\";\n\nimport classnames from \"classnames\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Typography } from \"neetoui\";\nimport { omit } from \"ramda\";\nimport { withRouter, Link } from \"react-router-dom\";\n\nimport { UNSUPPORTED_LINK_PROPS } from \"./constants\";\nimport \"./settings.scss\";\n\nconst Item = ({\n label,\n description,\n icon: Icon = null,\n path,\n href,\n dataTestid,\n className = \"\",\n children,\n ...otherProps\n}) => {\n const commonProps = {\n \"data-testid\": dataTestid,\n className: classnames(\n \"neeto-molecules-settings-link neeto-ui-rounded-lg neeto-ui-border-gray-300 flex cursor-pointer flex-col gap-y-4 border p-6 no-underline outline-none transition-shadow duration-300 ease-in-out group\",\n className\n ),\n ...omit(UNSUPPORTED_LINK_PROPS, otherProps),\n };\n\n const LinkElement = href ? \"a\" : Link;\n const linkProps = href\n ? { href, ...commonProps }\n : { to: path, ...commonProps };\n\n return (\n <LinkElement {...linkProps}>\n <div\n className=\"neeto-molecules-settings-item\"\n data-testid={`settings-item-${joinHyphenCase(label)}`}\n >\n <div className=\"mb-2.5 flex items-center gap-3\">\n {Icon && <Icon className=\"neeto-ui-text-gray-500\" size={24} />}\n <Typography\n className=\"neeto-molecules-settings-item-heading neeto-ui-text-black transition-color text-lg leading-6 duration-300 ease-in-out\"\n data-testid=\"settings-item-heading\"\n style=\"h3\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n </div>\n <Typography\n className=\"neeto-ui-text-gray-600\"\n data-testid=\"settings-item-description\"\n style=\"body2\"\n >\n {description}\n </Typography>\n </div>\n {children && (\n <div className=\"neeto-ui-border-gray-300 border-t pt-3\">{children}</div>\n )}\n </LinkElement>\n );\n};\n\nexport default memo(withRouter(Item));\n","import { memo } from \"react\";\n\nimport { hyphenate } from \"neetocist\";\nimport { withT } from \"neetocommons/react-utils\";\nimport { Check } from \"neetoicons\";\nimport { Tag } from \"neetoui\";\n\nimport Item from \"./Item\";\n\nconst IntegrationItem = withT(\n ({ t, isConnected, icon, description, label, path, ...otherProps }) => (\n <Item\n {...{ description, icon, label, path, ...otherProps }}\n dataTestid={`${hyphenate(label).replace(/\\./g, \"-\")}-integration-card`}\n >\n {isConnected && (\n <Tag\n className=\"flex-row-reverse\"\n data-testid=\"integration-status-tag\"\n icon={Check}\n label={t(\"neetoMolecules.integrationCard.connected\")}\n style=\"success\"\n />\n )}\n </Item>\n )\n);\n\nexport default memo(IntegrationItem);\n","import classNames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport { Typography } from \"neetoui\";\n\nimport IntegrationItem from \"./IntegrationItem\";\nimport Item from \"./Item\";\n\nconst Category = ({ items, label, id, isIntegration }) => {\n const SettingsCard = isIntegration ? IntegrationItem : Item;\n\n const isLabelPresent = isPresent(label);\n\n return (\n <div\n {...{ id }}\n className={classNames(\"flex flex-col\", { \"mb-7\": isLabelPresent })}\n >\n {isLabelPresent && (\n <Typography\n className=\"mb-6 mt-2\"\n component=\"h2\"\n data-testid=\"settings-category-heading\"\n style=\"h2\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n )}\n <div className=\"grid grid-cols-1 gap-3 py-1 md:grid-cols-2 lg:grid-cols-2 lg:gap-4 xl:grid-cols-3 2xl:grid-cols-4\">\n {items.map(item => (\n <SettingsCard key={item.label} {...item} />\n ))}\n </div>\n </div>\n );\n};\n\nexport default Category;\n","import { filterBy, isNotEmpty } from \"neetocist\";\n\nconst isTextMatching = (label, searchTerm) =>\n label.toLowerCase().includes(searchTerm.trim().toLowerCase());\n\nexport const scrollIntoSettingCategory = activeCategory => {\n document.getElementById(activeCategory)?.scrollIntoView({\n behavior: \"smooth\",\n });\n};\n\nexport const filterCategories = ({ categories = [], searchTerm = \"\" }) => {\n const isSearchTermBlank = !searchTerm.trim();\n\n const filteredCategories = isSearchTermBlank\n ? categories\n : categories.map(category => ({\n ...category,\n items: filterBy(\n ({ label, description }) =>\n isTextMatching(label, searchTerm) ||\n isTextMatching(description, searchTerm),\n category.items\n ),\n }));\n\n return filterBy({ items: isNotEmpty }, filteredCategories);\n};\n","import { useEffect } from \"react\";\n\nimport classNames from \"classnames\";\nimport useQueryParams from \"neetocommons/react-utils/useQueryParams\";\nimport { NoData } from \"neetoui\";\nimport propTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport Header from \"components/Header\";\n\nimport Category from \"./Category\";\nimport { filterCategories, scrollIntoSettingCategory } from \"./utils\";\n\nconst Settings = ({\n isTitleHidden = false,\n isSearchHidden = false,\n title,\n headerProps = {},\n categories = [],\n className = \"\",\n}) => {\n const { t } = useTranslation();\n\n const { category: categoryParam, searchTerm = \"\" } = useQueryParams();\n\n const filteredCategories = filterCategories({ categories, searchTerm });\n\n const isHeaderVisible = !isSearchHidden || !isTitleHidden;\n\n const headerTitle = title ?? t(\"neetoMolecules.settingsPage.title\");\n\n useEffect(() => {\n scrollIntoSettingCategory(categoryParam);\n }, [categoryParam]);\n\n return (\n <div\n className={classNames(\"neeto-molecules-container\", className, {\n \"h-auto overflow-y-auto\": isTitleHidden,\n })}\n >\n {isHeaderVisible && (\n <Header\n className={classNames({ \"min-h-0 pb-4 pt-8\": isTitleHidden })}\n title={!isTitleHidden && headerTitle}\n searchProps={\n isSearchHidden\n ? null\n : {\n className: \"w-72\",\n placeholder: t(\n \"neetoMolecules.settingsPage.placeholder.search\"\n ),\n }\n }\n {...headerProps}\n />\n )}\n {isEmpty(filteredCategories) ? (\n <div\n className=\"flex h-full w-full flex-grow items-center justify-center\"\n data-testid=\"settings-no-data\"\n >\n <NoData title={t(\"neetoMolecules.settingsPage.noData\")} />\n </div>\n ) : (\n <div className=\"w-full\">\n {filteredCategories.map(({ id, label, items, isIntegration }) => (\n <Category {...{ id, isIntegration, items, label }} key={id} />\n ))}\n </div>\n )}\n </div>\n );\n};\n\nSettings.propTypes = {\n /**\n * Whether to hide the title or not.\n */\n isTitleHidden: propTypes.bool,\n /**\n * This can be used to customize the title.\n */\n title: propTypes.string,\n /**\n * Whether to hide the search bar or not.\n */\n isSearchHidden: propTypes.bool,\n /**\n * An array of setting categories to be displayed.\n */\n categories: propTypes.array,\n /**\n * Additional classes to be added to the container.\n */\n className: propTypes.string,\n /**\n * Props to be passed to the header component.\n */\n headerProps: propTypes.object,\n};\n\nexport default Settings;\n"],"names":["UNSUPPORTED_LINK_PROPS","Item","_ref","label","description","_ref$icon","icon","Icon","path","href","dataTestid","_ref$className","className","children","otherProps","_objectWithoutProperties","_excluded","commonProps","_objectSpread","classnames","omit","LinkElement","Link","linkProps","to","_jsxs","concat","joinHyphenCase","_jsx","size","Typography","style","weight","memo","withRouter","IntegrationItem","withT","t","isConnected","hyphenate","replace","Tag","Check","Category","items","id","isIntegration","SettingsCard","isLabelPresent","isPresent","classNames","component","map","item","isTextMatching","searchTerm","toLowerCase","includes","trim","scrollIntoSettingCategory","activeCategory","_document$getElementB","document","getElementById","scrollIntoView","behavior","filterCategories","_ref$categories","categories","_ref$searchTerm","isSearchTermBlank","filteredCategories","category","filterBy","_ref2","isNotEmpty","Settings","_ref$isTitleHidden","isTitleHidden","_ref$isSearchHidden","isSearchHidden","title","_ref$headerProps","headerProps","_useTranslation","useTranslation","_useQueryParams","useQueryParams","categoryParam","_useQueryParams$searc","isHeaderVisible","headerTitle","useEffect","Header","searchProps","placeholder","isEmpty","NoData","_createElement","key"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,sBAAsB,GAAG,CAAC,eAAe,EAAE,QAAQ,CAAC;;;;;;;;ACWjE,IAAMC,MAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAUJ;AAAA,EAAA,IATJC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IAAAC,SAAA,GAAAH,IAAA,CACXI,IAAI;AAAEC,IAAAA,IAAI,GAAAF,SAAA,KAAA,MAAA,GAAG,IAAI,GAAAA,SAAA;IACjBG,IAAI,GAAAN,IAAA,CAAJM,IAAI;IACJC,IAAI,GAAAP,IAAA,CAAJO,IAAI;IACJC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IAAAC,cAAA,GAAAT,IAAA,CACVU,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;IACdE,QAAQ,GAAAX,IA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mF,WAAW,EAAE1D,CAAC,CACZ,gDACF;AACF;KACL,EACG8C,WAAW,CAChB,CACF,EACAa,aAAO,CAACzB,kBAAkB,CAAC,gBAC1B3C,cAAA,CAAA,KAAA,EAAA;AACEhB,MAAAA,SAAS,EAAC,0DAA0D;AACpE,MAAA,aAAA,EAAY,kBAAkB;MAAAC,QAAA,eAE9Be,cAAA,CAACqE,MAAM,EAAA;QAAChB,KAAK,EAAE5C,CAAC,CAAC,oCAAoC;OAAI;KACtD,CAAC,gBAENT,cAAA,CAAA,KAAA,EAAA;AAAKhB,MAAAA,SAAS,EAAC,QAAQ;AAAAC,MAAAA,QAAA,EACpB0D,kBAAkB,CAACnB,GAAG,CAAC,UAAAsB,KAAA,EAAA;AAAA,QAAA,IAAG7B,EAAE,GAAA6B,KAAA,CAAF7B,EAAE;UAAE1C,KAAK,GAAAuE,KAAA,CAALvE,KAAK;UAAEyC,KAAK,GAAA8B,KAAA,CAAL9B,KAAK;UAAEE,aAAa,GAAA4B,KAAA,CAAb5B,aAAa;QAAA,oBACxDoD,mBAAA,CAACvD,QAAQ,EAAA;AAAOE,UAAAA,EAAE,EAAFA,EAAE;AAAEC,UAAAA,aAAa,EAAbA,aAAa;AAAEF,UAAAA,KAAK,EAALA,KAAK;AAAEzC,UAAAA,KAAK,EAALA,KAAK;AAAIgG,UAAAA,GAAG,EAAEtD;AAAG,SAAE,CAAC;MAAA,CAC/D;AAAC,KACC,CACN;AAAA,GACE,CAAC;AAEV;;;;"}
|
|
1
|
+
{"version":3,"file":"Settings.js","sources":["../../src/components/Settings/constants.js","../../src/components/Settings/IntegrationItem.jsx","../../src/components/Settings/Item.jsx","../../src/components/Settings/Category.jsx","../../src/components/Settings/utils.js","../../src/components/Settings/index.jsx"],"sourcesContent":["export const UNSUPPORTED_LINK_PROPS = [\"staticContext\", \"tReady\"];\n","import { memo } from \"react\";\n\nimport classnames from \"classnames\";\nimport { hyphenate } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Tag, Typography } from \"neetoui\";\nimport { omit } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\nimport { withRouter, Link } from \"react-router-dom\";\n\nimport { UNSUPPORTED_LINK_PROPS } from \"./constants\";\nimport \"./settings.scss\";\n\nconst IntegrationItem = ({\n icon: Icon = null,\n description,\n label,\n path,\n href,\n isConnected,\n isMobileOrTablet = false,\n className = \"\",\n ...otherProps\n}) => {\n const { t } = useTranslation();\n\n const commonProps = {\n \"data-testid\": `${hyphenate(label).replace(/\\./g, \"-\")}-integration-card`,\n className: classnames(\n \"neeto-molecules-settings-link relative neeto-ui-rounded-lg neeto-ui-border-gray-300 lg:flex-row flex-col flex cursor-pointer items-start gap-3 xl:gap-4 border px-6 md:py-8 py-6 no-underline outline-none transition-shadow duration-300 ease-in-out\",\n className\n ),\n ...omit(UNSUPPORTED_LINK_PROPS, otherProps),\n };\n\n const LinkElement = href ? \"a\" : Link;\n const linkProps = href\n ? { href, ...commonProps }\n : { to: path, ...commonProps };\n\n return (\n <LinkElement {...linkProps}>\n {Icon && (\n <div className=\"neeto-ui-rounded-lg neeto-ui-shadow-xs neeto-ui-border-gray-200 mt-0.5 flex shrink-0 items-center justify-center border p-1.5 xl:p-2.5\">\n <Icon\n data-testid={`${joinHyphenCase(label)}-integration-icon`}\n size={isMobileOrTablet ? 26 : 32}\n />\n </div>\n )}\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <Typography\n className=\"neeto-molecules-settings-item-heading neeto-ui-text-black transition-color text-lg leading-6 duration-300 ease-in-out\"\n data-testid=\"settings-item-heading\"\n style=\"h3\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n <Typography\n className=\"neeto-ui-text-gray-600\"\n data-testid=\"settings-item-description\"\n style=\"body2\"\n >\n {description}\n </Typography>\n </div>\n {isConnected && (\n <Tag\n className=\"neeto-ui-text-primary-800 absolute top-2 right-2\"\n data-testid=\"integration-status-tag\"\n indicatorStyle=\"primary\"\n label={t(\"neetoMolecules.integrationCard.connected\")}\n style=\"success\"\n />\n )}\n </LinkElement>\n );\n};\n\nexport default memo(withRouter(IntegrationItem));\n","import { memo } from \"react\";\n\nimport classnames from \"classnames\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Typography } from \"neetoui\";\nimport { omit } from \"ramda\";\nimport { withRouter, Link } from \"react-router-dom\";\n\nimport { UNSUPPORTED_LINK_PROPS } from \"./constants\";\nimport \"./settings.scss\";\n\nconst Item = ({\n label,\n description,\n icon: Icon = null,\n path,\n href,\n dataTestid,\n className = \"\",\n children,\n ...otherProps\n}) => {\n const commonProps = {\n \"data-testid\": dataTestid,\n className: classnames(\n \"neeto-molecules-settings-link neeto-ui-rounded-lg neeto-ui-border-gray-300 flex cursor-pointer flex-col gap-y-4 border p-6 no-underline outline-none transition-shadow duration-300 ease-in-out group\",\n className\n ),\n ...omit(UNSUPPORTED_LINK_PROPS, otherProps),\n };\n\n const LinkElement = href ? \"a\" : Link;\n const linkProps = href\n ? { href, ...commonProps }\n : { to: path, ...commonProps };\n\n return (\n <LinkElement {...linkProps}>\n <div\n className=\"neeto-molecules-settings-item\"\n data-testid={`settings-item-${joinHyphenCase(label)}`}\n >\n <div className=\"mb-2.5 flex items-center gap-3\">\n {Icon && <Icon className=\"neeto-ui-text-gray-500\" size={24} />}\n <Typography\n className=\"neeto-molecules-settings-item-heading neeto-ui-text-black transition-color text-lg leading-6 duration-300 ease-in-out\"\n data-testid=\"settings-item-heading\"\n style=\"h3\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n </div>\n <Typography\n className=\"neeto-ui-text-gray-600\"\n data-testid=\"settings-item-description\"\n style=\"body2\"\n >\n {description}\n </Typography>\n </div>\n {children && (\n <div className=\"neeto-ui-border-gray-300 border-t pt-3\">{children}</div>\n )}\n </LinkElement>\n );\n};\n\nexport default memo(withRouter(Item));\n","import classNames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport { useBreakpoints } from \"neetocommons/react-utils\";\nimport { Typography } from \"neetoui\";\n\nimport IntegrationItem from \"./IntegrationItem\";\nimport Item from \"./Item\";\n\nconst Category = ({ items, label, id, isIntegration }) => {\n const { isSize } = useBreakpoints();\n const SettingsCard = isIntegration ? IntegrationItem : Item;\n const isMobileOrTablet = isSize(\"mobile\") || isSize(\"tablet\");\n\n const isLabelPresent = isPresent(label);\n\n return (\n <div\n {...{ id }}\n className={classNames(\"flex flex-col\", { \"mb-7\": isLabelPresent })}\n >\n {isLabelPresent && (\n <Typography\n className=\"mt-2 mb-6\"\n component=\"h2\"\n data-testid=\"settings-category-heading\"\n style=\"h2\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n )}\n <div\n className={classNames(\n \"grid grid-cols-1 gap-3 py-1 md:grid-cols-2 lg:grid-cols-2 lg:gap-4\",\n {\n \"xl:grid-cols-2 2xl:grid-cols-3\": isIntegration,\n \"xl:grid-cols-3 2xl:grid-cols-4\": !isIntegration,\n }\n )}\n >\n {items.map(item => (\n <SettingsCard\n key={item.label}\n {...item}\n {...(isIntegration && { isMobileOrTablet })}\n />\n ))}\n </div>\n </div>\n );\n};\n\nexport default Category;\n","import { filterBy, isNotEmpty } from \"neetocist\";\n\nconst isTextMatching = (label, searchTerm) =>\n label.toLowerCase().includes(searchTerm.trim().toLowerCase());\n\nexport const scrollIntoSettingCategory = activeCategory => {\n document.getElementById(activeCategory)?.scrollIntoView({\n behavior: \"smooth\",\n });\n};\n\nexport const filterCategories = ({ categories = [], searchTerm = \"\" }) => {\n const isSearchTermBlank = !searchTerm.trim();\n\n const filteredCategories = isSearchTermBlank\n ? categories\n : categories.map(category => ({\n ...category,\n items: filterBy(\n ({ label, description }) =>\n isTextMatching(label, searchTerm) ||\n isTextMatching(description, searchTerm),\n category.items\n ),\n }));\n\n return filterBy({ items: isNotEmpty }, filteredCategories);\n};\n","import { useEffect } from \"react\";\n\nimport classNames from \"classnames\";\nimport useQueryParams from \"neetocommons/react-utils/useQueryParams\";\nimport { NoData } from \"neetoui\";\nimport propTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport Header from \"components/Header\";\n\nimport Category from \"./Category\";\nimport { filterCategories, scrollIntoSettingCategory } from \"./utils\";\n\nconst Settings = ({\n isTitleHidden = false,\n isSearchHidden = false,\n title,\n headerProps = {},\n categories = [],\n className = \"\",\n}) => {\n const { t } = useTranslation();\n\n const { category: categoryParam, searchTerm = \"\" } = useQueryParams();\n\n const filteredCategories = filterCategories({ categories, searchTerm });\n\n const isHeaderVisible = !isSearchHidden || !isTitleHidden;\n\n const headerTitle = title ?? t(\"neetoMolecules.settingsPage.title\");\n\n useEffect(() => {\n scrollIntoSettingCategory(categoryParam);\n }, [categoryParam]);\n\n return (\n <div\n className={classNames(\"neeto-molecules-container\", className, {\n \"h-auto overflow-y-auto\": isTitleHidden,\n })}\n >\n {isHeaderVisible && (\n <Header\n className={classNames({ \"min-h-0 pb-4 pt-8\": isTitleHidden })}\n title={!isTitleHidden && headerTitle}\n searchProps={\n isSearchHidden\n ? null\n : {\n className: \"w-72\",\n placeholder: t(\n \"neetoMolecules.settingsPage.placeholder.search\"\n ),\n }\n }\n {...headerProps}\n />\n )}\n {isEmpty(filteredCategories) ? (\n <div\n className=\"flex h-full w-full flex-grow items-center justify-center\"\n data-testid=\"settings-no-data\"\n >\n <NoData title={t(\"neetoMolecules.settingsPage.noData\")} />\n </div>\n ) : (\n <div className=\"w-full\">\n {filteredCategories.map(({ id, label, items, isIntegration }) => (\n <Category {...{ id, isIntegration, items, label }} key={id} />\n ))}\n </div>\n )}\n </div>\n );\n};\n\nSettings.propTypes = {\n /**\n * Whether to hide the title or not.\n */\n isTitleHidden: propTypes.bool,\n /**\n * This can be used to customize the title.\n */\n title: propTypes.string,\n /**\n * Whether to hide the search bar or not.\n */\n isSearchHidden: propTypes.bool,\n /**\n * An array of setting categories to be displayed.\n */\n categories: propTypes.array,\n /**\n * Additional classes to be added to the container.\n */\n className: propTypes.string,\n /**\n * Props to be passed to the header component.\n */\n headerProps: propTypes.object,\n};\n\nexport default Settings;\n"],"names":["UNSUPPORTED_LINK_PROPS","IntegrationItem","_ref","_ref$icon","icon","Icon","description","label","path","href","isConnected","_ref$isMobileOrTablet","isMobileOrTablet","_ref$className","className","otherProps","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","commonProps","_objectSpread","concat","hyphenate","replace","classnames","omit","LinkElement","Link","linkProps","to","_jsxs","children","_jsx","joinHyphenCase","size","Typography","style","weight","Tag","indicatorStyle","memo","withRouter","Item","dataTestid","Category","items","id","isIntegration","_useBreakpoints","useBreakpoints","isSize","SettingsCard","isLabelPresent","isPresent","classNames","component","map","item","isTextMatching","searchTerm","toLowerCase","includes","trim","scrollIntoSettingCategory","activeCategory","_document$getElementB","document","getElementById","scrollIntoView","behavior","filterCategories","_ref$categories","categories","_ref$searchTerm","isSearchTermBlank","filteredCategories","category","filterBy","_ref2","isNotEmpty","Settings","_ref$isTitleHidden","isTitleHidden","_ref$isSearchHidden","isSearchHidden","title","_ref$headerProps","headerProps","_useQueryParams","useQueryParams","categoryParam","_useQueryParams$searc","isHeaderVisible","headerTitle","useEffect","Header","searchProps","placeholder","isEmpty","NoData","_createElement","key"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,sBAAsB,GAAG,CAAC,eAAe,EAAE,QAAQ,CAAC;;;;;;;;ACajE,IAAMC,iBAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAUf;AAAA,EAAA,IAAAC,SAAA,GAAAD,IAAA,CATJE,IAAI;AAAEC,IAAAA,IAAI,GAAAF,SAAA,KAAA,MAAA,GAAG,IAAI,GAAAA,SAAA;IACjBG,WAAW,GAAAJ,IAAA,CAAXI,WAAW;IACXC,KAAK,GAAAL,IAAA,CAALK,KAAK;IACLC,IAAI,GAAAN,IAAA,CAAJM,IAAI;IACJC,IAAI,GAAAP,IAAA,CAAJO,IAAI;IACJC,WAAW,GAAAR,IAAA,CAAXQ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AAK,GAAAyE,KAAA,CAALzE,KAAK;UAAEwC,KAAK,GAAAiC,KAAA,CAALjC,KAAK;UAAEE,aAAa,GAAA+B,KAAA,CAAb/B,aAAa;QAAA,oBACxDqD,mBAAA,CAACxD,QAAQ,EAAA;AAAOE,UAAAA,EAAE,EAAFA,EAAE;AAAEC,UAAAA,aAAa,EAAbA,aAAa;AAAEF,UAAAA,KAAK,EAALA,KAAK;AAAExC,UAAAA,KAAK,EAALA,KAAK;AAAIgG,UAAAA,GAAG,EAAEvD;AAAG,SAAE,CAAC;MAAA,CAC/D;AAAC,KACC,CACN;AAAA,GACE,CAAC;AAEV;;;;"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
|
|
4
|
+
var Button = require('@bigbinary/neetoui/Button');
|
|
5
|
+
var Modal = require('@bigbinary/neetoui/Modal');
|
|
6
|
+
var Typography = require('@bigbinary/neetoui/Typography');
|
|
7
|
+
var reactI18next = require('react-i18next');
|
|
8
|
+
var reactQuery = require('@tanstack/react-query');
|
|
9
|
+
var axios = require('axios');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
+
|
|
12
|
+
var create = function create() {
|
|
13
|
+
return axios.post("/neeto_sso/api/v1/subscription_request");
|
|
14
|
+
};
|
|
15
|
+
var subscriptionRequestApi = {
|
|
16
|
+
create: create
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var useCreateSubscriptionRequest = function useCreateSubscriptionRequest() {
|
|
20
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
21
|
+
onSuccess = _ref.onSuccess;
|
|
22
|
+
return reactQuery.useMutation({
|
|
23
|
+
mutationFn: subscriptionRequestApi.create,
|
|
24
|
+
onSuccess: onSuccess
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var SubscriptionUpgradeRequestModal = function SubscriptionUpgradeRequestModal(_ref) {
|
|
29
|
+
var _globalProps$appName;
|
|
30
|
+
var isOpen = _ref.isOpen,
|
|
31
|
+
onClose = _ref.onClose;
|
|
32
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
33
|
+
t = _useTranslation.t;
|
|
34
|
+
var pricingPageUrl = "https://neeto.com/".concat((_globalProps$appName = initializers.globalProps.appName) === null || _globalProps$appName === void 0 ? void 0 : _globalProps$appName.toLowerCase(), "/pricing");
|
|
35
|
+
var _useCreateSubscriptio = useCreateSubscriptionRequest({
|
|
36
|
+
onSuccess: onClose
|
|
37
|
+
}),
|
|
38
|
+
sendRequest = _useCreateSubscriptio.mutate,
|
|
39
|
+
isPending = _useCreateSubscriptio.isPending;
|
|
40
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Modal, {
|
|
41
|
+
isOpen: isOpen,
|
|
42
|
+
onClose: onClose,
|
|
43
|
+
closeOnEsc: !isPending,
|
|
44
|
+
closeOnOutsideClick: !isPending,
|
|
45
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Modal.Header, {
|
|
46
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
47
|
+
style: "h3",
|
|
48
|
+
weight: "semibold",
|
|
49
|
+
children: t("neetoMolecules.subscriptionRequest.title")
|
|
50
|
+
})
|
|
51
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Modal.Body, {
|
|
52
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
53
|
+
style: "body2",
|
|
54
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
55
|
+
components: {
|
|
56
|
+
strong: /*#__PURE__*/jsxRuntime.jsx("strong", {})
|
|
57
|
+
},
|
|
58
|
+
i18nKey: "neetoMolecules.subscriptionRequest.description"
|
|
59
|
+
})
|
|
60
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
61
|
+
className: "mt-3",
|
|
62
|
+
style: "body2",
|
|
63
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
64
|
+
i18nKey: "neetoMolecules.subscriptionRequest.pricingInfo",
|
|
65
|
+
components: {
|
|
66
|
+
pricingLink: /*#__PURE__*/jsxRuntime.jsx("a", {
|
|
67
|
+
className: "neeto-ui-text-primary-500",
|
|
68
|
+
href: pricingPageUrl,
|
|
69
|
+
rel: "noopener noreferrer",
|
|
70
|
+
target: "_blank"
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
})]
|
|
75
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Modal.Footer, {
|
|
76
|
+
className: "flex gap-x-2",
|
|
77
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
78
|
+
disabled: isPending,
|
|
79
|
+
label: t("neetoMolecules.subscriptionRequest.cancel"),
|
|
80
|
+
style: "secondary",
|
|
81
|
+
onClick: onClose
|
|
82
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
83
|
+
disabled: isPending,
|
|
84
|
+
label: t("neetoMolecules.subscriptionRequest.sendRequest"),
|
|
85
|
+
loading: isPending,
|
|
86
|
+
style: "primary",
|
|
87
|
+
onClick: sendRequest
|
|
88
|
+
})]
|
|
89
|
+
})]
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
module.exports = SubscriptionUpgradeRequestModal;
|
|
94
|
+
//# sourceMappingURL=SubscriptionUpgradeRequestModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionUpgradeRequestModal.js","sources":["../../src/components/SubscriptionUpgradeRequestModal/apis/subscription_request.js","../../src/components/SubscriptionUpgradeRequestModal/useSubscriptionRequestApi.js","../../src/components/SubscriptionUpgradeRequestModal/index.jsx"],"sourcesContent":["import axios from \"axios\";\n\nconst create = () => axios.post(\"/neeto_sso/api/v1/subscription_request\");\n\nconst subscriptionRequestApi = { create };\n\nexport default subscriptionRequestApi;\n","import { useMutation } from \"@tanstack/react-query\";\n\nimport subscriptionRequestApi from \"./apis/subscription_request\";\n\nconst useCreateSubscriptionRequest = ({ onSuccess } = {}) =>\n useMutation({\n mutationFn: subscriptionRequestApi.create,\n onSuccess,\n });\n\nexport { useCreateSubscriptionRequest };\n","import { globalProps } from \"neetocommons/initializers\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport { useCreateSubscriptionRequest } from \"./useSubscriptionRequestApi\";\n\nconst SubscriptionUpgradeRequestModal = ({ isOpen, onClose }) => {\n const { t } = useTranslation();\n\n const pricingPageUrl = `https://neeto.com/${globalProps.appName?.toLowerCase()}/pricing`;\n\n const { mutate: sendRequest, isPending } = useCreateSubscriptionRequest({\n onSuccess: onClose,\n });\n\n return (\n <Modal\n {...{ isOpen, onClose }}\n closeOnEsc={!isPending}\n closeOnOutsideClick={!isPending}\n >\n <Modal.Header>\n <Typography style=\"h3\" weight=\"semibold\">\n {t(\"neetoMolecules.subscriptionRequest.title\")}\n </Typography>\n </Modal.Header>\n <Modal.Body>\n <Typography style=\"body2\">\n <Trans\n components={{ strong: <strong /> }}\n i18nKey=\"neetoMolecules.subscriptionRequest.description\"\n />\n </Typography>\n <Typography className=\"mt-3\" style=\"body2\">\n <Trans\n i18nKey=\"neetoMolecules.subscriptionRequest.pricingInfo\"\n components={{\n pricingLink: (\n <a\n className=\"neeto-ui-text-primary-500\"\n href={pricingPageUrl}\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n />\n ),\n }}\n />\n </Typography>\n </Modal.Body>\n <Modal.Footer className=\"flex gap-x-2\">\n <Button\n disabled={isPending}\n label={t(\"neetoMolecules.subscriptionRequest.cancel\")}\n style=\"secondary\"\n onClick={onClose}\n />\n <Button\n disabled={isPending}\n label={t(\"neetoMolecules.subscriptionRequest.sendRequest\")}\n loading={isPending}\n style=\"primary\"\n onClick={sendRequest}\n />\n </Modal.Footer>\n </Modal>\n );\n};\n\nexport default SubscriptionUpgradeRequestModal;\n"],"names":["create","axios","post","subscriptionRequestApi","useCreateSubscriptionRequest","_ref","arguments","length","undefined","onSuccess","useMutation","mutationFn","SubscriptionUpgradeRequestModal","_globalProps$appName","isOpen","onClose","_useTranslation","useTranslation","t","pricingPageUrl","concat","globalProps","appName","toLowerCase","_useCreateSubscriptio","sendRequest","mutate","isPending","_jsxs","Modal","closeOnEsc","closeOnOutsideClick","children","_jsx","Header","Typography","style","weight","Body","Trans","components","strong","i18nKey","className","pricingLink","href","rel","target","Footer","Button","disabled","label","onClick","loading"],"mappings":";;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAMA,GAAA;AAAA,EAAA,OAASC,KAAK,CAACC,IAAI,CAAC,wCAAwC,CAAC;AAAA,CAAA;AAEzE,IAAMC,sBAAsB,GAAG;AAAEH,EAAAA,MAAM,EAANA;AAAO,CAAC;;ACAzC,IAAMI,4BAA4B,GAAG,SAA/BA,4BAA4BA,GAAA;AAAA,EAAA,IAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAoB,EAAE;IAAhBG,SAAS,GAAAJ,IAAA,CAATI,SAAS;AAAA,EAAA,OAC/CC,sBAAW,CAAC;IACVC,UAAU,EAAER,sBAAsB,CAACH,MAAM;AACzCS,IAAAA,SAAS,EAATA;AACF,GAAC,CAAC;AAAA,CAAA;;ACFJ,IAAMG,+BAA+B,GAAG,SAAlCA,+BAA+BA,CAAAP,IAAA,EAA4B;AAAA,EAAA,IAAAQ,oBAAA;AAAA,EAAA,IAAtBC,MAAM,GAAAT,IAAA,CAANS,MAAM;IAAEC,OAAO,GAAAV,IAAA,CAAPU,OAAO;AACxD,EAAA,IAAAC,eAAA,GAAcC,2BAAc,EAAE;IAAtBC,CAAC,GAAAF,eAAA,CAADE,CAAC;AAET,EAAA,IAAMC,cAAc,GAAA,oBAAA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AAAA,UAAU,EAAE;AACVI,YAAAA,WAAW,eACTX,cAAA,CAAA,GAAA,EAAA;AACEU,cAAAA,SAAS,EAAC,2BAA2B;AACrCE,cAAAA,IAAI,EAAE1B,cAAe;AACrB2B,cAAAA,GAAG,EAAC,qBAAqB;AACzBC,cAAAA,MAAM,EAAC;aACR;AAEL;SACD;AAAC,OACQ,CAAC;AAAA,KACH,CAAC,eACbnB,eAAA,CAACC,KAAK,CAACmB,MAAM,EAAA;AAACL,MAAAA,SAAS,EAAC,cAAc;MAAAX,QAAA,EAAA,cACpCC,cAAA,CAACgB,MAAM,EAAA;AACLC,QAAAA,QAAQ,EAAEvB,SAAU;AACpBwB,QAAAA,KAAK,EAAEjC,CAAC,CAAC,2CAA2C,CAAE;AACtDkB,QAAAA,KAAK,EAAC,WAAW;AACjBgB,QAAAA,OAAO,EAAErC;AAAQ,OAClB,CAAC,eACFkB,cAAA,CAACgB,MAAM,EAAA;AACLC,QAAAA,QAAQ,EAAEvB,SAAU;AACpBwB,QAAAA,KAAK,EAAEjC,CAAC,CAAC,gDAAgD,CAAE;AAC3DmC,QAAAA,OAAO,EAAE1B,SAAU;AACnBS,QAAAA,KAAK,EAAC,SAAS;AACfgB,QAAAA,OAAO,EAAE3B;AAAY,OACtB,CAAC;AAAA,KACU,CAAC;AAAA,GACV,CAAC;AAEZ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-molecules",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.41",
|
|
4
4
|
"description": "A package of reusable molecular components for neeto products.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-molecules.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|
package/src/translations/en.json
CHANGED
|
@@ -789,6 +789,13 @@
|
|
|
789
789
|
"menuAriaLabel": "More options",
|
|
790
790
|
"submenuAriaLabel": "{{label}} submenu"
|
|
791
791
|
},
|
|
792
|
+
"subscriptionRequest": {
|
|
793
|
+
"title": "Upgrade to pro plan",
|
|
794
|
+
"description": "You are requesting an upgrade to the <strong>Pro plan</strong>. We'll notify the workspace owner for approval.",
|
|
795
|
+
"pricingInfo": "Want to know more about the Pro plan features? Check out our <pricingLink>pricing page</pricingLink>.",
|
|
796
|
+
"sendRequest": "Send request",
|
|
797
|
+
"cancel": "Cancel"
|
|
798
|
+
},
|
|
792
799
|
"productEmbed": {
|
|
793
800
|
"title": "Embed",
|
|
794
801
|
"embedSelectionTitle": "How do you want to add {{productName, anyCase}} to your site?",
|