@bigbinary/neeto-molecules 4.1.67 → 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.
@@ -14,6 +14,7 @@ var v2 = require('@bigbinary/neeto-team-members-frontend/v2');
14
14
  var ramda = require('ramda');
15
15
  var v2_KeyboardShortcuts = require('./KeyboardShortcuts.js');
16
16
  var SubscriptionUpgradeRequestModal = require('../SubscriptionUpgradeRequestModal.js');
17
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
17
18
  var classnames = require('classnames');
18
19
  var reactI18next = require('react-i18next');
19
20
  var Neeto = require('@bigbinary/neeto-icons/typeface-logos/Neeto');
@@ -22,10 +23,10 @@ var jsxRuntime = require('react/jsx-runtime');
22
23
  var reactQuery = require('@tanstack/react-query');
23
24
  var axios = require('axios');
24
25
  var search = require('../search-BBuFYdmG.js');
26
+ var useBreakpoints = require('@bigbinary/neeto-commons-frontend/react-utils/useBreakpoints');
25
27
  var circleQuestionMark = require('../circle-question-mark-kxBMPyWQ.js');
26
28
  var chevronRight = require('../chevron-right-DpleLIQp.js');
27
29
  var createLucideIcon = require('../createLucideIcon-DBDhE7kE.js');
28
- var useBreakpoints = require('@bigbinary/neeto-commons-frontend/react-utils/useBreakpoints');
29
30
  var _objectDestructuringEmpty = require('@babel/runtime/helpers/objectDestructuringEmpty');
30
31
  var i18next = require('i18next');
31
32
  var user = require('../user-Ku5LVfLy.js');
@@ -39,7 +40,6 @@ require('zustand/shallow');
39
40
  require('@bigbinary/neeto-commons-frontend/react-utils/withImmutableActions');
40
41
  require('zustand');
41
42
  require('@bigbinary/neetoui/managers');
42
- require('@bigbinary/neeto-commons-frontend/react-utils');
43
43
  require('../ua-parser-DgQ3nYoO.js');
44
44
  require('../x-B38UX0_0.js');
45
45
  require('@bigbinary/neetoui/Button');
@@ -273,21 +273,22 @@ var ProductLink$1 = function ProductLink(_ref) {
273
273
  href: url,
274
274
  rel: "noreferrer",
275
275
  target: "_blank",
276
- 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", {
276
+ 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", {
277
277
  "border-primary bg-primary/5": (_globalProps = globalProps) === null || _globalProps === void 0 || (_globalProps = _globalProps.appName) === null || _globalProps === void 0 ? void 0 : _globalProps.includes(name),
278
278
  "nv-product-link-highlighted bg-accent": isHighlighted,
279
279
  "border-border hover:border-primary": !((_globalProps2 = globalProps) !== null && _globalProps2 !== void 0 && (_globalProps2 = _globalProps2.appName) !== null && _globalProps2 !== void 0 && _globalProps2.includes(name))
280
280
  })
281
281
  }, props), {}, {
282
282
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
283
- className: "shrink-0 grow [&>svg]:h-9 [&>svg]:w-auto",
283
+ className: "shrink-0 grow [&>svg]:h-9 [&>svg]:w-auto max-md:[&>svg]:h-6",
284
284
  children: AppIcon ? /*#__PURE__*/jsxRuntime.jsx(AppIcon, {}) : /*#__PURE__*/jsxRuntime.jsx(Neeto, {
285
- className: "h-6 w-auto"
285
+ className: "h-6 w-auto max-md:h-5"
286
286
  })
287
287
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
288
288
  className: "shrink-0",
289
- children: /*#__PURE__*/jsxRuntime.jsx("span", {
290
- className: "text-muted-foreground block text-xs",
289
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
290
+ color: "muted",
291
+ variant: "caption",
291
292
  children: description
292
293
  })
293
294
  })]
@@ -305,7 +306,7 @@ var Content = function Content(_ref) {
305
306
  t = _useTranslation.t;
306
307
  if (isLoading) {
307
308
  return /*#__PURE__*/jsxRuntime.jsx("div", {
308
- className: "flex items-center justify-center py-8",
309
+ className: "flex h-full items-center justify-center",
309
310
  children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Spinner, {
310
311
  "data-testid": "neeto-ui-spinner"
311
312
  })
@@ -319,10 +320,14 @@ var Content = function Content(_ref) {
319
320
  isHighlighted: index === highlightedIndex
320
321
  }), app.name);
321
322
  })
322
- }) : /*#__PURE__*/jsxRuntime.jsx("p", {
323
- className: "text-center text-sm",
323
+ }) : /*#__PURE__*/jsxRuntime.jsx("div", {
324
+ className: "flex h-full items-center justify-center",
324
325
  "data-testid": "no-apps-found-title",
325
- children: t("neetoMolecules.productSwitcher.noApps")
326
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
327
+ color: "muted",
328
+ variant: "body2",
329
+ children: t("neetoMolecules.productSwitcher.noApps")
330
+ })
326
331
  });
327
332
  };
328
333
 
@@ -463,12 +468,12 @@ var Menu = function Menu(_ref) {
463
468
  handleKeyDown = _useProductSwitcherNa.handleKeyDown,
464
469
  scrollContainerRef = _useProductSwitcherNa.scrollContainerRef;
465
470
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
466
- className: "bg-background flex w-full max-w-full flex-col items-start overflow-y-auto p-6 transition-all max-md:p-4",
471
+ className: "flex h-full w-full max-w-full flex-col items-start p-6 transition-all max-md:p-1",
467
472
  "data-testid": "switcher-wrapper",
468
473
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
469
474
  "data-testid": "product-switcher-body-wrapper",
470
- 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", {
471
- "max-md:mb-6": isMobile
475
+ 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", {
476
+ "max-md:mb-4": isMobile
472
477
  }),
