@bigbinary/neeto-molecules 3.16.18 → 3.16.19

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.
@@ -0,0 +1,260 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
+ import classnames from 'classnames';
4
+ import { handleMetaClick } from '@bigbinary/neeto-commons-frontend/react-utils';
5
+ import { hyphenize } from '@bigbinary/neeto-commons-frontend/utils/general';
6
+ import Home from '@bigbinary/neeto-icons/Home';
7
+ import Typography from '@bigbinary/neetoui/Typography';
8
+ import Button from '@bigbinary/neetoui/Button';
9
+ import { curry, is, includes, __, all, equals, omit } from 'ramda';
10
+ import { NavLink, useHistory } from 'react-router-dom';
11
+ import { Fragment } from 'react';
12
+ import { isNotEmpty, isPresent, hyphenate } from '@bigbinary/neeto-cist';
13
+ import Segments from '@bigbinary/neeto-filters-frontend/Segments';
14
+ import { useNavigationCheckpoints } from '@bigbinary/neeto-commons-frontend/react-utils/useRegisterNavigationCheckpoint';
15
+ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
16
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
17
+ import { n } from './inject-css-DmrvuTKK.js';
18
+
19
+ var _excluded$1 = ["checkpointKey", "to", "href", "children"];
20
+ 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; }
21
+ 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), !0).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; }
22
+ var CheckPointNavLinks = function CheckPointNavLinks(_ref) {
23
+ var checkpointKey = _ref.checkpointKey,
24
+ to = _ref.to,
25
+ href = _ref.href,
26
+ children = _ref.children,
27
+ others = _objectWithoutProperties(_ref, _excluded$1);
28
+ var _useNavigationCheckpo = useNavigationCheckpoints(checkpointKey),
29
+ checkpoint = _useNavigationCheckpo[checkpointKey];
30
+ var LinkElement = href ? "a" : NavLink;
31
+ var linkProps = href ? _objectSpread$2({
32
+ href: href,
33
+ key: href
34
+ }, others) : _objectSpread$2({
35
+ to: checkpoint || to,
36
+ key: to
37
+ }, others);
38
+ return /*#__PURE__*/jsx(LinkElement, _objectSpread$2(_objectSpread$2({}, linkProps), {}, {
39
+ children: children
40
+ }));
41
+ };
42
+
43
+ var SUB_LINK_TYPES = {
44
+ SYSTEM_VIEW: "system_view",
45
+ SEGMENTS: "segments"
46
+ };
47
+ var SELECTED_NAV_LINK_ROUTE_STORAGE_KEY = "selectedNavLinkRoute";
48
+ var DEFAULT_HOME_PATH = "/";
49
+ var SIDEBAR_WIDTH_KEY = "neeto-molecules-sidebar-width";
50
+ var MIN_SIDEBAR_WIDTH = 12.5 * 16;
51
+ var MAX_SIDEBAR_WIDTH = 20 * 16;
52
+ var DEFAULT_SIDEBAR_WIDTH = 15 * 16;
53
+
54
+ var isSubRouteActive = function isSubRouteActive(subRoute, location) {
55
+ var currentBrowserUrl = new URL(location.pathname + location.search + location.hash, window.location.origin);
56
+ var targetUrl = new URL(subRoute, window.location.origin);
57
+ var targetSearchParams = targetUrl.searchParams;
58
+ var targetSearchKeys = Array.from(targetSearchParams.keys());
59
+ return all(function (key) {
60
+ return currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key);
61
+ }, targetSearchKeys) && equals(currentBrowserUrl.pathname, targetUrl.pathname);
62
+ };
63
+ var getSidebarStateLocalStorageKey = function getSidebarStateLocalStorageKey() {
64
+ var _globalProps$user, _globalProps$user2;
65
+ 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);
66
+ return "sidebarState-".concat(user);
67
+ };
68
+ var filterByPermissions = curry(function (_ref) {
69
+ var permissions = _ref.permissions;
70
+ if (permissions && isNotEmpty(permissions)) {
71
+ return is(Array, permissions) ? permissions.some(includes(__, globalProps.permissions)) : globalProps.permissions.includes(permissions);
72
+ }
73
+ return true;
74
+ });
75
+ var getActiveConfigurePageLink = function getActiveConfigurePageLink(_ref2) {
76
+ var navLinks = _ref2.navLinks,
77
+ location = _ref2.location;
78
+ return navLinks.find(function (link) {
79
+ var _link$to;
80
+ var _ref3 = ((_link$to = link.to) === null || _link$to === void 0 ? void 0 : _link$to.split("?")) || [],
81
+ _ref4 = _slicedToArray(_ref3, 1),
82
+ linkPathname = _ref4[0];
83
+ return isPresent(link.isConfigureNavLink) && link.isConfigureNavLink && location.pathname.startsWith(linkPathname);
84
+ });
85
+ };
86
+ var enableDraggingStyles = function enableDraggingStyles() {
87
+ document.body.classList.add("dragging-sidebar");
88
+ document.body.style.cursor = "col-resize";
89
+ document.body.style.userSelect = "none";
90
+ };
91
+ var disableDraggingStyles = function disableDraggingStyles() {
92
+ document.body.classList.remove("dragging-sidebar");
93
+ document.body.style.cursor = "";
94
+ document.body.style.userSelect = "";
95
+ };
96
+
97
+ var SubLink = function SubLink(_ref) {
98
+ var to = _ref.to,
99
+ href = _ref.href,
100
+ label = _ref.label,
101
+ _ref$type = _ref.type,
102
+ type = _ref$type === void 0 ? SUB_LINK_TYPES.SYSTEM_VIEW : _ref$type,
103
+ count = _ref.count,
104
+ isSectionHeader = _ref.isSectionHeader,
105
+ isCountsLoading = _ref.isCountsLoading,
106
+ dataCy = _ref["data-cy"],
107
+ _ref$entity = _ref.entity,
108
+ entity = _ref$entity === void 0 ? "" : _ref$entity,
109
+ _ref$columns = _ref.columns,
110
+ columns = _ref$columns === void 0 ? [] : _ref$columns,
111
+ baseUrl = _ref.baseUrl,
112
+ isActive = _ref.isActive;
113
+ if (type === SUB_LINK_TYPES.SEGMENTS) {
114
+ return /*#__PURE__*/jsx(Segments, {
115
+ baseUrl: baseUrl,
116
+ columns: columns,
117
+ entity: entity,
118
+ isIndependent: false
119
+ });
120
+ }
121
+ var dataCyPrefix = dataCy || hyphenate(label);
122
+ var renderCount = function renderCount(count) {
123
+ return count > 999 ? "999+" : count;
124
+ };
125
+ var isSubLinkActive = function isSubLinkActive() {
126
+ return !isSectionHeader && (is(Function, isActive) ? isActive() : isSubRouteActive(to, location));
127
+ };
128
+ return /*#__PURE__*/jsxs(CheckPointNavLinks, {
129
+ href: href,
130
+ to: to,
131
+ activeClassName: "active",
132
+ className: "neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none",
133
+ "data-cy": "".concat(dataCyPrefix, "-sub-link"),
134
+ isActive: isSubLinkActive,
135
+ children: [/*#__PURE__*/jsx(Typography, {
136
+ className: "neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow",
137
+ component: "span",
138
+ "data-cy": "".concat(dataCyPrefix, "-sub-link-label"),
139
+ style: "body2",
140
+ children: label
141
+ }), /*#__PURE__*/jsx(Typography, {
142
+ className: "neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0",
143
+ component: "span",
144
+ "data-cy": "".concat(dataCyPrefix, "-sub-link-count"),
145
+ style: "body2",
146
+ children: isCountsLoading ? /*#__PURE__*/jsx("div", {
147
+ className: "neeto-ui-rounded neeto-ui-bg-gray-200 h-4 w-4 animate-pulse"
148
+ }) : renderCount(count)
149
+ })]
150
+ });
151
+ };
152
+
153
+ function ownKeys$1(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; }
154
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
155
+ var _Items = function Items(_ref) {
156
+ var items = _ref.items,
157
+ _ref$isSettingsItems = _ref.isSettingsItems,
158
+ isSettingsItems = _ref$isSettingsItems === void 0 ? false : _ref$isSettingsItems,
159
+ isCountsLoading = _ref.isCountsLoading;
160
+ return /*#__PURE__*/jsx("div", {
161
+ className: "neeto-molecules-sidebar__sublink-wrapper",
162
+ "data-cy": "sidebar-sub-link-wrapper",
163
+ children: items.filter(filterByPermissions).map(function (subItem, subIndex) {
164
+ var _subItem$to;
165
+ return /*#__PURE__*/jsxs(Fragment, {
166
+ children: [/*#__PURE__*/jsx(SubLink, _objectSpread$1(_objectSpread$1({}, _objectSpread$1(_objectSpread$1({}, subItem), {}, {
167
+ isCountsLoading: isCountsLoading
168
+ })), {}, {
169
+ href: subItem.href,
170
+ isActive: subItem.isActive,
171
+ isSectionHeader: isPresent(subItem.item),
172
+ to: (_subItem$to = subItem.to) !== null && _subItem$to !== void 0 ? _subItem$to : subItem.path
173
+ })), isSettingsItems && isPresent(subItem.items) && /*#__PURE__*/jsxs(Fragment$1, {
174
+ children: [/*#__PURE__*/jsx(_Items, {
175
+ isSettingsItems: isSettingsItems,
176
+ items: subItem.items
177
+ }), items.length - 1 !== subIndex && /*#__PURE__*/jsx("hr", {
178
+ className: "neeto-molecules-sidebar__separator neeto-ui-border-gray-200"
179
+ })]
180
+ })]
181
+ }, subIndex);
182
+ })
183
+ });
184
+ };
185
+
186
+ var _excluded = ["label", "items", "isConfigureNavLink"];
187
+ function ownKeys(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; }
188
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
189
+ var SelectedLink = function SelectedLink(_ref) {
190
+ var _ref$navLink = _ref.navLink,
191
+ navLink = _ref$navLink === void 0 ? {
192
+ label: "",
193
+ items: [],
194
+ isConfigureNavLink: false
195
+ } : _ref$navLink,
196
+ handleGoBack = _ref.handleGoBack,
197
+ isConfigureSidebar = _ref.isConfigureSidebar,
198
+ homePath = _ref.homePath;
199
+ var history = useHistory();
200
+ var label = navLink.label,
201
+ items = navLink.items,
202
+ isConfigureNavLink = navLink.isConfigureNavLink,
203
+ otherProps = _objectWithoutProperties(navLink, _excluded);
204
+ var handleHomeButtonClick = function handleHomeButtonClick(e) {
205
+ e.stopPropagation();
206
+ handleMetaClick(history, homePath, e);
207
+ };
208
+ return /*#__PURE__*/jsxs("div", {
209
+ className: "neeto-molecules-sidebar__links neeto-molecules-sidebar__links--focus-mode neeto-molecules-sidebar__no-shrinkable",
210
+ "data-cy": "configure-nav-container",
211
+ children: [/*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
212
+ className: "neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-molecules-sidebar__link neeto-ui-border-b neeto-ui-border-gray-200",
213
+ onClick: handleGoBack
214
+ }, _objectSpread({}, omit(["icon"], otherProps))), {}, {
215
+ children: [isConfigureNavLink && /*#__PURE__*/jsxs("span", {
216
+ className: "neeto-molecules-sidebar__link-icon flex items-center pl-3",
217
+ children: [/*#__PURE__*/jsx(Button, {
218
+ "data-cy": "".concat(hyphenize(label), "-go-back-button"),
219
+ "data-testid": "".concat(label, "-go-home-button"),
220
+ icon: Home,
221
+ style: "text",
222
+ onClick: handleHomeButtonClick
223
+ }), /*#__PURE__*/jsx("span", {
224
+ className: "px-1 text-xs",
225
+ children: "/"
226
+ })]
227
+ }), /*#__PURE__*/jsx(Typography, {
228
+ component: "span",
229
+ style: "body1",
230
+ className: classnames("neeto-molecules-sidebar__link-label", _defineProperty({
231
+ "neeto-molecules-sidebar__configure-page-header": isConfigureNavLink
232
+ }, "pl-4", isConfigureSidebar)),
233
+ children: label
234
+ })]
235
+ })), items && /*#__PURE__*/jsx(_Items, {
236
+ items: items,
237
+ isSettingsItems: true
238
+ })]
239
+ });
240
+ };
241
+
242
+ var css = ":root{--neeto-molecules-sidebar-width:15rem;--neeto-molecules-sidebar-wrapper-z-index:99997;--neeto-molecules-sidebar-z-index:99998;--neeto-chat-primary:136,134,255;--neeto-wireframe-primary:106,103,232;--neeto-site-primary:129,118,255;--neeto-desk-primary:253,148,55;--neeto-planner-primary:82,169,198;--neeto-replay-primary:32,199,189;--neeto-course-primary:140,214,114;--neeto-ci-primary:255,133,184;--neeto-invoice-primary:70,160,211;--neeto-quiz-primary:254,99,99;--neeto-runner-primary:75,71,255;--neeto-form-primary:254,128,114;--neeto-crm-primary:96,154,240;--neeto-engage-primary:255,135,135;--neeto-deploy-primary:20,209,164;--neeto-kb-primary:101,205,161;--neeto-cal-primary:238,77,95;--neeto-invisible-primary:121,157,250;--neeto-testify-primary:255,158,69;--neeto-monitor-primary:70,181,197;--neeto-git-primary:255,78,110}@media screen and (min-width:1024px){:root{--neeto-molecules-sidebar-width:15rem}}.neeto-molecules-sidebar__wrapper{display:flex;max-width:15rem;max-width:var(--neeto-molecules-sidebar-width);position:relative;width:15rem;width:var(--neeto-molecules-sidebar-width)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper{height:100%;left:0;max-width:100%;position:fixed;top:0;transition:none;width:100%;z-index:99997;z-index:var(--neeto-molecules-sidebar-wrapper-z-index)}.neeto-molecules-sidebar__wrapper .neeto-molecules-sidebar{left:0;max-width:15rem;max-width:var(--neeto-molecules-sidebar-width);position:fixed;top:0;transition:none;width:15rem;width:var(--neeto-molecules-sidebar-width)}}.neeto-molecules-sidebar__wrapper__configure-page .neeto-molecules-sidebar__toggler{right:1.25rem;top:.5rem}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper__configure-page .neeto-molecules-sidebar__toggler{right:auto;top:.5rem}}.neeto-molecules-sidebar__wrapper--collapsed{max-width:0;width:0}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{right:-2.25rem;transform:scale(-1)}@media screen and (max-width:768px){.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{left:.5rem;right:auto}.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar{left:-15rem;left:calc(var(--neeto-molecules-sidebar-width)*-1)}.neeto-molecules-sidebar__wrapper__configure-page.neeto-molecules-sidebar__wrapper--collapsed .neeto-molecules-sidebar__toggler{top:6.8125rem}}.neeto-molecules-sidebar{background-color:rgb(var(--neeto-ui-white));border-right:1px solid rgb(var(--neeto-ui-gray-200));height:100vh;padding:1.5rem 0;width:100%;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}.neeto-molecules-sidebar:not(.neeto-molecules-sidebar__configure-page) .neeto-molecules-sidebar__links:not(.neeto-molecules-sidebar__links--focus-mode){height:calc(100vh - 7.75rem)!important;overflow-y:auto}.neeto-molecules-sidebar:not(.neeto-molecules-sidebar__configure-page) .neeto-molecules-sidebar__links:not(.neeto-molecules-sidebar__links--focus-mode)::-webkit-scrollbar{height:0;width:0}.neeto-molecules-sidebar:not(.neeto-molecules-sidebar__configure-page) .neeto-molecules-sidebar__links:not(.neeto-molecules-sidebar__links--focus-mode)::-webkit-scrollbar-thumb{background:rgb(var(--neeto-ui-gray-300));border-radius:3.125rem}.neeto-molecules-sidebar:not(.neeto-molecules-sidebar__configure-page) .neeto-molecules-sidebar__links:not(.neeto-molecules-sidebar__links--focus-mode)::-webkit-scrollbar-track{background:\"transparent\"}.neeto-molecules-sidebar__no-shrinkable{max-width:15rem;max-width:var(--neeto-molecules-sidebar-width);width:15rem;width:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar__separator{margin:.375rem auto;width:100%}.neeto-molecules-sidebar::-webkit-scrollbar{height:0;width:0}.neeto-molecules-sidebar::-webkit-scrollbar-thumb{background:rgb(var(--neeto-ui-gray-300));border-radius:3.125rem}.neeto-molecules-sidebar::-webkit-scrollbar-track{background:\"transparent\"}.neeto-molecules-sidebar__toggler{color:rgb(var(--neeto-ui-primary-500))!important;position:absolute!important;right:.5rem;top:2.125rem;z-index:99998;z-index:var(--neeto-molecules-sidebar-z-index)}@media screen and (max-width:768px){.neeto-molecules-sidebar__toggler{left:12.625rem;left:calc(var(--neeto-molecules-sidebar-width) - 2.375rem);right:auto;transition:none}}.neeto-molecules-sidebar__configure-page{border-right:1px solid rgb(var(--neeto-ui-gray-200));height:auto}@media screen and (max-width:768px){.neeto-molecules-sidebar__configure-page{height:100%}}.neeto-molecules-sidebar__configure-page .neeto-molecules-sidebar__links{height:calc(100vh - 8.5rem)!important}@media screen and (max-width:768px){.neeto-molecules-sidebar__configure-page .neeto-molecules-sidebar__links{height:calc(100vh - 5rem)!important}}.neeto-molecules-sidebar__configure-page .neeto-molecules-sidebar__toggler{display:none}.neeto-molecules-sidebar__header{margin:.5rem 0 2rem;padding:0 1.5rem}.neeto-molecules-sidebar__logo svg{height:2.25rem;max-width:100%;width:auto}.neeto-molecules-sidebar__link{color:rgb(var(--neeto-ui-black));gap:.625rem;line-height:1.2;padding:.75rem 1.5rem;position:relative;text-decoration:none!important;transition:color .3s,background-color .3s;width:100%}.neeto-molecules-sidebar__link-icon{flex-shrink:0}.neeto-molecules-sidebar__link-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-sidebar__link-icon--rotate{transform:scale(-1)}.neeto-molecules-sidebar__link-icon--caret{opacity:0;transition:opacity .3s ease-in-out}.neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__link-sub-label{--neeto-ui-text-body2:0.9375rem;flex-grow:1;text-align:left}@media screen and (min-width:1536px){.neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__link-sub-label{--neeto-ui-text-body2:1rem}}.neeto-molecules-sidebar__link:hover{background-color:rgb(var(--neeto-ui-gray-100));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link:focus,.neeto-molecules-sidebar__link:focus-visible,.neeto-molecules-sidebar__link[aria-expanded=true]{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black));outline:none}.neeto-molecules-sidebar__link.active{background-color:rgb(var(--neeto-ui-accent-100));color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-semibold)}.neeto-molecules-sidebar__link.active .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:focus-visible .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link:hover .neeto-molecules-sidebar__link-icon--caret,.neeto-molecules-sidebar__link[aria-expanded=true] .neeto-molecules-sidebar__link-icon--caret{opacity:1}.neeto-molecules-sidebar__link--button:focus{background-color:transparent}.neeto-molecules-sidebar__link--button:focus-visible{background-color:rgb(var(--neeto-ui-gray-200));color:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__link--change-log{outline:none!important}.neeto-molecules-sidebar__sublink-wrapper{padding:.25rem 0}.neeto-molecules-sidebar__sublink{color:rgb(var(--neeto-ui-gray-700));cursor:pointer;gap:.5rem;margin-bottom:0;padding:.5rem 1.5rem .5rem 3.625rem;text-decoration:none;transition:color .3s,background-color .3s}.neeto-molecules-sidebar__sublink .neeto-molecules-sidebar__link-sub-count{--neeto-ui-text-body2:0.9375rem;opacity:.75}@media screen and (min-width:1536px){.neeto-molecules-sidebar__sublink .neeto-molecules-sidebar__link-sub-count{--neeto-ui-text-body2:1rem}}.neeto-molecules-sidebar__sublink:hover{color:rgb(var(--neeto-ui-black));text-decoration:none}.neeto-molecules-sidebar__sublink:hover .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink:focus,.neeto-molecules-sidebar__sublink:focus-visible{color:rgb(var(--neeto-ui-black));outline:none;text-decoration:none}.neeto-molecules-sidebar__sublink:focus .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:focus-visible .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__sublink.active,.neeto-molecules-sidebar__sublink:active{color:rgb(var(--neeto-ui-accent-800));font-weight:500;text-decoration:none}.neeto-molecules-sidebar__sublink.active .neeto-molecules-sidebar__link-sub-count,.neeto-molecules-sidebar__sublink:active .neeto-molecules-sidebar__link-sub-count{opacity:1}.neeto-molecules-sidebar__footer{margin-top:auto}.sidebar-featured-tooltip__content{border-radius:.5rem!important;box-shadow:var(--neeto-ui-shadow-sm)!important}.sidebar-featured-tooltip__content .tippy-content{padding:0}.sidebar-featured-tooltip{padding:.75rem;width:9.375rem}.sidebar-featured-tooltip__icon-wrap{background-color:rgb(var(--neeto-ui-gray-100));border-radius:.5rem;height:2.5rem;margin-bottom:.5rem;margin-left:auto;margin-right:auto;width:2.5rem}.sidebar-featured-tooltip__title{margin-bottom:.25rem}.neeto-molecules-help-popup-wrapper,.neeto-molecules-product-switcher-popup-wrapper,.neeto-molecules-profile-popup-wrapper{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded)!important;min-width:15rem}.neeto-molecules-help-popup-wrapper .tippy-content,.neeto-molecules-product-switcher-popup-wrapper .tippy-content,.neeto-molecules-profile-popup-wrapper .tippy-content{padding:0}.neeto-molecules-help-popup-wrapper .tippy-svg-arrow,.neeto-molecules-product-switcher-popup-wrapper .tippy-svg-arrow,.neeto-molecules-profile-popup-wrapper .tippy-svg-arrow{display:none!important}.neeto-molecules-profile-popup__top-section{border-top-left-radius:var(--neeto-ui-rounded);border-top-right-radius:var(--neeto-ui-rounded)}.neeto-molecules-profile-sublist{border-top:1px solid rgb(var(--neeto-ui-gray-400))}.neeto-molecules-help-sublist,.neeto-molecules-profile-sublist{list-style:none;margin:0;padding:.25rem 0}.neeto-molecules-help-sublist__item,.neeto-molecules-profile-sublist__item{width:100%}.neeto-molecules-help-sublist__item-btn,.neeto-molecules-profile-sublist__item-btn{border-radius:0;justify-content:flex-end!important;min-height:2.5rem;text-align:left}.neeto-molecules-help-sublist__item-btn.active,.neeto-molecules-profile-sublist__item-btn.active{background-color:rgb(var(--neeto-ui-gray-800));color:rgb(var(--neeto-ui-white))}.neeto-molecules-help-sublist__item-btn-icon svg path,.neeto-molecules-profile-sublist__item-btn-icon svg path{vector-effect:non-scaling-stroke}.neeto-molecules-help-sublist__item-btn span,.neeto-molecules-profile-sublist__item-btn span{align-items:center;display:flex;gap:.5rem}.neeto-molecules-sidebar__link-icon{position:relative}.neeto-molecules-sidebar__notif-count{position:absolute;right:-6px;top:-6px;z-index:1}.neeto-molecules-help-sublist__item-btn-count,.neeto-molecules-sidebar__notif-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);height:.9375rem;justify-content:center;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:.9375rem}.neeto-molecules-product-switcher-popup-wrapper{height:calc(100vh - 1rem);margin-bottom:.5rem;min-width:calc(100vw - 11rem);overflow-y:auto}@media screen and (max-width:768px){.neeto-molecules-product-switcher-popup-wrapper{width:calc(100vw - 11.5625rem)!important}}.neeto-molecules-sidebar__backdrop{background-color:rgba(var(--neeto-ui-black),.4);height:100%;left:0;position:absolute;top:0;width:100%}@media screen and (min-width:769px){.neeto-molecules-sidebar__backdrop{display:none;visibility:hidden}}.neeto-molecules-sidebar-segments-header{padding-left:3.625rem}.neeto-molecules-sidebar-segment{margin-bottom:0!important;padding:.25rem 1.5rem .25rem 3.625rem}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode{padding-top:0}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode .neeto-molecules-sidebar__header{padding-top:1.5rem}.neeto-molecules-sidebar.neeto-molecules-sidebar--focus-mode .neeto-molecules-sidebar__links{display:flex;flex-direction:column;height:calc(100vh - 10rem);margin-bottom:0}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper{flex-grow:1;margin:0 0 .625rem!important;min-height:0;overflow-y:auto;padding:0 0 .625rem!important}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper .neeto-molecules-sidebar__sublink-wrapper{padding:0!important}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper .neeto-molecules-sidebar__sublink-wrapper .neeto-molecules-sidebar__sublink{border-radius:0}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__link{--neeto-ui-text-body1:1.125rem;background-color:rgb(var(--neeto-ui-gray-100));color:rgb(var(--neeto-ui-black));cursor:pointer;font-weight:var(--neeto-ui-font-semibold);gap:.25rem;padding:.75rem .25rem;position:sticky;top:0;z-index:1}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__link-label,.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__link-sub-label{--neeto-ui-text-body2:0.9375rem}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink{color:rgb(var(--neeto-ui-black));font-weight:var(--neeto-ui-font-medium);margin-bottom:0;padding-bottom:.625rem;padding-top:.625rem}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink.active{font-weight:var(--neeto-ui-font-semibold)}.neeto-molecules-sidebar__links--focus-mode>.neeto-molecules-sidebar__sublink-wrapper>.neeto-molecules-sidebar__sublink-wrapper .neeto-molecules-sidebar__sublink{border-radius:0;padding-left:2rem}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink{cursor:pointer;line-height:1.2;padding:.5rem .75rem .5rem 1.5rem;position:relative}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink:hover{background-color:rgb(var(--neeto-ui-gray-100))}.neeto-molecules-sidebar__links--focus-mode .neeto-molecules-sidebar__sublink.active{background-color:rgb(var(--neeto-ui-accent-100))!important;color:rgb(var(--neeto-ui-black))!important;font-weight:var(--neeto-ui-font-medium)}.neeto-molecules-sidebar__link-unread-count{align-items:center;background-color:rgb(var(--neeto-ui-accent-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:flex;flex-shrink:0;font-size:var(--neeto-ui-text-xxs);height:1rem;justify-content:center;min-width:1rem;padding-left:.25rem;padding-right:.25rem;position:absolute;right:-4px;top:-4px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.neeto-ui-theme--dark .neeto-molecules-sidebar__logo [data-dark-mode-color=true]{fill:rgb(var(--neeto-ui-black))}.neeto-molecules-sidebar__workspace-info{margin-bottom:1.5rem;padding:.5rem 1.5rem}.neeto-molecules-sidebar__resize-handle{bottom:0;cursor:col-resize;position:absolute;right:0;top:0;width:3px;z-index:99999;z-index:calc(var(--neeto-molecules-sidebar-z-index) + 1)}.neeto-molecules-sidebar__resize-handle:before{background-color:rgb(var(--neeto-ui-gray-300));bottom:0;content:\"\";left:0;position:absolute;top:0;transition:background-color .15s ease-in-out,width .15s ease-in-out;width:1px}.neeto-molecules-sidebar__resize-handle:hover:before{background-color:rgb(var(--neeto-ui-gray-500));width:3px}.neeto-molecules-sidebar__resize-handle:active:before{background-color:rgb(var(--neeto-ui-primary-500));width:3px}.neeto-molecules-sidebar__wrapper:not(.neeto-molecules-sidebar__wrapper--collapsed)+.neeto-molecules-sidebar__resize-handle{display:block}.neeto-molecules-sidebar__wrapper+.neeto-molecules-sidebar__resize-handle{display:none;left:15rem;left:var(--neeto-molecules-sidebar-width)}.neeto-molecules-sidebar__wrapper--collapsed+.neeto-molecules-sidebar__resize-handle{display:none}body.dragging-sidebar,body.dragging-sidebar *{cursor:col-resize!important}body.dragging-sidebar *{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}";
243
+ n(css,{});
244
+
245
+ var Chevron = function Chevron(_ref) {
246
+ var style = _ref.style;
247
+ return /*#__PURE__*/jsx("svg", {
248
+ style: style,
249
+ height: "16",
250
+ viewBox: "0 0 16 16",
251
+ width: "16",
252
+ children: /*#__PURE__*/jsx("path", {
253
+ d: "M7.07031 13.8887C7.2207 14.0391 7.40527 14.1211 7.62402 14.1211C8.06836 14.1211 8.41699 13.7725 8.41699 13.3281C8.41699 13.1094 8.32812 12.9043 8.17773 12.7539L3.37207 8.05762L8.17773 3.375C8.32812 3.21777 8.41699 3.0127 8.41699 2.80078C8.41699 2.35645 8.06836 2.00781 7.62402 2.00781C7.40527 2.00781 7.2207 2.08984 7.07031 2.24023L1.73828 7.44922C1.56055 7.62012 1.46484 7.8252 1.46484 8.06445C1.46484 8.29688 1.55371 8.49512 1.73828 8.67969L7.07031 13.8887ZM13.1748 13.8887C13.3252 14.0391 13.5098 14.1211 13.7354 14.1211C14.1797 14.1211 14.5283 13.7725 14.5283 13.3281C14.5283 13.1094 14.4395 12.9043 14.2891 12.7539L9.4834 8.05762L14.2891 3.375C14.4395 3.21777 14.5283 3.0127 14.5283 2.80078C14.5283 2.35645 14.1797 2.00781 13.7354 2.00781C13.5098 2.00781 13.3252 2.08984 13.1748 2.24023L7.84961 7.44922C7.66504 7.62012 7.57617 7.8252 7.56934 8.06445C7.56934 8.29688 7.66504 8.49512 7.84961 8.67969L13.1748 13.8887Z",
254
+ fill: "currentColor"
255
+ })
256
+ });
257
+ };
258
+
259
+ export { Chevron as C, DEFAULT_SIDEBAR_WIDTH as D, MIN_SIDEBAR_WIDTH as M, SelectedLink as S, _Items as _, CheckPointNavLinks as a, SELECTED_NAV_LINK_ROUTE_STORAGE_KEY as b, SIDEBAR_WIDTH_KEY as c, DEFAULT_HOME_PATH as d, enableDraggingStyles as e, filterByPermissions as f, getSidebarStateLocalStorageKey as g, disableDraggingStyles as h, getActiveConfigurePageLink as i, MAX_SIDEBAR_WIDTH as j };
260
+ //# sourceMappingURL=Chevron-CFpCkNj1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chevron-CFpCkNj1.js","sources":["../src/components/Sidebar/Components/Links/CheckPointNavLink.jsx","../src/components/Sidebar/constants.js","../src/components/Sidebar/utils.js","../src/components/Sidebar/Components/Links/SubLink.jsx","../src/components/Sidebar/Components/Links/Items.jsx","../src/components/Sidebar/Components/Links/SelectedLink.jsx","../src/components/Sidebar/Components/Chevron.jsx"],"sourcesContent":["import { useNavigationCheckpoints } from \"neetocommons/react-utils/useRegisterNavigationCheckpoint\";\nimport { NavLink } from \"react-router-dom\";\n\nconst CheckPointNavLinks = ({\n checkpointKey,\n to,\n href,\n children,\n ...others\n}) => {\n const { [checkpointKey]: checkpoint } =\n useNavigationCheckpoints(checkpointKey);\n\n const LinkElement = href ? \"a\" : NavLink;\n const linkProps = href\n ? { href, key: href, ...others }\n : { to: checkpoint || to, key: to, ...others };\n\n return <LinkElement {...linkProps}>{children}</LinkElement>;\n};\n\nexport default CheckPointNavLinks;\n","export const SUB_LINK_TYPES = {\n SYSTEM_VIEW: \"system_view\",\n SEGMENTS: \"segments\",\n};\n\nexport const SELECTED_NAV_LINK_ROUTE_STORAGE_KEY = \"selectedNavLinkRoute\";\n\nexport const DEFAULT_HOME_PATH = \"/\";\n\nexport const SIDEBAR_WIDTH_KEY = \"neeto-molecules-sidebar-width\";\nexport const MIN_SIDEBAR_WIDTH = 12.5 * 16;\nexport const MAX_SIDEBAR_WIDTH = 20 * 16;\nexport const DEFAULT_SIDEBAR_WIDTH = 15 * 16;\n","import { isPresent, isNotEmpty } from \"neetocist\";\nimport { __, all, curry, equals, includes, is } from \"ramda\";\n\nexport const isSubRouteActive = (subRoute, location) => {\n const currentBrowserUrl = new URL(\n location.pathname + location.search + location.hash,\n window.location.origin\n );\n const targetUrl = new URL(subRoute, window.location.origin);\n\n const targetSearchParams = targetUrl.searchParams;\n const targetSearchKeys = Array.from(targetSearchParams.keys());\n\n return (\n all(\n key =>\n currentBrowserUrl.searchParams.get(key) === targetSearchParams.get(key),\n targetSearchKeys\n ) && equals(currentBrowserUrl.pathname, targetUrl.pathname)\n );\n};\n\nexport const getSidebarStateLocalStorageKey = () => {\n const user = globalProps.user?.email || globalProps.user?.phoneNumber;\n\n return `sidebarState-${user}`;\n};\n\nexport const filterByPermissions = curry(({ permissions }) => {\n if (permissions && isNotEmpty(permissions)) {\n return is(Array, permissions)\n ? permissions.some(includes(__, globalProps.permissions))\n : globalProps.permissions.includes(permissions);\n }\n\n return true;\n});\n\nexport const getActiveConfigurePageLink = ({ navLinks, location }) =>\n navLinks.find(link => {\n const [linkPathname] = link.to?.split(\"?\") || [];\n\n return (\n isPresent(link.isConfigureNavLink) &&\n link.isConfigureNavLink &&\n location.pathname.startsWith(linkPathname)\n );\n });\n\nexport const enableDraggingStyles = () => {\n document.body.classList.add(\"dragging-sidebar\");\n document.body.style.cursor = \"col-resize\";\n document.body.style.userSelect = \"none\";\n};\n\nexport const disableDraggingStyles = () => {\n document.body.classList.remove(\"dragging-sidebar\");\n document.body.style.cursor = \"\";\n document.body.style.userSelect = \"\";\n};\n","import { hyphenate } from \"neetocist\";\nimport { Segments } from \"neetofilters\";\nimport { Typography } from \"neetoui\";\nimport { is } from \"ramda\";\n\nimport CheckPointNavLinks from \"./CheckPointNavLink\";\n\nimport { SUB_LINK_TYPES } from \"../../constants\";\nimport { isSubRouteActive } from \"../../utils\";\n\nconst SubLink = ({\n to,\n href,\n label,\n type = SUB_LINK_TYPES.SYSTEM_VIEW,\n count,\n isSectionHeader,\n isCountsLoading,\n \"data-cy\": dataCy,\n entity = \"\",\n columns = [],\n baseUrl,\n isActive,\n}) => {\n if (type === SUB_LINK_TYPES.SEGMENTS) {\n return <Segments {...{ baseUrl, columns, entity }} isIndependent={false} />;\n }\n\n const dataCyPrefix = dataCy || hyphenate(label);\n\n const renderCount = count => (count > 999 ? \"999+\" : count);\n\n const isSubLinkActive = () =>\n !isSectionHeader &&\n (is(Function, isActive) ? isActive() : isSubRouteActive(to, location));\n\n return (\n <CheckPointNavLinks\n {...{ href, to }}\n activeClassName=\"active\"\n className=\"neeto-molecules-sidebar__sublink neeto-ui-flex neeto-ui-items-center neeto-ui-select-none\"\n data-cy={`${dataCyPrefix}-sub-link`}\n isActive={isSubLinkActive}\n >\n <Typography\n className=\"neeto-molecules-sidebar__link-sub-label neeto-ui-flex-grow\"\n component=\"span\"\n data-cy={`${dataCyPrefix}-sub-link-label`}\n style=\"body2\"\n >\n {label}\n </Typography>\n <Typography\n className=\"neeto-molecules-sidebar__link-sub-count neeto-ui-flex-shrink-0\"\n component=\"span\"\n data-cy={`${dataCyPrefix}-sub-link-count`}\n style=\"body2\"\n >\n {isCountsLoading ? (\n <div className=\"neeto-ui-rounded neeto-ui-bg-gray-200 h-4 w-4 animate-pulse\" />\n ) : (\n renderCount(count)\n )}\n </Typography>\n </CheckPointNavLinks>\n );\n};\n\nexport default SubLink;\n","import { Fragment } from \"react\";\n\nimport { isPresent } from \"neetocist\";\n\nimport SubLink from \"./SubLink\";\n\nimport { filterByPermissions } from \"../../utils\";\n\nconst Items = ({ items, isSettingsItems = false, isCountsLoading }) => (\n <div\n className=\"neeto-molecules-sidebar__sublink-wrapper\"\n data-cy=\"sidebar-sub-link-wrapper\"\n >\n {items.filter(filterByPermissions).map((subItem, subIndex) => (\n <Fragment key={subIndex}>\n <SubLink\n {...{ ...subItem, isCountsLoading }}\n href={subItem.href}\n isActive={subItem.isActive}\n isSectionHeader={isPresent(subItem.item)}\n to={subItem.to ?? subItem.path}\n />\n {isSettingsItems && isPresent(subItem.items) && (\n <>\n <Items {...{ isSettingsItems }} items={subItem.items} />\n {items.length - 1 !== subIndex && (\n <hr className=\"neeto-molecules-sidebar__separator neeto-ui-border-gray-200\" />\n )}\n </>\n )}\n </Fragment>\n ))}\n </div>\n);\n\nexport default Items;\n","import classNames from \"classnames\";\nimport { handleMetaClick } from \"neetocommons/react-utils\";\nimport { hyphenize } from \"neetocommons/utils/general\";\nimport { Home } from \"neetoicons\";\nimport { Typography, Button } from \"neetoui\";\nimport { omit } from \"ramda\";\nimport { useHistory } from \"react-router-dom\";\n\nimport Items from \"./Items\";\n\nconst SelectedLink = ({\n navLink = { label: \"\", items: [], isConfigureNavLink: false },\n handleGoBack,\n isConfigureSidebar,\n homePath,\n}) => {\n const history = useHistory();\n const { label, items, isConfigureNavLink, ...otherProps } = navLink;\n\n const handleHomeButtonClick = e => {\n e.stopPropagation();\n handleMetaClick(history, homePath, e);\n };\n\n return (\n <div\n className=\"neeto-molecules-sidebar__links neeto-molecules-sidebar__links--focus-mode neeto-molecules-sidebar__no-shrinkable\"\n data-cy=\"configure-nav-container\"\n >\n <div\n className=\"neeto-ui-flex neeto-ui-items-center neeto-ui-no-underline neeto-molecules-sidebar__link neeto-ui-border-b neeto-ui-border-gray-200\"\n onClick={handleGoBack}\n {...{ ...omit([\"icon\"], otherProps) }}\n >\n {isConfigureNavLink && (\n <span className=\"neeto-molecules-sidebar__link-icon flex items-center pl-3\">\n <Button\n data-cy={`${hyphenize(label)}-go-back-button`}\n data-testid={`${label}-go-home-button`}\n icon={Home}\n style=\"text\"\n onClick={handleHomeButtonClick}\n />\n <span className=\"px-1 text-xs\">/</span>\n </span>\n )}\n <Typography\n component=\"span\"\n style=\"body1\"\n className={classNames(\"neeto-molecules-sidebar__link-label\", {\n \"neeto-molecules-sidebar__configure-page-header\":\n isConfigureNavLink,\n [\"pl-4\"]: isConfigureSidebar,\n })}\n >\n {label}\n </Typography>\n </div>\n {items && <Items {...{ items }} isSettingsItems />}\n </div>\n );\n};\n\nexport default SelectedLink;\n","const Chevron = ({ style }) => (\n <svg {...{ style }} height=\"16\" viewBox=\"0 0 16 16\" width=\"16\">\n <path\n d=\"M7.07031 13.8887C7.2207 14.0391 7.40527 14.1211 7.62402 14.1211C8.06836 14.1211 8.41699 13.7725 8.41699 13.3281C8.41699 13.1094 8.32812 12.9043 8.17773 12.7539L3.37207 8.05762L8.17773 3.375C8.32812 3.21777 8.41699 3.0127 8.41699 2.80078C8.41699 2.35645 8.06836 2.00781 7.62402 2.00781C7.40527 2.00781 7.2207 2.08984 7.07031 2.24023L1.73828 7.44922C1.56055 7.62012 1.46484 7.8252 1.46484 8.06445C1.46484 8.29688 1.55371 8.49512 1.73828 8.67969L7.07031 13.8887ZM13.1748 13.8887C13.3252 14.0391 13.5098 14.1211 13.7354 14.1211C14.1797 14.1211 14.5283 13.7725 14.5283 13.3281C14.5283 13.1094 14.4395 12.9043 14.2891 12.7539L9.4834 8.05762L14.2891 3.375C14.4395 3.21777 14.5283 3.0127 14.5283 2.80078C14.5283 2.35645 14.1797 2.00781 13.7354 2.00781C13.5098 2.00781 13.3252 2.08984 13.1748 2.24023L7.84961 7.44922C7.66504 7.62012 7.57617 7.8252 7.56934 8.06445C7.56934 8.29688 7.66504 8.49512 7.84961 8.67969L13.1748 13.8887Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport default Chevron;\n"],"names":["CheckPointNavLinks","_ref","checkpointKey","to","href","children","others","_objectWithoutProperties","_excluded","_useNavigationCheckpo","useNavigationCheckpoints","checkpoint","LinkElement","NavLink","linkProps","_objectSpread","key","_jsx","SUB_LINK_TYPES","SYSTEM_VIEW","SEGMENTS","SELECTED_NAV_LINK_ROUTE_STORAGE_KEY","DEFAULT_HOME_PATH","SIDEBAR_WIDTH_KEY","MIN_SIDEBAR_WIDTH","MAX_SIDEBAR_WIDTH","DEFAULT_SIDEBAR_WIDTH","isSubRouteActive","subRoute","location","currentBrowserUrl","URL","pathname","search","hash","window","origin","targetUrl","targetSearchParams","searchParams","targetSearchKeys","Array","from","keys","all","get","equals","getSidebarStateLocalStorageKey","_globalProps$user","_globalProps$user2","user","globalProps","email","phoneNumber","concat","filterByPermissions","curry","permissions","isNotEmpty","is","some","includes","__","getActiveConfigurePageLink","_ref2","navLinks","find","link","_link$to","_ref3","split","_ref4","_slicedToArray","linkPathname","isPresent","isConfigureNavLink","startsWith","enableDraggingStyles","document","body","classList","add","style","cursor","userSelect","disableDraggingStyles","remove","SubLink","label","_ref$type","type","count","isSectionHeader","isCountsLoading","dataCy","_ref$entity","entity","_ref$columns","columns","baseUrl","isActive","Segments","isIndependent","dataCyPrefix","hyphenate","renderCount","isSubLinkActive","Function","_jsxs","activeClassName","className","Typography","component","Items","items","_ref$isSettingsItems","isSettingsItems","filter","map","subItem","subIndex","_subItem$to","Fragment","item","path","_Fragment","_Items","length","SelectedLink","_ref$navLink","navLink","handleGoBack","isConfigureSidebar","homePath","history","useHistory","otherProps","handleHomeButtonClick","e","stopPropagation","handleMetaClick","onClick","omit","Button","hyphenize","icon","Home","classNames","_defineProperty","Chevron","height","viewBox","width","d","fill"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAMlB;AAAA,EAAA,IALJC,aAAa,GAAAD,IAAA,CAAbC,aAAa;IACbC,EAAE,GAAAF,IAAA,CAAFE,EAAE;IACFC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IACJC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;AACLC,IAAAA,MAAM,GAAAC,wBAAA,CAAAN,IAAA,EAAAO,WAAA,CAAA,CAAA;AAET,EAAA,IAAAC,qBAAA,GACEC,wBAAwB,CAACR,aAAa,CAAC;IADhBS,UAAU,GAAAF,qBAAA,CAA1BP,aAAa,CAAA,CAAA;AAGtB,EAAA,IAAMU,WAAW,GAAGR,IAAI,GAAG,GAAG,GAAGS,OAAO,CAAA;AACxC,EAAA,IAAMC,SAAS,GAAGV,IAAI,G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AA,SAAS,EAAC,cAAc;AAAAzG,UAAAA,QAAA,EAAC,GAAA;AAAC,SAAM,CAAC,CAAA;AAAA,OACnC,CACP,eACDY,GAAA,CAAC8F,UAAU,EAAA;AACTC,QAAAA,SAAS,EAAC,MAAM;AAChB9B,QAAAA,KAAK,EAAC,OAAO;AACb4B,QAAAA,SAAS,EAAEqC,UAAU,CAAC,qCAAqC,EAAAC,eAAA,CAAA;AACzD,UAAA,gDAAgD,EAC9CzE,kBAAAA;AAAkB,SAAA,EACnB,MAAM,EAAGyD,kBAAkB,CAC7B,CAAE;AAAA/H,QAAAA,QAAA,EAEFmF,KAAAA;AAAK,OACI,CAAC,CAAA;AAAA,KAAA,CACV,CAAC,EACL0B,KAAK,iBAAIjG,GAAA,CAACgG,MAAK,EAAA;AAAOC,MAAAA,KAAK,EAALA,KAAK;MAAIE,eAAe,EAAA,IAAA;AAAA,KAAE,CAAC,CAAA;AAAA,GAC/C,CAAC,CAAA;AAEV;;;;;AC7DA,IAAMiC,OAAO,GAAG,SAAVA,OAAOA,CAAApJ,IAAA,EAAA;AAAA,EAAA,IAAMiF,KAAK,GAAAjF,IAAA,CAALiF,KAAK,CAAA;AAAA,EAAA,oBACtBjE,GAAA,CAAA,KAAA,EAAA;AAAWiE,IAAAA,KAAK,EAALA,KAAK;AAAIoE,IAAAA,MAAM,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAC,WAAW;AAACC,IAAAA,KAAK,EAAC,IAAI;AAAAnJ,IAAAA,QAAA,eAC5DY,GAAA,CAAA,MAAA,EAAA;AACEwI,MAAAA,CAAC,EAAC,y5BAAy5B;AAC35BC,MAAAA,IAAI,EAAC,cAAA;KACN,CAAA;AAAC,GACC,CAAC,CAAA;AAAA;;;;"}
@@ -5,7 +5,7 @@ import Button from '@bigbinary/neetoui/Button';
5
5
  import { not } from 'ramda';
