@bigbinary/neeto-molecules 5.3.10 → 5.3.12

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.
@@ -23,14 +23,14 @@ import axios from 'axios';
23
23
  import { S as Search } from '../search-H0uYy0W-.js';
24
24
  import useBreakpoints from '@bigbinary/neeto-commons-frontend/v2/react-utils/useBreakpoints';
25
25
  import { t } from 'i18next';
26
+ import { getFromLocalStorage } from '@bigbinary/neeto-commons-frontend/v2/utils';
27
+ import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/v2/utils/axios';
28
+ import { removeFromLocalStorage } from '@bigbinary/neeto-commons-frontend/v2/utils/general';
26
29
  import { c as createLucideIcon } from '../createLucideIcon--oLqczpc.js';
27
30
  import { C as CircleQuestionMark } from '../circle-question-mark-B807GLZf.js';
28
31
  import { C as ChevronRight } from '../chevron-right-CEsVcNLw.js';
29
32
  import { U as User } from '../user-Dhw9zdMR.js';
30
33
  import useLocalStorage from '@bigbinary/neeto-commons-frontend/v2/react-utils/useLocalStorage';
31
- import { getFromLocalStorage } from '@bigbinary/neeto-commons-frontend/v2/utils';
32
- import { resetAuthTokens } from '@bigbinary/neeto-commons-frontend/v2/utils/axios';
33
- import { removeFromLocalStorage } from '@bigbinary/neeto-commons-frontend/v2/utils/general';
34
34
  import CopyToClipboardButton from './CopyToClipboardButton.js';
35
35
  import '../useKeyboardShortcutsPaneState-BlyFMEtW.js';
36
36
  import 'zustand/shallow';
@@ -49,7 +49,7 @@ import '../copy-Dj71cP65.js';
49
49
  */
50
50
 
51
51
 
