@bigbinary/neeto-molecules 4.1.66 → 4.1.68

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.
@@ -4,14 +4,15 @@ import { memo, useState, useRef, useEffect, useMemo, forwardRef, useCallback } f
4
4
  import { globalProps as globalProps$1 } from '@bigbinary/neeto-commons-frontend/initializers';
5
5
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
6
6
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
7
- import { Spinner, Input, Dialog, Badge, Avatar } from '@bigbinary/neeto-atoms';
8
- import { Popover, PopoverAnchor, PopoverContent, Separator } from '@bigbinary/neeto-atoms/primitives';
7
+ import { Typography, Spinner, Input, Dialog, Badge, Avatar } from '@bigbinary/neeto-atoms';
8
+ import { Collapsible, CollapsibleTrigger, CollapsibleContent, Popover, PopoverAnchor, PopoverContent, Separator } from '@bigbinary/neeto-atoms/primitives';
9
9
  import { isNotEmpty, isNotPresent, isPresent, truncate, humanize } from '@bigbinary/neeto-cist';
10
10
  import useHotkeys from '@bigbinary/neeto-hotkeys';
11
11
  import { Profile } from '@bigbinary/neeto-team-members-frontend/v2';
12
12
  import { isEmpty, toLower, mergeDeepLeft, not } from 'ramda';
13
13
  import KeyboardShortcuts from './KeyboardShortcuts.js';
14
14
  import SubscriptionUpgradeRequestModal from '../SubscriptionUpgradeRequestModal.js';
15
+ import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
15
16
  import classnames from 'classnames';
16
17
  import { useTranslation } from 'react-i18next';
17
18
  import Neeto from '@bigbinary/neeto-icons/typeface-logos/Neeto';
@@ -20,10 +21,10 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
20
21
  import { useQuery } from '@tanstack/react-query';
21
22
  import axios from 'axios';
22
23
  import { S as Search } from '../search-DCgpNjip.js';
24
+ import useBreakpoints from '@bigbinary/neeto-commons-frontend/react-utils/useBreakpoints';
23
25
  import { C as CircleQuestionMark } from '../circle-question-mark-Dib48f5Z.js';
24
26
  import { C as ChevronRight } from '../chevron-right-DcaO-Hlu.js';
25
27
  import { c as createLucideIcon } from '../createLucideIcon-mNMhCCpf.js';
26
- import useBreakpoints from '@bigbinary/neeto-commons-frontend/react-utils/useBreakpoints';
27
28
  import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
28
29
  import { t } from 'i18next';
29
30
  import { U as User } from '../user-A843PT-q.js';
@@ -37,7 +38,6 @@ import 'zustand/shallow';
37
38
  import '@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions';
38
39
  import 'zustand';
39
40
  import '@bigbinary/neetoui/managers';
40
- import '@bigbinary/neeto-commons-frontend/react-utils';
41
41
  import '../ua-parser-OzUiuIwt.js';
42
42
  import '../x-B1Er0oV4.js';
43
43
  import '@bigbinary/neetoui/Button';
