@camunda/camunda-composite-components 0.0.39 → 0.0.40
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/components/c3-navigation/c3-info-button.d.ts +4 -0
- package/lib/esm/components/c3-navigation/c3-info-button.js +5 -0
- package/lib/esm/components/c3-navigation/c3-navigation.d.ts +1 -1
- package/lib/esm/components/c3-navigation/c3-navigation.js +3 -5
- package/lib/esm/components/c3-navigation/c3-navigation.types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HeaderGlobalAction } from "@carbon/react";
|
|
3
|
+
import { Help } from "@carbon/react/icons";
|
|
4
|
+
export const InfoButton = ({ onClick }) => (React.createElement(HeaderGlobalAction, { "aria-label": "Open Help Center", tooltipAlignment: "center", onClick: onClick },
|
|
5
|
+
React.createElement(Help, { size: 20 })));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { C3NavigationProps } from "./c3-navigation.types";
|
|
3
|
-
export declare const C3Navigation: ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, actionButtons, userSideBar, notificationSideBar, }: C3NavigationProps) => JSX.Element;
|
|
3
|
+
export declare const C3Navigation: ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, infoButton, actionButtons, userSideBar, notificationSideBar, }: C3NavigationProps) => JSX.Element;
|
|
@@ -9,6 +9,7 @@ import { C3NavigationAppBar } from "./c3-navigation-appbar";
|
|
|
9
9
|
import styled from "styled-components";
|
|
10
10
|
import C3ActionButtons from "./c3-navigation-actions/c3-action-buttons";
|
|
11
11
|
import { CamundaLogo } from "../../icons/c3-icons";
|
|
12
|
+
import { InfoButton } from "./c3-info-button";
|
|
12
13
|
import { C3SidebarStateProvider } from "./c3-navigation-sidebar/c3-sidebar-state-provider";
|
|
13
14
|
/**
|
|
14
15
|
* UI SHELL
|
|
@@ -29,7 +30,7 @@ const StyledToggletipContent = styled(ToggletipContent) `
|
|
|
29
30
|
color: var(--cds-link-hover-text-color);
|
|
30
31
|
}
|
|
31
32
|
`;
|
|
32
|
-
export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, actionButtons, userSideBar, notificationSideBar, }) => {
|
|
33
|
+
export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, infoButton, actionButtons, userSideBar, notificationSideBar, }) => {
|
|
33
34
|
const isLargeScreen = useMediaQuery(`(min-width: ${BREAKPOINT_LG_WIDTH}`);
|
|
34
35
|
const appBarElementsLength = appBar.elements?.length ?? 0;
|
|
35
36
|
const displayAppBar = appBarElementsLength > 0 || (!isLargeScreen && navbar.elements.length > 0);
|
|
@@ -92,10 +93,7 @@ export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, info
|
|
|
92
93
|
...orgSideBar,
|
|
93
94
|
type: "org",
|
|
94
95
|
} })),
|
|
95
|
-
infoSideBar && (React.createElement(C3InfoSidebar, { sideBar: {
|
|
96
|
-
...infoSideBar,
|
|
97
|
-
type: "info",
|
|
98
|
-
} })),
|
|
96
|
+
infoButton ? (React.createElement(InfoButton, { onClick: infoButton.onClick })) : (infoSideBar && (React.createElement(C3InfoSidebar, { sideBar: { ...infoSideBar, type: "info" } }))),
|
|
99
97
|
userSideBar && (React.createElement(C3UserSidebar, { sideBar: {
|
|
100
98
|
...userSideBar,
|
|
101
99
|
type: "user",
|
|
@@ -54,6 +54,9 @@ export interface C3NavigationProps {
|
|
|
54
54
|
appBar: WithoutType<C3NavigationAppBarProps>;
|
|
55
55
|
orgSideBar?: WithoutType<C3NavigationOrgSideBarProps>;
|
|
56
56
|
infoSideBar?: WithoutType<C3NavigationInfoSideBarProps>;
|
|
57
|
+
infoButton?: {
|
|
58
|
+
onClick: () => void;
|
|
59
|
+
};
|
|
57
60
|
actionButtons?: C3ActionButtonsProps;
|
|
58
61
|
userSideBar?: WithoutType<C3NavigationUserSideBarProps>;
|
|
59
62
|
notificationSideBar?: WithoutType<C3NavigationNotificationsSideBarProps>;
|