@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.
Files changed (88) hide show
  1. package/lib/esm/package.json +27 -28
  2. package/lib/esm/src/api/clusters.js +1 -1
  3. package/lib/esm/src/api/endpoints.const.js +2 -0
  4. package/lib/esm/src/api/help-center.d.ts +1 -1
  5. package/lib/esm/src/api/status.js +1 -1
  6. package/lib/esm/src/assets/c3-icons.d.ts +4 -4
  7. package/lib/esm/src/assets/c3-icons.js +5 -14
  8. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.d.ts +1 -1
  9. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.js +10 -19
  10. package/lib/esm/src/components/c3-app-teaser/app-teaster-card.d.ts +1 -1
  11. package/lib/esm/src/components/c3-app-teaser/app-teaster-card.js +4 -8
  12. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.d.ts +1 -1
  13. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.js +2 -2
  14. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.d.ts +1 -1
  15. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.js +8 -9
  16. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.d.ts +2 -1
  17. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.js +9 -8
  18. package/lib/esm/src/components/c3-data-table/c3-data-table.js +84 -70
  19. package/lib/esm/src/components/c3-data-table/c3-data-table.types.d.ts +3 -2
  20. package/lib/esm/src/components/c3-data-table/link-button/link-button.js +2 -4
  21. package/lib/esm/src/components/c3-data-table/link-button/link-button.types.d.ts +0 -1
  22. package/lib/esm/src/components/c3-empty-state/c3-empty-state.js +9 -29
  23. package/lib/esm/src/components/c3-help-center/c3-help-center-provider.js +3 -2
  24. package/lib/esm/src/components/c3-help-center/c3-help-center.js +3 -7
  25. package/lib/esm/src/components/c3-help-center/help-center-hint.d.ts +1 -1
  26. package/lib/esm/src/components/c3-help-center/help-center-hint.js +6 -10
  27. package/lib/esm/src/components/c3-help-center/help-center.d.ts +1 -1
  28. package/lib/esm/src/components/c3-help-center/help-center.js +69 -102
  29. package/lib/esm/src/components/c3-help-center/tabs/feedback.js +41 -89
  30. package/lib/esm/src/components/c3-help-center/tabs/tabContent.js +2 -5
  31. package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.js +4 -5
  32. package/lib/esm/src/components/c3-help-center/tile.js +16 -30
  33. package/lib/esm/src/components/c3-navigation/c3-info-button.d.ts +1 -1
  34. package/lib/esm/src/components/c3-navigation/c3-info-button.js +2 -3
  35. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.d.ts +1 -1
  36. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.js +9 -9
  37. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.js +72 -87
  38. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.d.ts +1 -5
  39. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.js +1 -0
  40. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.d.ts +1 -1
  41. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.js +20 -28
  42. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts +1 -1
  43. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js +23 -27
  44. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.d.ts +1 -1
  45. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.js +29 -37
  46. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js +18 -24
  47. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js +3 -2
  48. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.js +13 -37
  49. package/lib/esm/src/components/c3-navigation/c3-navigation.js +78 -120
  50. package/lib/esm/src/components/c3-navigation/c3-navigation.types.d.ts +5 -6
  51. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts +1 -1
  52. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.js +10 -18
  53. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.js +4 -4
  54. package/lib/esm/src/components/c3-navigation/c3-org-name.js +2 -4
  55. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.js +48 -60
  56. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.js +23 -13
  57. package/lib/esm/src/components/c3-navigation/helpers.d.ts +2 -3
  58. package/lib/esm/src/components/c3-navigation/index.d.ts +1 -2
  59. package/lib/esm/src/components/c3-navigation/stories/story-helpers.js +3 -5
  60. package/lib/esm/src/components/c3-navigation/stories/story-templates.d.ts +1 -1
  61. package/lib/esm/src/components/c3-navigation/stories/story-templates.js +23 -29
  62. package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.js +2 -1
  63. package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.js +25 -38
  64. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.js +45 -56
  65. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.js +24 -34
  66. package/lib/esm/src/components/c3-onboarding-survey/elements/textField.js +4 -9
  67. package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.d.ts +9 -9
  68. package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.js +31 -42
  69. package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.d.ts +9 -9
  70. package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.js +27 -39
  71. package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.js +9 -13
  72. package/lib/esm/src/components/c3-onboarding-survey/step.js +27 -27
  73. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.js +8 -17
  74. package/lib/esm/src/components/c3-page/c3-page.js +2 -9
  75. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.js +4 -5
  76. package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.d.ts +2 -0
  77. package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.js +13 -0
  78. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts +1 -1
  79. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.js +5 -4
  80. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.js +3 -2
  81. package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.js +3 -4
  82. package/lib/esm/src/contexts/c3-cluster-update-manager.d.ts +1 -1
  83. package/lib/esm/src/contexts/c3-cluster-update-manager.js +3 -2
  84. package/lib/esm/src/hooks/useApi.d.ts +4 -5
  85. package/lib/esm/src/index.d.ts +1 -0
  86. package/lib/esm/src/index.js +1 -0
  87. package/package.json +20 -27
  88. package/README.md +0 -197
