@camunda/camunda-composite-components 0.0.41 → 0.0.42
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 +2 -1
- package/lib/esm/api/api.d.ts +19 -19
- package/lib/esm/api/api.js +65 -67
- package/lib/esm/api/endpoints.const.d.ts +12 -12
- package/lib/esm/api/endpoints.const.js +24 -25
- package/lib/esm/api/jwt.utils.d.ts +3 -3
- package/lib/esm/api/jwt.utils.js +23 -21
- package/lib/esm/api/notifications.d.ts +64 -35
- package/lib/esm/api/notifications.js +168 -159
- package/lib/esm/components/c3-empty-state/c3-empty-state.d.ts +8 -2
- package/lib/esm/components/c3-empty-state/c3-empty-state.js +58 -17
- 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 +13 -5
- 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 +21 -8
- package/lib/esm/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.d.ts +5 -5
- 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 +157 -68
- 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 +58 -37
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts +9 -9
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js +56 -33
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.d.ts +8 -8
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.js +114 -54
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts +70 -60
- 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 +142 -88
- 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 +105 -51
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.d.ts +26 -24
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js +38 -25
- 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 +125 -43
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/components.d.ts +6 -1
- package/lib/esm/components/c3-navigation/c3-navigation-sidebar/components.js +4 -4
- package/lib/esm/components/c3-navigation/c3-navigation.d.ts +13 -2
- package/lib/esm/components/c3-navigation/c3-navigation.js +210 -88
- package/lib/esm/components/c3-navigation/c3-navigation.types.d.ts +69 -63
- 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 +30 -13
- package/lib/esm/components/c3-navigation/c3-notification-provider/c3-notification-container.js +114 -70
- package/lib/esm/components/c3-navigation/c3-notification-provider/c3-notification-provider.d.ts +29 -27
- package/lib/esm/components/c3-navigation/c3-notification-provider/c3-notification-provider.js +118 -90
- package/lib/esm/components/c3-navigation/helpers.d.ts +5 -3
- package/lib/esm/components/c3-navigation/helpers.js +53 -49
- package/lib/esm/components/c3-navigation/index.d.ts +4 -2
- package/lib/esm/components/c3-navigation/index.js +3 -3
- package/lib/esm/components/c3-navigation/story-helpers.d.ts +23 -18
- package/lib/esm/components/c3-navigation/story-helpers.js +189 -186
- package/lib/esm/components/c3-navigation/story-templates.d.ts +8 -8
- package/lib/esm/components/c3-navigation/story-templates.js +66 -33
- package/lib/esm/components/c3-user-configuration/c3-user-configuration-provider.d.ts +20 -16
- package/lib/esm/components/c3-user-configuration/c3-user-configuration-provider.js +9 -4
- package/lib/esm/icons/c3-icons.d.ts +7 -5
- package/lib/esm/icons/c3-icons.js +82 -14
- 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 +14 -9
- package/lib/esm/index.js +4 -4
- package/package.json +2 -1
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
C3NavigationAppProps,
|
|
4
|
+
C3NavigationElementProps,
|
|
5
|
+
C3NavigationNavBarProps,
|
|
6
|
+
C3NavigationProps,
|
|
7
|
+
} from "./c3-navigation.types"
|
|
8
|
+
export declare function createAppProps(): C3NavigationAppProps
|
|
4
9
|
export declare function createAppBarProps(options?: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}): C3NavigationProps["appBar"]
|
|
10
|
+
isOpen?: boolean
|
|
11
|
+
elements?: Array<C3NavigationElementProps>
|
|
12
|
+
}): C3NavigationProps["appBar"]
|
|
8
13
|
export declare function createNavBarBarProps(options?: {
|
|
9
|
-
|
|
10
|
-
}): C3NavigationNavBarProps
|
|
14
|
+
elements?: C3NavigationNavBarProps["elements"]
|
|
15
|
+
}): C3NavigationNavBarProps
|
|
11
16
|
export declare function createInfoSideBarProps(options: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}): C3NavigationProps["infoSideBar"]
|
|
17
|
+
isOpen: boolean
|
|
18
|
+
preceedingDividerOn2ndElement?: boolean
|
|
19
|
+
}): C3NavigationProps["infoSideBar"]
|
|
15
20
|
export declare function createOrgSideBarProps(options: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}): C3NavigationProps["orgSideBar"]
|
|
21
|
+
isOpen: boolean
|
|
22
|
+
orgCount: number
|
|
23
|
+
}): C3NavigationProps["orgSideBar"]
|
|
19
24
|
export declare function createUserSideBarProps(options: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}): C3NavigationProps["userSideBar"]
|
|
25
|
+
isOpen: boolean
|
|
26
|
+
customSection?: JSX.Element
|
|
27
|
+
}): C3NavigationProps["userSideBar"]
|
|
23
28
|
export declare function createNotificationSideBarProps(options: {
|
|
24
|
-
|
|
25
|
-
}): C3NavigationProps["notificationSideBar"]
|
|
29
|
+
isOpen: boolean
|
|
30
|
+
}): C3NavigationProps["notificationSideBar"]
|
|
@@ -1,200 +1,203 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { Link } from "@carbon/react"
|
|
3
|
-
import { ArrowRight } from "@carbon/react/icons"
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Link } from "@carbon/react"
|
|
3
|
+
import { ArrowRight } from "@carbon/react/icons"
|
|
4
4
|
export function createAppProps() {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
return {
|
|
6
|
+
name: "Console",
|
|
7
|
+
ariaLabel: "Camunda Console",
|
|
8
|
+
routeProps: {
|
|
9
|
+
href: "https://www.camunda.com",
|
|
10
|
+
},
|
|
11
|
+
}
|
|
12
12
|
}
|
|
13
13
|
export function createAppBarProps(options = {}) {
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
14
|
+
return {
|
|
15
|
+
isOpen: Boolean(options?.isOpen),
|
|
16
|
+
elements: options?.elements ?? [
|
|
17
|
+
{
|
|
18
|
+
key: "console",
|
|
19
|
+
label: "Console",
|
|
20
|
+
active: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: "modeler",
|
|
24
|
+
label: "Modeler",
|
|
25
|
+
active: false,
|
|
26
|
+
routeProps: { onClick: () => console.log("Redirecting to Modeler...") },
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: "operate",
|
|
30
|
+
label: "Operate",
|
|
31
|
+
active: false,
|
|
32
|
+
target: "_blank",
|
|
33
|
+
href: "https://camunda.com/",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: "tasklist",
|
|
37
|
+
label: "Task List",
|
|
38
|
+
active: false,
|
|
39
|
+
subElements: [
|
|
40
|
+
{
|
|
41
|
+
key: "cluster-a",
|
|
42
|
+
label: "Cluster A",
|
|
43
|
+
href: "https://camunda.com/",
|
|
44
|
+
target: "_blank",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: "cluster-b",
|
|
48
|
+
label: "Cluster B",
|
|
49
|
+
onClick: () => console.log("Redirecting to Tasklist..."),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: "cluster-c",
|
|
53
|
+
label: "Cluster C",
|
|
54
|
+
routeProps: {
|
|
55
|
+
onClick: () => console.log("Redirecting to Tasklist..."),
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
}
|
|
62
62
|
}
|
|
63
63
|
export function createNavBarBarProps(options = {}) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
64
|
+
return {
|
|
65
|
+
elements: options?.elements ?? [
|
|
66
|
+
{
|
|
67
|
+
key: "dashboard",
|
|
68
|
+
label: "Dashboard",
|
|
69
|
+
isCurrentPage: true,
|
|
70
|
+
routeProps: {},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: "clusters",
|
|
74
|
+
label: "Clusters",
|
|
75
|
+
isCurrentPage: false,
|
|
76
|
+
routeProps: {
|
|
77
|
+
onClick: () => console.log("Redirecting to clusters..."),
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
orgName: "Camunda",
|
|
82
|
+
tags: [
|
|
83
|
+
{
|
|
84
|
+
key: "stage",
|
|
85
|
+
label: "Production",
|
|
86
|
+
color: "red",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
key: "githash",
|
|
90
|
+
label: "abcdefg",
|
|
91
|
+
color: "teal",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
key: "fooTooltip",
|
|
95
|
+
label: "I am a tooltip pill",
|
|
96
|
+
color: "cool-gray",
|
|
97
|
+
tooltip: {
|
|
98
|
+
content: React.createElement(
|
|
99
|
+
"p",
|
|
100
|
+
null,
|
|
101
|
+
"tooltip popover with a",
|
|
102
|
+
" ",
|
|
103
|
+
React.createElement(Link, { href: "http://camunda.com/" }, "link"),
|
|
104
|
+
),
|
|
105
|
+
buttonLabel: "open the tooltip",
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
}
|
|
107
110
|
}
|
|
108
111
|
export function createInfoSideBarProps(options) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
112
|
+
return {
|
|
113
|
+
isOpen: options.isOpen,
|
|
114
|
+
onOpen: () => console.log("Opened info sidebar"),
|
|
115
|
+
elements: [
|
|
116
|
+
{
|
|
117
|
+
key: "info1",
|
|
118
|
+
label: "Info 1",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
key: "info2",
|
|
122
|
+
label: "Info 2",
|
|
123
|
+
preceedingDivider: options.preceedingDividerOn2ndElement,
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
version: "8.2.0-alpha2",
|
|
127
|
+
}
|
|
125
128
|
}
|
|
126
129
|
export function createOrgSideBarProps(options) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
130
|
+
const elements = []
|
|
131
|
+
for (let i = 0; i < options.orgCount; i++) {
|
|
132
|
+
elements.push({
|
|
133
|
+
key: `org-${i}`,
|
|
134
|
+
label: `Organization ${i}`,
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
isOpen: options.isOpen,
|
|
139
|
+
customElements: {
|
|
140
|
+
activeOrganization: {
|
|
141
|
+
activeLabel: "Active Organization",
|
|
142
|
+
otherLabel: "Other Organization",
|
|
143
|
+
orgName: "Camunda",
|
|
144
|
+
action: {
|
|
145
|
+
label: "Manage",
|
|
146
|
+
onClick: () => console.log("Manage organization"),
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
elements,
|
|
151
|
+
}
|
|
149
152
|
}
|
|
150
153
|
export function createUserSideBarProps(options) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
154
|
+
return {
|
|
155
|
+
isOpen: options.isOpen,
|
|
156
|
+
customElements: {
|
|
157
|
+
customSection: options.customSection,
|
|
158
|
+
profile: {
|
|
159
|
+
label: "Profile",
|
|
160
|
+
user: {
|
|
161
|
+
email: "teamcloud@camunda.com",
|
|
162
|
+
name: "Team Cloud",
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
themeSelector: {
|
|
166
|
+
currentTheme: "dark",
|
|
167
|
+
onChange: () => console.log("Selected dark theme"),
|
|
168
|
+
},
|
|
169
|
+
stageToggle: {
|
|
170
|
+
prodFeaturesEnabled: true,
|
|
171
|
+
toggle: () => console.log("Toggle stage"),
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
elements: [
|
|
175
|
+
{
|
|
176
|
+
key: "cookie",
|
|
177
|
+
label: "Cookie Preferences",
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
key: "terms",
|
|
181
|
+
label: "Terms of use",
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
key: "delete",
|
|
185
|
+
label: "Delete account",
|
|
186
|
+
kind: "danger--ghost",
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
bottomElements: [
|
|
190
|
+
{
|
|
191
|
+
key: "logout",
|
|
192
|
+
label: "Logout",
|
|
193
|
+
kind: "ghost",
|
|
194
|
+
renderIcon: ArrowRight,
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
}
|
|
195
198
|
}
|
|
196
199
|
export function createNotificationSideBarProps(options) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
+
return {
|
|
201
|
+
isOpen: options.isOpen,
|
|
202
|
+
}
|
|
200
203
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { FC } from "react"
|
|
2
|
-
import { C3Navigation } from "./c3-navigation"
|
|
3
|
-
import { ComponentStory } from "@storybook/react"
|
|
4
|
-
export declare const DefaultTemplate: ComponentStory<typeof C3Navigation
|
|
1
|
+
import { FC } from "react"
|
|
2
|
+
import { C3Navigation } from "./c3-navigation"
|
|
3
|
+
import { ComponentStory } from "@storybook/react"
|
|
4
|
+
export declare const DefaultTemplate: ComponentStory<typeof C3Navigation>
|
|
5
5
|
export declare const SuperUserToggle: FC<{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
export declare const NavbarWithCustomSection: FC
|
|
6
|
+
isActive?: boolean
|
|
7
|
+
onChange?: (newValue: boolean) => void
|
|
8
|
+
}>
|
|
9
|
+
export declare const NavbarWithCustomSection: FC
|
|
@@ -1,35 +1,68 @@
|
|
|
1
|
-
import React, { useState } from "react"
|
|
2
|
-
import { C3Navigation } from "./c3-navigation"
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
import { C3Navigation } from "./c3-navigation"
|
|
3
|
+
import {
|
|
4
|
+
createAppBarProps,
|
|
5
|
+
createAppProps,
|
|
6
|
+
createNavBarBarProps,
|
|
7
|
+
createUserSideBarProps,
|
|
8
|
+
} from "./story-helpers"
|
|
9
|
+
import { SwitcherDivider, Toggle } from "@carbon/react"
|
|
10
|
+
export const DefaultTemplate = (args) =>
|
|
11
|
+
React.createElement(
|
|
12
|
+
React.Fragment,
|
|
13
|
+
null,
|
|
14
|
+
React.createElement(C3Navigation, { ...args }),
|
|
15
|
+
React.createElement("div", { id: "main-content" }),
|
|
16
|
+
)
|
|
8
17
|
export const SuperUserToggle = ({ isActive, onChange }) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
return React.createElement(
|
|
19
|
+
React.Fragment,
|
|
20
|
+
null,
|
|
21
|
+
React.createElement(SwitcherDivider, null),
|
|
22
|
+
React.createElement(
|
|
23
|
+
"div",
|
|
24
|
+
{ style: { padding: ".5rem 1rem" } },
|
|
25
|
+
React.createElement(Toggle, {
|
|
26
|
+
size: "sm",
|
|
27
|
+
id: "toggle-super-admin-mode",
|
|
28
|
+
defaultToggled: isActive,
|
|
29
|
+
onToggle: (superAdminModeActive) => onChange?.(superAdminModeActive),
|
|
30
|
+
labelText: "Enter super-admin mode",
|
|
31
|
+
"aria-label": "Enter super-admin mode",
|
|
32
|
+
}),
|
|
33
|
+
),
|
|
34
|
+
)
|
|
35
|
+
}
|
|
14
36
|
export const NavbarWithCustomSection = () => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
37
|
+
const [isSuperAdminModeActive, setIsSuperAdminModeActive] = useState(true)
|
|
38
|
+
return React.createElement(
|
|
39
|
+
React.Fragment,
|
|
40
|
+
null,
|
|
41
|
+
React.createElement(C3Navigation, {
|
|
42
|
+
app: createAppProps(),
|
|
43
|
+
appBar: createAppBarProps(),
|
|
44
|
+
navbar: {
|
|
45
|
+
...createNavBarBarProps(),
|
|
46
|
+
tags: isSuperAdminModeActive
|
|
47
|
+
? [
|
|
48
|
+
{
|
|
49
|
+
key: "superUserMode",
|
|
50
|
+
label: "Super-user mode",
|
|
51
|
+
color: "high-contrast",
|
|
52
|
+
},
|
|
53
|
+
]
|
|
54
|
+
: undefined,
|
|
55
|
+
},
|
|
56
|
+
userSideBar: {
|
|
57
|
+
...createUserSideBarProps({ isOpen: false }),
|
|
58
|
+
customElements: {
|
|
59
|
+
customSection: React.createElement(SuperUserToggle, {
|
|
60
|
+
isActive: isSuperAdminModeActive,
|
|
61
|
+
onChange: setIsSuperAdminModeActive,
|
|
62
|
+
}),
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
React.createElement("div", { id: "main-content" }),
|
|
67
|
+
)
|
|
68
|
+
}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import React, { FC, ReactNode } from "react"
|
|
2
|
-
import { Endpoints, Stage } from "../../api/endpoints.const"
|
|
1
|
+
import React, { FC, ReactNode } from "react"
|
|
2
|
+
import { Endpoints, Stage } from "../../api/endpoints.const"
|
|
3
3
|
declare type C3UserConfigurationBase = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
4
|
+
activeOrganizationId: string
|
|
5
|
+
userToken: string
|
|
6
|
+
getNewUserToken: () => Promise<string>
|
|
7
|
+
}
|
|
8
8
|
declare type C3UserConfigurationWithEndpoints = C3UserConfigurationBase & {
|
|
9
|
-
|
|
10
|
-
}
|
|
9
|
+
endpoints: Endpoints
|
|
10
|
+
}
|
|
11
11
|
declare type C3UserConfigurationWithStage = C3UserConfigurationBase & {
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
export declare type C3UserConfiguration =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
stage: Stage
|
|
13
|
+
}
|
|
14
|
+
export declare type C3UserConfiguration =
|
|
15
|
+
| C3UserConfigurationWithEndpoints
|
|
16
|
+
| C3UserConfigurationWithStage
|
|
17
|
+
export declare const C3UserConfigurationContext: React.Context<C3UserConfiguration | null>
|
|
18
|
+
declare const C3UserConfigurationProvider: FC<
|
|
19
|
+
C3UserConfiguration & {
|
|
20
|
+
children?: ReactNode
|
|
21
|
+
}
|
|
22
|
+
>
|
|
23
|
+
export default C3UserConfigurationProvider
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
export const C3UserConfigurationContext = React.createContext(null)
|
|
3
|
-
const C3UserConfigurationProvider = ({ children, ...config }) =>
|
|
4
|
-
|
|
1
|
+
import React from "react"
|
|
2
|
+
export const C3UserConfigurationContext = React.createContext(null)
|
|
3
|
+
const C3UserConfigurationProvider = ({ children, ...config }) =>
|
|
4
|
+
React.createElement(
|
|
5
|
+
C3UserConfigurationContext.Provider,
|
|
6
|
+
{ value: config },
|
|
7
|
+
children,
|
|
8
|
+
)
|
|
9
|
+
export default C3UserConfigurationProvider
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { C3IconProps } from "./c3-icons.types"
|
|
3
|
-
export declare const C3AppMenuIcon: ({ size }: C3IconProps) => JSX.Element
|
|
4
|
-
export declare const C3NotificationsUnreadIcon: ({
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { C3IconProps } from "./c3-icons.types"
|
|
3
|
+
export declare const C3AppMenuIcon: ({ size }: C3IconProps) => JSX.Element
|
|
4
|
+
export declare const C3NotificationsUnreadIcon: ({
|
|
5
|
+
size,
|
|
6
|
+
}: C3IconProps) => JSX.Element
|
|
7
|
+
export declare const C3BellIcon: ({ size }: C3IconProps) => JSX.Element
|
|
8
|
+
export declare const CamundaLogo: () => JSX.Element
|