@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,170 +1,161 @@
|
|
|
1
|
-
import { EventSourcePolyfill } from "event-source-polyfill"
|
|
2
|
-
import { request } from "./api"
|
|
3
|
-
import { getEndpointByOptions, NOTIFICATIONS } from "./endpoints.const"
|
|
1
|
+
import { EventSourcePolyfill } from "event-source-polyfill";
|
|
2
|
+
import { request } from "./api";
|
|
3
|
+
import { getEndpointByOptions, NOTIFICATIONS } from "./endpoints.const";
|
|
4
4
|
export class NotificationService {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
notificationIds.includes(notification.uuid),
|
|
162
|
-
)
|
|
163
|
-
foundNotifications.forEach((foundNotification) => {
|
|
164
|
-
foundNotification.state = newState
|
|
165
|
-
})
|
|
166
|
-
break
|
|
167
|
-
}
|
|
168
|
-
return updatedNotifications
|
|
169
|
-
}
|
|
5
|
+
static async getNotifications(options) {
|
|
6
|
+
let notifications = [];
|
|
7
|
+
try {
|
|
8
|
+
notifications = await request({
|
|
9
|
+
method: "get",
|
|
10
|
+
base: "notifications",
|
|
11
|
+
stage: options.stage,
|
|
12
|
+
endpoints: options.endpoints,
|
|
13
|
+
camundaAuth: {
|
|
14
|
+
token: options.userToken,
|
|
15
|
+
refreshTokenMethod: options.getNewUserToken,
|
|
16
|
+
},
|
|
17
|
+
url: `notifications/orgs/${options.activeOrganizationId}`,
|
|
18
|
+
});
|
|
19
|
+
return notifications;
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
console.error(error);
|
|
23
|
+
}
|
|
24
|
+
return notifications;
|
|
25
|
+
}
|
|
26
|
+
static sendAnalyticsEvent(options, eventOptions) {
|
|
27
|
+
request({
|
|
28
|
+
method: "post",
|
|
29
|
+
base: "notifications",
|
|
30
|
+
stage: options.stage,
|
|
31
|
+
endpoints: options.endpoints,
|
|
32
|
+
camundaAuth: {
|
|
33
|
+
token: options.userToken,
|
|
34
|
+
refreshTokenMethod: options.getNewUserToken,
|
|
35
|
+
},
|
|
36
|
+
url: `analytics/${options.activeOrganizationId}/${eventOptions.event}`,
|
|
37
|
+
body: {
|
|
38
|
+
id: eventOptions.id,
|
|
39
|
+
},
|
|
40
|
+
responseType: "text",
|
|
41
|
+
})
|
|
42
|
+
.then(() => {
|
|
43
|
+
// do nothing
|
|
44
|
+
})
|
|
45
|
+
.catch((error) => {
|
|
46
|
+
console.error(error);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
static changeState(options, notificationId, operation) {
|
|
50
|
+
request({
|
|
51
|
+
method: "patch",
|
|
52
|
+
base: "notifications",
|
|
53
|
+
stage: options.stage,
|
|
54
|
+
endpoints: options.endpoints,
|
|
55
|
+
camundaAuth: {
|
|
56
|
+
token: options.userToken,
|
|
57
|
+
refreshTokenMethod: options.getNewUserToken,
|
|
58
|
+
},
|
|
59
|
+
url: `notifications/${notificationId}/${operation}`,
|
|
60
|
+
})
|
|
61
|
+
.then(() => {
|
|
62
|
+
// do nothing
|
|
63
|
+
})
|
|
64
|
+
.catch((error) => {
|
|
65
|
+
console.error(error);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
static changeManyStates(options, notificationIds, operation) {
|
|
69
|
+
if (notificationIds.length === 0) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
request({
|
|
73
|
+
method: "patch",
|
|
74
|
+
base: "notifications",
|
|
75
|
+
stage: options.stage,
|
|
76
|
+
endpoints: options.endpoints,
|
|
77
|
+
camundaAuth: {
|
|
78
|
+
token: options.userToken,
|
|
79
|
+
refreshTokenMethod: options.getNewUserToken,
|
|
80
|
+
},
|
|
81
|
+
url: `notifications/batch/state/${operation}`,
|
|
82
|
+
body: {
|
|
83
|
+
uuids: notificationIds,
|
|
84
|
+
},
|
|
85
|
+
})
|
|
86
|
+
.then(() => {
|
|
87
|
+
// do nothing
|
|
88
|
+
})
|
|
89
|
+
.catch((error) => {
|
|
90
|
+
console.error(error);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
static notificationsStream(options, handler) {
|
|
94
|
+
const baseUrl = getEndpointByOptions({
|
|
95
|
+
...options,
|
|
96
|
+
endpoint: NOTIFICATIONS,
|
|
97
|
+
});
|
|
98
|
+
const source = new EventSourcePolyfill(`${baseUrl}/notifications/events`, {
|
|
99
|
+
headers: {
|
|
100
|
+
authorization: `Bearer ${options.userToken}`,
|
|
101
|
+
},
|
|
102
|
+
heartbeatTimeout: 1000 * 60 * 60,
|
|
103
|
+
});
|
|
104
|
+
source.onmessage = function (event) {
|
|
105
|
+
try {
|
|
106
|
+
const notification = JSON.parse(event.data);
|
|
107
|
+
if (!notification.keepAlive) {
|
|
108
|
+
handler(notification);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
console.error(`Failed to handle SSE event`, { error });
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
// updates <allNotifications> with <newNotification>
|
|
117
|
+
// if <newNotification> is read or new, it will be added to <allNotifications>
|
|
118
|
+
// if <newNotification> is dismissed, it will be removed from <allNotifications>
|
|
119
|
+
static updateNotifications(allNotifications, newNotification) {
|
|
120
|
+
const updatedNotifications = allNotifications
|
|
121
|
+
.slice()
|
|
122
|
+
.filter((currentNotification) => currentNotification.uuid !== newNotification.uuid);
|
|
123
|
+
if (newNotification.state === "read" || newNotification.state === "new") {
|
|
124
|
+
updatedNotifications.push(newNotification);
|
|
125
|
+
}
|
|
126
|
+
updatedNotifications.sort((a, b) => b.timestamp - a.timestamp);
|
|
127
|
+
return updatedNotifications;
|
|
128
|
+
}
|
|
129
|
+
static updateNotificationState(allNotifications, notificationId, newState) {
|
|
130
|
+
let updatedNotifications = allNotifications.slice();
|
|
131
|
+
let foundNotification;
|
|
132
|
+
switch (newState) {
|
|
133
|
+
case "dismiss":
|
|
134
|
+
updatedNotifications = updatedNotifications.filter((notification) => notification.uuid !== notificationId);
|
|
135
|
+
break;
|
|
136
|
+
case "read":
|
|
137
|
+
foundNotification = updatedNotifications.find((currentNotification) => currentNotification.uuid === notificationId);
|
|
138
|
+
if (foundNotification) {
|
|
139
|
+
foundNotification.state = newState;
|
|
140
|
+
}
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
return updatedNotifications;
|
|
144
|
+
}
|
|
145
|
+
static updateNotificationStates(allNotifications, notificationIds, newState) {
|
|
146
|
+
let updatedNotifications = allNotifications.slice();
|
|
147
|
+
let foundNotifications = [];
|
|
148
|
+
switch (newState) {
|
|
149
|
+
case "dismiss":
|
|
150
|
+
updatedNotifications = updatedNotifications.filter((notification) => !notificationIds.includes(notification.uuid));
|
|
151
|
+
break;
|
|
152
|
+
case "read":
|
|
153
|
+
foundNotifications = updatedNotifications.filter((notification) => notificationIds.includes(notification.uuid));
|
|
154
|
+
foundNotifications.forEach((foundNotification) => {
|
|
155
|
+
foundNotification.state = newState;
|
|
156
|
+
});
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
return updatedNotifications;
|
|
160
|
+
}
|
|
170
161
|
}
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const C3EmptyState: ({
|
|
4
|
-
icon,
|
|
5
|
-
heading,
|
|
6
|
-
description,
|
|
7
|
-
button,
|
|
8
|
-
link,
|
|
9
|
-
}: C3EmptyStateProps) => JSX.Element
|
|
1
|
+
import { C3EmptyStateProps } from "./c3-empty-state.types";
|
|
2
|
+
export declare const C3EmptyState: ({ icon, heading, description, button, link, }: C3EmptyStateProps) => JSX.Element;
|
|
@@ -1,58 +1,17 @@
|
|
|
1
|
-
import { Stack, Tile, Button, Link } from "@carbon/react"
|
|
2
|
-
import React from "react"
|
|
3
|
-
export const C3EmptyState = ({ icon, heading, description, button, link }) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Stack,
|
|
19
|
-
{ gap: 3 },
|
|
20
|
-
React.createElement("h2", null, heading),
|
|
21
|
-
React.createElement(
|
|
22
|
-
Stack,
|
|
23
|
-
{ gap: 6 },
|
|
24
|
-
React.createElement(
|
|
25
|
-
"p",
|
|
26
|
-
{ style: { maxWidth: "400px" } },
|
|
27
|
-
description,
|
|
28
|
-
),
|
|
29
|
-
React.createElement(
|
|
30
|
-
Stack,
|
|
31
|
-
{ gap: 5 },
|
|
32
|
-
button &&
|
|
33
|
-
React.createElement(
|
|
34
|
-
Button,
|
|
35
|
-
{
|
|
36
|
-
id: button.id,
|
|
37
|
-
size: "md",
|
|
38
|
-
onClick: button.onClick,
|
|
39
|
-
renderIcon: button.icon,
|
|
40
|
-
disabled: button.disabled,
|
|
41
|
-
},
|
|
42
|
-
button.label,
|
|
43
|
-
),
|
|
44
|
-
link &&
|
|
45
|
-
React.createElement(
|
|
46
|
-
"div",
|
|
47
|
-
null,
|
|
48
|
-
React.createElement(
|
|
49
|
-
Link,
|
|
50
|
-
{ target: "_blank", href: link.href, onClick: link.onClick },
|
|
51
|
-
link.label,
|
|
52
|
-
),
|
|
53
|
-
),
|
|
54
|
-
),
|
|
55
|
-
),
|
|
56
|
-
),
|
|
57
|
-
),
|
|
58
|
-
)
|
|
1
|
+
import { Stack, Tile, Button, Link } from "@carbon/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export const C3EmptyState = ({ icon, heading, description, button, link, }) => (React.createElement(Tile, { style: {
|
|
4
|
+
paddingLeft: "5rem",
|
|
5
|
+
paddingTop: "3rem",
|
|
6
|
+
paddingBottom: "3rem",
|
|
7
|
+
} },
|
|
8
|
+
React.createElement(Stack, { orientation: "horizontal", gap: 6 },
|
|
9
|
+
icon && React.createElement("img", { src: icon.path, alt: icon.altText }),
|
|
10
|
+
React.createElement(Stack, { gap: 3 },
|
|
11
|
+
React.createElement("h2", null, heading),
|
|
12
|
+
React.createElement(Stack, { gap: 6 },
|
|
13
|
+
React.createElement("p", { style: { maxWidth: "400px" } }, description),
|
|
14
|
+
React.createElement(Stack, { gap: 5 },
|
|
15
|
+
button && (React.createElement(Button, { id: button.id, size: "md", onClick: button.onClick, renderIcon: button.icon, disabled: button.disabled }, button.label)),
|
|
16
|
+
link && (React.createElement("div", null,
|
|
17
|
+
React.createElement(Link, { target: "_blank", href: link.href, onClick: link.onClick }, link.label)))))))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { expect, test } from "@playwright/test";
|
|
2
|
+
import { getStory } from "../test-utils";
|
|
3
|
+
test.describe("Empty State", () => {
|
|
4
|
+
test("Basic", async ({ page }) => {
|
|
5
|
+
await getStory(page, "components-c3emptystate--basic");
|
|
6
|
+
await expect(page).toHaveScreenshot();
|
|
7
|
+
});
|
|
8
|
+
test("No icon", async ({ page }) => {
|
|
9
|
+
await getStory(page, "components-c3emptystate--no-icon");
|
|
10
|
+
await expect(page).toHaveScreenshot();
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { ReactElement } from "react"
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
2
|
export interface C3EmptyStateProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
3
|
+
heading: string;
|
|
4
|
+
description: string | ReactElement;
|
|
5
|
+
icon?: {
|
|
6
|
+
path: string;
|
|
7
|
+
altText: string;
|
|
8
|
+
};
|
|
9
|
+
button?: {
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
label: string;
|
|
13
|
+
icon?: any;
|
|
14
|
+
id?: string;
|
|
15
|
+
};
|
|
16
|
+
link?: {
|
|
17
|
+
href: string;
|
|
18
|
+
label: string;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
};
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from "react"
|
|
1
|
+
import { FC } from "react";
|
|
2
2
|
export declare const InfoButton: FC<{
|
|
3
|
-
|
|
4
|
-
}
|
|
3
|
+
onClick: () => void;
|
|
4
|
+
}>;
|
|
@@ -1,13 +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 }) =>
|
|
5
|
-
|
|
6
|
-
HeaderGlobalAction,
|
|
7
|
-
{
|
|
8
|
-
"aria-label": "Open Help Center",
|
|
9
|
-
tooltipAlignment: "center",
|
|
10
|
-
onClick: onClick,
|
|
11
|
-
},
|
|
12
|
-
React.createElement(Help, { size: 20 }),
|
|
13
|
-
)
|
|
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,6 +1,6 @@
|
|
|
1
|
-
import { FC } from "react"
|
|
2
|
-
import { C3ActionButtonsProps } from "./c3-action-buttons.types"
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { C3ActionButtonsProps } from "./c3-action-buttons.types";
|
|
3
3
|
declare const C3ActionButtons: FC<{
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export default C3ActionButtons
|
|
4
|
+
elements: C3ActionButtonsProps;
|
|
5
|
+
}>;
|
|
6
|
+
export default C3ActionButtons;
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const C3ActionButtons = ({ elements }) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
key: `${actionButton.label}-key`,
|
|
15
|
-
},
|
|
16
|
-
actionButton.icon,
|
|
17
|
-
)
|
|
18
|
-
}),
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
export default C3ActionButtons
|
|
1
|
+
import { HeaderGlobalAction } from "@carbon/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
const C3ActionButtons = ({ elements, }) => {
|
|
4
|
+
return (React.createElement(React.Fragment, null, elements.map((actionButton) => {
|
|
5
|
+
if ("element" in actionButton) {
|
|
6
|
+
return actionButton.element;
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
return (React.createElement(HeaderGlobalAction, { "aria-label": `Open ${actionButton.label}`, onClick: actionButton.action, isActive: false, key: `${actionButton.label}-key` }, actionButton.icon));
|
|
10
|
+
}
|
|
11
|
+
})));
|
|
12
|
+
};
|
|
13
|
+
export default C3ActionButtons;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { ReactElement } from "react"
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
export interface C3ActionButtonElement {
|
|
3
|
+
element: JSX.Element;
|
|
4
|
+
}
|
|
5
|
+
export interface C3ActionButtonSimple {
|
|
6
|
+
label: string;
|
|
7
|
+
icon: ReactElement;
|
|
8
|
+
action: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare type C3ActionButtonsProps = Array<C3ActionButtonElement | C3ActionButtonSimple>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { C3NavigationProps } from "./c3-navigation.types"
|
|
3
|
-
export declare const C3NavigationAppBar: React.FC<C3NavigationProps
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { C3NavigationProps } from "./c3-navigation.types";
|
|
3
|
+
export declare const C3NavigationAppBar: React.FC<C3NavigationProps>;
|