@camunda/camunda-composite-components 0.20.2 → 0.20.3
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.
- package/lib/esm/package.json +27 -28
- package/lib/esm/src/api/clusters.js +1 -1
- package/lib/esm/src/api/endpoints.const.js +2 -0
- package/lib/esm/src/api/help-center.d.ts +1 -1
- package/lib/esm/src/api/status.js +1 -1
- package/lib/esm/src/assets/c3-icons.d.ts +4 -4
- package/lib/esm/src/assets/c3-icons.js +5 -14
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.d.ts +1 -1
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.js +10 -19
- package/lib/esm/src/components/c3-app-teaser/app-teaster-card.d.ts +1 -1
- package/lib/esm/src/components/c3-app-teaser/app-teaster-card.js +4 -8
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.d.ts +1 -1
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.js +2 -2
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.d.ts +1 -1
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.js +8 -9
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.d.ts +2 -1
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.js +9 -8
- package/lib/esm/src/components/c3-data-table/c3-data-table.js +84 -70
- package/lib/esm/src/components/c3-data-table/c3-data-table.types.d.ts +3 -2
- package/lib/esm/src/components/c3-data-table/link-button/link-button.js +2 -4
- package/lib/esm/src/components/c3-data-table/link-button/link-button.types.d.ts +0 -1
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.js +9 -29
- package/lib/esm/src/components/c3-help-center/c3-help-center-provider.js +3 -2
- package/lib/esm/src/components/c3-help-center/c3-help-center.js +3 -7
- package/lib/esm/src/components/c3-help-center/help-center-hint.d.ts +1 -1
- package/lib/esm/src/components/c3-help-center/help-center-hint.js +6 -10
- package/lib/esm/src/components/c3-help-center/help-center.d.ts +1 -1
- package/lib/esm/src/components/c3-help-center/help-center.js +69 -102
- package/lib/esm/src/components/c3-help-center/tabs/feedback.js +41 -89
- package/lib/esm/src/components/c3-help-center/tabs/tabContent.js +2 -5
- package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.js +4 -5
- package/lib/esm/src/components/c3-help-center/tile.js +16 -30
- package/lib/esm/src/components/c3-navigation/c3-info-button.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/c3-info-button.js +2 -3
- package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.js +9 -9
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.js +72 -87
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.d.ts +1 -5
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.js +1 -0
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.js +20 -28
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js +23 -27
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.js +29 -37
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js +18 -24
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js +3 -2
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.js +13 -37
- package/lib/esm/src/components/c3-navigation/c3-navigation.js +78 -120
- package/lib/esm/src/components/c3-navigation/c3-navigation.types.d.ts +5 -6
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.js +10 -18
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.js +4 -4
- package/lib/esm/src/components/c3-navigation/c3-org-name.js +2 -4
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.js +48 -60
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.js +23 -13
- package/lib/esm/src/components/c3-navigation/helpers.d.ts +2 -3
- package/lib/esm/src/components/c3-navigation/index.d.ts +1 -2
- package/lib/esm/src/components/c3-navigation/stories/story-helpers.js +3 -5
- package/lib/esm/src/components/c3-navigation/stories/story-templates.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/stories/story-templates.js +23 -29
- package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.js +2 -1
- package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.js +25 -38
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.js +45 -56
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.js +24 -34
- package/lib/esm/src/components/c3-onboarding-survey/elements/textField.js +4 -9
- package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.d.ts +9 -9
- package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.js +31 -42
- package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.d.ts +9 -9
- package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.js +27 -39
- package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.js +9 -13
- package/lib/esm/src/components/c3-onboarding-survey/step.js +27 -27
- package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.js +8 -17
- package/lib/esm/src/components/c3-page/c3-page.js +2 -9
- package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.js +4 -5
- package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.d.ts +2 -0
- package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.js +13 -0
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts +1 -1
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.js +5 -4
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.js +3 -2
- package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.js +3 -4
- package/lib/esm/src/contexts/c3-cluster-update-manager.d.ts +1 -1
- package/lib/esm/src/contexts/c3-cluster-update-manager.js +3 -2
- package/lib/esm/src/hooks/useApi.d.ts +4 -5
- package/lib/esm/src/index.d.ts +1 -0
- package/lib/esm/src/index.js +1 -0
- package/package.json +20 -27
- package/README.md +0 -197
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
2
3
|
import { Close } from "@carbon/react/icons";
|
|
3
4
|
import { styled } from "styled-components";
|
|
4
5
|
import { useOnClickOutside } from "../helpers";
|
|
@@ -48,33 +49,29 @@ const OrgPickerModal = ({ isOpen, onCancel, orgs, activeOrg, loadingStatus, appT
|
|
|
48
49
|
return (!isConsoleOrModeler &&
|
|
49
50
|
getClustersToRender(clusters, activeOrg, appToNavigateTo).length === 0);
|
|
50
51
|
});
|
|
51
|
-
return (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return (React.createElement(SideNavMenu, { key: org?.uuid, title: org?.name }, clustersToRender?.map((cluster) => {
|
|
75
|
-
return (React.createElement(SideNavMenuItem, { key: cluster.uuid, href: cluster.endpoints[appToNavigateTo] }, cluster.name));
|
|
76
|
-
})));
|
|
77
|
-
}))))));
|
|
52
|
+
return (_jsx(Modal, { danger: true, open: isOpen, modalHeading: "Select a team", onRequestClose: onCancel, passiveModal: true, loadingStatus: loadingStatus, size: "sm", children: _jsxs("div", { style: { marginLeft: "-1rem" }, children: [_jsx(FormLabel, { style: {
|
|
53
|
+
paddingTop: "15px",
|
|
54
|
+
paddingLeft: "1rem",
|
|
55
|
+
}, children: hasNoTeams
|
|
56
|
+
? "No teams found"
|
|
57
|
+
: hasNoTeamsWithClusters
|
|
58
|
+
? "No teams with clusters found"
|
|
59
|
+
: "Teams" }), _jsx("div", { style: {
|
|
60
|
+
marginTop: "-1rem",
|
|
61
|
+
}, children: _jsx(SideNavItems, { children: Object.values(orgs ?? {})?.map(({ org, clusters }) => {
|
|
62
|
+
const isConsoleOrModeler = [APPS[0], APPS[1]].includes(appToNavigateTo);
|
|
63
|
+
const toOrg = getOrgLink(appToNavigateTo, org.uuid, domain ?? "");
|
|
64
|
+
if (isConsoleOrModeler) {
|
|
65
|
+
return (_jsx(SideNavLink, { href: toOrg, children: org?.name }, org?.uuid));
|
|
66
|
+
}
|
|
67
|
+
const clustersToRender = getClustersToRender(clusters, activeOrg, appToNavigateTo);
|
|
68
|
+
if (clustersToRender.length === 0) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
return (_jsx(SideNavMenu, { title: org?.name, children: clustersToRender?.map((cluster) => {
|
|
72
|
+
return (_jsx(SideNavMenuItem, { href: cluster.endpoints[appToNavigateTo], children: cluster.name }, cluster.uuid));
|
|
73
|
+
}) }, org?.uuid));
|
|
74
|
+
}) }) })] }) }));
|
|
78
75
|
};
|
|
79
76
|
const SubElementWrapper = styled.ul `
|
|
80
77
|
.cds--side-nav__submenu[aria-expanded="true"] + .cds--side-nav__menu {
|
|
@@ -294,71 +291,59 @@ export const C3NavigationAppBar = ({ app: appProps, appBar, forwardRef, navbar,
|
|
|
294
291
|
const appBarElements = appBar.elements || (clusters || clustersByOrgId ? appElements : null);
|
|
295
292
|
const [isOrgPickerModalOpen, setIsOrgPickerModalOpen] = useState(false);
|
|
296
293
|
const orgName = activeOrg?.name || navbar.orgName;
|
|
297
|
-
return (
|
|
298
|
-
React.createElement(HeaderGlobalAction
|
|
299
|
-
// eslint-disable-next-line
|
|
300
|
-
// @ts-ignore
|
|
301
|
-
, {
|
|
294
|
+
return (_jsxs(_Fragment, { children: [_jsx(HeaderGlobalAction
|
|
302
295
|
// eslint-disable-next-line
|
|
303
296
|
// @ts-ignore
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
orgName && (React.createElement("li", null,
|
|
317
|
-
React.createElement(OrgNameWrapper, null,
|
|
318
|
-
React.createElement(FormLabel, null, "Organization"),
|
|
319
|
-
React.createElement(ActiveOrgName, { className: "textPrimary", title: orgName }, orgName)))),
|
|
320
|
-
React.createElement("li", null, navbar.elements.length > 0 && (React.createElement(HeaderSideNavItems, { hasDivider: true }, navbar.elements.map((element) => (React.createElement(HeaderMenuItem, { key: element.key, as: element.routeProps && forwardRef, isActive: element.isCurrentPage, ...element.routeProps, onClick: () => {
|
|
321
|
-
if (element.routeProps.onClick) {
|
|
322
|
-
element.routeProps.onClick();
|
|
323
|
-
}
|
|
324
|
-
if (appBar.closeOnClick !== false) {
|
|
325
|
-
toggleAppbar(false);
|
|
326
|
-
}
|
|
327
|
-
} }, element.label)))))),
|
|
328
|
-
React.createElement("li", null,
|
|
329
|
-
React.createElement(SubElementWrapper, { "$expanded": appBar.isOpen }, appBarElements &&
|
|
330
|
-
appBarElements.map((element) => {
|
|
331
|
-
if (element.subElements && element.subElements.length > 0) {
|
|
332
|
-
return (React.createElement(SideNavMenu, { large: true, title: element.label, key: element.key }, element.subElements.map((subElement) => (React.createElement(SideNavMenuItem, { as: subElement.routeProps && forwardRef, key: subElement.key, href: subElement.href, target: subElement.href ? subElement.target : undefined, isActive: subElement.isActive || subElement.active, ...subElement.routeProps, onClick: () => {
|
|
333
|
-
if (subElement.onClick) {
|
|
334
|
-
subElement.onClick();
|
|
335
|
-
}
|
|
336
|
-
if (subElement.routeProps?.onClick) {
|
|
337
|
-
subElement.routeProps.onClick();
|
|
338
|
-
}
|
|
339
|
-
if (appBar.closeOnClick !== false) {
|
|
340
|
-
toggleAppbar(false);
|
|
341
|
-
}
|
|
342
|
-
if (appBar.elementClicked) {
|
|
343
|
-
appBar.elementClicked(subElement.key);
|
|
344
|
-
}
|
|
345
|
-
} }, subElement.label)))));
|
|
346
|
-
}
|
|
347
|
-
else {
|
|
348
|
-
return (React.createElement(SideNavLink, { as: element.routeProps && forwardRef, key: element.key, large: true, isActive: element.active, ...element.routeProps, onClick: () => {
|
|
349
|
-
if (element.onClick) {
|
|
350
|
-
element.onClick();
|
|
351
|
-
}
|
|
352
|
-
if (element.routeProps?.onClick) {
|
|
297
|
+
, {
|
|
298
|
+
// eslint-disable-next-line
|
|
299
|
+
// @ts-ignore
|
|
300
|
+
ref: iconRef, "aria-label": "Camunda components", isActive: appBar.isOpen, onClick: () => {
|
|
301
|
+
toggleAppbar(!appBar.isOpen);
|
|
302
|
+
}, tooltipAlignment: "start",
|
|
303
|
+
/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
|
|
304
|
+
/* @ts-ignore */
|
|
305
|
+
leaveDelayMs: 100, children: appBar.isOpen ? _jsx(Close, { size: 20 }) : _jsx(C3AppMenuIcon, { size: 20 }) }), _jsx(OrgPickerModal, { activeOrg: activeOrg, appToNavigateTo: appToNavigateTo, isOpen: isOrgPickerModalOpen, orgs: clustersByOrgId, onCancel: () => {
|
|
306
|
+
setIsOrgPickerModalOpen(false);
|
|
307
|
+
}, loadingStatus: loadingStatus, domain: domain }), _jsx(NavWrapper, { children: _jsx(SideNav, { ref: panelRef, "aria-label": appBar.ariaLabel || "Side Navigation", expanded: appBar.isOpen, isPersistent: false, children: _jsxs(SideNavItems, { children: [orgName && (_jsx("li", { children: _jsxs(OrgNameWrapper, { children: [_jsx(FormLabel, { children: "Organization" }), _jsx(ActiveOrgName, { className: "textPrimary", title: orgName, children: orgName })] }) })), _jsx("li", { children: navbar.elements.length > 0 && (_jsx(HeaderSideNavItems, { hasDivider: true, children: navbar.elements.map((element) => (_jsx(HeaderMenuItem, { as: element.routeProps && forwardRef, isActive: element.isCurrentPage, ...element.routeProps, onClick: () => {
|
|
308
|
+
if (element.routeProps.onClick) {
|
|
353
309
|
element.routeProps.onClick();
|
|
354
310
|
}
|
|
355
311
|
if (appBar.closeOnClick !== false) {
|
|
356
312
|
toggleAppbar(false);
|
|
357
313
|
}
|
|
358
|
-
|
|
359
|
-
|
|
314
|
+
}, children: element.label }, element.key))) })) }), _jsx("li", { children: _jsx(SubElementWrapper, { "$expanded": appBar.isOpen, children: appBarElements &&
|
|
315
|
+
appBarElements.map((element) => {
|
|
316
|
+
if (element.subElements && element.subElements.length > 0) {
|
|
317
|
+
return (_jsx(SideNavMenu, { large: true, title: element.label, children: element.subElements.map((subElement) => (_jsx(SideNavMenuItem, { as: subElement.routeProps && forwardRef, href: subElement.href, target: subElement.href ? subElement.target : undefined, isActive: subElement.isActive || subElement.active, ...subElement.routeProps, onClick: () => {
|
|
318
|
+
if (subElement.onClick) {
|
|
319
|
+
subElement.onClick();
|
|
320
|
+
}
|
|
321
|
+
if (subElement.routeProps?.onClick) {
|
|
322
|
+
subElement.routeProps.onClick();
|
|
323
|
+
}
|
|
324
|
+
if (appBar.closeOnClick !== false) {
|
|
325
|
+
toggleAppbar(false);
|
|
326
|
+
}
|
|
327
|
+
if (appBar.elementClicked) {
|
|
328
|
+
appBar.elementClicked(subElement.key);
|
|
329
|
+
}
|
|
330
|
+
}, children: subElement.label }, subElement.key))) }, element.key));
|
|
360
331
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
332
|
+
else {
|
|
333
|
+
return (_jsx(SideNavLink, { as: element.routeProps && forwardRef, large: true, isActive: element.active, ...element.routeProps, onClick: () => {
|
|
334
|
+
if (element.onClick) {
|
|
335
|
+
element.onClick();
|
|
336
|
+
}
|
|
337
|
+
if (element.routeProps?.onClick) {
|
|
338
|
+
element.routeProps.onClick();
|
|
339
|
+
}
|
|
340
|
+
if (appBar.closeOnClick !== false) {
|
|
341
|
+
toggleAppbar(false);
|
|
342
|
+
}
|
|
343
|
+
if (appBar.elementClicked) {
|
|
344
|
+
appBar.elementClicked(element.key);
|
|
345
|
+
}
|
|
346
|
+
}, href: element.href, target: element.href ? element.target : undefined, children: element.label }, element.key));
|
|
347
|
+
}
|
|
348
|
+
}) }) })] }) }) })] }));
|
|
364
349
|
};
|
|
@@ -5,6 +5,7 @@ export const NavWrapper = styled.div `
|
|
|
5
5
|
display: none;
|
|
6
6
|
}
|
|
7
7
|
`;
|
|
8
|
+
// Use a minimal prop typing to wrap Carbon's SideNav without relying on legacy carbon-components-react types
|
|
8
9
|
export const SideNav = styled(CarbonSideNav) `
|
|
9
10
|
visibility: ${({ expanded }) => (expanded ? "visible" : "hidden")};
|
|
10
11
|
display: grid;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { SwitcherDivider } from "./components";
|
|
3
3
|
import { Help } from "@carbon/react/icons";
|
|
4
4
|
import C3NavigationSideBar from "./c3-navigation-sidebar";
|
|
@@ -8,34 +8,26 @@ const C3InfoSidebar = ({ sideBar, }) => {
|
|
|
8
8
|
const { enableLogs } = useC3UserConfiguration();
|
|
9
9
|
if (version && enableLogs)
|
|
10
10
|
console.warn("The `version` prop in the info sidebar is deprecated and will be removed in a future release. Please set `version` in the `userSideBar` prop instead.");
|
|
11
|
-
return (
|
|
11
|
+
return (_jsx(C3NavigationSideBar, { sideBar: {
|
|
12
12
|
...sideBarProps,
|
|
13
13
|
ariaLabel: sideBarProps.ariaLabel || "Info Sidebar",
|
|
14
|
-
}, icon:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
fontSize: "var(--cds-label-01-font-size)",
|
|
33
|
-
fontWeight: "var(--cds-label-01-font-weight)",
|
|
34
|
-
lineHeight: "var(--cds-label-01-line-height)",
|
|
35
|
-
letterSpacing: "var(--cds-label-01-letter-spacing)",
|
|
36
|
-
} },
|
|
37
|
-
`© Camunda Services GmbH ${new Date().getFullYear()}`,
|
|
38
|
-
React.createElement("br", null),
|
|
39
|
-
" All rights reserved."))) }));
|
|
14
|
+
}, icon: _jsx(Help, { size: 20 }), bottomChildren: version !== undefined && (_jsxs(_Fragment, { children: [_jsx(SwitcherDivider, {}), _jsxs("span", { className: "cds--switcher__item", style: {
|
|
15
|
+
padding: "var(--cds-spacing-05)",
|
|
16
|
+
paddingTop: "var(--cds-spacing-03)",
|
|
17
|
+
paddingBottom: 0,
|
|
18
|
+
color: "var(--cds-text-primary)",
|
|
19
|
+
fontSize: "var(--cds-body-01-font-size)",
|
|
20
|
+
fontWeight: "var(--cds-body-01-font-weight)",
|
|
21
|
+
lineHeight: "var(--cds-body-01-line-height)",
|
|
22
|
+
letterSpacing: "var(--cds-body-01-letter-spacing)",
|
|
23
|
+
}, children: ["Version ", version] }), _jsxs("span", { className: "cds--switcher__item", style: {
|
|
24
|
+
paddingRight: "var(--cds-spacing-05)",
|
|
25
|
+
paddingLeft: "var(--cds-spacing-05)",
|
|
26
|
+
color: "var(--cds-text-secondary)",
|
|
27
|
+
fontSize: "var(--cds-label-01-font-size)",
|
|
28
|
+
fontWeight: "var(--cds-label-01-font-weight)",
|
|
29
|
+
lineHeight: "var(--cds-label-01-line-height)",
|
|
30
|
+
letterSpacing: "var(--cds-label-01-letter-spacing)",
|
|
31
|
+
}, children: [`© Camunda Services GmbH ${new Date().getFullYear()}`, _jsx("br", {}), " All rights reserved."] })] })) }));
|
|
40
32
|
};
|
|
41
33
|
export default C3InfoSidebar;
|
|
@@ -3,7 +3,7 @@ import { C3NavigationSideBarProps } from "./c3-navigation-sidebar.types";
|
|
|
3
3
|
declare const C3NavigationSidebarElement: (props: {
|
|
4
4
|
element: C3NavigationElementProps;
|
|
5
5
|
index: number;
|
|
6
|
-
itemTabIndex?: number
|
|
6
|
+
itemTabIndex?: number;
|
|
7
7
|
sideBar: C3NavigationSideBarProps;
|
|
8
8
|
setSideBarOpen: (open: boolean) => void;
|
|
9
9
|
scrollBarWidth: number;
|
package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
import { Button, SideNavLink } from "@carbon/react";
|
|
2
|
-
import
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
4
|
import { SwitcherDivider } from "./components";
|
|
4
5
|
import styled from "styled-components";
|
|
5
6
|
const Row = styled.div `
|
|
@@ -37,31 +38,26 @@ const C3NavigationSidebarElement = (props) => {
|
|
|
37
38
|
handleSetIsOverflown();
|
|
38
39
|
return () => window.removeEventListener("resize", handleSetIsOverflown);
|
|
39
40
|
}, []);
|
|
40
|
-
return (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
textOverflow: "ellipsis",
|
|
62
|
-
whiteSpace: "nowrap",
|
|
63
|
-
width: "100%",
|
|
64
|
-
} }, props.element.label)),
|
|
65
|
-
overflowMenu)));
|
|
41
|
+
return (_jsxs(_Fragment, { children: [props.element.preceedingDivider && _jsx(SwitcherDivider, {}), _jsxs(Row, { children: [_jsx(Element, { style: {
|
|
42
|
+
width: overflowMenu
|
|
43
|
+
? `calc(14rem - ${props.scrollBarWidth}px)`
|
|
44
|
+
: `calc(16rem - ${props.scrollBarWidth}px)`,
|
|
45
|
+
...(props.index === 0 &&
|
|
46
|
+
(!("elements" in props.sideBar) || !props.sideBar.elements)
|
|
47
|
+
? { marginTop: "1.5rem" }
|
|
48
|
+
: {}),
|
|
49
|
+
}, size: "sm", kind: props.element.kind ?? "ghost", className: `cds--switcher__item ${isActive ? "cds--side-nav__item--active" : ""}`, onClick: () => {
|
|
50
|
+
if (props.element.onClick) {
|
|
51
|
+
props.element.onClick();
|
|
52
|
+
}
|
|
53
|
+
if (props.sideBar.closeOnClick !== false) {
|
|
54
|
+
props.setSideBarOpen(false);
|
|
55
|
+
}
|
|
56
|
+
}, tabIndex: props.itemTabIndex, renderIcon: props.element.renderIcon, ...(isNavLink ? { isActive } : {}), children: _jsx("span", { ref: sideBarElementRef, title: isOverflown ? props.element.label : "", style: {
|
|
57
|
+
overflow: "hidden",
|
|
58
|
+
textOverflow: "ellipsis",
|
|
59
|
+
whiteSpace: "nowrap",
|
|
60
|
+
width: "100%",
|
|
61
|
+
}, children: props.element.label }) }), overflowMenu] })] }));
|
|
66
62
|
};
|
|
67
63
|
export default C3NavigationSidebarElement;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Button, HeaderGlobalAction, HeaderPanel as CarbonHeaderPanel, Stack, SwitcherDivider, } from "@carbon/react";
|
|
2
|
-
import
|
|
3
|
+
import { useEffect } from "react";
|
|
3
4
|
import { useOnClickOutside } from "../helpers";
|
|
4
5
|
import C3NavigationSidebarElement from "./c3-navigation-sidebar-element";
|
|
5
6
|
import styled from "styled-components";
|
|
@@ -54,45 +55,36 @@ const C3NavigationSideBar = (props) => {
|
|
|
54
55
|
}, 120);
|
|
55
56
|
}
|
|
56
57
|
}, [isOpen]);
|
|
57
|
-
return (
|
|
58
|
-
React.createElement(HeaderGlobalAction
|
|
59
|
-
// eslint-disable-next-line
|
|
60
|
-
// @ts-ignore
|
|
61
|
-
, {
|
|
58
|
+
return (_jsxs(Wrapper, { children: [_jsx(HeaderGlobalAction
|
|
62
59
|
// eslint-disable-next-line
|
|
63
60
|
// @ts-ignore
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
, {
|
|
61
|
+
, {
|
|
62
|
+
// eslint-disable-next-line
|
|
63
|
+
// @ts-ignore
|
|
64
|
+
ref: setIconRef, "aria-label": sideBar.tooltip ?? `Open ${sideBar.ariaLabel}`, "aria-expanded": isOpen, "aria-controls": id, onClick: () => {
|
|
65
|
+
setIsOpen(!isOpen);
|
|
66
|
+
}, isActive: isOpen, tooltipAlignment: sideBar.type === "user" ? "end" : "center",
|
|
67
|
+
/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
|
|
68
|
+
/* @ts-ignore */
|
|
69
|
+
leaveDelayMs: 100, children: icon }), _jsxs(HeaderPanel
|
|
74
70
|
// eslint-disable-next-line
|
|
75
71
|
// @ts-ignore
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
sideBar.elements &&
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (sideBar.closeOnClick !== false) {
|
|
94
|
-
setIsOpen(false);
|
|
95
|
-
}
|
|
96
|
-
}, tabIndex: itemTabIndex, style: { width: `calc(16rem + 2px - ${scrollBarWidth}px)` } }, element.label)))))));
|
|
72
|
+
, {
|
|
73
|
+
// eslint-disable-next-line
|
|
74
|
+
// @ts-ignore
|
|
75
|
+
ref: setPanelRef, expanded: isOpen, id: id, style: { width: isOpen ? "calc(16rem)" : "0" }, children: [_jsxs(Stack, { children: [children, sideBar.elements &&
|
|
76
|
+
sideBar.elements.length > 0 &&
|
|
77
|
+
"customElements" in sideBar &&
|
|
78
|
+
sideBar.customElements &&
|
|
79
|
+
"activeOrganization" in sideBar.customElements &&
|
|
80
|
+
!sideBar.customElements?.activeOrganization && _jsx(SwitcherDivider, {}), sideBar.elements?.map((element, index) => (_jsx(C3NavigationSidebarElement, { element: element, index: index, sideBar: sideBar, setSideBarOpen: setIsOpen, itemTabIndex: itemTabIndex, scrollBarWidth: scrollBarWidth }, element.key))), bottomChildren] }), version, _jsx(BottomElements, { children: sideBar.bottomElements &&
|
|
81
|
+
sideBar.bottomElements.map((element) => (_jsx(Button, { kind: element.kind, className: "cds--switcher__item", renderIcon: element.renderIcon, onClick: () => {
|
|
82
|
+
if (element.onClick) {
|
|
83
|
+
element.onClick();
|
|
84
|
+
}
|
|
85
|
+
if (sideBar.closeOnClick !== false) {
|
|
86
|
+
setIsOpen(false);
|
|
87
|
+
}
|
|
88
|
+
}, tabIndex: itemTabIndex, style: { width: `calc(16rem + 2px - ${scrollBarWidth}px)` }, children: element.label }, element.key))) })] })] }));
|
|
97
89
|
};
|
|
98
90
|
export default C3NavigationSideBar;
|
package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Button } from "@carbon/react";
|
|
2
3
|
import { Notification as NotificationIcon } from "@carbon/react/icons";
|
|
3
|
-
import
|
|
4
|
+
import { useContext, useEffect, useRef, useState } from "react";
|
|
4
5
|
import styled from "styled-components";
|
|
5
6
|
import { C3BellIcon, C3NotificationsUnreadIcon } from "../../../assets/c3-icons";
|
|
6
7
|
import C3NotificationContainer, { NotificationDescription, NotificationTitle, } from "../c3-notification-provider/c3-notification-container";
|
|
@@ -82,30 +83,23 @@ export const C3NotificationSidebar = ({ sideBar }) => {
|
|
|
82
83
|
markAllAsReadSidebar();
|
|
83
84
|
};
|
|
84
85
|
}, []);
|
|
85
|
-
return (
|
|
86
|
+
return (_jsxs(C3NavigationSideBar, { sideBar: {
|
|
86
87
|
...sideBar,
|
|
87
88
|
ariaLabel: sideBar.ariaLabel || "Notification Sidebar",
|
|
88
89
|
callbacks: { beforeOpening, afterClosing },
|
|
89
|
-
}, icon: hasUnreadNotifications && !isFetching ? (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
if (onLinkClick) {
|
|
105
|
-
onLinkClick(notification.meta);
|
|
106
|
-
}
|
|
107
|
-
}, unread: unreadNotifications.some((id) => id === notification.uuid), ...notification })))) : (React.createElement(EmptyState, null,
|
|
108
|
-
React.createElement(C3BellIcon, { size: 56 }),
|
|
109
|
-
React.createElement(EmptyStateTitle, null, "No notifications"),
|
|
110
|
-
React.createElement(EmptyStateDescription, null, "New updates regarding your processes, clusters and more will appear here.")))));
|
|
90
|
+
}, icon: hasUnreadNotifications && !isFetching ? (_jsx(C3NotificationsUnreadIcon, { size: 20 })) : (_jsx(NotificationIcon, { size: 20, "aria-label": "Notifications" })), children: [_jsxs(PanelHeader, { children: [_jsx(PanelTitle, { children: "Notifications" }), notifications.length > 0 && (
|
|
91
|
+
// eslint-disable-next-line
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
_jsx(DismissAllButton, { kind: "ghost", size: "sm", onClick: dismissAllSidebar, children: "Dismiss all" }))] }), notifications.length > 0 ? (notifications.sort(sortNotificationsDescending).map((notification) => (_jsx(C3NotificationContainer, { onRead: () => {
|
|
94
|
+
if (notification.state === "new") {
|
|
95
|
+
markAsRead(notification);
|
|
96
|
+
}
|
|
97
|
+
}, onDismiss: () => dismiss(notification), originalOnLinkClick: onLinkClick, onLinkClick: () => {
|
|
98
|
+
if (enabled && analytics) {
|
|
99
|
+
analytics("notification-clicked-cta", notification.meta?.identifier);
|
|
100
|
+
}
|
|
101
|
+
if (onLinkClick) {
|
|
102
|
+
onLinkClick(notification.meta);
|
|
103
|
+
}
|
|
104
|
+
}, unread: unreadNotifications.some((id) => id === notification.uuid), ...notification }, notification.uuid)))) : (_jsxs(EmptyState, { children: [_jsx(C3BellIcon, { size: 56 }), _jsx(EmptyStateTitle, { children: "No notifications" }), _jsx(EmptyStateDescription, { children: "New updates regarding your processes, clusters and more will appear here." })] }))] }));
|
|
111
105
|
};
|
package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React, { useContext, useState } from "react";
|
|
2
3
|
export const C3SidebarStateContext = React.createContext(null);
|
|
3
4
|
export const C3SidebarStateProvider = ({ children, ...value }) => {
|
|
@@ -9,7 +10,7 @@ export const C3SidebarStateProvider = ({ children, ...value }) => {
|
|
|
9
10
|
const [infoScrollBarWidth, setInfoScrollBarWidth] = useState(0);
|
|
10
11
|
const [isUserSidebarOpen, setIsUserSidebarOpen] = useState(value.isUserSidebarOpen || false);
|
|
11
12
|
const [userScrollBarWidth, setUserScrollBarWidth] = useState(0);
|
|
12
|
-
return (
|
|
13
|
+
return (_jsx(C3SidebarStateContext.Provider, { value: {
|
|
13
14
|
notifications: {
|
|
14
15
|
isOpen: isNotificationSidebarOpen,
|
|
15
16
|
setIsOpen: setIsNotificationSidebarOpen,
|
|
@@ -34,7 +35,7 @@ export const C3SidebarStateProvider = ({ children, ...value }) => {
|
|
|
34
35
|
scrollBarWidth: userScrollBarWidth,
|
|
35
36
|
setScrollBarWidth: setUserScrollBarWidth,
|
|
36
37
|
},
|
|
37
|
-
}
|
|
38
|
+
}, children: children }));
|
|
38
39
|
};
|
|
39
40
|
export const useSidebarState = () => {
|
|
40
41
|
const value = useContext(C3SidebarStateContext);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import C3NavigationSideBar from "./c3-navigation-sidebar";
|
|
3
3
|
import { FormLabel, RadioButton, RadioButtonGroup, Stack, SwitcherDivider, Toggle, } from "@carbon/react";
|
|
4
4
|
import { UserAvatar } from "@carbon/react/icons";
|
|
@@ -34,43 +34,19 @@ const C3UserSidebar = ({ sideBar }) => {
|
|
|
34
34
|
const { theme, onThemeChange } = useC3Profile();
|
|
35
35
|
const { isOpen } = useUserSidebarState();
|
|
36
36
|
const itemTabIndex = isOpen ? undefined : -1;
|
|
37
|
-
return (
|
|
37
|
+
return (_jsxs(C3NavigationSideBar, { sideBar: {
|
|
38
38
|
...sideBarProps,
|
|
39
39
|
ariaLabel: sideBarProps.ariaLabel || "User Sidebar",
|
|
40
|
-
}, icon:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
paddingBottom: ".5rem",
|
|
52
|
-
} },
|
|
53
|
-
React.createElement(Stack, { gap: 2 },
|
|
54
|
-
React.createElement(FormLabel, null, profile.label),
|
|
55
|
-
React.createElement(Stack, null,
|
|
56
|
-
React.createElement("div", { className: "textPrimary", style: { fontSize: "14px" } }, profile.user.name),
|
|
57
|
-
React.createElement("div", { className: "textPrimary", style: { fontSize: "12px" } }, profile.user.email))))),
|
|
58
|
-
(themeSelector || handleTheme) && (React.createElement(React.Fragment, null,
|
|
59
|
-
React.createElement(SwitcherDivider, null),
|
|
60
|
-
React.createElement("div", { style: {
|
|
61
|
-
padding: ".5rem 1rem",
|
|
62
|
-
} },
|
|
63
|
-
React.createElement(RadioButtonGroup, { name: "theme-radio-group", legendText: "Theme", orientation: "vertical", onChange: (newValue) => {
|
|
64
|
-
handleTheme
|
|
65
|
-
? onThemeChange(newValue)
|
|
66
|
-
: themeSelector?.onChange(newValue);
|
|
67
|
-
}, valueSelected: handleTheme ? theme : themeSelector?.currentTheme },
|
|
68
|
-
React.createElement(RadioButton, { id: "light", labelText: "Light", value: "light", tabIndex: itemTabIndex }),
|
|
69
|
-
React.createElement(RadioButton, { id: "system", labelText: "System", value: "system", tabIndex: itemTabIndex }),
|
|
70
|
-
React.createElement(RadioButton, { id: "dark", labelText: "Dark", value: "dark", tabIndex: itemTabIndex }))))),
|
|
71
|
-
stageToggle && (React.createElement(React.Fragment, null,
|
|
72
|
-
React.createElement(SwitcherDivider, null),
|
|
73
|
-
React.createElement("div", { style: { padding: ".5rem 1rem" } },
|
|
74
|
-
React.createElement(Toggle, { size: "sm", id: "toggle-productionfeatures", defaultToggled: stageToggle.prodFeaturesEnabled, onClick: stageToggle.toggle, labelText: "Simulate Production Features", tabIndex: itemTabIndex, "aria-label": "Simulate Production Features" }))))));
|
|
40
|
+
}, icon: _jsx(UserAvatar, { size: 20 }), version: version && (_jsxs(VersionWrapper, { children: [_jsxs(Version, { children: ["Version ", version] }), _jsxs(Copyright, { children: ["\u00A9 Camunda Services GmbH ", new Date().getFullYear()] }), _jsx(Copyright, { children: "All right reserved." })] })), bottomChildren: customSection, children: [profile && (_jsx("div", { style: {
|
|
41
|
+
padding: "1rem",
|
|
42
|
+
paddingTop: "1.5rem",
|
|
43
|
+
paddingBottom: ".5rem",
|
|
44
|
+
}, children: _jsxs(Stack, { gap: 2, children: [_jsx(FormLabel, { children: profile.label }), _jsxs(Stack, { children: [_jsx("div", { className: "textPrimary", style: { fontSize: "14px" }, children: profile.user.name }), _jsx("div", { className: "textPrimary", style: { fontSize: "12px" }, children: profile.user.email })] })] }) })), (themeSelector || handleTheme) && (_jsxs(_Fragment, { children: [_jsx(SwitcherDivider, {}), _jsx("div", { style: {
|
|
45
|
+
padding: ".5rem 1rem",
|
|
46
|
+
}, children: _jsxs(RadioButtonGroup, { name: "theme-radio-group", legendText: "Theme", orientation: "vertical", onChange: (newValue) => {
|
|
47
|
+
handleTheme
|
|
48
|
+
? onThemeChange(newValue)
|
|
49
|
+
: themeSelector?.onChange(newValue);
|
|
50
|
+
}, valueSelected: handleTheme ? theme : themeSelector?.currentTheme, children: [_jsx(RadioButton, { id: "light", labelText: "Light", value: "light", tabIndex: itemTabIndex }), _jsx(RadioButton, { id: "system", labelText: "System", value: "system", tabIndex: itemTabIndex }), _jsx(RadioButton, { id: "dark", labelText: "Dark", value: "dark", tabIndex: itemTabIndex })] }) })] })), stageToggle && (_jsxs(_Fragment, { children: [_jsx(SwitcherDivider, {}), _jsx("div", { style: { padding: ".5rem 1rem" }, children: _jsx(Toggle, { size: "sm", id: "toggle-productionfeatures", defaultToggled: stageToggle.prodFeaturesEnabled, onClick: stageToggle.toggle, labelText: "Simulate Production Features", tabIndex: itemTabIndex, "aria-label": "Simulate Production Features" }) })] }))] }));
|
|
75
51
|
};
|
|
76
52
|
export default C3UserSidebar;
|