52
- const __iconNode$9 = [
52
+ const __iconNode$b = [
53
53
  [
54
54
  "path",
55
55
  {
@@ -58,7 +58,7 @@ const __iconNode$9 = [
58
58
  }
59
59
  ]
60
60
  ];
61
- const Activity = createLucideIcon("activity", __iconNode$9);
61
+ const Activity = createLucideIcon("activity", __iconNode$b);
62
62
 
63
63
  /**
64
64
  * @license lucide-react v1.24.0 - ISC
@@ -68,7 +68,7 @@ const Activity = createLucideIcon("activity", __iconNode$9);
68
68
  */
69
69
 
70
70
 
71
- const __iconNode$8 = [
71
+ const __iconNode$a = [
72
72
  ["path", { d: "M12 7v14", key: "1akyts" }],
73
73
  [
74
74
  "path",
@@ -78,7 +78,7 @@ const __iconNode$8 = [
78
78
  }
79
79
  ]
80
80
  ];
81
- const BookOpen = createLucideIcon("book-open", __iconNode$8);
81
+ const BookOpen = createLucideIcon("book-open", __iconNode$a);
82
82
 
83
83
  /**
84
84
  * @license lucide-react v1.24.0 - ISC
@@ -88,11 +88,11 @@ const BookOpen = createLucideIcon("book-open", __iconNode$8);
88
88
  */
89
89
 
90
90
 
91
- const __iconNode$7 = [
91
+ const __iconNode$9 = [
92
92
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
93
93
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
94
94
  ];
95
- const CircleCheck = createLucideIcon("circle-check", __iconNode$7);
95
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$9);
96
96
 
97
97
  /**
98
98
  * @license lucide-react v1.24.0 - ISC
@@ -102,12 +102,12 @@ const CircleCheck = createLucideIcon("circle-check", __iconNode$7);
102
102
  */
103
103
 
104
104
 
105
- const __iconNode$6 = [
105
+ const __iconNode$8 = [
106
106
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
107
107
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
108
108
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
109
109
  ];
110
- const CircleX = createLucideIcon("circle-x", __iconNode$6);
110
+ const CircleX = createLucideIcon("circle-x", __iconNode$8);
111
111
 
112
112
  /**
113
113
  * @license lucide-react v1.24.0 - ISC
@@ -117,7 +117,7 @@ const CircleX = createLucideIcon("circle-x", __iconNode$6);
117
117
  */
118
118
 
119
119
 
120
- const __iconNode$5 = [
120
+ const __iconNode$7 = [
121
121
  [
122
122
  "path",
123
123
  {
@@ -127,7 +127,7 @@ const __iconNode$5 = [
127
127
  ],
128
128
  ["path", { d: "M5 21h14", key: "11awu3" }]
129
129
  ];
130
- const Crown = createLucideIcon("crown", __iconNode$5);
130
+ const Crown = createLucideIcon("crown", __iconNode$7);
131
131
 
132
132
  /**
133
133
  * @license lucide-react v1.24.0 - ISC
@@ -137,12 +137,54 @@ const Crown = createLucideIcon("crown", __iconNode$5);
137
137
  */
138
138
 
139
139
 
140
- const __iconNode$4 = [
140
+ const __iconNode$6 = [
141
+ [
142
+ "path",
143
+ {
144
+ d: "M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",
145
+ key: "1gvzjb"
146
+ }
147
+ ],
148
+ ["path", { d: "M9 18h6", key: "x1upvd" }],
149
+ ["path", { d: "M10 22h4", key: "ceow96" }]
150
+ ];
151
+ const Lightbulb = createLucideIcon("lightbulb", __iconNode$6);
152
+
153
+ /**
154
+ * @license lucide-react v1.24.0 - ISC
155
+ *
156
+ * This source code is licensed under the ISC license.
157
+ * See the LICENSE file in the root directory of this source tree.
158
+ */
159
+
160
+
161
+ const __iconNode$5 = [
141
162
  ["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
142
163
  ["path", { d: "M21 12H9", key: "dn1m92" }],
143
164
  ["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
144
165
  ];
145
- const LogOut = createLucideIcon("log-out", __iconNode$4);
166
+ const LogOut = createLucideIcon("log-out", __iconNode$5);
167
+
168
+ /**
169
+ * @license lucide-react v1.24.0 - ISC
170
+ *
171
+ * This source code is licensed under the ISC license.
172
+ * See the LICENSE file in the root directory of this source tree.
173
+ */
174
+
175
+
176
+ const __iconNode$4 = [
177
+ [
178
+ "path",
179
+ {
180
+ d: "M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",
181
+ key: "169xi5"
182
+ }
183
+ ],
184
+ ["path", { d: "M15 5.764v15", key: "1pn4in" }],
185
+ ["path", { d: "M9 3.236v15", key: "1uimfh" }]
186
+ ];
187
+ const Map = createLucideIcon("map", __iconNode$4);
146
188
 
147
189
  /**
148
190
  * @license lucide-react v1.24.0 - ISC
@@ -542,6 +584,72 @@ var MENU_ITEM_CLASSES = "gap-2.5 px-2.5 py-2 font-medium [&>[data-slot=menu-item
542
584
  var THEME_BUTTON_BASE = "relative z-10 flex items-center justify-center gap-1 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none";
543
585
  var THEME_ICON_BASE = "transition-transform duration-300 ease-out";
544
586
 
587
+ var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
588
+ var _globalProps$user, _globalProps$user2;
589
+ var user = ((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email) || ((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.phoneNumber);
590
+ return "sidebarState-".concat(user);
591
+ };
592
+ var getUserProfileInfo = function getUserProfileInfo() {
593
+ var _globalProps$user$fir, _globalProps$user3, _globalProps$user$las, _globalProps$user4, _globalProps$user5, _globalProps$user6, _globalProps$user7;
594
+ return {
595
+ name: "".concat((_globalProps$user$fir = (_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.firstName) !== null && _globalProps$user$fir !== void 0 ? _globalProps$user$fir : "", " ").concat((_globalProps$user$las = (_globalProps$user4 = globalProps.user) === null || _globalProps$user4 === void 0 ? void 0 : _globalProps$user4.lastName) !== null && _globalProps$user$las !== void 0 ? _globalProps$user$las : ""),
596
+ imageUrl: globalProps.authenticated ? (_globalProps$user5 = globalProps.user) === null || _globalProps$user5 === void 0 ? void 0 : _globalProps$user5.profileImageUrl : "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
597
+ email: ((_globalProps$user6 = globalProps.user) === null || _globalProps$user6 === void 0 ? void 0 : _globalProps$user6.email) || ((_globalProps$user7 = globalProps.user) === null || _globalProps$user7 === void 0 ? void 0 : _globalProps$user7.phoneNumber),
598
+ isAuthenticated: globalProps.authenticated
599
+ };
600
+ };
601
+ var getConsumerProfileInfo = function getConsumerProfileInfo() {
602
+ var _globalProps$consumer, _globalProps$consumer2, _globalProps$consumer3, _globalProps$consumer4, _globalProps$consumer5, _globalProps$consumer6, _globalProps$consumer7;
603
+ return {
604
+ name: "".concat((_globalProps$consumer = (_globalProps$consumer2 = globalProps.consumer) === null || _globalProps$consumer2 === void 0 ? void 0 : _globalProps$consumer2.firstName) !== null && _globalProps$consumer !== void 0 ? _globalProps$consumer : "", " ").concat((_globalProps$consumer3 = (_globalProps$consumer4 = globalProps.consumer) === null || _globalProps$consumer4 === void 0 ? void 0 : _globalProps$consumer4.lastName) !== null && _globalProps$consumer3 !== void 0 ? _globalProps$consumer3 : ""),
605
+ imageUrl: ((_globalProps$consumer5 = globalProps.consumer) === null || _globalProps$consumer5 === void 0 ? void 0 : _globalProps$consumer5.profileImageUrl) || "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
606
+ email: ((_globalProps$consumer6 = globalProps.consumer) === null || _globalProps$consumer6 === void 0 ? void 0 : _globalProps$consumer6.email) || ((_globalProps$consumer7 = globalProps.consumer) === null || _globalProps$consumer7 === void 0 ? void 0 : _globalProps$consumer7.phoneNumber),
607
+ isAuthenticated: globalProps.isConsumer
608
+ };
609
+ };
610
+ var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated, isConsumer) {
611
+ return [isAuthenticated ? {
612
+ label: t("neetoMolecules.sidebar.logout"),
613
+ icon: LogOut,
614
+ onClick: function onClick() {
615
+ resetAuthTokens();
616
+ removeFromLocalStorage(getSidebarStateLocalStorageKey());
617
+ isConsumer ? window.location.href = "/consumers/logout?redirect_uri=".concat(window.location.href) : window.location.href = "/logout";
618
+ },
619
+ "data-testid": "profile-logout-button"
620
+ } : {
621
+ label: t("neetoMolecules.sidebar.login"),
622
+ onClick: function onClick() {
623
+ window.location.href = "/login";
624
+ },
625
+ "data-testid": "profile-login-button"
626
+ }];
627
+ };
628
+ var getProfileInfo = function getProfileInfo(profileInfoOverrides, isConsumer) {
629
+ return mergeDeepLeft(profileInfoOverrides, isConsumer ? getConsumerProfileInfo() : getUserProfileInfo());
630
+ };
631
+
632
+ // Theme switcher utils.
633
+ var setDarkTheme = function setDarkTheme() {
634
+ if (!document.body) return;
635
+ document.body.classList.remove(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
636
+ document.body.classList.add(THEMES.DARK, LEGACY_THEMES.DARK);
637
+ };
638
+ var setLightTheme = function setLightTheme() {
639
+ if (!document.body) return;
640
+ document.body.classList.remove(THEMES.DARK, LEGACY_THEMES.DARK);
641
+ document.body.classList.add(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
642
+ };
643
+ var setAppTheme = function setAppTheme() {
644
+ var storedTheme = getFromLocalStorage(APP_THEME_LOCALSTORAGE_KEY);
645
+ var isDarkTheme = storedTheme === THEMES.DARK || storedTheme === LEGACY_THEMES.DARK;
646
+ isDarkTheme ? setDarkTheme() : setLightTheme();
647
+ };
648
+ var getRoadmapUrl = function getRoadmapUrl() {
649
+ var _globalProps;
650
+ return "https://roadmap.".concat(toLower(((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.appName) || ""), ".com");
651
+ };
652
+
545
653
  var _excluded$2 = ["className"];
546
654
  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; }
547
655
  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; }
@@ -588,6 +696,24 @@ var HelpItems = withT(function (_ref) {
588
696
  rel: "noreferrer",
589
697
  target: "_blank",
590
698
  children: t("neetoMolecules.sidebar.helpLinks.askTheCommunity")
699
+ }), /*#__PURE__*/jsx(MenuItem, {
700
+ "data-testid": "help-link-request-feature-button",
701
+ href: "".concat(getRoadmapUrl(), "/feature-requests"),
702
+ prefix: /*#__PURE__*/jsx(Lightbulb, {
703
+ size: 18
704
+ }),
705
+ rel: "noreferrer",
706
+ target: "_blank",
707
+ children: t("neetoMolecules.sidebar.helpLinks.requestFeature")
708
+ }), /*#__PURE__*/jsx(MenuItem, {
709
+ "data-testid": "help-link-roadmap-button",
710
+ href: "".concat(getRoadmapUrl(), "/product-roadmap"),
711
+ prefix: /*#__PURE__*/jsx(Map, {
712
+ size: 18
713
+ }),
714
+ rel: "noreferrer",
715
+ target: "_blank",
716
+ children: t("neetoMolecules.sidebar.helpLinks.roadmap")
591
717
  }), /*#__PURE__*/jsx(MenuItem, {
592
718
  "data-testid": "help-link-status-button",
593
719
  href: "https://neetostatus.com/",
@@ -1005,68 +1131,6 @@ var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
1005
1131
  });
1006
1132
  };
1007
1133
 
1008
- var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
1009
- var _globalProps$user, _globalProps$user2;
1010
- var user = ((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email) || ((_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.phoneNumber);
1011
- return "sidebarState-".concat(user);
1012
- };
1013
- var getUserProfileInfo = function getUserProfileInfo() {
1014
- var _globalProps$user$fir, _globalProps$user3, _globalProps$user$las, _globalProps$user4, _globalProps$user5, _globalProps$user6, _globalProps$user7;
1015
- return {
1016
- name: "".concat((_globalProps$user$fir = (_globalProps$user3 = globalProps.user) === null || _globalProps$user3 === void 0 ? void 0 : _globalProps$user3.firstName) !== null && _globalProps$user$fir !== void 0 ? _globalProps$user$fir : "", " ").concat((_globalProps$user$las = (_globalProps$user4 = globalProps.user) === null || _globalProps$user4 === void 0 ? void 0 : _globalProps$user4.lastName) !== null && _globalProps$user$las !== void 0 ? _globalProps$user$las : ""),
1017
- imageUrl: globalProps.authenticated ? (_globalProps$user5 = globalProps.user) === null || _globalProps$user5 === void 0 ? void 0 : _globalProps$user5.profileImageUrl : "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
1018
- email: ((_globalProps$user6 = globalProps.user) === null || _globalProps$user6 === void 0 ? void 0 : _globalProps$user6.email) || ((_globalProps$user7 = globalProps.user) === null || _globalProps$user7 === void 0 ? void 0 : _globalProps$user7.phoneNumber),
1019
- isAuthenticated: globalProps.authenticated
1020
- };
1021
- };
1022
- var getConsumerProfileInfo = function getConsumerProfileInfo() {
1023
- var _globalProps$consumer, _globalProps$consumer2, _globalProps$consumer3, _globalProps$consumer4, _globalProps$consumer5, _globalProps$consumer6, _globalProps$consumer7;
1024
- return {
1025
- name: "".concat((_globalProps$consumer = (_globalProps$consumer2 = globalProps.consumer) === null || _globalProps$consumer2 === void 0 ? void 0 : _globalProps$consumer2.firstName) !== null && _globalProps$consumer !== void 0 ? _globalProps$consumer : "", " ").concat((_globalProps$consumer3 = (_globalProps$consumer4 = globalProps.consumer) === null || _globalProps$consumer4 === void 0 ? void 0 : _globalProps$consumer4.lastName) !== null && _globalProps$consumer3 !== void 0 ? _globalProps$consumer3 : ""),
1026
- imageUrl: ((_globalProps$consumer5 = globalProps.consumer) === null || _globalProps$consumer5 === void 0 ? void 0 : _globalProps$consumer5.profileImageUrl) || "https://d2v7kzglnr2dnh.cloudfront.net/others/profile-pic.jpg",
1027
- email: ((_globalProps$consumer6 = globalProps.consumer) === null || _globalProps$consumer6 === void 0 ? void 0 : _globalProps$consumer6.email) || ((_globalProps$consumer7 = globalProps.consumer) === null || _globalProps$consumer7 === void 0 ? void 0 : _globalProps$consumer7.phoneNumber),
1028
- isAuthenticated: globalProps.isConsumer
1029
- };
1030
- };
1031
- var getDefaultBottomLinks = function getDefaultBottomLinks(isAuthenticated, isConsumer) {
1032
- return [isAuthenticated ? {
1033
- label: t("neetoMolecules.sidebar.logout"),
1034
- icon: LogOut,
1035
- onClick: function onClick() {
1036
- resetAuthTokens();
1037
- removeFromLocalStorage(getSidebarStateLocalStorageKey());
1038
- isConsumer ? window.location.href = "/consumers/logout?redirect_uri=".concat(window.location.href) : window.location.href = "/logout";
1039
- },
1040
- "data-testid": "profile-logout-button"
1041
- } : {
1042
- label: t("neetoMolecules.sidebar.login"),
1043
- onClick: function onClick() {
1044
- window.location.href = "/login";
1045
- },
1046
- "data-testid": "profile-login-button"
1047
- }];
1048
- };
1049
- var getProfileInfo = function getProfileInfo(profileInfoOverrides, isConsumer) {
1050
- return mergeDeepLeft(profileInfoOverrides, isConsumer ? getConsumerProfileInfo() : getUserProfileInfo());
1051
- };
1052
-
1053
- // Theme switcher utils.
1054
- var setDarkTheme = function setDarkTheme() {
1055
- if (!document.body) return;
1056
- document.body.classList.remove(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
1057
- document.body.classList.add(THEMES.DARK, LEGACY_THEMES.DARK);
1058
- };
1059
- var setLightTheme = function setLightTheme() {
1060
- if (!document.body) return;
1061
- document.body.classList.remove(THEMES.DARK, LEGACY_THEMES.DARK);
1062
- document.body.classList.add(THEMES.LIGHT, LEGACY_THEMES.LIGHT);
1063
- };
1064
- var setAppTheme = function setAppTheme() {
1065
- var storedTheme = getFromLocalStorage(APP_THEME_LOCALSTORAGE_KEY);
1066
- var isDarkTheme = storedTheme === THEMES.DARK || storedTheme === LEGACY_THEMES.DARK;
1067
- isDarkTheme ? setDarkTheme() : setLightTheme();
1068
- };
1069
-
1070
1134
  var ThemeSwitcher = function ThemeSwitcher() {
1071
1135
  var _useTranslation = useTranslation(),
1072
1136
  t = _useTranslation.t;