473
478
  children: [!isMobile && /*#__PURE__*/jsxRuntime.jsx("h1", {
474
479
  className: "text-2xl font-bold max-sm:text-xl",
@@ -494,7 +499,7 @@ var Menu = function Menu(_ref) {
494
499
  })
495
500
  })]
496
501
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
497
- className: "mb-6 flex w-full flex-col gap-3 text-sm",
502
+ className: "flex min-h-0 w-full flex-1 flex-col gap-3 overflow-y-auto text-sm",
498
503
  ref: scrollContainerRef,
499
504
  children: /*#__PURE__*/jsxRuntime.jsx(Content, {
500
505
  filteredApps: filteredApps,
@@ -505,24 +510,28 @@ var Menu = function Menu(_ref) {
505
510
  }, "switcher-wrapper");
506
511
  };
507
512
 
508
- var Modal = function Modal(_ref) {
509
- var isOpen = _ref.isOpen,
513
+ var Modal = reactUtils.withT(function (_ref) {
514
+ var t = _ref.t,
515
+ isOpen = _ref.isOpen,
510
516
  onClose = _ref.onClose;
511
517
  return /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Dialog, {
512
518
  isOpen: isOpen,
513
519
  onClose: onClose,
514
520
  "aria-describedby": undefined,
515
- className: "sm:max-w-4xl",
516
- closeButton: false,
521
+ className: "grid-rows-[1fr] sm:max-w-4xl",
522
+ size: "fullScreen",
517
523
  children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Dialog.Title, {
518
524
  className: "sr-only",
519
- children: "Product Switcher"
520
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
521
- "data-testid": "product-switcher-modal",
522
- children: /*#__PURE__*/jsxRuntime.jsx(Menu, {})
525
+ children: t("neetoMolecules.productSwitcher.title")
526
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Dialog.Body, {
527
+ className: "min-h-0 overflow-y-auto",
528
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
529
+ "data-testid": "product-switcher-modal",
530
+ children: /*#__PURE__*/jsxRuntime.jsx(Menu, {})
531
+ })
523
532
  })]
524
533
  });
525
- };
534
+ });
526
535
 
527
536
  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";
528
537
 
@@ -533,7 +542,7 @@ var MenuButton$4 = /*#__PURE__*/React.forwardRef(function (props, ref) {
533
542
  t = _useTranslation.t;
534
543
  return /*#__PURE__*/jsxRuntime.jsxs("button", _objectSpread$8(_objectSpread$8({
535
544
  ref: ref,
536
- className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
545
+ className: "group hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
537
546
  "data-testid": "help-menu-button",
538
547
  type: "button"
539
548
  }, props), {}, {
@@ -543,22 +552,68 @@ var MenuButton$4 = /*#__PURE__*/React.forwardRef(function (props, ref) {
543
552
  className: "flex-grow text-start",
544
553
  children: t("neetoMolecules.sidebar.help")
545
554
  }), /*#__PURE__*/jsxRuntime.jsx(chevronRight.ChevronRight, {
546
- className: "rtl:scale-x-[-1]",
555
+ className: "transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
547
556
  size: 18
548
557
  })]
549
558
  }));
550
559
  });
551
560
  MenuButton$4.displayName = "HelpMenuButton";
552
561
 
