@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/dist/Settings.js CHANGED
@@ -7,12 +7,11 @@ import { omit, isEmpty } from 'ramda';
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import Header from './Header.js';
9
9
  import { hyphenate, isPresent, filterBy, isNotEmpty } from '@bigbinary/neeto-cist';
10
+ import { useBreakpoints } from '@bigbinary/neeto-commons-frontend/react-utils';
10
11
  import Typography from '@bigbinary/neetoui/Typography';
11
12
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
12
- import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
13
- import Check from '@bigbinary/neeto-icons/Check';
14
- import Tag from '@bigbinary/neetoui/Tag';
15
13
  import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils/general';
14
+ import Tag from '@bigbinary/neetoui/Tag';
16
15
  import { withRouter, Link } from 'react-router-dom';
17
16
  import { n } from './inject-css-C2dztUxs.js';
18
17
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -39,9 +38,69 @@ var UNSUPPORTED_LINK_PROPS = ["staticContext", "tReady"];
39
38
  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}";
40
39
  n(css,{});
41
40
 
42
- var _excluded$1 = ["label", "description", "icon", "path", "href", "dataTestid", "className", "children"];
41
+ var _excluded$1 = ["icon", "description", "label", "path", "href", "isConnected", "isMobileOrTablet", "className"];
43
42
  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; }
44
43
  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; }
