@camunda/camunda-composite-components 0.0.24 → 0.0.26
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
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# Camunda Composite Components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Camunda Composite Components (also known as **C3**) is the main software artifact of the [Design System Team](https://confluence.camunda.com/display/HAN/Design+System).
|
|
4
|
+
|
|
5
|
+
We have a dedicated slack channel for everyone having questions, comments, bug reports or concerns about this repository: [#camunda-composite-components](https://app.slack.com/client/T0PM0P1SA/C049YH1C202/thread/C03NF7FH17G-1671730364.608129). For more general questions towards the Design System team, please use [#ask-cds](https://app.slack.com/client/T0PM0P1SA/C04FUEGLG8N).
|
|
6
|
+
|
|
7
|
+
If you like the idea of having a repository for your own composite components - how about you do your own **Camunda Custom Composite Components**? Just go over [here](https://github.com/camunda-cloud/c4-starter), fork it, lezgo! A list of C4-Adopters can be found <a href="#c4list">here</a>.
|
|
8
|
+
|
|
9
|
+
## Storybook
|
|
10
|
+
|
|
11
|
+
A live view of the `main` branch can be found [here](https://camunda-composite-components.pages.dev/). When opening a PR, a version of storybook with the changes is deployed automatically and can be accessed by clicking on the link in the PR.
|
|
4
12
|
|
|
5
13
|
## Dev
|
|
6
14
|
|
|
@@ -17,7 +25,7 @@ yarn build
|
|
|
17
25
|
|
|
18
26
|
## Release
|
|
19
27
|
|
|
20
|
-
|
|
28
|
+
Just create a [new release](https://github.com/camunda-cloud/camunda-composite-components/releases/new). This will start a github action to bump the version in `package.json` and publish the package to the github package repository.
|
|
21
29
|
|
|
22
30
|
Pushing to `main` will update the storybook available under [cloudflare page](https://camunda-composite-components.pages.dev/).
|
|
23
31
|
|
|
@@ -42,3 +50,7 @@ return (
|
|
|
42
50
|
/>
|
|
43
51
|
)
|
|
44
52
|
```
|
|
53
|
+
|
|
54
|
+
## <a name="c4list"></a> (incomplete) List of adopters of C3+C4
|
|
55
|
+
|
|
56
|
+
- [console-team](https://confluence.camunda.com/display/HAN/Console+Team) started this, their C4 repo can be found [here](https://github.com/camunda-cloud/camunda-console-composite-components)
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { Button, FormLabel, Header, HeaderContainer, HeaderGlobalAction, HeaderGlobalBar, HeaderMenuItem, HeaderName, HeaderNavigation, HeaderPanel, HeaderSideNavItems, RadioButton, RadioButtonGroup, SideNav, SideNavItems, SideNavLink, SideNavMenu, SideNavMenuItem, SkipToContent, Stack, SwitcherDivider, Tag, Toggle,
|
|
2
|
-
import { Close, Enterprise, Help,
|
|
1
|
+
import { Button, FormLabel, Header, HeaderContainer, HeaderGlobalAction, HeaderGlobalBar, HeaderMenuItem, HeaderName, HeaderNavigation, HeaderPanel, HeaderSideNavItems, RadioButton, RadioButtonGroup, SideNav, SideNavItems, SideNavLink, SideNavMenu, SideNavMenuItem, SkipToContent, Stack, SwitcherDivider, Tag, Toggle, Toggletip, ToggletipButton, ToggletipContent, usePrefix, useTheme, } from "@carbon/react";
|
|
2
|
+
import { Close, Enterprise, Help, UserAvatar } from "@carbon/react/icons";
|
|
3
3
|
import React, { useEffect, useState } from "react";
|
|
4
4
|
import { C3AppMenuIcon } from "../../icons/c3-icons";
|
|
5
5
|
const BREAKPOINT_LG_WIDTH = "66rem"; // This is Carbon's breakpoint (lg) width https://github.com/carbon-design-system/carbon/blob/main/packages/layout/src/index.js#L56
|
|
6
|
-
const C3NavigationExternalLink = ({ label }) =>
|
|
7
|
-
label,
|
|
8
|
-
React.createElement(Launch, { style: {
|
|
9
|
-
transform: `translate(2px, 1px)`,
|
|
10
|
-
verticalAlign: "top",
|
|
11
|
-
} })));
|
|
6
|
+
const C3NavigationExternalLink = ({ label }) => React.createElement(React.Fragment, null, label);
|
|
12
7
|
const C3NavigationAppBar = ({ appBar, forwardRef, navbar, }) => {
|
|
13
8
|
const [appBarOpen, setAppBarOpen] = useState(appBar.isOpen);
|
|
14
9
|
const refPanel = React.createRef();
|
|
@@ -173,18 +168,7 @@ const C3NavigationSideBar = (props) => {
|
|
|
173
168
|
sideBar.customElements &&
|
|
174
169
|
!sideBar.customElements?.activeOrganization && (React.createElement(SwitcherDivider, null)),
|
|
175
170
|
sideBar.elements &&
|
|
176
|
-
sideBar.elements.map((element, index) => (React.createElement(
|
|
177
|
-
element.preceedingDivider && React.createElement(SwitcherDivider, null),
|
|
178
|
-
React.createElement(Button, { style: index === 0 && !sideBar.customElements
|
|
179
|
-
? { marginTop: "1.5rem", whiteSpace: "nowrap" }
|
|
180
|
-
: { whiteSpace: "nowrap" }, size: "sm", kind: element.kind ?? "ghost", className: "cds--switcher__item", onClick: () => {
|
|
181
|
-
if (element.onClick) {
|
|
182
|
-
element.onClick();
|
|
183
|
-
}
|
|
184
|
-
if (sideBar.closeOnClick !== false) {
|
|
185
|
-
setSideBarOpen(false);
|
|
186
|
-
}
|
|
187
|
-
}, tabIndex: itemTabIndex }, element.label)))),
|
|
171
|
+
sideBar.elements.map((element, index) => (React.createElement(C3NavigationSideBarElement, { key: element.key, element: element, index: index, sideBar: sideBar, setSideBarOpen: setSideBarOpen, itemTabIndex: itemTabIndex }))),
|
|
188
172
|
sideBar.type === "info" && sideBar.version !== undefined && (React.createElement(React.Fragment, null,
|
|
189
173
|
React.createElement(SwitcherDivider, null),
|
|
190
174
|
React.createElement("span", { className: "cds--switcher__item", style: {
|
|
@@ -223,6 +207,20 @@ const C3NavigationSideBar = (props) => {
|
|
|
223
207
|
}
|
|
224
208
|
return null;
|
|
225
209
|
};
|
|
210
|
+
const C3NavigationSideBarElement = (props) => {
|
|
211
|
+
return (React.createElement(React.Fragment, null,
|
|
212
|
+
props.element.preceedingDivider && React.createElement(SwitcherDivider, null),
|
|
213
|
+
React.createElement(Button, { style: props.index === 0 && !props.sideBar.customElements
|
|
214
|
+
? { marginTop: "1.5rem", whiteSpace: "nowrap" }
|
|
215
|
+
: { whiteSpace: "nowrap" }, size: "sm", kind: props.element.kind ?? "ghost", className: "cds--switcher__item", onClick: () => {
|
|
216
|
+
if (props.element.onClick) {
|
|
217
|
+
props.element.onClick();
|
|
218
|
+
}
|
|
219
|
+
if (props.sideBar.closeOnClick !== false) {
|
|
220
|
+
props.setSideBarOpen(false);
|
|
221
|
+
}
|
|
222
|
+
}, tabIndex: props.itemTabIndex }, props.element.label)));
|
|
223
|
+
};
|
|
226
224
|
export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, userSideBar, }) => {
|
|
227
225
|
const isLargeScreen = useMediaQuery(`(min-width: ${BREAKPOINT_LG_WIDTH}`);
|
|
228
226
|
const appBarElementsLength = appBar.elements?.length ?? 0;
|