553
- var HelpMenu = function HelpMenu() {
562
+ var HelpItems = reactUtils.withT(function (_ref) {
554
563
  var _globalProps;
555
- var _useTranslation = reactI18next.useTranslation(),
556
- t = _useTranslation.t;
564
+ var t = _ref.t;
565
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
566
+ children: [/*#__PURE__*/jsxRuntime.jsxs("a", {
567
+ className: MENU_ITEM_CLASS$1,
568
+ "data-testid": "help-link-help-articles-button",
569
+ href: "https://help.".concat(ramda.toLower(((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.appName) || ""), ".com/"),
570
+ rel: "noreferrer",
571
+ target: "_blank",
572
+ children: [/*#__PURE__*/jsxRuntime.jsx(BookOpen, {
573
+ size: 18
574
+ }), t("neetoMolecules.sidebar.helpLinks.helpArticles")]
575
+ }), /*#__PURE__*/jsxRuntime.jsxs("button", {
576
+ className: MENU_ITEM_CLASS$1,
577
+ "data-testid": "help-link-live-chat-button",
578
+ type: "button",
579
+ onClick: function onClick() {
580
+ var _window$NeetoChat, _window$NeetoChat2;
581
+ (_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 || (_window$NeetoChat = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat === void 0 || _window$NeetoChat.maximizeWidget();
582
+ (_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 || (_window$NeetoChat2 = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2 === void 0 || _window$NeetoChat2.openWidget();
583
+ },
584
+ children: [/*#__PURE__*/jsxRuntime.jsx(MessageCircleQuestionMark, {
585
+ size: 18
586
+ }), t("neetoMolecules.sidebar.helpLinks.liveChat")]
587
+ }), /*#__PURE__*/jsxRuntime.jsxs("a", {
588
+ className: MENU_ITEM_CLASS$1,
589
+ "data-testid": "help-link-community-button",
590
+ href: "https://www.launchpass.com/neetohq",
591
+ rel: "noreferrer",
592
+ target: "_blank",
593
+ children: [/*#__PURE__*/jsxRuntime.jsx(Users, {
594
+ size: 18
595
+ }), t("neetoMolecules.sidebar.helpLinks.askTheCommunity")]
596
+ }), /*#__PURE__*/jsxRuntime.jsxs("a", {
597
+ className: MENU_ITEM_CLASS$1,
598
+ "data-testid": "help-link-status-button",
599
+ href: "https://neetostatus.com/",
600
+ rel: "noreferrer",
601
+ target: "_blank",
602
+ children: [/*#__PURE__*/jsxRuntime.jsx(Activity, {
603
+ size: 18
604
+ }), t("neetoMolecules.sidebar.helpLinks.systemStatus")]
605
+ })]
606
+ });
607
+ });
608
+ var HelpMenu = function HelpMenu() {
557
609
  var _useState = React.useState(false),
558
610
  _useState2 = _slicedToArray(_useState, 2),
559
611
  open = _useState2[0],
560
612
  setOpen = _useState2[1];
561
613
  var timeoutRef = React.useRef(null);
614
+ var _useBreakpoints = useBreakpoints(),
615
+ isSize = _useBreakpoints.isSize;
616
+ var isMobile = isSize("mobile");
562
617
  var handleMouseEnter = React.useCallback(function () {
563
618
  clearTimeout(timeoutRef.current);
564
619
  setOpen(true);
@@ -568,6 +623,19 @@ var HelpMenu = function HelpMenu() {
568
623
  return setOpen(false);
569
624
  }, 150);
570
625
  }, []);
626
+ if (isMobile) {
627
+ return /*#__PURE__*/jsxRuntime.jsxs(primitives.Collapsible, {
628
+ open: open,
629
+ onOpenChange: setOpen,
630
+ children: [/*#__PURE__*/jsxRuntime.jsx(primitives.CollapsibleTrigger, {
631
+ asChild: true,
632
+ children: /*#__PURE__*/jsxRuntime.jsx(MenuButton$4, {})
633
+ }), /*#__PURE__*/jsxRuntime.jsx(primitives.CollapsibleContent, {
634
+ className: "flex flex-col gap-0.5 ps-6 pt-1",
635
+ children: /*#__PURE__*/jsxRuntime.jsx(HelpItems, {})
636
+ })]
637
+ });
638
+ }
571
639
  return /*#__PURE__*/jsxRuntime.jsxs(primitives.Popover, {
572
640
  open: open,
573
641
  onOpenChange: setOpen,
@@ -582,7 +650,7 @@ var HelpMenu = function HelpMenu() {
582
650
  onMouseEnter: handleMouseEnter,
583
651
  onMouseLeave: handleMouseLeave
584
652
  })
585
- }), /*#__PURE__*/jsxRuntime.jsxs(primitives.PopoverContent, {
653
+ }), /*#__PURE__*/jsxRuntime.jsx(primitives.PopoverContent, {
586
654
  align: "center",
587
655
  className: "z-[99999] w-56 gap-0.5 p-1",
588
656
  side: "right",
@@ -592,46 +660,7 @@ var HelpMenu = function HelpMenu() {
592
660
  onOpenAutoFocus: function onOpenAutoFocus(e) {
593
661
  return e.preventDefault();
594
662
  },
595
- children: [/*#__PURE__*/jsxRuntime.jsxs("a", {
596
- className: MENU_ITEM_CLASS$1,
597
- "data-testid": "help-link-help-articles-button",
598
- href: "https://help.".concat(ramda.toLower(((_globalProps = globalProps) === null || _globalProps === void 0 ? void 0 : _globalProps.appName) || ""), ".com/"),
599
- rel: "noreferrer",
600
- target: "_blank",
601
- children: [/*#__PURE__*/jsxRuntime.jsx(BookOpen, {
602
- size: 18
603
- }), t("neetoMolecules.sidebar.helpLinks.helpArticles")]
604
- }), /*#__PURE__*/jsxRuntime.jsxs("button", {
605
- className: MENU_ITEM_CLASS$1,
606
- "data-testid": "help-link-live-chat-button",
607
- type: "button",
608
- onClick: function onClick() {
609
- var _window$NeetoChat, _window$NeetoChat2;
610
- (_window$NeetoChat = window.NeetoChat) === null || _window$NeetoChat === void 0 || (_window$NeetoChat = _window$NeetoChat.contextualHelp) === null || _window$NeetoChat === void 0 || _window$NeetoChat.maximizeWidget();
611
- (_window$NeetoChat2 = window.NeetoChat) === null || _window$NeetoChat2 === void 0 || (_window$NeetoChat2 = _window$NeetoChat2.contextualHelp) === null || _window$NeetoChat2 === void 0 || _window$NeetoChat2.openWidget();
612
- },
613
- children: [/*#__PURE__*/jsxRuntime.jsx(MessageCircleQuestionMark, {
614
- size: 18
615
- }), t("neetoMolecules.sidebar.helpLinks.liveChat")]
616
- }), /*#__PURE__*/jsxRuntime.jsxs("a", {
617
- className: MENU_ITEM_CLASS$1,
618
- "data-testid": "help-link-community-button",
619
- href: "https://www.launchpass.com/neetohq",
620
- rel: "noreferrer",
621
- target: "_blank",
622
- children: [/*#__PURE__*/jsxRuntime.jsx(Users, {
623
- size: 18
624
- }), t("neetoMolecules.sidebar.helpLinks.askTheCommunity")]
625
- }), /*#__PURE__*/jsxRuntime.jsxs("a", {
626
- className: MENU_ITEM_CLASS$1,
627
- "data-testid": "help-link-status-button",
628
- href: "https://neetostatus.com/",
629
- rel: "noreferrer",
630
- target: "_blank",
631
- children: [/*#__PURE__*/jsxRuntime.jsx(Activity, {
632
- size: 18
633
- }), t("neetoMolecules.sidebar.helpLinks.systemStatus")]
634
- })]
663
+ children: /*#__PURE__*/jsxRuntime.jsx(HelpItems, {})
635
664
  })]
636
665
  });
637
666
  };
