@camunda/camunda-composite-components 0.1.1 → 0.1.2
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/README.md +60 -0
- package/lib/esm/api/api.d.ts +19 -19
- package/lib/esm/api/api.js +67 -65
- package/lib/esm/api/endpoints.const.d.ts +12 -12
- package/lib/esm/api/endpoints.const.js +25 -24
- package/lib/esm/api/jwt.utils.d.ts +3 -3
- package/lib/esm/api/jwt.utils.js +21 -23
- package/lib/esm/api/notifications.d.ts +35 -64
- package/lib/esm/api/notifications.js +159 -168
- package/lib/esm/components/c3-empty-state/c3-empty-state.d.ts +2 -9
- package/lib/esm/components/c3-empty-state/c3-empty-state.js +17 -58
- package/lib/esm/components/c3-empty-state/c3-empty-state.test.d.ts +1 -0
- package/lib/esm/components/c3-empty-state/c3-empty-state.test.js +12 -0
- package/lib/esm/components/c3-empty-state/c3-empty-state.types.d.ts +19 -19
- package/lib/esm/components/c3-empty-state/c3-empty-state.types.js +1 -1
- package/lib/esm/components/c3-navigation/c3-info-button.d.ts +3 -3
- package/lib/esm/components/c3-navigation/c3-info-button.js +5 -13
- package/lib/esm/components/c3-navigation/c3-navigation-actions/c3-action-buttons.d.ts +5 -5
- package/lib/esm/components/c3-navigation/c3-navigation-actions/c3-action-buttons.js +13 -21
- package/lib/esm/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.d.ts +10 -6
- package/lib/esm/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.js +1 -1
- package/lib/esm/components/c3-navigation/c3-navigation-appbar.d.ts +3 -3
- package/lib/esm/components/c3-navigation/c3-navigation-appbar.js +68 -157
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.d.ts +5 -5
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.js +39 -62
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts +9 -10
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js +33 -56
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.d.ts +9 -9
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.js +57 -110
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts +61 -72
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.js +1 -1
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.d.ts +4 -4
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js +88 -142
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-org-sidebar.d.ts +5 -5
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-org-sidebar.js +51 -105
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.d.ts +24 -26
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js +25 -38
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.d.ts +5 -5
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.js +57 -146
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/components.d.ts +2 -8
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/components.js +4 -4
- package/lib/esm/components/c3-navigation/c3-navigation.d.ts +2 -14
- package/lib/esm/components/c3-navigation/c3-navigation.js +90 -214
- package/lib/esm/components/c3-navigation/c3-navigation.test.d.ts +1 -0
- package/lib/esm/components/c3-navigation/c3-navigation.test.js +80 -0
- package/lib/esm/components/c3-navigation/c3-navigation.types.d.ts +63 -70
- package/lib/esm/components/c3-navigation/c3-navigation.types.js +1 -1
- package/lib/esm/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts +13 -30
- package/lib/esm/components/c3-navigation/c3-notification-provider/c3-notification-container.js +70 -114
- package/lib/esm/components/c3-navigation/c3-notification-provider/c3-notification-provider.d.ts +27 -29
- package/lib/esm/components/c3-navigation/c3-notification-provider/c3-notification-provider.js +90 -118
- package/lib/esm/components/c3-navigation/helpers.d.ts +3 -5
- package/lib/esm/components/c3-navigation/helpers.js +49 -53
- package/lib/esm/components/c3-navigation/index.d.ts +2 -4
- package/lib/esm/components/c3-navigation/index.js +3 -3
- package/lib/esm/components/c3-navigation/story-helpers.d.ts +18 -24
- package/lib/esm/components/c3-navigation/story-helpers.js +197 -200
- package/lib/esm/components/c3-navigation/story-templates.d.ts +8 -8
- package/lib/esm/components/c3-navigation/story-templates.js +33 -66
- package/lib/esm/components/c3-user-configuration/c3-user-configuration-provider.d.ts +16 -20
- package/lib/esm/components/c3-user-configuration/c3-user-configuration-provider.js +4 -9
- package/lib/esm/components/test-utils.d.ts +3 -0
- package/lib/esm/components/test-utils.js +22 -0
- package/lib/esm/icons/c3-icons.d.ts +5 -8
- package/lib/esm/icons/c3-icons.js +14 -82
- package/lib/esm/icons/c3-icons.types.d.ts +1 -1
- package/lib/esm/icons/c3-icons.types.js +1 -1
- package/lib/esm/index.d.ts +9 -14
- package/lib/esm/index.js +4 -4
- package/package.json +30 -20
|
@@ -1,106 +1,52 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { Button, FormLabel } from "@carbon/react"
|
|
3
|
-
import { Enterprise } from "@carbon/react/icons"
|
|
4
|
-
import C3NavigationSideBar from "./c3-navigation-sidebar"
|
|
5
|
-
import { SwitcherDivider } from "./components"
|
|
6
|
-
import { useOrgSidebarState } from "./c3-sidebar-state-provider"
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button, FormLabel } from "@carbon/react";
|
|
3
|
+
import { Enterprise } from "@carbon/react/icons";
|
|
4
|
+
import C3NavigationSideBar from "./c3-navigation-sidebar";
|
|
5
|
+
import { SwitcherDivider } from "./components";
|
|
6
|
+
import { useOrgSidebarState } from "./c3-sidebar-state-provider";
|
|
7
7
|
const C3OrgSidebar = ({ sideBar }) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
className: "textPrimary",
|
|
55
|
-
style: {
|
|
56
|
-
height: "20px",
|
|
57
|
-
lineHeight: "20px",
|
|
58
|
-
fontSize: "14px",
|
|
59
|
-
textOverflow: "ellipsis",
|
|
60
|
-
overflow: "hidden",
|
|
61
|
-
whiteSpace: "nowrap",
|
|
62
|
-
},
|
|
63
|
-
title: activeOrganization.orgName,
|
|
64
|
-
},
|
|
65
|
-
activeOrganization.orgName,
|
|
66
|
-
),
|
|
67
|
-
),
|
|
68
|
-
React.createElement(
|
|
69
|
-
Button,
|
|
70
|
-
{
|
|
71
|
-
size: "md",
|
|
72
|
-
kind: "ghost",
|
|
73
|
-
key: "org-management",
|
|
74
|
-
onClick: () => {
|
|
75
|
-
activeOrganization.action.onClick()
|
|
76
|
-
if (sideBar.closeOnClick !== false) {
|
|
77
|
-
setIsOpen(false)
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
tabIndex: itemTabIndex,
|
|
81
|
-
},
|
|
82
|
-
activeOrganization.action.label,
|
|
83
|
-
),
|
|
84
|
-
),
|
|
85
|
-
sideBar.elements &&
|
|
86
|
-
sideBar.elements.length > 0 &&
|
|
87
|
-
React.createElement(
|
|
88
|
-
React.Fragment,
|
|
89
|
-
null,
|
|
90
|
-
React.createElement(SwitcherDivider, null),
|
|
91
|
-
React.createElement(
|
|
92
|
-
FormLabel,
|
|
93
|
-
{
|
|
94
|
-
style: {
|
|
95
|
-
paddingTop: ".5rem",
|
|
96
|
-
paddingLeft: "1rem",
|
|
97
|
-
paddingBottom: ".25rem",
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
activeOrganization.otherLabel,
|
|
101
|
-
),
|
|
102
|
-
),
|
|
103
|
-
),
|
|
104
|
-
)
|
|
105
|
-
}
|
|
106
|
-
export default C3OrgSidebar
|
|
8
|
+
const { customElements, ...sideBarProps } = sideBar;
|
|
9
|
+
const activeOrganization = customElements?.activeOrganization;
|
|
10
|
+
const { isOpen, setIsOpen } = useOrgSidebarState();
|
|
11
|
+
const itemTabIndex = isOpen ? undefined : -1;
|
|
12
|
+
return (React.createElement(C3NavigationSideBar, { sideBar: {
|
|
13
|
+
...sideBarProps,
|
|
14
|
+
ariaLabel: sideBarProps.ariaLabel || "Organization Sidebars",
|
|
15
|
+
}, icon: React.createElement(Enterprise, { size: 20 }) }, activeOrganization && (React.createElement(React.Fragment, null,
|
|
16
|
+
React.createElement("div", { style: {
|
|
17
|
+
padding: "1rem",
|
|
18
|
+
paddingTop: "1.5rem",
|
|
19
|
+
paddingBottom: ".5rem",
|
|
20
|
+
display: "grid",
|
|
21
|
+
gridAutoFlow: "column",
|
|
22
|
+
gap: ".25rem",
|
|
23
|
+
} },
|
|
24
|
+
React.createElement("div", { style: {
|
|
25
|
+
overflow: "hidden",
|
|
26
|
+
display: "grid",
|
|
27
|
+
gap: "4px",
|
|
28
|
+
} },
|
|
29
|
+
React.createElement(FormLabel, null, activeOrganization.activeLabel),
|
|
30
|
+
React.createElement("div", { className: "textPrimary", style: {
|
|
31
|
+
height: "20px",
|
|
32
|
+
lineHeight: "20px",
|
|
33
|
+
fontSize: "14px",
|
|
34
|
+
textOverflow: "ellipsis",
|
|
35
|
+
overflow: "hidden",
|
|
36
|
+
whiteSpace: "nowrap",
|
|
37
|
+
}, title: activeOrganization.orgName }, activeOrganization.orgName)),
|
|
38
|
+
React.createElement(Button, { size: "md", kind: "ghost", key: "org-management", onClick: () => {
|
|
39
|
+
activeOrganization.action.onClick();
|
|
40
|
+
if (sideBar.closeOnClick !== false) {
|
|
41
|
+
setIsOpen(false);
|
|
42
|
+
}
|
|
43
|
+
}, tabIndex: itemTabIndex }, activeOrganization.action.label)),
|
|
44
|
+
sideBar.elements && sideBar.elements.length > 0 && (React.createElement(React.Fragment, null,
|
|
45
|
+
React.createElement(SwitcherDivider, null),
|
|
46
|
+
React.createElement(FormLabel, { style: {
|
|
47
|
+
paddingTop: ".5rem",
|
|
48
|
+
paddingLeft: "1rem",
|
|
49
|
+
paddingBottom: ".25rem",
|
|
50
|
+
} }, activeOrganization.otherLabel)))))));
|
|
51
|
+
};
|
|
52
|
+
export default C3OrgSidebar;
|
package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.d.ts
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import React, { FC } from "react"
|
|
1
|
+
import React, { FC } from "react";
|
|
2
2
|
declare type DefaultValues = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
3
|
+
isNotificationSidebarOpen?: boolean;
|
|
4
|
+
isOrgSidebarOpen?: boolean;
|
|
5
|
+
isInfoSidebarOpen?: boolean;
|
|
6
|
+
isUserSidebarOpen?: boolean;
|
|
7
|
+
};
|
|
8
8
|
declare type SideBarState = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
11
|
+
};
|
|
12
12
|
declare type C3SidebarsState = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
export declare const C3SidebarStateContext: React.Context<C3SidebarsState | null
|
|
19
|
-
export declare const C3SidebarStateProvider: FC<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const
|
|
27
|
-
export
|
|
28
|
-
export declare const useUserSidebarState: () => SideBarState
|
|
29
|
-
export {}
|
|
13
|
+
notifications: SideBarState;
|
|
14
|
+
org: SideBarState;
|
|
15
|
+
info: SideBarState;
|
|
16
|
+
user: SideBarState;
|
|
17
|
+
};
|
|
18
|
+
export declare const C3SidebarStateContext: React.Context<C3SidebarsState | null>;
|
|
19
|
+
export declare const C3SidebarStateProvider: FC<DefaultValues & {
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const useSidebarState: () => C3SidebarsState;
|
|
23
|
+
export declare const useNotificationSidebarState: () => SideBarState;
|
|
24
|
+
export declare const useOrgSidebarState: () => SideBarState;
|
|
25
|
+
export declare const useInfoSidebarState: () => SideBarState;
|
|
26
|
+
export declare const useUserSidebarState: () => SideBarState;
|
|
27
|
+
export {};
|
|
@@ -1,40 +1,27 @@
|
|
|
1
|
-
import React, { useContext, useState } from "react"
|
|
2
|
-
export const C3SidebarStateContext = React.createContext(null)
|
|
1
|
+
import React, { useContext, useState } from "react";
|
|
2
|
+
export const C3SidebarStateContext = React.createContext(null);
|
|
3
3
|
export const C3SidebarStateProvider = ({ children, ...value }) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
value: {
|
|
20
|
-
notifications: {
|
|
21
|
-
isOpen: isNotificationSidebarOpen,
|
|
22
|
-
setIsOpen: setIsNotificationSidebarOpen,
|
|
23
|
-
},
|
|
24
|
-
org: { isOpen: isOrgSidebarOpen, setIsOpen: setIsOrgSidebarOpen },
|
|
25
|
-
info: { isOpen: isInfoSidebarOpen, setIsOpen: setIsInfoSidebarOpen },
|
|
26
|
-
user: { isOpen: isUserSidebarOpen, setIsOpen: setIsUserSidebarOpen },
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
children,
|
|
30
|
-
)
|
|
31
|
-
}
|
|
4
|
+
const [isNotificationSidebarOpen, setIsNotificationSidebarOpen] = useState(value.isNotificationSidebarOpen || false);
|
|
5
|
+
const [isOrgSidebarOpen, setIsOrgSidebarOpen] = useState(value.isOrgSidebarOpen || false);
|
|
6
|
+
const [isInfoSidebarOpen, setIsInfoSidebarOpen] = useState(value.isInfoSidebarOpen || false);
|
|
7
|
+
const [isUserSidebarOpen, setIsUserSidebarOpen] = useState(value.isUserSidebarOpen || false);
|
|
8
|
+
return (React.createElement(C3SidebarStateContext.Provider, { value: {
|
|
9
|
+
notifications: {
|
|
10
|
+
isOpen: isNotificationSidebarOpen,
|
|
11
|
+
setIsOpen: setIsNotificationSidebarOpen,
|
|
12
|
+
},
|
|
13
|
+
org: { isOpen: isOrgSidebarOpen, setIsOpen: setIsOrgSidebarOpen },
|
|
14
|
+
info: { isOpen: isInfoSidebarOpen, setIsOpen: setIsInfoSidebarOpen },
|
|
15
|
+
user: { isOpen: isUserSidebarOpen, setIsOpen: setIsUserSidebarOpen },
|
|
16
|
+
} }, children));
|
|
17
|
+
};
|
|
32
18
|
export const useSidebarState = () => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export const
|
|
39
|
-
export const
|
|
40
|
-
export const
|
|
19
|
+
const value = useContext(C3SidebarStateContext);
|
|
20
|
+
if (!value)
|
|
21
|
+
throw new Error("No C3SidebarStateContextProvider found.");
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
export const useNotificationSidebarState = () => useSidebarState().notifications;
|
|
25
|
+
export const useOrgSidebarState = () => useSidebarState().org;
|
|
26
|
+
export const useInfoSidebarState = () => useSidebarState().info;
|
|
27
|
+
export const useUserSidebarState = () => useSidebarState().user;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FC } from "react"
|
|
2
|
-
import { C3NavigationUserSideBarProps } from "./c3-navigation-sidebar.types"
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { C3NavigationUserSideBarProps } from "./c3-navigation-sidebar.types";
|
|
3
3
|
declare const C3UserSidebar: FC<{
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export default C3UserSidebar
|
|
4
|
+
sideBar: C3NavigationUserSideBarProps;
|
|
5
|
+
}>;
|
|
6
|
+
export default C3UserSidebar;
|
|
@@ -1,159 +1,70 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import C3NavigationSideBar from "./c3-navigation-sidebar"
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
SwitcherDivider,
|
|
9
|
-
Toggle,
|
|
10
|
-
} from "@carbon/react"
|
|
11
|
-
import { UserAvatar } from "@carbon/react/icons"
|
|
12
|
-
import styled from "styled-components"
|
|
13
|
-
import { useUserSidebarState } from "./c3-sidebar-state-provider"
|
|
14
|
-
const VersionWrapper = styled.div`
|
|
1
|
+
import React from "react";
|
|
2
|
+
import C3NavigationSideBar from "./c3-navigation-sidebar";
|
|
3
|
+
import { FormLabel, RadioButton, RadioButtonGroup, Stack, SwitcherDivider, Toggle, } from "@carbon/react";
|
|
4
|
+
import { UserAvatar } from "@carbon/react/icons";
|
|
5
|
+
import styled from "styled-components";
|
|
6
|
+
import { useUserSidebarState } from "./c3-sidebar-state-provider";
|
|
7
|
+
const VersionWrapper = styled.div `
|
|
15
8
|
align-self: end;
|
|
16
9
|
padding: 0.5rem 1rem;
|
|
17
|
-
|
|
18
|
-
const Version = styled.p`
|
|
10
|
+
`;
|
|
11
|
+
const Version = styled.p `
|
|
19
12
|
color: var(--cds-text-primary);
|
|
20
13
|
font-size: var(--cds-label-02-font-size);
|
|
21
14
|
font-weight: var(--cds-label-02-font-weight);
|
|
22
15
|
line-height: var(--cds-label-02-line-height);
|
|
23
16
|
letter-spacing: var(--cds-label-02-letter-spacing);
|
|
24
|
-
|
|
25
|
-
const Copyright = styled.p`
|
|
17
|
+
`;
|
|
18
|
+
const Copyright = styled.p `
|
|
26
19
|
color: var(--cds-text-secondary);
|
|
27
20
|
font-size: var(--cds-label-01-font-size);
|
|
28
21
|
font-weight: var(--cds-label-01-font-weight);
|
|
29
22
|
line-height: var(--cds-label-01-line-height);
|
|
30
23
|
letter-spacing: var(--cds-label-01-letter-spacing);
|
|
31
|
-
|
|
24
|
+
`;
|
|
32
25
|
const C3UserSidebar = ({ sideBar }) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
React.createElement(
|
|
79
|
-
Stack,
|
|
80
|
-
null,
|
|
81
|
-
React.createElement(
|
|
82
|
-
"div",
|
|
83
|
-
{ className: "textPrimary", style: { fontSize: "14px" } },
|
|
84
|
-
profile.user.name,
|
|
85
|
-
),
|
|
86
|
-
React.createElement(
|
|
87
|
-
"div",
|
|
88
|
-
{ className: "textPrimary", style: { fontSize: "12px" } },
|
|
89
|
-
profile.user.email,
|
|
90
|
-
),
|
|
91
|
-
),
|
|
92
|
-
),
|
|
93
|
-
),
|
|
94
|
-
themeSelector &&
|
|
95
|
-
React.createElement(
|
|
96
|
-
React.Fragment,
|
|
97
|
-
null,
|
|
98
|
-
React.createElement(SwitcherDivider, null),
|
|
99
|
-
React.createElement(
|
|
100
|
-
"div",
|
|
101
|
-
{
|
|
102
|
-
style: {
|
|
103
|
-
padding: ".5rem 1rem",
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
React.createElement(
|
|
107
|
-
RadioButtonGroup,
|
|
108
|
-
{
|
|
109
|
-
name: "theme-radio-group",
|
|
110
|
-
defaultSelected: themeSelector.currentTheme,
|
|
111
|
-
legendText: "Theme",
|
|
112
|
-
orientation: "vertical",
|
|
113
|
-
onChange: (newValue) => {
|
|
114
|
-
themeSelector.onChange(newValue)
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
React.createElement(RadioButton, {
|
|
118
|
-
id: "light",
|
|
119
|
-
labelText: "Light",
|
|
120
|
-
value: "light",
|
|
121
|
-
tabIndex: itemTabIndex,
|
|
122
|
-
}),
|
|
123
|
-
React.createElement(RadioButton, {
|
|
124
|
-
id: "system",
|
|
125
|
-
labelText: "System",
|
|
126
|
-
value: "system",
|
|
127
|
-
tabIndex: itemTabIndex,
|
|
128
|
-
}),
|
|
129
|
-
React.createElement(RadioButton, {
|
|
130
|
-
id: "dark",
|
|
131
|
-
labelText: "Dark",
|
|
132
|
-
value: "dark",
|
|
133
|
-
tabIndex: itemTabIndex,
|
|
134
|
-
}),
|
|
135
|
-
),
|
|
136
|
-
),
|
|
137
|
-
),
|
|
138
|
-
stageToggle &&
|
|
139
|
-
React.createElement(
|
|
140
|
-
React.Fragment,
|
|
141
|
-
null,
|
|
142
|
-
React.createElement(SwitcherDivider, null),
|
|
143
|
-
React.createElement(
|
|
144
|
-
"div",
|
|
145
|
-
{ style: { padding: ".5rem 1rem" } },
|
|
146
|
-
React.createElement(Toggle, {
|
|
147
|
-
size: "sm",
|
|
148
|
-
id: "toggle-productionfeatures",
|
|
149
|
-
defaultToggled: stageToggle.prodFeaturesEnabled,
|
|
150
|
-
onClick: stageToggle.toggle,
|
|
151
|
-
labelText: "Simulate Production Features",
|
|
152
|
-
tabIndex: itemTabIndex,
|
|
153
|
-
"aria-label": "Simulate Production Features",
|
|
154
|
-
}),
|
|
155
|
-
),
|
|
156
|
-
),
|
|
157
|
-
)
|
|
158
|
-
}
|
|
159
|
-
export default C3UserSidebar
|
|
26
|
+
const { customElements, version, ...sideBarProps } = sideBar;
|
|
27
|
+
const profile = customElements?.profile;
|
|
28
|
+
const themeSelector = customElements?.themeSelector;
|
|
29
|
+
const stageToggle = customElements?.stageToggle;
|
|
30
|
+
const customSection = customElements?.customSection;
|
|
31
|
+
const { isOpen } = useUserSidebarState();
|
|
32
|
+
const itemTabIndex = isOpen ? undefined : -1;
|
|
33
|
+
return (React.createElement(C3NavigationSideBar, { sideBar: {
|
|
34
|
+
...sideBarProps,
|
|
35
|
+
ariaLabel: sideBarProps.ariaLabel || "User Sidebar",
|
|
36
|
+
}, icon: React.createElement(UserAvatar, { size: 20 }), version: version && (React.createElement(VersionWrapper, null,
|
|
37
|
+
React.createElement(Version, null,
|
|
38
|
+
"Version ",
|
|
39
|
+
version),
|
|
40
|
+
React.createElement(Copyright, null,
|
|
41
|
+
"\u00A9 Camunda Services GmbH ",
|
|
42
|
+
new Date().getFullYear()),
|
|
43
|
+
React.createElement(Copyright, null, "All right reserved."))), bottomChildren: customSection },
|
|
44
|
+
profile && (React.createElement("div", { style: {
|
|
45
|
+
padding: "1rem",
|
|
46
|
+
paddingTop: "1.5rem",
|
|
47
|
+
paddingBottom: ".5rem",
|
|
48
|
+
} },
|
|
49
|
+
React.createElement(Stack, { gap: 2 },
|
|
50
|
+
React.createElement(FormLabel, null, profile.label),
|
|
51
|
+
React.createElement(Stack, null,
|
|
52
|
+
React.createElement("div", { className: "textPrimary", style: { fontSize: "14px" } }, profile.user.name),
|
|
53
|
+
React.createElement("div", { className: "textPrimary", style: { fontSize: "12px" } }, profile.user.email))))),
|
|
54
|
+
themeSelector && (React.createElement(React.Fragment, null,
|
|
55
|
+
React.createElement(SwitcherDivider, null),
|
|
56
|
+
React.createElement("div", { style: {
|
|
57
|
+
padding: ".5rem 1rem",
|
|
58
|
+
} },
|
|
59
|
+
React.createElement(RadioButtonGroup, { name: "theme-radio-group", defaultSelected: themeSelector.currentTheme, legendText: "Theme", orientation: "vertical", onChange: (newValue) => {
|
|
60
|
+
themeSelector.onChange(newValue);
|
|
61
|
+
} },
|
|
62
|
+
React.createElement(RadioButton, { id: "light", labelText: "Light", value: "light", tabIndex: itemTabIndex }),
|
|
63
|
+
React.createElement(RadioButton, { id: "system", labelText: "System", value: "system", tabIndex: itemTabIndex }),
|
|
64
|
+
React.createElement(RadioButton, { id: "dark", labelText: "Dark", value: "dark", tabIndex: itemTabIndex }))))),
|
|
65
|
+
stageToggle && (React.createElement(React.Fragment, null,
|
|
66
|
+
React.createElement(SwitcherDivider, null),
|
|
67
|
+
React.createElement("div", { style: { padding: ".5rem 1rem" } },
|
|
68
|
+
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" }))))));
|
|
69
|
+
};
|
|
70
|
+
export default C3UserSidebar;
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const SwitcherDivider: import("styled-components").StyledComponent<
|
|
4
|
-
import("react").FC<import("@carbon/react").SwitcherDividerProps>,
|
|
5
|
-
any,
|
|
6
|
-
{},
|
|
7
|
-
never
|
|
8
|
-
>
|
|
1
|
+
import { SwitcherDivider as CarbonSwitcherDivider } from "@carbon/react";
|
|
2
|
+
export declare const SwitcherDivider: typeof CarbonSwitcherDivider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SwitcherDivider as CarbonSwitcherDivider } from "@carbon/react"
|
|
2
|
-
import styled from "styled-components"
|
|
3
|
-
export const SwitcherDivider = styled(CarbonSwitcherDivider)`
|
|
1
|
+
import { SwitcherDivider as CarbonSwitcherDivider } from "@carbon/react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
export const SwitcherDivider = styled(CarbonSwitcherDivider) `
|
|
4
4
|
margin: auto;
|
|
5
|
-
|
|
5
|
+
`;
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const C3Navigation: ({
|
|
4
|
-
app,
|
|
5
|
-
appBar,
|
|
6
|
-
forwardRef,
|
|
7
|
-
navbar,
|
|
8
|
-
orgSideBar,
|
|
9
|
-
infoSideBar,
|
|
10
|
-
infoButton,
|
|
11
|
-
actionButtons,
|
|
12
|
-
userSideBar,
|
|
13
|
-
notificationSideBar,
|
|
14
|
-
}: C3NavigationProps) => JSX.Element
|
|
1
|
+
import { C3NavigationProps } from "./c3-navigation.types";
|
|
2
|
+
export declare const C3Navigation: ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, infoButton, actionButtons, userSideBar, notificationSideBar, }: C3NavigationProps) => JSX.Element;
|