6
6
  import { useTranslation } from 'react-i18next';
7
7
  import { useHistory } from 'react-router-dom';
8
- import { S as SelectedLink, C as Chevron } from './Chevron-DfSoxXBs.js';
8
+ import { S as SelectedLink, C as Chevron } from './Chevron-CFpCkNj1.js';
9
9
  import { jsxs, jsx } from 'react/jsx-runtime';
10
10
  import '@babel/runtime/helpers/defineProperty';
11
11
  import '@babel/runtime/helpers/objectWithoutProperties';
package/dist/Sidebar.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
- import { memo, useState, Fragment, useEffect, useMemo } from 'react';
2
+ import { memo, useState, Fragment, useRef, useEffect, useMemo } from 'react';
3
3
  import classnames from 'classnames';
4
4
  import { capitalize, isPresent, hyphenate, isNotEmpty, findBy } from '@bigbinary/neeto-cist';
5
5
  import useFetchNeetoApps from '@bigbinary/neeto-commons-frontend/react-utils/useFetchNeetoApps';
@@ -10,7 +10,7 @@ import Typography from '@bigbinary/neetoui/Typography';
10
10
  import { not, is, findLast } from 'ramda';
11
11
  import { useTranslation } from 'react-i18next';
12
12
  import { Link, useLocation, useHistory } from 'react-router-dom';