@@ -662,7 +691,7 @@ var LinkSection = function LinkSection(_ref) {
662
691
  }), /*#__PURE__*/jsxRuntime.jsxs("span", {
663
692
  className: "flex flex-grow items-center gap-2",
664
693
  children: [label, neetoCist.isPresent(changesCount) && /*#__PURE__*/jsxRuntime.jsx("span", {
665
- 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",
694
+ 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",
666
695
  "data-testid": "help-section-menu-changes-count",
667
696
  children: changesCount
668
697
  })]
@@ -704,7 +733,7 @@ var MenuButton$3 = /*#__PURE__*/React.forwardRef(function (props, ref) {
704
733
  t = _useTranslation.t;
705
734
  return /*#__PURE__*/jsxRuntime.jsxs("button", _objectSpread$6(_objectSpread$6({
706
735
  ref: ref,
707
- className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
736
+ className: "group hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
708
737
  "data-testid": "organization-switcher-button",
709
738
  type: "button"
710
739
  }, props), {}, {
@@ -712,22 +741,61 @@ var MenuButton$3 = /*#__PURE__*/React.forwardRef(function (props, ref) {
712
741
  className: "flex-grow text-start",
713
742
  children: t("neetoMolecules.sidebar.organizationSwitcher.label")
714
743
  }), /*#__PURE__*/jsxRuntime.jsx(chevronRight.ChevronRight, {
715
- className: "rtl:scale-x-[-1]",
744
+ className: "transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
716
745
  size: 18
717
746
  })]
718
747
  }));
719
748
  });
720
749
  MenuButton$3.displayName = "OrganizationSwitcherMenuButton";
721
750
 
751
+ var isCurrentSubdomain = function isCurrentSubdomain(link) {
752
+ try {
753
+ var currentSubdomain = window.location.hostname.split(".")[0];
754
+ var linkSubdomain = new URL(link).hostname.split(".")[0];
755
+ return currentSubdomain === linkSubdomain;
756
+ } catch (_unused) {
757
+ return false;
758
+ }
759
+ };
760
+ var OrganizationItems = reactUtils.withT(function (_ref) {
761
+ var t = _ref.t,
762
+ organizations = _ref.organizations,
763
+ authAppUrl = _ref.authAppUrl;
764
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
765
+ children: [organizations === null || organizations === void 0 ? void 0 : organizations.map(function (organization) {
766
+ return /*#__PURE__*/jsxRuntime.jsxs("a", {
767
+ href: organization.organizationUrl,
768
+ rel: "noreferrer",
769
+ target: "_blank",
770
+ className: classnames("hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium", {
771
+ "text-green-600": isCurrentSubdomain(organization.organizationUrl)
772
+ }),
773
+ children: [organization.orgName, isCurrentSubdomain(organization.organizationUrl) && /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Badge, {
774
+ variant: "default",
775
+ children: [/*#__PURE__*/jsxRuntime.jsx(CircleCheck, {
776
+ size: 12
777
+ }), t("neetoMolecules.sidebar.organizationSwitcher.signedin")]
778
+ })]
779
+ }, organization.userId);
780
+ }), /*#__PURE__*/jsxRuntime.jsx("a", {
781
+ className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
782
+ href: authAppUrl,
783
+ rel: "noreferrer",
784
+ target: "_blank",
785
+ children: t("neetoMolecules.sidebar.organizationSwitcher.addAccount")
786
+ })]
787
+ });
788
+ });
722
789
  var OrganizationSwitcher = function OrganizationSwitcher() {
723
790
  var _globalProps$user;
724
- var _useTranslation = reactI18next.useTranslation(),
725
- t = _useTranslation.t;
726
791
  var _useState = React.useState(false),
727
792
  _useState2 = _slicedToArray(_useState, 2),
728
793
  open = _useState2[0],
729
794
  setOpen = _useState2[1];
730
795
  var timeoutRef = React.useRef(null);
796
+ var _useBreakpoints = useBreakpoints(),
797
+ isSize = _useBreakpoints.isSize;
798
+ var isMobile = isSize("mobile");
731
799
  var _useFetchLoggedInOrga = useFetchLoggedInOrganizations(initializers.globalProps === null || initializers.globalProps === void 0 || (_globalProps$user = initializers.globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.email),
732
800
  _useFetchLoggedInOrga2 = _useFetchLoggedInOrga.data,
733
801
  _useFetchLoggedInOrga3 = _useFetchLoggedInOrga2 === void 0 ? {} : _useFetchLoggedInOrga2,
@@ -742,15 +810,22 @@ var OrganizationSwitcher = function OrganizationSwitcher() {
742
810
  return setOpen(false);
743
811
  }, 150);
744
812
  }, []);