@@ -1,4 +1,5 @@
1
- import React, { useCallback, useEffect, useState } from "react";
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 (React.createElement(Modal, { danger: true, open: isOpen, modalHeading: "Select a team", onRequestClose: onCancel, passiveModal: true, loadingStatus: loadingStatus, size: "sm" },
52
- React.createElement("div", { style: { marginLeft: "-1rem" } },
53
- React.createElement(FormLabel, { style: {
54
- paddingTop: "15px",
55
- paddingLeft: "1rem",
56
- } }, hasNoTeams
57
- ? "No teams found"
58
- : hasNoTeamsWithClusters
59
- ? "No teams with clusters found"
60
- : "Teams"),
61
- React.createElement("div", { style: {
62
- marginTop: "-1rem",
63
- } },
64
- React.createElement(SideNavItems, null, Object.values(orgs ?? {})?.map(({ org, clusters }) => {
65
- const isConsoleOrModeler = [APPS[0], APPS[1]].includes(appToNavigateTo);
66
- const toOrg = getOrgLink(appToNavigateTo, org.uuid, domain ?? "");
67
- if (isConsoleOrModeler) {
68
- return (React.createElement(SideNavLink, { key: org?.uuid, href: toOrg }, org?.name));
69
- }
70
- const clustersToRender = getClustersToRender(clusters, activeOrg, appToNavigateTo);
71
- if (clustersToRender.length === 0) {
72
- return null;
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 (React.createElement(React.Fragment, null,
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
- ref: iconRef, "aria-label": "Camunda components", isActive: appBar.isOpen, onClick: () => {
305
- toggleAppbar(!appBar.isOpen);
306
- }, tooltipAlignment: "start",
307
- /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
308
- /* @ts-ignore */
309
- leaveDelayMs: 100 }, appBar.isOpen ? React.createElement(Close, { size: 20 }) : React.createElement(C3AppMenuIcon, { size: 20 })),
310
- React.createElement(OrgPickerModal, { activeOrg: activeOrg, appToNavigateTo: appToNavigateTo, isOpen: isOrgPickerModalOpen, orgs: clustersByOrgId, onCancel: () => {
311
- setIsOrgPickerModalOpen(false);
312
- }, loadingStatus: loadingStatus, domain: domain }),
313
- React.createElement(NavWrapper, null,
314
- React.createElement(SideNav, { ref: panelRef, "aria-label": appBar.ariaLabel || "Side Navigation", expanded: appBar.isOpen, isPersistent: false },
315
- React.createElement(SideNavItems, null,
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
- if (appBar.elementClicked) {
359
- appBar.elementClicked(element.key);
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
- }, href: element.href, target: element.href ? element.target : undefined }, element.label));
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
  };
@@ -1,6 +1,2 @@
1
- import { FC } from "react";
2
- import { SideNavProps } from "carbon-components-react";
3
1
  export declare const NavWrapper: any;
4
- export declare const SideNav: FC<SideNavProps & {
5
- ref: unknown;
6
- }>;
2
+ export declare const SideNav: any;
@@ -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 { FC } from "react";
1
+ import { type FC } from "react";
2
2
  import { C3NavigationInfoSideBarProps } from "./c3-navigation-sidebar.types";
3
3
  declare const C3InfoSidebar: FC<{
4
4
  sideBar: C3NavigationInfoSideBarProps;
@@ -1,4 +1,4 @@
1
- import React from "react";
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 (React.createElement(C3NavigationSideBar, { sideBar: {
11
+ return (_jsx(C3NavigationSideBar, { sideBar: {
12
12
  ...sideBarProps,
13
13
  ariaLabel: sideBarProps.ariaLabel || "Info Sidebar",
14
- }, icon: React.createElement(Help, { size: 20 }), bottomChildren: version !== undefined && (React.createElement(React.Fragment, null,
15
- React.createElement(SwitcherDivider, null),
16
- React.createElement("span", { className: "cds--switcher__item", style: {
17
- padding: "var(--cds-spacing-05)",
18
- paddingTop: "var(--cds-spacing-03)",
19
- paddingBottom: 0,
20
- color: "var(--cds-text-primary)",
21
- fontSize: "var(--cds-body-01-font-size)",
22
- fontWeight: "var(--cds-body-01-font-weight)",
23
- lineHeight: "var(--cds-body-01-line-height)",
24
- letterSpacing: "var(--cds-body-01-letter-spacing)",
25
- } },
26
- "Version ",
27
- version),
28
- React.createElement("span", { className: "cds--switcher__item", style: {
29
- paddingRight: "var(--cds-spacing-05)",
30
- paddingLeft: "var(--cds-spacing-05)",
31
- color: "var(--cds-text-secondary)",
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 | undefined;
6
+ itemTabIndex?: number;
7
7
  sideBar: C3NavigationSideBarProps;
8
8
  setSideBarOpen: (open: boolean) => void;
9
9
  scrollBarWidth: number;
@@ -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 React, { useEffect, useRef, useState } from "react";
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 (React.createElement(React.Fragment, null,
41
- props.element.preceedingDivider && React.createElement(SwitcherDivider, null),
42
- React.createElement(Row, null,
43
- React.createElement(Element, { style: {
44
- width: overflowMenu
45
- ? `calc(14rem - ${props.scrollBarWidth}px)`
46
- : `calc(16rem - ${props.scrollBarWidth}px)`,
47
- ...(props.index === 0 &&
48
- (!("elements" in props.sideBar) || !props.sideBar.elements)
49
- ? { marginTop: "1.5rem" }
50
- : {}),
51
- }, size: "sm", kind: props.element.kind ?? "ghost", className: `cds--switcher__item ${isActive ? "cds--side-nav__item--active" : ""}`, onClick: () => {
52
- if (props.element.onClick) {
53
- props.element.onClick();
54
- }
55
- if (props.sideBar.closeOnClick !== false) {
56
- props.setSideBarOpen(false);
57
- }
58
- }, tabIndex: props.itemTabIndex, renderIcon: props.element.renderIcon, ...(isNavLink ? { isActive } : {}) },
59
- React.createElement("span", { ref: sideBarElementRef, title: isOverflown ? props.element.label : "", style: {
60
- overflow: "hidden",
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,4 +1,4 @@
1
- import { ReactElement, ReactNode } from "react";
1
+ import { type ReactElement, type ReactNode } from "react";
2
2
  import { C3NavigationSideBarProps } from "./c3-navigation-sidebar.types";
3
3
  declare const C3NavigationSideBar: (props: {
4
4
  sideBar: C3NavigationSideBarProps;
@@ -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 React, { useEffect } from "react";
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 (React.createElement(Wrapper, null,
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
- 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 }, icon),
70
- React.createElement(HeaderPanel
71
- // eslint-disable-next-line
72
- // @ts-ignore
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
- ref: setPanelRef, expanded: isOpen, id: id, style: { width: isOpen ? "calc(16rem)" : "0" } },
77
- React.createElement(Stack, null,
78
- children,
79
- sideBar.elements &&
80
- sideBar.elements.length > 0 &&
81
- "customElements" in sideBar &&
82
- sideBar.customElements &&
83
- "activeOrganization" in sideBar.customElements &&
84
- !sideBar.customElements?.activeOrganization && React.createElement(SwitcherDivider, null),
85
- sideBar.elements?.map((element, index) => (React.createElement(C3NavigationSidebarElement, { key: element.key, element: element, index: index, sideBar: sideBar, setSideBarOpen: setIsOpen, itemTabIndex: itemTabIndex, scrollBarWidth: scrollBarWidth }))),
86
- bottomChildren),
87
- version,
88
- React.createElement(BottomElements, null, sideBar.bottomElements &&
89
- sideBar.bottomElements.map((element) => (React.createElement(Button, { kind: element.kind, key: element.key, className: "cds--switcher__item", renderIcon: element.renderIcon, onClick: () => {
90
- if (element.onClick) {
91
- element.onClick();
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;
@@ -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 React, { useContext, useEffect, useRef, useState } from "react";
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 (React.createElement(C3NavigationSideBar, { sideBar: {
86
+ return (_jsxs(C3NavigationSideBar, { sideBar: {
86
87
  ...sideBar,
87
88
  ariaLabel: sideBar.ariaLabel || "Notification Sidebar",
88
89
  callbacks: { beforeOpening, afterClosing },
89
- }, icon: hasUnreadNotifications && !isFetching ? (React.createElement(C3NotificationsUnreadIcon, { size: 20 })) : (React.createElement(NotificationIcon, { size: 20, "aria-label": "Notifications" })) },
90
- React.createElement(PanelHeader, null,
91
- React.createElement(PanelTitle, null, "Notifications"),
92
- notifications.length > 0 && (
93
- // eslint-disable-next-line
94
- // @ts-ignore
95
- React.createElement(DismissAllButton, { kind: "ghost", size: "sm", onClick: dismissAllSidebar }, "Dismiss all"))),
96
- notifications.length > 0 ? (notifications.sort(sortNotificationsDescending).map((notification) => (React.createElement(C3NotificationContainer, { key: notification.uuid, onRead: () => {
97
- if (notification.state === "new") {
98
- markAsRead(notification);
99
- }
100
- }, onDismiss: () => dismiss(notification), originalOnLinkClick: onLinkClick, onLinkClick: () => {
101
- if (enabled && analytics) {
102
- analytics("notification-clicked-cta", notification.meta?.identifier);
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
  };
@@ -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 (React.createElement(C3SidebarStateContext.Provider, { value: {
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
- } }, children));
38
+ }, children: children }));
38
39
  };
39
40
  export const useSidebarState = () => {
40
41
  const value = useContext(C3SidebarStateContext);
@@ -1,4 +1,4 @@
1
- import React from "react";
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 (React.createElement(C3NavigationSideBar, { sideBar: {
37
+ return (_jsxs(C3NavigationSideBar, { sideBar: {
38
38
  ...sideBarProps,
39
39
  ariaLabel: sideBarProps.ariaLabel || "User Sidebar",
40
- }, icon: React.createElement(UserAvatar, { size: 20 }), version: version && (React.createElement(VersionWrapper, null,
41
- React.createElement(Version, null,
42
- "Version ",
43
- version),
44
- React.createElement(Copyright, null,
45
- "\u00A9 Camunda Services GmbH ",
46
- new Date().getFullYear()),
47
- React.createElement(Copyright, null, "All right reserved."))), bottomChildren: customSection },
48
- profile && (React.createElement("div", { style: {
49
- padding: "1rem",
50
- paddingTop: "1.5rem",
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;