44
+ var IntegrationItem = function IntegrationItem(_ref) {
45
+ var _ref$icon = _ref.icon,
46
+ Icon = _ref$icon === void 0 ? null : _ref$icon,
47
+ description = _ref.description,
48
+ label = _ref.label,
49
+ path = _ref.path,
50
+ href = _ref.href,
51
+ isConnected = _ref.isConnected,
52
+ _ref$isMobileOrTablet = _ref.isMobileOrTablet,
53
+ isMobileOrTablet = _ref$isMobileOrTablet === void 0 ? false : _ref$isMobileOrTablet,
54
+ _ref$className = _ref.className,
55
+ className = _ref$className === void 0 ? "" : _ref$className,
56
+ otherProps = _objectWithoutProperties(_ref, _excluded$1);
57
+ var _useTranslation = useTranslation(),
58
+ t = _useTranslation.t;
59
+ var commonProps = _objectSpread$4({
60
+ "data-testid": "".concat(hyphenate(label).replace(/\./g, "-"), "-integration-card"),
61
+ 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)
62
+ }, omit(UNSUPPORTED_LINK_PROPS, otherProps));
63
+ var LinkElement = href ? "a" : Link;
64
+ var linkProps = href ? _objectSpread$4({
65
+ href: href
66
+ }, commonProps) : _objectSpread$4({
67
+ to: path
68
+ }, commonProps);
69
+ return /*#__PURE__*/jsxs(LinkElement, _objectSpread$4(_objectSpread$4({}, linkProps), {}, {
70
+ children: [Icon && /*#__PURE__*/jsx("div", {
71
+ 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",
72
+ children: /*#__PURE__*/jsx(Icon, {
73
+ "data-testid": "".concat(joinHyphenCase(label), "-integration-icon"),
74
+ size: isMobileOrTablet ? 26 : 32
75
+ })
76
+ }), /*#__PURE__*/jsxs("div", {
77
+ className: "flex min-w-0 flex-1 flex-col gap-1",
78
+ children: [/*#__PURE__*/jsx(Typography, {
79
+ className: "neeto-molecules-settings-item-heading neeto-ui-text-black transition-color text-lg leading-6 duration-300 ease-in-out",
80
+ "data-testid": "settings-item-heading",
81
+ style: "h3",
82
+ weight: "semibold",
83
+ children: label
84
+ }), /*#__PURE__*/jsx(Typography, {
85
+ className: "neeto-ui-text-gray-600",
86
+ "data-testid": "settings-item-description",
87
+ style: "body2",
88
+ children: description
89
+ })]
90
+ }), isConnected && /*#__PURE__*/jsx(Tag, {
91
+ className: "neeto-ui-text-primary-800 absolute top-2 right-2",
92
+ "data-testid": "integration-status-tag",
93
+ indicatorStyle: "primary",
94
+ label: t("neetoMolecules.integrationCard.connected"),
95
+ style: "success"
96
+ })]
97
+ }));
98
+ };
99
+ var IntegrationItem$1 = /*#__PURE__*/memo(withRouter(IntegrationItem));
100
+
101
+ var _excluded = ["label", "description", "icon", "path", "href", "dataTestid", "className", "children"];
102
+ 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; }
103
+ 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; }
45
104
  var Item = function Item(_ref) {
46
105
  var label = _ref.label,
47
106
  description = _ref.description,
@@ -53,18 +112,18 @@ var Item = function Item(_ref) {
53
112
  _ref$className = _ref.className,
54
113
  className = _ref$className === void 0 ? "" : _ref$className,
55
114
  children = _ref.children,
56
- otherProps = _objectWithoutProperties(_ref, _excluded$1);
57
- var commonProps = _objectSpread$4({
115
+ otherProps = _objectWithoutProperties(_ref, _excluded);
116
+ var commonProps = _objectSpread$3({
58
117
  "data-testid": dataTestid,
59
118
  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)
60
119
  }, omit(UNSUPPORTED_LINK_PROPS, otherProps));
61
120
  var LinkElement = href ? "a" : Link;
62
- var linkProps = href ? _objectSpread$4({
121
+ var linkProps = href ? _objectSpread$3({
63
122
  href: href
64
- }, commonProps) : _objectSpread$4({
123
+ }, commonProps) : _objectSpread$3({
65
124
  to: path
66
125
  }, commonProps);
67
- return /*#__PURE__*/jsxs(LinkElement, _objectSpread$4(_objectSpread$4({}, linkProps), {}, {
126
+ return /*#__PURE__*/jsxs(LinkElement, _objectSpread$3(_objectSpread$3({}, linkProps), {}, {
68
127
  children: [/*#__PURE__*/jsxs("div", {
69
128
  className: "neeto-molecules-settings-item",
70
129
  "data-testid": "settings-item-".concat(joinHyphenCase(label)),
@@ -94,35 +153,6 @@ var Item = function Item(_ref) {
94
153
  };
95
154
  var Item$1 = /*#__PURE__*/memo(withRouter(Item));
96
155
 
97
- var _excluded = ["t", "isConnected", "icon", "description", "label", "path"];
98
- 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; }
99
- 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; }
100
- var IntegrationItem = withT(function (_ref) {
101
- var t = _ref.t,
102
- isConnected = _ref.isConnected,
103
- icon = _ref.icon,
104
- description = _ref.description,
105
- label = _ref.label,
106
- path = _ref.path,
107
- otherProps = _objectWithoutProperties(_ref, _excluded);
108
- return /*#__PURE__*/jsx(Item$1, _objectSpread$3(_objectSpread$3({}, _objectSpread$3({
109
- description: description,
110
- icon: icon,
111
- label: label,
112
- path: path
113
- }, otherProps)), {}, {
114
- dataTestid: "".concat(hyphenate(label).replace(/\./g, "-"), "-integration-card"),
115
- children: isConnected && /*#__PURE__*/jsx(Tag, {
116
- className: "flex-row-reverse",
117
- "data-testid": "integration-status-tag",
118
- icon: Check,
119
- label: t("neetoMolecules.integrationCard.connected"),
120
- style: "success"
121
- })
122
- }));
123
- });
124
- var IntegrationItem$1 = /*#__PURE__*/memo(IntegrationItem);
125
-
126
156
  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; }
127
157
  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; }
128
158
  var Category = function Category(_ref) {
@@ -130,7 +160,10 @@ var Category = function Category(_ref) {
130
160
  label = _ref.label,
131
161
  id = _ref.id,
132
162
  isIntegration = _ref.isIntegration;
163
+ var _useBreakpoints = useBreakpoints(),
164
+ isSize = _useBreakpoints.isSize;
133
165
  var SettingsCard = isIntegration ? IntegrationItem$1 : Item$1;
166
+ var isMobileOrTablet = isSize("mobile") || isSize("tablet");
134
167
  var isLabelPresent = isPresent(label);
135
168
  return /*#__PURE__*/jsxs("div", {
136
169
  id: id,
@@ -138,16 +171,21 @@ var Category = function Category(_ref) {
138
171
  "mb-7": isLabelPresent
139
172
  }),
140
173
  children: [isLabelPresent && /*#__PURE__*/jsx(Typography, {
141
- className: "mb-6 mt-2",
174
+ className: "mt-2 mb-6",
142
175
  component: "h2",
143
176
  "data-testid": "settings-category-heading",
144
177
  style: "h2",
145
178
  weight: "semibold",
146
179
  children: label
147
180
  }), /*#__PURE__*/jsx("div", {
148
- 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",
181
+ className: classnames("grid grid-cols-1 gap-3 py-1 md:grid-cols-2 lg:grid-cols-2 lg:gap-4", {
182
+ "xl:grid-cols-2 2xl:grid-cols-3": isIntegration,
183
+ "xl:grid-cols-3 2xl:grid-cols-4": !isIntegration
184
+ }),
149
185
  children: items.map(function (item) {
150
- return /*#__PURE__*/jsx(SettingsCard, _objectSpread$2({}, item), item.label);
186
+ return /*#__PURE__*/jsx(SettingsCard, _objectSpread$2(_objectSpread$2({}, item), isIntegration && {
187
+ isMobileOrTablet: isMobileOrTablet
188
+ }), item.label);
151
189
  })
152
190
  })]
153
191
  });
@@ -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,QA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AEC,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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ACL,EACGqE,WAAW,CAChB,CACF,EACAW,OAAO,CAACvB,kBAAkB,CAAC,gBAC1B3C,GAAA,CAAA,KAAA,EAAA;AACEpB,MAAAA,SAAS,EAAC,0DAA0D;AACpE,MAAA,aAAA,EAAY,kBAAkB;MAAAmB,QAAA,eAE9BC,GAAA,CAACmE,MAAM,EAAA;QAACd,KAAK,EAAEnE,CAAC,CAAC,oCAAoC;OAAI;KACtD,CAAC,gBAENc,GAAA,CAAA,KAAA,EAAA;AAAKpB,MAAAA,SAAS,EAAC,QAAQ;AAAAmB,MAAAA,QAAA,EACpB4C,kBAAkB,CAACnB,GAAG,CAAC,UAAAsB,KAAA,EAAA;AAAA,QAAA,IAAGhC,EAAE,GAAAgC,KAAA,CAAFhC,EAAE;UAAEzC,KAAK,GAAAyE,KAAA,CAALzE,KAAK;UAAEwC,KAAK,GAAAiC,KAAA,CAALjC,KAAK;UAAEE,aAAa,GAAA+B,KAAA,CAAb/B,aAAa;QAAA,oBACxDqD,aAAA,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,92 @@
1
+ import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
2
+ import Button from '@bigbinary/neetoui/Button';
3
+ import Modal from '@bigbinary/neetoui/Modal';
4
+ import Typography from '@bigbinary/neetoui/Typography';
5
+ import { useTranslation, Trans } from 'react-i18next';
6
+ import { useMutation } from '@tanstack/react-query';
7
+ import axios from 'axios';
8
+ import { jsxs, jsx } from 'react/jsx-runtime';
9
+
10
+ var create = function create() {
11
+ return axios.post("/neeto_sso/api/v1/subscription_request");
12
+ };
13
+ var subscriptionRequestApi = {
14
+ create: create
15
+ };
16
+
17
+ var useCreateSubscriptionRequest = function useCreateSubscriptionRequest() {
18
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19
+ onSuccess = _ref.onSuccess;
20
+ return useMutation({
21
+ mutationFn: subscriptionRequestApi.create,
22
+ onSuccess: onSuccess
23
+ });
24
+ };
25
+
26
+ var SubscriptionUpgradeRequestModal = function SubscriptionUpgradeRequestModal(_ref) {
27
+ var _globalProps$appName;
28
+ var isOpen = _ref.isOpen,
29
+ onClose = _ref.onClose;
30
+ var _useTranslation = useTranslation(),
31
+ t = _useTranslation.t;
32
+ var pricingPageUrl = "https://neeto.com/".concat((_globalProps$appName = globalProps.appName) === null || _globalProps$appName === void 0 ? void 0 : _globalProps$appName.toLowerCase(), "/pricing");
33
+ var _useCreateSubscriptio = useCreateSubscriptionRequest({
34
+ onSuccess: onClose
35
+ }),
36
+ sendRequest = _useCreateSubscriptio.mutate,
37
+ isPending = _useCreateSubscriptio.isPending;
38
+ return /*#__PURE__*/jsxs(Modal, {
39
+ isOpen: isOpen,
40
+ onClose: onClose,
41
+ closeOnEsc: !isPending,
42
+ closeOnOutsideClick: !isPending,
43
+ children: [/*#__PURE__*/jsx(Modal.Header, {
44
+ children: /*#__PURE__*/jsx(Typography, {
45
+ style: "h3",
46
+ weight: "semibold",
47
+ children: t("neetoMolecules.subscriptionRequest.title")
48
+ })
49
+ }), /*#__PURE__*/jsxs(Modal.Body, {
50
+ children: [/*#__PURE__*/jsx(Typography, {
51
+ style: "body2",
52
+ children: /*#__PURE__*/jsx(Trans, {
53
+ components: {
54
+ strong: /*#__PURE__*/jsx("strong", {})
55
+ },
56
+ i18nKey: "neetoMolecules.subscriptionRequest.description"
57
+ })
58
+ }), /*#__PURE__*/jsx(Typography, {
59
+ className: "mt-3",
60
+ style: "body2",
61
+ children: /*#__PURE__*/jsx(Trans, {
62
+ i18nKey: "neetoMolecules.subscriptionRequest.pricingInfo",
63
+ components: {
64
+ pricingLink: /*#__PURE__*/jsx("a", {
65
+ className: "neeto-ui-text-primary-500",
66
+ href: pricingPageUrl,
67
+ rel: "noopener noreferrer",
68
+ target: "_blank"
69
+ })
70
+ }
71
+ })
72
+ })]
73
+ }), /*#__PURE__*/jsxs(Modal.Footer, {
74
+ className: "flex gap-x-2",
75
+ children: [/*#__PURE__*/jsx(Button, {
76
+ disabled: isPending,
77
+ label: t("neetoMolecules.subscriptionRequest.cancel"),
78
+ style: "secondary",
79
+ onClick: onClose
80
+ }), /*#__PURE__*/jsx(Button, {
81
+ disabled: isPending,
82
+ label: t("neetoMolecules.subscriptionRequest.sendRequest"),
83
+ loading: isPending,
84
+ style: "primary",
85
+ onClick: sendRequest
86
+ })]
87
+ })]
88
+ });
89
+ };
90
+
91
+ export { SubscriptionUpgradeRequestModal as default };
92
+ //# 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,SA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