745
- var isCurrentSubdomain = function isCurrentSubdomain(link) {
746
- try {
747
- var currentSubdomain = window.location.hostname.split(".")[0];
748
- var linkSubdomain = new URL(link).hostname.split(".")[0];
749
- return currentSubdomain === linkSubdomain;
750
- } catch (_unused) {
751
- return false;
752
- }
753
- };
813
+ if (isMobile) {
814
+ return /*#__PURE__*/jsxRuntime.jsxs(primitives.Collapsible, {
815
+ open: open,
816
+ onOpenChange: setOpen,
817
+ children: [/*#__PURE__*/jsxRuntime.jsx(primitives.CollapsibleTrigger, {
818
+ asChild: true,
819
+ children: /*#__PURE__*/jsxRuntime.jsx(MenuButton$3, {})
820
+ }), /*#__PURE__*/jsxRuntime.jsx(primitives.CollapsibleContent, {
821
+ className: "flex flex-col gap-0.5 ps-6 pt-1",
822
+ children: /*#__PURE__*/jsxRuntime.jsx(OrganizationItems, {
823
+ authAppUrl: authAppUrl,
824
+ organizations: organizations
825
+ })
826
+ })]
827
+ });
828
+ }
754
829
  return /*#__PURE__*/jsxRuntime.jsxs(primitives.Popover, {
755
830
  open: open,
756
831
  onOpenChange: setOpen,
@@ -765,7 +840,7 @@ var OrganizationSwitcher = function OrganizationSwitcher() {
765
840
  onMouseEnter: handleMouseEnter,
766
841
  onMouseLeave: handleMouseLeave
767
842
  })
768
- }), /*#__PURE__*/jsxRuntime.jsxs(primitives.PopoverContent, {
843
+ }), /*#__PURE__*/jsxRuntime.jsx(primitives.PopoverContent, {
769
844
  align: "center",
770
845
  className: "z-[99999] w-56 gap-0.5 p-1",
771
846
  side: "right",
@@ -775,28 +850,10 @@ var OrganizationSwitcher = function OrganizationSwitcher() {
775
850
  onOpenAutoFocus: function onOpenAutoFocus(e) {
776
851
  return e.preventDefault();
777
852
  },
778
- children: [organizations === null || organizations === void 0 ? void 0 : organizations.map(function (organization) {
779
- return /*#__PURE__*/jsxRuntime.jsxs("a", {
780
- href: organization.organizationUrl,
781
- rel: "noreferrer",
782
- target: "_blank",
783
- className: classnames("hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium", {
784
- "text-green-600": isCurrentSubdomain(organization.organizationUrl)
785
- }),
786
- children: [organization.orgName, isCurrentSubdomain(organization.organizationUrl) && /*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.Badge, {
787
- variant: "default",
788
- children: [/*#__PURE__*/jsxRuntime.jsx(CircleCheck, {
789
- size: 12
790
- }), t("neetoMolecules.sidebar.organizationSwitcher.signedin")]
791
- })]
792
- }, organization.userId);
793
- }), /*#__PURE__*/jsxRuntime.jsx("a", {
794
- className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
795
- href: authAppUrl,
796
- rel: "noreferrer",
797
- target: "_blank",
798
- children: t("neetoMolecules.sidebar.organizationSwitcher.addAccount")
799
- })]
853
+ children: /*#__PURE__*/jsxRuntime.jsx(OrganizationItems, {
854
+ authAppUrl: authAppUrl,
855
+ organizations: organizations
856
+ })
800
857
  })]
801
858
  });
802
859
  };
@@ -855,13 +912,10 @@ var Dropdown = function Dropdown() {
855
912
  })
856
913
  }), /*#__PURE__*/jsxRuntime.jsx(primitives.PopoverContent, {
857
914
  align: "start",
858
- className: "z-[99999] w-[calc(100vw-25rem)] max-w-none overflow-y-auto rounded-xl p-0",
915
+ 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",
859
916
  collisionPadding: 16,
860
917
  side: "right",
861
918
  sideOffset: 8,
862
- style: {
863
- maxHeight: "var(--radix-popover-content-available-height)"
864
- },
865
919
  onMouseEnter: handleMouseEnter,
866
920
  onMouseLeave: handleMouseLeave,
867
921
  onOpenAutoFocus: function onOpenAutoFocus(e) {
@@ -908,10 +962,15 @@ var ProfileHeader = function ProfileHeader(_ref) {
908
962
  "data-testid": "floating-action-menu-header-user-name",
909
963
  title: name,
910
964
  children: neetoCist.truncate(name, 18)
911
- }), email && /*#__PURE__*/jsxRuntime.jsx("span", {
912
- className: "text-muted-foreground w-full truncate text-xs leading-tight",
913
- "data-testid": "floating-action-menu-header-user-email",
914
- children: email
965
+ }), email && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
966
+ asChild: true,
967
+ className: "w-full truncate leading-tight",
968
+ color: "muted",
969
+ variant: "caption",
970
+ children: /*#__PURE__*/jsxRuntime.jsx("span", {
971
+ "data-testid": "floating-action-menu-header-user-email",
972
+ children: email
973
+ })
915
974
  })]
916
975
  })]
917
976
  });
@@ -925,14 +984,14 @@ var MenuButton$1 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
925
984
  otherProps = _objectWithoutProperties(_ref, _excluded$1);