13
- import { f as filterByPermissions, a as CheckPointNavLinks, _ as _Items, b as SELECTED_NAV_LINK_ROUTE_STORAGE_KEY, g as getSidebarStateLocalStorageKey, D as DEFAULT_HOME_PATH, S as SelectedLink, C as Chevron, c as getActiveConfigurePageLink } from './Chevron-DfSoxXBs.js';
13
+ import { f as filterByPermissions, a as CheckPointNavLinks, _ as _Items, b as SELECTED_NAV_LINK_ROUTE_STORAGE_KEY, g as getSidebarStateLocalStorageKey, c as SIDEBAR_WIDTH_KEY, D as DEFAULT_SIDEBAR_WIDTH, d as DEFAULT_HOME_PATH, S as SelectedLink, C as Chevron, e as enableDraggingStyles, h as disableDraggingStyles, i as getActiveConfigurePageLink, M as MIN_SIDEBAR_WIDTH, j as MAX_SIDEBAR_WIDTH } from './Chevron-CFpCkNj1.js';
14
14
  import Neeto from '@bigbinary/neeto-icons/typeface-logos/Neeto';
15
15
  import * as AppIcons from '@bigbinary/neeto-icons/typeface-logos';
16
16
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
@@ -157,7 +157,9 @@ var Sidebar = function Sidebar(_ref) {
157
157
  _ref$isCountsLoading = _ref.isCountsLoading,
158
158
  isCountsLoading = _ref$isCountsLoading === void 0 ? false : _ref$isCountsLoading,
159
159
  _ref$showWorkspaceNam = _ref.showWorkspaceName,
160
- showWorkspaceName = _ref$showWorkspaceNam === void 0 ? false : _ref$showWorkspaceNam;
160
+ showWorkspaceName = _ref$showWorkspaceNam === void 0 ? false : _ref$showWorkspaceNam,
161
+ _ref$isExpandable = _ref.isExpandable,
162
+ isExpandable = _ref$isExpandable === void 0 ? false : _ref$isExpandable;
161
163
  var _useState = useState(false),
162
164
  _useState2 = _slicedToArray(_useState, 2),
163
165
  isSidebarPaneOpen = _useState2[0],
@@ -170,6 +172,14 @@ var Sidebar = function Sidebar(_ref) {
170
172
  _useLocalStorage4 = _slicedToArray(_useLocalStorage3, 2),
171
173
  isSidebarCollapsed = _useLocalStorage4[0],
172
174
  setIsSidebarCollapsed = _useLocalStorage4[1];
175
+ var _useLocalStorage5 = useLocalStorage(SIDEBAR_WIDTH_KEY, "".concat(DEFAULT_SIDEBAR_WIDTH, "px")),
176
+ _useLocalStorage6 = _slicedToArray(_useLocalStorage5, 2),
177
+ sidebarWidth = _useLocalStorage6[0],
178
+ setSidebarWidth = _useLocalStorage6[1];
179
+ var sidebarRef = useRef(null);
180
+ var isMouseDownRef = useRef(false);
181
+ var startXRef = useRef(null);
182
+ var startWidthRef = useRef(null);
173
183
  var location = useLocation();
174
184
  var history = useHistory();
175
185
  var _useTranslation = useTranslation(),
@@ -203,6 +213,41 @@ var Sidebar = function Sidebar(_ref) {
203
213
  return window.removeEventListener("resize", handleResize);
204
214
  };
205
215
  }, []);