@@ -252,21 +252,22 @@ var ProductLink = function ProductLink(_ref) {
252
252
  href: url,
253
253
  rel: "noreferrer",
254
254
  target: "_blank",
255
- className: classnames("bg-background focus-visible:bg-accent flex w-full max-w-full cursor-pointer flex-col gap-4 rounded-lg border p-2.5 no-underline transition-all outline-none", {
255
+ className: classnames("bg-background focus-visible:bg-accent flex w-full max-w-full cursor-pointer flex-col gap-4 rounded-lg border p-2.5 no-underline transition-all outline-none max-md:gap-2 max-md:p-2", {
256
256
  "border-primary bg-primary/5": (_globalProps = globalProps) === null || _globalProps === void 0 || (_globalProps = _globalProps.appName) === null || _globalProps === void 0 ? void 0 : _globalProps.includes(name),
257
257
  "nv-product-link-highlighted bg-accent": isHighlighted,
258
258
  "border-border hover:border-primary": !((_globalProps2 = globalProps) !== null && _globalProps2 !== void 0 && (_globalProps2 = _globalProps2.appName) !== null && _globalProps2 !== void 0 && _globalProps2.includes(name))
259
259
  })
260
260
  }, props), {}, {
261
261
  children: [/*#__PURE__*/jsx("div", {
262
- className: "shrink-0 grow [&>svg]:h-9 [&>svg]:w-auto",
262
+ className: "shrink-0 grow [&>svg]:h-9 [&>svg]:w-auto max-md:[&>svg]:h-6",
263
263
  children: AppIcon ? /*#__PURE__*/jsx(AppIcon, {}) : /*#__PURE__*/jsx(Neeto, {
264
- className: "h-6 w-auto"
264
+ className: "h-6 w-auto max-md:h-5"
265
265
  })
266
266
  }), /*#__PURE__*/jsx("div", {
267
267
  className: "shrink-0",
268
- children: /*#__PURE__*/jsx("span", {
269
- className: "text-muted-foreground block text-xs",
268
+ children: /*#__PURE__*/jsx(Typography, {
269
+ color: "muted",
270
+ variant: "caption",
270
271
  children: description
271
272
  })
272
273
  })]
@@ -284,7 +285,7 @@ var Content = function Content(_ref) {
284
285
  t = _useTranslation.t;
285
286
  if (isLoading) {
286
287
  return /*#__PURE__*/jsx("div", {
287
- className: "flex items-center justify-center py-8",
288
+ className: "flex h-full items-center justify-center",
288
289
  children: /*#__PURE__*/jsx(Spinner, {
289
290
  "data-testid": "neeto-ui-spinner"
290
291
  })
@@ -298,10 +299,14 @@ var Content = function Content(_ref) {
298
299
  isHighlighted: index === highlightedIndex
299
300
  }), app.name);
300
301
  })
301
- }) : /*#__PURE__*/jsx("p", {
302
- className: "text-center text-sm",
302
+ }) : /*#__PURE__*/jsx("div", {
303
+ className: "flex h-full items-center justify-center",
303
304
  "data-testid": "no-apps-found-title",
304
- children: t("neetoMolecules.productSwitcher.noApps")
305
+ children: /*#__PURE__*/jsx(Typography, {
306
+ color: "muted",
307
+ variant: "body2",
308
+ children: t("neetoMolecules.productSwitcher.noApps")
309
+ })
305
310
  });
306
311
  };
307
312
 
@@ -442,12 +447,12 @@ var Menu = function Menu(_ref) {
442
447
  handleKeyDown = _useProductSwitcherNa.handleKeyDown,
443
448
  scrollContainerRef = _useProductSwitcherNa.scrollContainerRef;
444
449
  return /*#__PURE__*/jsxs("div", {
445
- className: "bg-background flex w-full max-w-full flex-col items-start overflow-y-auto p-6 transition-all max-md:p-4",
450
+ className: "flex h-full w-full max-w-full flex-col items-start p-6 transition-all max-md:p-1",
446
451
  "data-testid": "switcher-wrapper",
447
452
  children: [/*#__PURE__*/jsxs("div", {
448
453
  "data-testid": "product-switcher-body-wrapper",
449
- className: classnames("mb-8 flex w-full items-center justify-between gap-8 pt-1 max-md:flex-col max-md:items-start max-md:gap-6", {
450
- "max-md:mb-6": isMobile
454
+ className: classnames("mb-6 flex w-full shrink-0 items-center justify-between gap-8 pt-1 max-md:flex-col max-md:items-start max-md:gap-3", {
455
+ "max-md:mb-4": isMobile
451
456
  }),
452
457
  children: [!isMobile && /*#__PURE__*/jsx("h1", {
453
458
  className: "text-2xl font-bold max-sm:text-xl",
@@ -473,7 +478,7 @@ var Menu = function Menu(_ref) {
473
478
  })
474
479
  })]
475
480
  }), /*#__PURE__*/jsx("div", {
476
- className: "mb-6 flex w-full flex-col gap-3 text-sm",
481
+ className: "flex min-h-0 w-full flex-1 flex-col gap-3 overflow-y-auto text-sm",
477
482
  ref: scrollContainerRef,
478
483
  children: /*#__PURE__*/jsx(Content, {
479
484
  filteredApps: filteredApps,
@@ -484,24 +489,28 @@ var Menu = function Menu(_ref) {
484
489
  }, "switcher-wrapper");
485
490
  };
486
491
 
487
- var Modal = function Modal(_ref) {
488
- var isOpen = _ref.isOpen,
492
+ var Modal = withT(function (_ref) {
493
+ var t = _ref.t,
494
+ isOpen = _ref.isOpen,
489
495
  onClose = _ref.onClose;
490
496
  return /*#__PURE__*/jsxs(Dialog, {
491
497
  isOpen: isOpen,
492
498
  onClose: onClose,
493
499
  "aria-describedby": undefined,
494
- className: "sm:max-w-4xl",
495
- closeButton: false,
500
+ className: "grid-rows-[1fr] sm:max-w-4xl",
501
+ size: "fullScreen",
496
502
  children: [/*#__PURE__*/jsx(Dialog.Title, {
497
503
  className: "sr-only",
498
- children: "Product Switcher"
499
- }), /*#__PURE__*/jsx("div", {
500
- "data-testid": "product-switcher-modal",
501
- children: /*#__PURE__*/jsx(Menu, {})
504
+ children: t("neetoMolecules.productSwitcher.title")
505
+ }), /*#__PURE__*/jsx(Dialog.Body, {
506
+ className: "min-h-0 overflow-y-auto",
507
+ children: /*#__PURE__*/jsx("div", {
508
+ "data-testid": "product-switcher-modal",
509
+ children: /*#__PURE__*/jsx(Menu, {})
510
+ })
502
511
  })]
503
512
  });
504
- };
513
+ });
505
514
 
506
515
  var MENU_ITEM_CLASS$1 = "flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium hover:bg-accent";
507
516
 
@@ -512,7 +521,7 @@ var MenuButton$4 = /*#__PURE__*/forwardRef(function (props, ref) {
512
521
  t = _useTranslation.t;
513
522
  return /*#__PURE__*/jsxs("button", _objectSpread$8(_objectSpread$8({
514
523
  ref: ref,
515
- className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
524
+ className: "group hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
516
525
  "data-testid": "help-menu-button",
517
526
  type: "button"
518
527
  }, props), {}, {
@@ -522,22 +531,68 @@ var MenuButton$4 = /*#__PURE__*/forwardRef(function (props, ref) {
522
531
  className: "flex-grow text-start",
523
532
  children: t("neetoMolecules.sidebar.help")
524
533
  }), /*#__PURE__*/jsx(ChevronRight, {
525
- className: "rtl:scale-x-[-1]",
534
+ className: "transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
526
535
  size: 18
527
536
  })]
528
537
  }));
529
538
  });
530
539
  MenuButton$4.displayName = "HelpMenuButton";
531
540
 
532
- var HelpMenu = function HelpMenu() {
541
+ var HelpItems = withT(function (_ref) {
533
542
  var _globalProps;
534
- var _useTranslation = useTranslation(),
535
- t = _useTranslation.t;
543
+ var t = _ref.t;
544
+ return /*#__PURE__*/jsxs(Fragment, {
545
+ children: [/*#__PURE__*/jsxs("a", {
546
+ className: MENU_ITEM_CLASS$1,
547
+ "data-testid": "help-link-help-articles-button",
548
+ href: "https://help.".concat(toLower(((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.appName) || ""), ".com/"),
549
+ rel: "noreferrer",
550
+ target: "_blank",
551
+ children: [/*#__PURE__*/jsx(BookOpen, {
552
+ size: 18
553
+ }), t("neetoMolecules.sidebar.helpLinks.helpArticles")]
554
+ }), /*#__PURE__*/jsxs("button", {
555
+ className: MENU_ITEM_CLASS$1,
556
+ "data-testid": "help-link-live-chat-button",
557
+ type: "button",
558
+ onClick: function onClick() {
559
+ var _window$NeetoChat, _window$NeetoChat2;
560
+ (_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 || (_window$NeetoChat = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat === void 0 || _window$NeetoChat.maximizeWidget();
561
+ (_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 || (_window$NeetoChat2 = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2 === void 0 || _window$NeetoChat2.openWidget();
562
+ },
563
+ children: [/*#__PURE__*/jsx(MessageCircleQuestionMark, {
564
+ size: 18
565
+ }), t("neetoMolecules.sidebar.helpLinks.liveChat")]
566
+ }), /*#__PURE__*/jsxs("a", {
567
+ className: MENU_ITEM_CLASS$1,
568
+ "data-testid": "help-link-community-button",
569
+ href: "https://www.launchpass.com/neetohq",
570
+ rel: "noreferrer",
571
+ target: "_blank",
572
+ children: [/*#__PURE__*/jsx(Users, {
573
+ size: 18
574
+ }), t("neetoMolecules.sidebar.helpLinks.askTheCommunity")]
575
+ }), /*#__PURE__*/jsxs("a", {
576
+ className: MENU_ITEM_CLASS$1,
577
+ "data-testid": "help-link-status-button",
578
+ href: "https://neetostatus.com/",
579
+ rel: "noreferrer",
580
+ target: "_blank",
581
+ children: [/*#__PURE__*/jsx(Activity, {
582
+ size: 18
583
+ }), t("neetoMolecules.sidebar.helpLinks.systemStatus")]
584
+ })]
585
+ });
586
+ });
587
+ var HelpMenu = function HelpMenu() {
536
588
  var _useState = useState(false),
537
589
  _useState2 = _slicedToArray(_useState, 2),
538
590
  open = _useState2[0],
539
591
  setOpen = _useState2[1];
540
592
  var timeoutRef = useRef(null);
593
+ var _useBreakpoints = useBreakpoints(),
594
+ isSize = _useBreakpoints.isSize;
595
+ var isMobile = isSize("mobile");
541
596
  var handleMouseEnter = useCallback(function () {
542
597
  clearTimeout(timeoutRef.current);
543
598
  setOpen(true);
@@ -547,6 +602,19 @@ var HelpMenu = function HelpMenu() {
547
602
  return setOpen(false);
548
603
  }, 150);
549
604
  }, []);
605
+ if (isMobile) {
606
+ return /*#__PURE__*/jsxs(Collapsible, {
607
+ open: open,
608
+ onOpenChange: setOpen,
609
+ children: [/*#__PURE__*/jsx(CollapsibleTrigger, {
610
+ asChild: true,
611
+ children: /*#__PURE__*/jsx(MenuButton$4, {})
612
+ }), /*#__PURE__*/jsx(CollapsibleContent, {
613
+ className: "flex flex-col gap-0.5 ps-6 pt-1",
614
+ children: /*#__PURE__*/jsx(HelpItems, {})
615
+ })]
616
+ });
617
+ }
550
618
  return /*#__PURE__*/jsxs(Popover, {
551
619
  open: open,
552
620
  onOpenChange: setOpen,
@@ -561,7 +629,7 @@ var HelpMenu = function HelpMenu() {
561
629
  onMouseEnter: handleMouseEnter,
562
630
  onMouseLeave: handleMouseLeave
563
631
  })
564
- }), /*#__PURE__*/jsxs(PopoverContent, {
632
+ }), /*#__PURE__*/jsx(PopoverContent, {
565
633
  align: "center",
566
634
  className: "z-[99999] w-56 gap-0.5 p-1",
567
635
  side: "right",
@@ -571,46 +639,7 @@ var HelpMenu = function HelpMenu() {
571
639
  onOpenAutoFocus: function onOpenAutoFocus(e) {
572
640
  return e.preventDefault();
573
641
  },
574
- children: [/*#__PURE__*/jsxs("a", {
575
- className: MENU_ITEM_CLASS$1,
576
- "data-testid": "help-link-help-articles-button",
577
- href: "https://help.".concat(toLower(((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.appName) || ""), ".com/"),
578
- rel: "noreferrer",
579
- target: "_blank",
580
- children: [/*#__PURE__*/jsx(BookOpen, {
581
- size: 18
582
- }), t("neetoMolecules.sidebar.helpLinks.helpArticles")]
583
- }), /*#__PURE__*/jsxs("button", {
584
- className: MENU_ITEM_CLASS$1,
585
- "data-testid": "help-link-live-chat-button",
586
- type: "button",
587
- onClick: function onClick() {
588
- var _window$NeetoChat, _window$NeetoChat2;
589
- (_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 || (_window$NeetoChat = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat === void 0 || _window$NeetoChat.maximizeWidget();
590
- (_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 || (_window$NeetoChat2 = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2 === void 0 || _window$NeetoChat2.openWidget();
591
- },
592
- children: [/*#__PURE__*/jsx(MessageCircleQuestionMark, {
593
- size: 18
594
- }), t("neetoMolecules.sidebar.helpLinks.liveChat")]
595
- }), /*#__PURE__*/jsxs("a", {
596
- className: MENU_ITEM_CLASS$1,
597
- "data-testid": "help-link-community-button",
598
- href: "https://www.launchpass.com/neetohq",
599
- rel: "noreferrer",
600
- target: "_blank",
601
- children: [/*#__PURE__*/jsx(Users, {
602
- size: 18
603
- }), t("neetoMolecules.sidebar.helpLinks.askTheCommunity")]
604
- }), /*#__PURE__*/jsxs("a", {
605
- className: MENU_ITEM_CLASS$1,
606
- "data-testid": "help-link-status-button",
607
- href: "https://neetostatus.com/",
608
- rel: "noreferrer",
609
- target: "_blank",
610
- children: [/*#__PURE__*/jsx(Activity, {
611
- size: 18
612
- }), t("neetoMolecules.sidebar.helpLinks.systemStatus")]
613
- })]
642
+ children: /*#__PURE__*/jsx(HelpItems, {})
614
643
  })]
615
644
  });
616
645
  };
@@ -641,7 +670,7 @@ var LinkSection = function LinkSection(_ref) {
641
670
  }), /*#__PURE__*/jsxs("span", {
642
671
  className: "flex flex-grow items-center gap-2",
643
672
  children: [label, isPresent(changesCount) && /*#__PURE__*/jsx("span", {
644
- className: "bg-accent-foreground flex h-[1.125rem] min-w-[1.125rem] shrink-0 items-center justify-center rounded-full px-1 text-[10px] text-white select-none",
673
+ className: "bg-foreground text-background flex h-[1.125rem] min-w-[1.125rem] shrink-0 items-center justify-center rounded-full px-1 text-[10px] select-none",
645
674
  "data-testid": "help-section-menu-changes-count",
646
675
  children: changesCount
647
676
  })]
@@ -683,7 +712,7 @@ var MenuButton$3 = /*#__PURE__*/forwardRef(function (props, ref) {
683
712
  t = _useTranslation.t;
684
713
  return /*#__PURE__*/jsxs("button", _objectSpread$6(_objectSpread$6({
685
714
  ref: ref,
686
- className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
715
+ className: "group hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
687
716
  "data-testid": "organization-switcher-button",
688
717
  type: "button"
689
718
  }, props), {}, {
@@ -691,22 +720,61 @@ var MenuButton$3 = /*#__PURE__*/forwardRef(function (props, ref) {
691
720
  className: "flex-grow text-start",
692
721
  children: t("neetoMolecules.sidebar.organizationSwitcher.label")
693
722
  }), /*#__PURE__*/jsx(ChevronRight, {
694
- className: "rtl:scale-x-[-1]",
723
+ className: "transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
695
724
  size: 18
696
725
  })]
697
726
  }));
698
727
  });
699
728
  MenuButton$3.displayName = "OrganizationSwitcherMenuButton";
700
729
 
730
+ var isCurrentSubdomain = function isCurrentSubdomain(link) {
731
+ try {
732
+ var currentSubdomain = window.location.hostname.split(".")[0];
733
+ var linkSubdomain = new URL(link).hostname.split(".")[0];
734
+ return currentSubdomain === linkSubdomain;
735
+ } catch (_unused) {
736
+ return false;
737
+ }
738
+ };
739
+ var OrganizationItems = withT(function (_ref) {
740
+ var t = _ref.t,
741
+ organizations = _ref.organizations,
742
+ authAppUrl = _ref.authAppUrl;
743
+ return /*#__PURE__*/jsxs(Fragment, {
744
+ children: [organizations === null || organizations === void 0 ? void 0 : organizations.map(function (organization) {
745
+ return /*#__PURE__*/jsxs("a", {
746
+ href: organization.organizationUrl,
747
+ rel: "noreferrer",
748
+ target: "_blank",
749
+ className: classnames("hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium", {
750
+ "text-green-600": isCurrentSubdomain(organization.organizationUrl)
751
+ }),
752
+ children: [organization.orgName, isCurrentSubdomain(organization.organizationUrl) && /*#__PURE__*/jsxs(Badge, {
753
+ variant: "default",
754
+ children: [/*#__PURE__*/jsx(CircleCheck, {
755
+ size: 12
756
+ }), t("neetoMolecules.sidebar.organizationSwitcher.signedin")]
757
+ })]
758
+ }, organization.userId);
759
+ }), /*#__PURE__*/jsx("a", {
760
+ className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
761
+ href: authAppUrl,
762
+ rel: "noreferrer",
763
+ target: "_blank",
764
+ children: t("neetoMolecules.sidebar.organizationSwitcher.addAccount")
765
+ })]
766
+ });
767
+ });
701
768
  var OrganizationSwitcher = function OrganizationSwitcher() {
702
769
  var _globalProps$user;
703
- var _useTranslation = useTranslation(),
704
- t = _useTranslation.t;
705
770
  var _useState = useState(false),
706
771
  _useState2 = _slicedToArray(_useState, 2),
707
772
  open = _useState2[0],
708
773
  setOpen = _useState2[1];
709
774
  var timeoutRef = useRef(null);
775
+ var _useBreakpoints = useBreakpoints(),
776
+ isSize = _useBreakpoints.isSize;
777
+ var isMobile = isSize("mobile");
710
778
  var _useFetchLoggedInOrga = useFetchLoggedInOrganizations(globalProps$1 === null || globalProps$1 === void 0 || (_globalProps$user = globalProps$1.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email),
711
779
  _useFetchLoggedInOrga2 = _useFetchLoggedInOrga.data,
712
780
  _useFetchLoggedInOrga3 = _useFetchLoggedInOrga2 === void 0 ? {} : _useFetchLoggedInOrga2,
@@ -721,15 +789,22 @@ var OrganizationSwitcher = function OrganizationSwitcher() {
721
789
  return setOpen(false);
722
790
  }, 150);
723
791
  }, []);
724
- var isCurrentSubdomain = function isCurrentSubdomain(link) {
725
- try {
726
- var currentSubdomain = window.location.hostname.split(".")[0];
727
- var linkSubdomain = new URL(link).hostname.split(".")[0];
728
- return currentSubdomain === linkSubdomain;
729
- } catch (_unused) {
730
- return false;
731
- }
732
- };
792
+ if (isMobile) {
793
+ return /*#__PURE__*/jsxs(Collapsible, {
794
+ open: open,
795
+ onOpenChange: setOpen,
796
+ children: [/*#__PURE__*/jsx(CollapsibleTrigger, {
797
+ asChild: true,
798
+ children: /*#__PURE__*/jsx(MenuButton$3, {})
799
+ }), /*#__PURE__*/jsx(CollapsibleContent, {
800
+ className: "flex flex-col gap-0.5 ps-6 pt-1",
801
+ children: /*#__PURE__*/jsx(OrganizationItems, {
802
+ authAppUrl: authAppUrl,
803
+ organizations: organizations
804
+ })
805
+ })]
806
+ });
807
+ }
733
808
  return /*#__PURE__*/jsxs(Popover, {
734
809
  open: open,
735
810
  onOpenChange: setOpen,
@@ -744,7 +819,7 @@ var OrganizationSwitcher = function OrganizationSwitcher() {
744
819
  onMouseEnter: handleMouseEnter,
745
820
  onMouseLeave: handleMouseLeave
746
821
  })
747
- }), /*#__PURE__*/jsxs(PopoverContent, {
822
+ }), /*#__PURE__*/jsx(PopoverContent, {
748
823
  align: "center",
749
824
  className: "z-[99999] w-56 gap-0.5 p-1",
750
825
  side: "right",
@@ -754,28 +829,10 @@ var OrganizationSwitcher = function OrganizationSwitcher() {
754
829
  onOpenAutoFocus: function onOpenAutoFocus(e) {
755
830
  return e.preventDefault();
756
831
  },
757
- children: [organizations === null || organizations === void 0 ? void 0 : organizations.map(function (organization) {
758
- return /*#__PURE__*/jsxs("a", {
759
- href: organization.organizationUrl,
760
- rel: "noreferrer",
761
- target: "_blank",
762
- className: classnames("hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium", {
763
- "text-green-600": isCurrentSubdomain(organization.organizationUrl)
764
- }),
765
- children: [organization.orgName, isCurrentSubdomain(organization.organizationUrl) && /*#__PURE__*/jsxs(Badge, {
766
- variant: "default",
767
- children: [/*#__PURE__*/jsx(CircleCheck, {
768
- size: 12
769
- }), t("neetoMolecules.sidebar.organizationSwitcher.signedin")]
770
- })]
771
- }, organization.userId);
772
- }), /*#__PURE__*/jsx("a", {
773
- className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
774
- href: authAppUrl,
775
- rel: "noreferrer",
776
- target: "_blank",
777
- children: t("neetoMolecules.sidebar.organizationSwitcher.addAccount")
778
- })]
832
+ children: /*#__PURE__*/jsx(OrganizationItems, {
833
+ authAppUrl: authAppUrl,
834
+ organizations: organizations
835
+ })
779
836
  })]
780
837
  });
781
838
  };
@@ -834,13 +891,10 @@ var Dropdown = function Dropdown() {
834
891
  })
835
892
  }), /*#__PURE__*/jsx(PopoverContent, {
836
893
  align: "start",
837
- className: "z-[99999] w-[calc(100vw-25rem)] max-w-none overflow-y-auto rounded-xl p-0",
894
+ className: "z-[99999] flex h-[max(36rem,min(80vh,48rem))] max-h-[var(--radix-popover-content-available-height)] w-[calc(100vw-25rem)] max-w-7xl flex-col overflow-hidden rounded-xl p-0",
838
895
  collisionPadding: 16,
839
896
  side: "right",
840
897
  sideOffset: 8,
841
- style: {
842
- maxHeight: "var(--radix-popover-content-available-height)"
843
- },
844
898
  onMouseEnter: handleMouseEnter,
845
899
  onMouseLeave: handleMouseLeave,
846
900
  onOpenAutoFocus: function onOpenAutoFocus(e) {
@@ -887,10 +941,15 @@ var ProfileHeader = function ProfileHeader(_ref) {
887
941
  "data-testid": "floating-action-menu-header-user-name",
888
942
  title: name,
889
943
  children: truncate(name, 18)
890
- }), email && /*#__PURE__*/jsx("span", {
891
- className: "text-muted-foreground w-full truncate text-xs leading-tight",
892
- "data-testid": "floating-action-menu-header-user-email",
893
- children: email
944
+ }), email && /*#__PURE__*/jsx(Typography, {
945
+ asChild: true,
946
+ className: "w-full truncate leading-tight",
947
+ color: "muted",
948
+ variant: "caption",
949
+ children: /*#__PURE__*/jsx("span", {
950
+ "data-testid": "floating-action-menu-header-user-email",
951
+ children: email
952
+ })
894
953
  })]
895
954
  })]
896
955
  });
@@ -904,14 +963,14 @@ var MenuButton$1 = /*#__PURE__*/forwardRef(function (_ref, ref) {
904
963
  otherProps = _objectWithoutProperties(_ref, _excluded$1);
905
964
  return /*#__PURE__*/jsxs("button", _objectSpread$4(_objectSpread$4({
906
965
  ref: ref,
907
- className: "hover:bg-accent flex w-full items-center gap-2 rounded-md px-2.5 py-2 transition-colors",
966
+ className: "group hover:bg-accent flex w-full items-center gap-2 rounded-md px-2.5 py-2 transition-colors",
908
967
  "data-testid": "profile-expand-menu-button",
909
968
  type: "button"
910
969
  }, otherProps), {}, {
911
970
  children: [/*#__PURE__*/jsx(ProfileHeader, {
912
971
  profileInfo: profileInfo
913
972
  }), /*#__PURE__*/jsx(ChevronRight, {
914
- className: "shrink-0 rtl:scale-x-[-1]",
973
+ className: "shrink-0 transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
915
974
  size: 18
916
975
  })]
917
976
  }));
@@ -947,11 +1006,33 @@ var LEGACY_THEMES = {
947
1006
  };
948
1007
  var NEETO_AUTH_BILLING_INFO_URL = "/neeto_sso/api/v1/subscription/billing";
949
1008
 
950
- var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
1009
+ var ProfileItems = withT(function (_ref) {
951
1010
  var _window$globalProps;
952
- var profileInfo = _ref.profileInfo;
953
- var _useTranslation = useTranslation(),
954
- t = _useTranslation.t;
1011
+ var t = _ref.t,
1012
+ onProfileClick = _ref.onProfileClick;
1013
+ return /*#__PURE__*/jsxs(Fragment, {
1014
+ children: [/*#__PURE__*/jsxs("button", {
1015
+ className: MENU_ITEM_CLASS,
1016
+ "data-testid": "profile-my-profile-button",
1017
+ type: "button",
1018
+ onClick: onProfileClick,
1019
+ children: [/*#__PURE__*/jsx(User, {
1020
+ size: 18
1021
+ }), t("neetoMolecules.sidebar.myProfile")]
1022
+ }), ((_window$globalProps = window.globalProps) === null || _window$globalProps === void 0 || (_window$globalProps = _window$globalProps.user) === null || _window$globalProps === void 0 ? void 0 : _window$globalProps.isOwner) && /*#__PURE__*/jsxs("a", {
1023
+ className: MENU_ITEM_CLASS,
1024
+ "data-testid": "profile-cancel-account-button",
1025
+ href: DELETE_WORKSPACE_URL,
1026
+ rel: "noreferrer",
1027
+ target: "_blank",
1028
+ children: [/*#__PURE__*/jsx(CircleX, {
1029
+ size: 18
1030
+ }), t("neetoMolecules.sidebar.cancelAccount")]
1031
+ })]
1032
+ });
1033
+ });
1034
+ var ProfileExpandMenu = function ProfileExpandMenu(_ref2) {
1035
+ var profileInfo = _ref2.profileInfo;
955
1036
  var _useState = useState(false),
956
1037
  _useState2 = _slicedToArray(_useState, 2),
957
1038
  open = _useState2[0],
@@ -960,6 +1041,9 @@ var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
960
1041
  _Profile$usePaneState2 = _slicedToArray(_Profile$usePaneState, 2),
961
1042
  setIsProfilePaneOpen = _Profile$usePaneState2[1];
962
1043
  var timeoutRef = useRef(null);
1044
+ var _useBreakpoints = useBreakpoints(),
1045
+ isSize = _useBreakpoints.isSize;
1046
+ var isMobile = isSize("mobile");
963
1047
  var handleMouseEnter = useCallback(function () {
964
1048
  clearTimeout(timeoutRef.current);
965
1049
  setOpen(true);
@@ -969,6 +1053,26 @@ var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
969
1053
  return setOpen(false);
970
1054
  }, 150);
971
1055
  }, []);
1056
+ var onProfileClick = function onProfileClick() {
1057
+ return setIsProfilePaneOpen(true);
1058
+ };
1059
+ if (isMobile) {
1060
+ return /*#__PURE__*/jsxs(Collapsible, {
1061
+ open: open,
1062
+ onOpenChange: setOpen,
1063
+ children: [/*#__PURE__*/jsx(CollapsibleTrigger, {
1064
+ asChild: true,
1065
+ children: /*#__PURE__*/jsx(MenuButton$1, {
1066
+ profileInfo: profileInfo
1067
+ })
1068
+ }), /*#__PURE__*/jsx(CollapsibleContent, {
1069
+ className: "flex flex-col gap-0.5 ps-6 pt-1",
1070
+ children: /*#__PURE__*/jsx(ProfileItems, {
1071
+ onProfileClick: onProfileClick
1072
+ })
1073
+ })]
1074
+ });
1075
+ }
972
1076
  return /*#__PURE__*/jsxs(Popover, {
973
1077
  open: open,
974
1078
  onOpenChange: setOpen,
@@ -984,7 +1088,7 @@ var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
984
1088
  onMouseEnter: handleMouseEnter,
985
1089
  onMouseLeave: handleMouseLeave
986
1090
  })
987
- }), /*#__PURE__*/jsxs(PopoverContent, {
1091
+ }), /*#__PURE__*/jsx(PopoverContent, {
988
1092
  align: "center",
989
1093
  className: "z-[99999] w-56 gap-0.5 p-1",
990
1094
  side: "right",
@@ -994,26 +1098,9 @@ var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
994
1098
  onOpenAutoFocus: function onOpenAutoFocus(e) {
995
1099
  return e.preventDefault();
996
1100
  },
997
- children: [/*#__PURE__*/jsxs("button", {
998
- className: MENU_ITEM_CLASS,
999
- "data-testid": "profile-my-profile-button",
1000
- type: "button",
1001
- onClick: function onClick() {
1002
- return setIsProfilePaneOpen(true);
1003
- },
1004
- children: [/*#__PURE__*/jsx(User, {
1005
- size: 18
1006
- }), t("neetoMolecules.sidebar.myProfile")]
1007
- }), ((_window$globalProps = window.globalProps) === null || _window$globalProps === void 0 || (_window$globalProps = _window$globalProps.user) === null || _window$globalProps === void 0 ? void 0 : _window$globalProps.isOwner) && /*#__PURE__*/jsxs("a", {
1008
- className: MENU_ITEM_CLASS,
1009
- "data-testid": "profile-cancel-account-button",
1010
- href: DELETE_WORKSPACE_URL,
1011
- rel: "noreferrer",
1012
- target: "_blank",
1013
- children: [/*#__PURE__*/jsx(CircleX, {
1014
- size: 18
1015
- }), t("neetoMolecules.sidebar.cancelAccount")]
1016
- })]
1101
+ children: /*#__PURE__*/jsx(ProfileItems, {
1102
+ onProfileClick: onProfileClick
1103
+ })
1017
1104
  })]