926
985
  return /*#__PURE__*/jsxRuntime.jsxs("button", _objectSpread$4(_objectSpread$4({
927
986
  ref: ref,
928
- className: "hover:bg-accent flex w-full items-center gap-2 rounded-md px-2.5 py-2 transition-colors",
987
+ className: "group hover:bg-accent flex w-full items-center gap-2 rounded-md px-2.5 py-2 transition-colors",
929
988
  "data-testid": "profile-expand-menu-button",
930
989
  type: "button"
931
990
  }, otherProps), {}, {
932
991
  children: [/*#__PURE__*/jsxRuntime.jsx(ProfileHeader, {
933
992
  profileInfo: profileInfo
934
993
  }), /*#__PURE__*/jsxRuntime.jsx(chevronRight.ChevronRight, {
935
- className: "shrink-0 rtl:scale-x-[-1]",
994
+ className: "shrink-0 transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
936
995
  size: 18
937
996
  })]
938
997
  }));
@@ -968,11 +1027,33 @@ var LEGACY_THEMES = {
968
1027
  };
969
1028
  var NEETO_AUTH_BILLING_INFO_URL = "/neeto_sso/api/v1/subscription/billing";
970
1029
 
971
- var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
1030
+ var ProfileItems = reactUtils.withT(function (_ref) {
972
1031
  var _window$globalProps;
973
- var profileInfo = _ref.profileInfo;
974
- var _useTranslation = reactI18next.useTranslation(),
975
- t = _useTranslation.t;
1032
+ var t = _ref.t,
1033
+ onProfileClick = _ref.onProfileClick;
1034
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1035
+ children: [/*#__PURE__*/jsxRuntime.jsxs("button", {
1036
+ className: MENU_ITEM_CLASS,
1037
+ "data-testid": "profile-my-profile-button",
1038
+ type: "button",
1039
+ onClick: onProfileClick,
1040
+ children: [/*#__PURE__*/jsxRuntime.jsx(user.User, {
1041
+ size: 18
1042
+ }), t("neetoMolecules.sidebar.myProfile")]
1043
+ }), ((_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__*/jsxRuntime.jsxs("a", {
1044
+ className: MENU_ITEM_CLASS,
1045
+ "data-testid": "profile-cancel-account-button",
1046
+ href: DELETE_WORKSPACE_URL,
1047
+ rel: "noreferrer",
1048
+ target: "_blank",
1049
+ children: [/*#__PURE__*/jsxRuntime.jsx(CircleX, {
1050
+ size: 18
1051
+ }), t("neetoMolecules.sidebar.cancelAccount")]
1052
+ })]
1053
+ });
1054
+ });
1055
+ var ProfileExpandMenu = function ProfileExpandMenu(_ref2) {
1056
+ var profileInfo = _ref2.profileInfo;
976
1057
  var _useState = React.useState(false),
977
1058
  _useState2 = _slicedToArray(_useState, 2),
978
1059
  open = _useState2[0],
@@ -981,6 +1062,9 @@ var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
981
1062
  _Profile$usePaneState2 = _slicedToArray(_Profile$usePaneState, 2),
982
1063
  setIsProfilePaneOpen = _Profile$usePaneState2[1];
983
1064
  var timeoutRef = React.useRef(null);
1065
+ var _useBreakpoints = useBreakpoints(),
1066
+ isSize = _useBreakpoints.isSize;
1067
+ var isMobile = isSize("mobile");
984
1068
  var handleMouseEnter = React.useCallback(function () {
985
1069
  clearTimeout(timeoutRef.current);
986
1070
  setOpen(true);
@@ -990,6 +1074,26 @@ var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
990
1074
  return setOpen(false);
991
1075
  }, 150);
992
1076
  }, []);
1077
+ var onProfileClick = function onProfileClick() {
1078
+ return setIsProfilePaneOpen(true);
1079
+ };
1080
+ if (isMobile) {
1081
+ return /*#__PURE__*/jsxRuntime.jsxs(primitives.Collapsible, {
1082
+ open: open,
1083
+ onOpenChange: setOpen,
1084
+ children: [/*#__PURE__*/jsxRuntime.jsx(primitives.CollapsibleTrigger, {
1085
+ asChild: true,
1086
+ children: /*#__PURE__*/jsxRuntime.jsx(MenuButton$1, {
1087
+ profileInfo: profileInfo
1088
+ })
1089
+ }), /*#__PURE__*/jsxRuntime.jsx(primitives.CollapsibleContent, {
1090
+ className: "flex flex-col gap-0.5 ps-6 pt-1",
1091
+ children: /*#__PURE__*/jsxRuntime.jsx(ProfileItems, {
1092
+ onProfileClick: onProfileClick
1093
+ })
1094
+ })]
1095
+ });
1096
+ }
993
1097
  return /*#__PURE__*/jsxRuntime.jsxs(primitives.Popover, {
994
1098
  open: open,
995
1099
  onOpenChange: setOpen,
@@ -1005,7 +1109,7 @@ var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
1005
1109
  onMouseEnter: handleMouseEnter,
1006
1110
  onMouseLeave: handleMouseLeave
1007
1111
  })