216
+ useEffect(function () {
217
+ if (!isExpandable) return undefined;
218
+ var handle = document.querySelector(".neeto-molecules-sidebar__resize-handle");
219
+ if (!handle) return undefined;
220
+ var onMouseDown = function onMouseDown(e) {
221
+ var _sidebarRef$current;
222
+ isMouseDownRef.current = true;
223
+ startXRef.current = e.clientX;
224
+ startWidthRef.current = ((_sidebarRef$current = sidebarRef.current) === null || _sidebarRef$current === void 0 ? void 0 : _sidebarRef$current.getBoundingClientRect().width) || DEFAULT_SIDEBAR_WIDTH;
225
+ enableDraggingStyles();
226
+ };
227
+ var onMouseMove = function onMouseMove(e) {
228
+ if (!isMouseDownRef.current) return;
229
+ var dx = e.clientX - startXRef.current;
230
+ var newWidth = startWidthRef.current + dx;
231
+ newWidth = Math.max(MIN_SIDEBAR_WIDTH, Math.min(newWidth, MAX_SIDEBAR_WIDTH));
232
+ setSidebarWidth("".concat(newWidth, "px"));
233
+ };
234
+ var onMouseUp = function onMouseUp() {
235
+ if (!isMouseDownRef.current) return;
236
+ isMouseDownRef.current = false;
237
+ disableDraggingStyles();
238
+ };
239
+ handle.addEventListener("mousedown", onMouseDown);
240
+ document.addEventListener("mousemove", onMouseMove);
241
+ document.addEventListener("mouseup", onMouseUp);
242
+ return function () {
243
+ handle.removeEventListener("mousedown", onMouseDown);
244
+ document.removeEventListener("mousemove", onMouseMove);
245
+ document.removeEventListener("mouseup", onMouseUp);
246
+ };
247
+ }, [isExpandable]);
248
+ useEffect(function () {
249
+ document.documentElement.style.setProperty("--neeto-molecules-sidebar-width", "".concat(parseInt(sidebarWidth) / 16, "rem"));
250
+ }, [sidebarWidth]);
206
251
  var handleGoBack = function handleGoBack(event) {
207
252
  event.preventDefault();
208
253
  setSelectedNavLinkRoute(null);
@@ -230,67 +275,75 @@ var Sidebar = function Sidebar(_ref) {
230
275
  });