1018
1105
  });
1019
1106
  };
@@ -1094,8 +1181,10 @@ var ThemeSwitcher = function ThemeSwitcher() {
1094
1181
  };
1095
1182
  return /*#__PURE__*/jsxs("div", {
1096
1183
  className: "bg-muted/40 flex items-center justify-between gap-3 rounded-b-xl px-4 py-3",
1097
- children: [/*#__PURE__*/jsx("span", {
1098
- className: "text-muted-foreground text-xs font-medium",
1184
+ children: [/*#__PURE__*/jsx(Typography, {
1185
+ color: "muted",
1186
+ variant: "caption",
1187
+ weight: "medium",
1099
1188
  children: t("neetoMolecules.sidebar.themeSwitcher.label")
1100
1189
  }), /*#__PURE__*/jsxs("div", {
1101
1190
  className: "bg-muted flex rounded-lg p-0.5",
@@ -1133,7 +1222,7 @@ var MenuButton = /*#__PURE__*/forwardRef(function (props, ref) {
1133
1222
  t = _useTranslation.t;
1134
1223
  return /*#__PURE__*/jsxs("button", _objectSpread$3(_objectSpread$3({
1135
1224
  ref: ref,
1136
- className: "hover:bg-accent flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-start",
1225
+ className: "group hover:bg-accent flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-start",
1137
1226
  "data-testid": "workspace-display",
1138
1227
  type: "button"
1139
1228
  }, props), {}, {
@@ -1142,27 +1231,64 @@ var MenuButton = /*#__PURE__*/forwardRef(function (props, ref) {
1142
1231
  children: [/*#__PURE__*/jsx("span", {
1143
1232
  className: "text-sm font-medium",
1144
1233
  children: t("neetoMolecules.sidebar.workspace")
1145
- }), ((_globalProps$organiza = globalProps$1.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.name) && /*#__PURE__*/jsx("span", {
1146
- className: "text-muted-foreground text-xs",
1147
- children: globalProps$1.organization.name
1234
+ }), ((_globalProps$organiza = globalProps$1.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.name) && /*#__PURE__*/jsx(Typography, {
1235
+ asChild: true,
1236
+ color: "muted",
1237
+ variant: "caption",
1238
+ children: /*#__PURE__*/jsx("span", {
1239
+ children: globalProps$1.organization.name
1240
+ })
1148
1241
  })]
1149
1242
  }), /*#__PURE__*/jsx(ChevronRight, {
1150
- className: "shrink-0 rtl:scale-x-[-1]",
1243
+ className: "shrink-0 transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
1151
1244
  size: 18
1152
1245
  })]
1153
1246
  }));
1154
1247
  });
1155
1248
  MenuButton.displayName = "WorkspaceMenuButton";
1156
1249
 
1157
- var WorkspaceMenu = function WorkspaceMenu() {
1250
+ var WorkspaceItems = withT(function (_ref) {
1158
1251
  var _globalProps$organiza;
1159
- var _useTranslation = useTranslation(),
1160
- t = _useTranslation.t;
1252
+ var t = _ref.t;
1253
+ return /*#__PURE__*/jsxs(Fragment, {
1254
+ children: [/*#__PURE__*/jsx("a", {
1255
+ className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
1256
+ "data-testid": "profile-organization-settings-button",
1257
+ href: MY_ORGANIZATION_URL,
1258
+ rel: "noreferrer",
1259
+ target: "_blank",
1260
+ children: t("neetoMolecules.sidebar.workspaceMenu.settings")
1261
+ }), ((_globalProps$organiza = globalProps$1.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.subdomain) && /*#__PURE__*/jsx("div", {
1262
+ className: "px-2.5 py-2",
1263
+ children: /*#__PURE__*/jsxs("span", {
1264
+ className: "flex flex-col gap-0.5 text-start",
1265
+ children: [/*#__PURE__*/jsx("span", {
1266
+ className: "text-sm font-medium",
1267
+ children: t("neetoMolecules.sidebar.workspaceMenu.subdomain")
1268
+ }), /*#__PURE__*/jsxs("span", {
1269
+ className: "text-muted-foreground flex items-center gap-1 text-xs",
1270
+ children: [/*#__PURE__*/jsx("span", {
1271
+ className: "min-w-0 truncate",
1272
+ children: globalProps$1.organization.subdomain
1273
+ }), /*#__PURE__*/jsx(CopyToClipboardButton, {
1274
+ className: "flex-shrink-0",
1275
+ value: globalProps$1.organization.subdomain,
1276
+ variant: "ghost"
1277
+ })]
1278
+ })]
1279
+ })
1280
+ })]
1281
+ });
1282
+ });
1283
+ var WorkspaceMenu = function WorkspaceMenu() {
1161
1284
  var _useState = useState(false),
1162
1285
  _useState2 = _slicedToArray(_useState, 2),
1163
1286
  open = _useState2[0],
1164
1287
  setOpen = _useState2[1];
1165
1288
  var timeoutRef = useRef(null);
1289
+ var _useBreakpoints = useBreakpoints(),
1290
+ isSize = _useBreakpoints.isSize;
1291
+ var isMobile = isSize("mobile");
1166
1292
  var handleMouseEnter = useCallback(function () {
1167
1293
  clearTimeout(timeoutRef.current);
1168
1294
  setOpen(true);
@@ -1172,6 +1298,19 @@ var WorkspaceMenu = function WorkspaceMenu() {
1172
1298
  return setOpen(false);
1173
1299
  }, 150);
1174
1300
  }, []);
1301
+ if (isMobile) {
1302
+ return /*#__PURE__*/jsxs(Collapsible, {
1303
+ open: open,
1304
+ onOpenChange: setOpen,
1305
+ children: [/*#__PURE__*/jsx(CollapsibleTrigger, {
1306
+ asChild: true,
1307
+ children: /*#__PURE__*/jsx(MenuButton, {})
1308
+ }), /*#__PURE__*/jsx(CollapsibleContent, {
1309
+ className: "flex flex-col gap-0.5 ps-6 pt-1",
1310
+ children: /*#__PURE__*/jsx(WorkspaceItems, {})
1311
+ })]
1312
+ });
1313
+ }
1175
1314
  return /*#__PURE__*/jsxs(Popover, {
1176
1315
  open: open,
1177
1316
  onOpenChange: setOpen,
@@ -1186,7 +1325,7 @@ var WorkspaceMenu = function WorkspaceMenu() {
1186
1325
  onMouseEnter: handleMouseEnter,
1187
1326
  onMouseLeave: handleMouseLeave
1188
1327
  })
1189
- }), /*#__PURE__*/jsxs(PopoverContent, {
1328
+ }), /*#__PURE__*/jsx(PopoverContent, {
1190
1329
  align: "center",
1191
1330
  className: "z-[99999] w-56 gap-0.5 p-1",
1192
1331
  side: "right",
@@ -1196,33 +1335,7 @@ var WorkspaceMenu = function WorkspaceMenu() {
1196
1335
  onOpenAutoFocus: function onOpenAutoFocus(e) {
1197
1336
  return e.preventDefault();
1198
1337
  },
1199
- children: [/*#__PURE__*/jsx("a", {
1200
- className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
1201
- "data-testid": "profile-organization-settings-button",
1202
- href: MY_ORGANIZATION_URL,
1203
- rel: "noreferrer",
1204
- target: "_blank",
1205
- children: t("neetoMolecules.sidebar.workspaceMenu.settings")
1206
- }), ((_globalProps$organiza = globalProps$1.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.subdomain) && /*#__PURE__*/jsx("div", {
1207
- className: "px-3 py-2",
1208
- children: /*#__PURE__*/jsxs("span", {
1209
- className: "flex flex-col gap-0.5 text-start",
1210
- children: [/*#__PURE__*/jsx("span", {
1211
- className: "text-sm font-medium",
1212
- children: t("neetoMolecules.sidebar.workspaceMenu.subdomain")
1213
- }), /*#__PURE__*/jsxs("span", {
1214
- className: "text-muted-foreground flex items-center gap-1 text-xs",
1215
- children: [/*#__PURE__*/jsx("span", {
1216
- className: "min-w-0 truncate",
1217
- children: globalProps$1.organization.subdomain
1218
- }), /*#__PURE__*/jsx(CopyToClipboardButton, {
1219
- className: "flex-shrink-0",
1220
- value: globalProps$1.organization.subdomain,
1221
- variant: "ghost"
1222
- })]
1223
- })]
1224
- })
1225
- })]
1338
+ children: /*#__PURE__*/jsx(WorkspaceItems, {})
1226
1339
  })]
1227
1340
  });
1228
1341
  };
@@ -1459,7 +1572,7 @@ var ProfileButton = function ProfileButton(_ref) {
1459
1572
  })
1460
1573
  })]
1461
1574
  }), isPresent(changesCount) && /*#__PURE__*/jsx("span", {
1462
- className: "bg-accent-foreground pointer-events-none absolute end-0 top-0 z-[3] flex h-[0.9375rem] min-w-[0.9375rem] items-center justify-center rounded-full border border-white px-1 text-[10px] text-white select-none",
1575
+ className: "bg-foreground text-background pointer-events-none absolute end-0 top-0 z-[3] flex h-[0.9375rem] min-w-[0.9375rem] items-center justify-center rounded-full border border-white px-1 text-[10px] select-none",
1463
1576
  "data-testid": "help-icon-changes-count",
1464
1577
  children: changesCount
1465
1578
  }), /*#__PURE__*/jsx(Modal, {