1008
- }), /*#__PURE__*/jsxRuntime.jsxs(primitives.PopoverContent, {
1112
+ }), /*#__PURE__*/jsxRuntime.jsx(primitives.PopoverContent, {
1009
1113
  align: "center",
1010
1114
  className: "z-[99999] w-56 gap-0.5 p-1",
1011
1115
  side: "right",
@@ -1015,26 +1119,9 @@ var ProfileExpandMenu = function ProfileExpandMenu(_ref) {
1015
1119
  onOpenAutoFocus: function onOpenAutoFocus(e) {
1016
1120
  return e.preventDefault();
1017
1121
  },
1018
- children: [/*#__PURE__*/jsxRuntime.jsxs("button", {
1019
- className: MENU_ITEM_CLASS,
1020
- "data-testid": "profile-my-profile-button",
1021
- type: "button",
1022
- onClick: function onClick() {
1023
- return setIsProfilePaneOpen(true);
1024
- },
1025
- children: [/*#__PURE__*/jsxRuntime.jsx(user.User, {
1026
- size: 18
1027
- }), t("neetoMolecules.sidebar.myProfile")]
1028
- }), ((_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__*/jsxRuntime.jsxs("a", {
1029
- className: MENU_ITEM_CLASS,
1030
- "data-testid": "profile-cancel-account-button",
1031
- href: DELETE_WORKSPACE_URL,
1032
- rel: "noreferrer",
1033
- target: "_blank",
1034
- children: [/*#__PURE__*/jsxRuntime.jsx(CircleX, {
1035
- size: 18
1036
- }), t("neetoMolecules.sidebar.cancelAccount")]
1037
- })]
1122
+ children: /*#__PURE__*/jsxRuntime.jsx(ProfileItems, {
1123
+ onProfileClick: onProfileClick
1124
+ })
1038
1125
  })]
1039
1126
  });
1040
1127
  };
@@ -1115,8 +1202,10 @@ var ThemeSwitcher = function ThemeSwitcher() {
1115
1202
  };
1116
1203
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
1117
1204
  className: "bg-muted/40 flex items-center justify-between gap-3 rounded-b-xl px-4 py-3",
1118
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
1119
- className: "text-muted-foreground text-xs font-medium",
1205
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
1206
+ color: "muted",
1207
+ variant: "caption",
1208
+ weight: "medium",
1120
1209
  children: t("neetoMolecules.sidebar.themeSwitcher.label")
1121
1210
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
1122
1211
  className: "bg-muted flex rounded-lg p-0.5",
@@ -1154,7 +1243,7 @@ var MenuButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
1154
1243
  t = _useTranslation.t;
1155
1244
  return /*#__PURE__*/jsxRuntime.jsxs("button", _objectSpread$3(_objectSpread$3({
1156
1245
  ref: ref,
1157
- className: "hover:bg-accent flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-start",
1246
+ className: "group hover:bg-accent flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-start",
1158
1247
  "data-testid": "workspace-display",
1159
1248
  type: "button"
1160
1249
  }, props), {}, {
@@ -1163,27 +1252,64 @@ var MenuButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
1163
1252
  children: [/*#__PURE__*/jsxRuntime.jsx("span", {
1164
1253
  className: "text-sm font-medium",
1165
1254
  children: t("neetoMolecules.sidebar.workspace")
1166
- }), ((_globalProps$organiza = initializers.globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.name) && /*#__PURE__*/jsxRuntime.jsx("span", {
1167
- className: "text-muted-foreground text-xs",
1168
- children: initializers.globalProps.organization.name
1255
+ }), ((_globalProps$organiza = initializers.globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.name) && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
1256
+ asChild: true,
1257
+ color: "muted",
1258
+ variant: "caption",
1259
+ children: /*#__PURE__*/jsxRuntime.jsx("span", {
1260
+ children: initializers.globalProps.organization.name
1261
+ })
1169
1262
  })]
1170
1263
  }), /*#__PURE__*/jsxRuntime.jsx(chevronRight.ChevronRight, {
1171
- className: "shrink-0 rtl:scale-x-[-1]",
1264
+ className: "shrink-0 transition-transform group-data-[state=open]:rotate-90 rtl:scale-x-[-1]",
1172
1265
  size: 18
1173
1266
  })]
1174
1267
  }));
1175
1268
  });
1176
1269
  MenuButton.displayName = "WorkspaceMenuButton";
1177
1270
 
