@camunda/camunda-composite-components 0.20.8 → 0.20.9

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/camunda-composite-components",
3
- "version": "0.20.8",
3
+ "version": "0.20.9",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"
@@ -32,7 +32,7 @@ export const HelpCenterTile = ({ tile, tabType, origin, mixpanelTrack }) => {
32
32
  }, className: "cds--layer-two", children: [_jsxs(Stack, { orientation: "vertical", gap: 3, children: [_jsx("img", { src: image, alt: title }), _jsxs(TileStack, { children: [_jsx(TileHeading, { children: title }), _jsx(TileDescription, { children: description }), _jsx("div", { style: { marginLeft: "-4px", marginTop: "12px" }, children: (() => {
33
33
  let content = _jsx("div", { style: { height: "32px" } });
34
34
  if (timeToComplete) {
35
- content = (_jsx(Tag, { type: "warm-gray", size: "sm", title: timeToComplete, children: timeToComplete }));
35
+ content = (_jsx(Tag, { type: "warm-gray", size: "sm", children: timeToComplete }));
36
36
  }
37
37
  return content;
38
38
  })() })] })] }), _jsx(Button, { size: "sm", as: "a", href: link, target: "_blank", onClick: () => {
@@ -17,6 +17,10 @@ const HeaderPanel = styled(CarbonHeaderPanel) `
17
17
  grid-auto-rows: max-content 1fr;
18
18
  overflow-y: auto;
19
19
  overflow-x: hidden;
20
+
21
+ .cds--overflow-menu-options {
22
+ width: 165px;
23
+ }
20
24
  `;
21
25
  const BottomElements = styled.div `
22
26
  align-self: end;
@@ -72,7 +76,7 @@ const C3NavigationSideBar = (props) => {
72
76
  , {
73
77
  // eslint-disable-next-line
74
78
  // @ts-ignore
75
- ref: setPanelRef, expanded: isOpen, id: id, style: { width: isOpen ? "calc(16rem)" : "0" }, children: [_jsxs(Stack, { children: [children, sideBar.elements &&
79
+ ref: setPanelRef, expanded: isOpen, id: id, style: { width: isOpen ? "calc(16rem)" : "0" }, "data-floating-menu-container": true, children: [_jsxs(Stack, { children: [children, sideBar.elements &&
76
80
  sideBar.elements.length > 0 &&
77
81
  "customElements" in sideBar &&
78
82
  sideBar.customElements &&
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from "react";
3
- import { Dropdown, Modal, OverflowMenu, OverflowMenuItem, Popover, PopoverContent, } from "@carbon/react";
2
+ import { Dropdown, Modal, OverflowMenu, OverflowMenuItem, Tooltip, } from "@carbon/react";
4
3
  import styled from "styled-components";
5
4
  export const ActiveOrgWrapperCustom = styled.div `
6
5
  padding: 1.5rem 1rem 15px;
@@ -39,28 +38,18 @@ export const ActiveOrgName = styled.div `
39
38
  export const ConfirmLeaveModal = ({ isOpen, onConfirm, onCancel, orgName, loadingStatus }) => {
40
39
  return (_jsxs(Modal, { danger: true, open: isOpen, modalHeading: "Leave organization", primaryButtonText: "Leave", secondaryButtonText: "Cancel", closeButtonLabel: "Cancel", loadingStatus: loadingStatus, onRequestClose: onCancel, onRequestSubmit: onConfirm, onSecondarySubmit: onCancel, loadingDescription: "Leaving", children: [_jsxs("p", { children: ["Are you sure you want to leave ", _jsx("strong", { children: orgName }), "?"] }), _jsx("br", {}), _jsx("p", { children: "Leaving this organization will remove you from all associated teams and projects. To regain access you would need to reach out to the admin/owner of this organization." })] }));
41
40
  };
42
- const PopoverWrapper = styled(Popover) `
43
- max-width: 11rem;
44
-
45
- .cds--popover-content {
46
- max-width: 176px;
47
- padding: 0.5rem 1rem;
48
- }
49
- `;
50
- const StyledOverflowMenu = styled(OverflowMenu) `
51
- .cds--overflow-menu-options {
52
- width: 165px;
41
+ const _Tooltip = styled(Tooltip) `
42
+ .cds--tooltip-content {
43
+ max-width: 200px;
53
44
  }
54
45
  `;
55
46
  export const ManageOrgOverflowMenu = ({ canManage, canLeave, isLastOrg, isOrgMember, onManage, onRequestToLeave, orgName, }) => {
56
- const [isPopoverShown, setIsPopoverShown] = React.useState(false);
57
- const leaveMenuItem = (_jsx(OverflowMenuItem, { itemText: "Leave organization", disabled: !canLeave, onClick: onRequestToLeave, onMouseOver: () => setIsPopoverShown(true), onMouseLeave: () => setIsPopoverShown(false), "aria-label": `Leave organization - ${orgName}` }));
58
- const popoverLabel = !isOrgMember
47
+ const tooltipLabel = !isOrgMember
59
48
  ? "You are not a member of this team. You can only leave teams you are a member of."
60
49
  : isLastOrg
61
50
  ? "You need to be a member of at least one organization. Join a different organization first if you wish to leave."
62
51
  : "Owners cannot leave an organization directly. Assign another user as an owner if you wish to leave.";
63
- return (_jsxs(StyledOverflowMenu, { size: "sm", flipped: true, "aria-label": "Organization options menu", "data-floating-menu-container": "cds--header-panel", align: "top-right", children: [canManage && (_jsx(OverflowMenuItem, { itemText: "Manage organization", onClick: onManage, "aria-label": `Manage organization - ${orgName}` })), canLeave ? (leaveMenuItem) : (_jsxs(PopoverWrapper, { open: isPopoverShown, label: popoverLabel, align: "bottom-right", children: [leaveMenuItem, _jsx(PopoverContent, { children: popoverLabel })] }))] }));
52
+ return (_jsxs(OverflowMenu, { size: "sm", flipped: true, "aria-label": "Organization options menu", align: "top-end", children: [canManage && (_jsx(OverflowMenuItem, { itemText: "Manage organization", onClick: onManage, "aria-label": `Manage organization - ${orgName}` })), _jsx(OverflowMenuItem, { itemText: canLeave ? ("Leave organization") : (_jsx(_Tooltip, { label: tooltipLabel, align: "bottom-end", children: _jsx("span", { children: "Leave organization" }) })), disabled: !canLeave, onClick: onRequestToLeave, "aria-label": `Leave organization - ${orgName}` })] }));
64
53
  };
65
54
  export const StyledDropdown = styled(Dropdown) `
66
55
  grid-gap: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/camunda-composite-components",
3
- "version": "0.20.8",
3
+ "version": "0.20.9",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"