@camunda/camunda-composite-components 0.0.42-rc.0 → 0.0.43

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
@@ -53,4 +53,5 @@ return (
53
53
 
54
54
  ## <a name="c4list"></a> (incomplete) List of adopters of C3+C4
55
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)
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-cloud-management-apps/tree/main/packages/c4)
57
+ - [Identity team](https://github.com/camunda/team-identity): [c4-identity](https://github.com/camunda-cloud/c4-identity)
@@ -4,6 +4,10 @@ import { Help } from "@carbon/react/icons"
4
4
  import C3NavigationSideBar from "./c3-navigation-sidebar"
5
5
  const C3InfoSidebar = ({ sideBar }) => {
6
6
  const { version, ...sideBarProps } = sideBar
7
+ if (version)
8
+ console.warn(
9
+ "The `version` prop in the info sidebar is deprecated and will be removed in a future release. Please set `version` in the `userSideBar` prop instead.",
10
+ )
7
11
  return React.createElement(C3NavigationSideBar, {
8
12
  sideBar: {
9
13
  ...sideBarProps,
@@ -4,6 +4,7 @@ declare const C3NavigationSideBar: (props: {
4
4
  sideBar: C3NavigationSideBarProps
5
5
  icon: ReactElement
6
6
  children?: ReactNode
7
+ version?: ReactNode
7
8
  bottomChildren?: ReactNode
8
9
  }) => JSX.Element
9
10
  export default C3NavigationSideBar
@@ -31,7 +31,7 @@ const BottomElements = styled.div`
31
31
  }
32
32
  `
33
33
  const C3NavigationSideBar = (props) => {
34
- const { icon, sideBar, children, bottomChildren } = props
34
+ const { icon, sideBar, children, version, bottomChildren } = props
35
35
  const { callbacks, onOpen } = sideBar
36
36
  const { isOpen, setIsOpen: setOpenState } = useSidebarState()[sideBar.type]
37
37
  const setIsOpen = (open) => {
@@ -92,6 +92,7 @@ const C3NavigationSideBar = (props) => {
92
92
  ),
93
93
  bottomChildren,
94
94
  ),
95
+ version,
95
96
  React.createElement(
96
97
  BottomElements,
97
98
  null,
@@ -33,6 +33,7 @@ export declare type C3NavigationInfoSideBarProps =
33
33
  export declare type C3NavigationUserSideBarProps =
34
34
  C3NavigationSideBarBaseProps & {
35
35
  type: "user"
36
+ version?: string
36
37
  customElements?: {
37
38
  customSection?: JSX.Element
38
39
  profile?: {
@@ -9,9 +9,28 @@ import {
9
9
  Toggle,
10
10
  } from "@carbon/react"
11
11
  import { UserAvatar } from "@carbon/react/icons"
12
+ import styled from "styled-components"
12
13
  import { useUserSidebarState } from "./c3-sidebar-state-provider"
14
+ const VersionWrapper = styled.div`
15
+ align-self: end;
16
+ padding: 0.5rem 1rem;
17
+ `
18
+ const Version = styled.p`
19
+ color: var(--cds-text-primary);
20
+ font-size: var(--cds-label-02-font-size);
21
+ font-weight: var(--cds-label-02-font-weight);
22
+ line-height: var(--cds-label-02-line-height);
23
+ letter-spacing: var(--cds-label-02-letter-spacing);
24
+ `
25
+ const Copyright = styled.p`
26
+ color: var(--cds-text-secondary);
27
+ font-size: var(--cds-label-01-font-size);
28
+ font-weight: var(--cds-label-01-font-weight);
29
+ line-height: var(--cds-label-01-line-height);
30
+ letter-spacing: var(--cds-label-01-letter-spacing);
31
+ `
13
32
  const C3UserSidebar = ({ sideBar }) => {
14
- const { customElements, ...sideBarProps } = sideBar
33
+ const { customElements, version, ...sideBarProps } = sideBar
15
34
  const profile = customElements?.profile
16
35
  const themeSelector = customElements?.themeSelector
17
36
  const stageToggle = customElements?.stageToggle
@@ -26,6 +45,20 @@ const C3UserSidebar = ({ sideBar }) => {
26
45
  ariaLabel: sideBarProps.ariaLabel || "User Sidebar",
27
46
  },
28
47
  icon: React.createElement(UserAvatar, { size: 20 }),
48
+ version:
49
+ version &&
50
+ React.createElement(
51
+ VersionWrapper,
52
+ null,
53
+ React.createElement(Version, null, "Version ", version),
54
+ React.createElement(
55
+ Copyright,
56
+ null,
57
+ "\u00A9 Camunda Services GmbH ",
58
+ new Date().getFullYear(),
59
+ ),
60
+ React.createElement(Copyright, null, "All right reserved."),
61
+ ),
29
62
  bottomChildren: customSection,
30
63
  },
31
64
  profile &&
@@ -58,6 +58,10 @@ export const C3Navigation = ({
58
58
  const appBarElementsLength = appBar.elements?.length ?? 0
59
59
  const displayAppBar =
60
60
  appBarElementsLength > 0 || (!isLargeScreen && navbar.elements.length > 0)
61
+ if (app.prefix)
62
+ console.warn(
63
+ "The `prefix` prop is deprecated and will be removed in a future release. It has been replaced with a Camunda icon.",
64
+ )
61
65
  return React.createElement(
62
66
  C3SidebarStateProvider,
63
67
  {
@@ -1,6 +1,6 @@
1
1
  import React from "react"
2
2
  import { Link } from "@carbon/react"
3
- import { ArrowRight } from "@carbon/react/icons"
3
+ import { ArrowRight, TrashCan } from "@carbon/react/icons"
4
4
  export function createAppProps() {
5
5
  return {
6
6
  name: "Console",
@@ -123,7 +123,6 @@ export function createInfoSideBarProps(options) {
123
123
  preceedingDivider: options.preceedingDividerOn2ndElement,
124
124
  },
125
125
  ],
126
- version: "8.2.0-alpha2",
127
126
  }
128
127
  }
129
128
  export function createOrgSideBarProps(options) {
@@ -153,6 +152,7 @@ export function createOrgSideBarProps(options) {
153
152
  export function createUserSideBarProps(options) {
154
153
  return {
155
154
  isOpen: options.isOpen,
155
+ version: "8.3.0-alpha4",
156
156
  customElements: {
157
157
  customSection: options.customSection,
158
158
  profile: {
@@ -181,17 +181,18 @@ export function createUserSideBarProps(options) {
181
181
  label: "Terms of use",
182
182
  },
183
183
  {
184
- key: "delete",
185
- label: "Delete account",
186
- kind: "danger--ghost",
184
+ key: "logout",
185
+ label: "Log out",
186
+ kind: "ghost",
187
+ renderIcon: ArrowRight,
187
188
  },
188
189
  ],
189
190
  bottomElements: [
190
191
  {
191
- key: "logout",
192
- label: "Logout",
193
- kind: "ghost",
194
- renderIcon: ArrowRight,
192
+ key: "delete",
193
+ label: "Delete account",
194
+ kind: "danger--ghost",
195
+ renderIcon: TrashCan,
195
196
  },
196
197
  ],
197
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/camunda-composite-components",
3
- "version": "0.0.42-rc.0",
3
+ "version": "0.0.43",
4
4
  "scripts": {
5
5
  "clean": "rimraf lib/",
6
6
  "copy-css-files": "copyfiles -u 1 src/components/**/*.css lib/esm",
@@ -30,6 +30,7 @@
30
30
  "@storybook/addon-essentials": "7.0.18",
31
31
  "@storybook/addon-interactions": "7.0.18",
32
32
  "@storybook/addon-links": "7.0.18",
33
+ "@storybook/blocks": "7.0.21",
33
34
  "@storybook/preset-scss": "1.0.3",
34
35
  "@storybook/react": "7.0.18",
35
36
  "@storybook/react-webpack5": "7.0.18",