231
276
  }, [location.pathname, navLinks]);
232
277
  var isSelectedNavLinkVisible = selectedNavLinkRoute && (activeLink === null || activeLink === void 0 ? void 0 : activeLink.to) === selectedNavLinkRoute && isNotEmpty(navLinks);
233
- return /*#__PURE__*/jsxs("div", {
234
- "data-testid": "sidebar-container",
235
- className: classnames("neeto-molecules-sidebar__wrapper", {
236
- "neeto-molecules-sidebar__wrapper--collapsed": isLargerScreen() ? isSidebarCollapsed : not(isSidebarPaneOpen)
237
- }),
238
- children: [/*#__PURE__*/jsx("div", {
239
- className: "neeto-molecules-sidebar__backdrop",
240
- onClick: function onClick() {
241
- setIsSidebarPaneOpen(false);
242
- setSelectedNavLinkRoute(null);
243
- }
244
- }), /*#__PURE__*/jsxs("div", {
245
- "data-cy": "sidebar-wrapper",
246
- "data-testid": "sidebar",
247
- className: classnames("neeto-molecules-sidebar neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-shrink-0 neeto-ui-overflow-y-auto neeto-ui-overflow-x-hidden", {
248
- "neeto-molecules-sidebar--focus-mode": isPresent(selectedNavLinkRoute)
278
+ return /*#__PURE__*/jsxs(Fragment$1, {
279
+ children: [/*#__PURE__*/jsxs("div", {
280
+ "data-testid": "sidebar-container",
281
+ ref: sidebarRef,
282
+ style: {
283
+ width: isSidebarCollapsed ? "0" : sidebarWidth
284
+ },
285
+ className: classnames("neeto-molecules-sidebar__wrapper", {
286
+ "neeto-molecules-sidebar__wrapper--collapsed": isLargerScreen() ? isSidebarCollapsed : not(isSidebarPaneOpen)
249
287
  }),
250
- children: [/*#__PURE__*/jsx(Header$1, {
251
- customLogo: customLogo,
252
- homePath: homePath,
253
- clearSettingsNav: function clearSettingsNav() {
254
- return setSelectedNavLinkRoute(null);
288
+ children: [/*#__PURE__*/jsx("div", {
289
+ className: "neeto-molecules-sidebar__backdrop",
290
+ onClick: function onClick() {
291
+ setIsSidebarPaneOpen(false);
292
+ setSelectedNavLinkRoute(null);
255
293
  }
256
- }), showWorkspaceName && /*#__PURE__*/jsxs("div", {
257
- className: "neeto-ui-bg-gray-100 neeto-molecules-sidebar__workspace-info",
258
- children: [/*#__PURE__*/jsx(Typography, {
259
- className: "neeto-ui-mb-1",
260
- style: "h5",
261
- weight: "semibold",
262
- children: t("neetoMolecules.sidebar.myWorkspace")
263
- }), /*#__PURE__*/jsx(Typography, {
264
- className: "neeto-ui-truncate",
265
- style: "body2",
266
- children: globalProps.organization.name
294
+ }), /*#__PURE__*/jsxs("div", {
295
+ "data-cy": "sidebar-wrapper",
296
+ "data-testid": "sidebar",
297
+ className: classnames("neeto-molecules-sidebar neeto-ui-flex neeto-ui-flex-col neeto-ui-flex-shrink-0 neeto-ui-overflow-y-auto neeto-ui-overflow-x-hidden", {
298
+ "neeto-molecules-sidebar--focus-mode": isPresent(selectedNavLinkRoute)
299
+ }),
300
+ children: [/*#__PURE__*/jsx(Header$1, {
301
+ customLogo: customLogo,
302
+ homePath: homePath,
303
+ clearSettingsNav: function clearSettingsNav() {
304
+ return setSelectedNavLinkRoute(null);
305
+ }
306
+ }), showWorkspaceName && /*#__PURE__*/jsxs("div", {
307
+ className: "neeto-ui-bg-gray-100 neeto-molecules-sidebar__workspace-info",
308
+ children: [/*#__PURE__*/jsx(Typography, {
309
+ className: "neeto-ui-mb-1",
310
+ style: "h5",
311
+ weight: "semibold",
312
+ children: t("neetoMolecules.sidebar.myWorkspace")
313
+ }), /*#__PURE__*/jsx(Typography, {
314
+ className: "neeto-ui-truncate",
315
+ style: "body2",
316
+ children: globalProps.organization.name
317
+ })]
318
+ }), isSelectedNavLinkVisible ? /*#__PURE__*/jsx(SelectedLink, {
319
+ handleGoBack: handleGoBack,
320
+ homePath: homePath,
321
+ navLink: activeLink
322
+ }) : /*#__PURE__*/jsx(Links, {
323
+ isCountsLoading: isCountsLoading,
324
+ navLinks: navLinks,
325
+ setSelectedNavLinkRoute: setSelectedNavLinkRoute
267
326
  })]
268
- }), isSelectedNavLinkVisible ? /*#__PURE__*/jsx(SelectedLink, {
269
- handleGoBack: handleGoBack,
270
- homePath: homePath,
271
- navLink: activeLink
272
- }) : /*#__PURE__*/jsx(Links, {
273
- isCountsLoading: isCountsLoading,
274
- navLinks: navLinks,
275
- setSelectedNavLinkRoute: setSelectedNavLinkRoute
327
+ }), /*#__PURE__*/jsx(Button, {
328
+ className: "neeto-molecules-sidebar__toggler",
329
+ "data-cy": "neeto-molecules-sidebar-toggler",
330
+ "data-testid": "sidebar-toggleButton",
331
+ icon: function icon() {
332
+ return /*#__PURE__*/jsx(Chevron, {});
333
+ },
334
+ style: isLargerScreen() ? "text" : "secondary",
335
+ tooltipProps: {
336
+ content: isSidebarClosed ? t("neetoMolecules.sidebar.showMenu") : t("neetoMolecules.sidebar.hideMenu"),
337
+ position: "bottom",
338
+ touch: ["hold", 500]
339
+ },
340
+ onClick: function onClick() {
341
+ setIsSidebarCollapsed(!isSidebarCollapsed);
342
+ setIsSidebarPaneOpen(not);
343
+ }
276
344
  })]
277
- }), /*#__PURE__*/jsx(Button, {
278
- className: "neeto-molecules-sidebar__toggler",
279
- "data-cy": "neeto-molecules-sidebar-toggler",
280
- "data-testid": "sidebar-toggleButton",
281
- icon: function icon() {
282
- return /*#__PURE__*/jsx(Chevron, {});
283
- },
284
- style: isLargerScreen() ? "text" : "secondary",
285
- tooltipProps: {
286
- content: isSidebarClosed ? t("neetoMolecules.sidebar.showMenu") : t("neetoMolecules.sidebar.hideMenu"),
287
- position: "bottom",
288
- touch: ["hold", 500]
289
- },
290
- onClick: function onClick() {
291
- setIsSidebarCollapsed(!isSidebarCollapsed);
292
- setIsSidebarPaneOpen(not);
293
- }
345
+ }), isExpandable && /*#__PURE__*/jsx("div", {
346
+ className: "neeto-molecules-sidebar__resize-handle"
294
347
  })]
295
348
  });
296
349
  };