1178
- var WorkspaceMenu = function WorkspaceMenu() {
1271
+ var WorkspaceItems = reactUtils.withT(function (_ref) {
1179
1272
  var _globalProps$organiza;
1180
- var _useTranslation = reactI18next.useTranslation(),
1181
- t = _useTranslation.t;
1273
+ var t = _ref.t;
1274
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1275
+ children: [/*#__PURE__*/jsxRuntime.jsx("a", {
1276
+ className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
1277
+ "data-testid": "profile-organization-settings-button",
1278
+ href: MY_ORGANIZATION_URL,
1279
+ rel: "noreferrer",
1280
+ target: "_blank",
1281
+ children: t("neetoMolecules.sidebar.workspaceMenu.settings")
1282
+ }), ((_globalProps$organiza = initializers.globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.subdomain) && /*#__PURE__*/jsxRuntime.jsx("div", {
1283
+ className: "px-2.5 py-2",
1284
+ children: /*#__PURE__*/jsxRuntime.jsxs("span", {
1285
+ className: "flex flex-col gap-0.5 text-start",
1286
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
1287
+ className: "text-sm font-medium",
1288
+ children: t("neetoMolecules.sidebar.workspaceMenu.subdomain")
1289
+ }), /*#__PURE__*/jsxRuntime.jsxs("span", {
1290
+ className: "text-muted-foreground flex items-center gap-1 text-xs",
1291
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
1292
+ className: "min-w-0 truncate",
1293
+ children: initializers.globalProps.organization.subdomain
1294
+ }), /*#__PURE__*/jsxRuntime.jsx(v2_CopyToClipboardButton, {
1295
+ className: "flex-shrink-0",
1296
+ value: initializers.globalProps.organization.subdomain,
1297
+ variant: "ghost"
1298
+ })]
1299
+ })]
1300
+ })
1301
+ })]
1302
+ });
1303
+ });
1304
+ var WorkspaceMenu = function WorkspaceMenu() {
1182
1305
  var _useState = React.useState(false),
1183
1306
  _useState2 = _slicedToArray(_useState, 2),
1184
1307
  open = _useState2[0],
1185
1308
  setOpen = _useState2[1];
1186
1309
  var timeoutRef = React.useRef(null);
1310
+ var _useBreakpoints = useBreakpoints(),
1311
+ isSize = _useBreakpoints.isSize;
1312
+ var isMobile = isSize("mobile");
1187
1313
  var handleMouseEnter = React.useCallback(function () {
1188
1314
  clearTimeout(timeoutRef.current);
1189
1315
  setOpen(true);
@@ -1193,6 +1319,19 @@ var WorkspaceMenu = function WorkspaceMenu() {
1193
1319
  return setOpen(false);
1194
1320
  }, 150);
1195
1321
  }, []);
1322
+ if (isMobile) {
1323
+ return /*#__PURE__*/jsxRuntime.jsxs(primitives.Collapsible, {
1324
+ open: open,
1325
+ onOpenChange: setOpen,
1326
+ children: [/*#__PURE__*/jsxRuntime.jsx(primitives.CollapsibleTrigger, {
1327
+ asChild: true,
1328
+ children: /*#__PURE__*/jsxRuntime.jsx(MenuButton, {})
1329
+ }), /*#__PURE__*/jsxRuntime.jsx(primitives.CollapsibleContent, {
1330
+ className: "flex flex-col gap-0.5 ps-6 pt-1",
1331
+ children: /*#__PURE__*/jsxRuntime.jsx(WorkspaceItems, {})
1332
+ })]
1333
+ });
1334
+ }
1196
1335
  return /*#__PURE__*/jsxRuntime.jsxs(primitives.Popover, {
1197
1336
  open: open,
1198
1337
  onOpenChange: setOpen,
@@ -1207,7 +1346,7 @@ var WorkspaceMenu = function WorkspaceMenu() {
1207
1346
  onMouseEnter: handleMouseEnter,
1208
1347
  onMouseLeave: handleMouseLeave
1209
1348
  })
1210
- }), /*#__PURE__*/jsxRuntime.jsxs(primitives.PopoverContent, {
1349
+ }), /*#__PURE__*/jsxRuntime.jsx(primitives.PopoverContent, {
1211
1350
  align: "center",
1212
1351
  className: "z-[99999] w-56 gap-0.5 p-1",
1213
1352
  side: "right",
@@ -1217,33 +1356,7 @@ var WorkspaceMenu = function WorkspaceMenu() {
1217
1356
  onOpenAutoFocus: function onOpenAutoFocus(e) {
1218
1357
  return e.preventDefault();
1219
1358
  },
1220
- children: [/*#__PURE__*/jsxRuntime.jsx("a", {
1221
- className: "hover:bg-accent flex h-9 w-full items-center gap-2 rounded-md px-2.5 text-sm font-medium",
1222
- "data-testid": "profile-organization-settings-button",
1223
- href: MY_ORGANIZATION_URL,
1224
- rel: "noreferrer",
1225
- target: "_blank",
1226
- children: t("neetoMolecules.sidebar.workspaceMenu.settings")
1227
- }), ((_globalProps$organiza = initializers.globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.subdomain) && /*#__PURE__*/jsxRuntime.jsx("div", {
1228
- className: "px-3 py-2",
1229
- children: /*#__PURE__*/jsxRuntime.jsxs("span", {
1230
- className: "flex flex-col gap-0.5 text-start",
1231
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
1232
- className: "text-sm font-medium",
1233
- children: t("neetoMolecules.sidebar.workspaceMenu.subdomain")
1234
- }), /*#__PURE__*/jsxRuntime.jsxs("span", {
1235
- className: "text-muted-foreground flex items-center gap-1 text-xs",
1236
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
1237
- className: "min-w-0 truncate",
1238
- children: initializers.globalProps.organization.subdomain
1239
- }), /*#__PURE__*/jsxRuntime.jsx(v2_CopyToClipboardButton, {
1240
- className: "flex-shrink-0",
1241
- value: initializers.globalProps.organization.subdomain,
1242
- variant: "ghost"
1243
- })]
1244
- })]
1245
- })
1246
- })]
1359
+ children: /*#__PURE__*/jsxRuntime.jsx(WorkspaceItems, {})
1247
1360
  })]
1248
1361
  });
1249
1362
  };
@@ -1480,7 +1593,7 @@ var ProfileButton = function ProfileButton(_ref) {
1480
1593
  })
1481
1594
  })]
1482
1595
  }), neetoCist.isPresent(changesCount) && /*#__PURE__*/jsxRuntime.jsx("span", {
1483
- 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",
1596
+ 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",
1484
1597
  "data-testid": "help-icon-changes-count",
1485
1598
  children: changesCount
1486
1599
  }), /*#__PURE__*/jsxRuntime.jsx(Modal, {