@camunda/camunda-composite-components 0.0.35 → 0.0.36-actionbuttons

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.
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ import { C3ActionButtonsProps } from "./c3-action-buttons.types";
3
+ declare const C3ActionButtons: FC<{
4
+ elements: C3ActionButtonsProps;
5
+ }>;
6
+ export default C3ActionButtons;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { HeaderGlobalAction } from "@carbon/react";
3
+ const C3ActionButtons = ({ elements, }) => {
4
+ return (React.createElement(React.Fragment, null, elements.map((actionButton) => {
5
+ return (React.createElement(HeaderGlobalAction, { "aria-label": `Open ${actionButton.label}`, onClick: actionButton.action, isActive: false, key: `${actionButton.label}-key` }, actionButton.icon));
6
+ })));
7
+ };
8
+ export default C3ActionButtons;
@@ -0,0 +1,5 @@
1
+ export declare type C3ActionButtonsProps = Array<{
2
+ label: string;
3
+ icon: any;
4
+ action: () => void;
5
+ }>;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { C3NavigationProps } from "./c3-navigation.types";
3
- export declare const C3Navigation: ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, userSideBar, notificationSideBar, }: C3NavigationProps) => JSX.Element;
3
+ export declare const C3Navigation: ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, actionButtons, userSideBar, notificationSideBar, }: C3NavigationProps) => JSX.Element;
@@ -7,6 +7,7 @@ import C3UserSidebar from "./c3-navigation-sidebar/c3-user-sidebar";
7
7
  import { useMediaQuery } from "./helpers";
8
8
  import { C3NavigationAppBar } from "./c3-navigation-appbar";
9
9
  import styled from "styled-components";
10
+ import C3ActionButtons from "./c3-navigation-actions/c3-action-buttons";
10
11
  /**
11
12
  * UI SHELL
12
13
  * Docs: https://react.carbondesignsystem.com/?path=/story/components-ui-shell--fixed-side-nav
@@ -21,7 +22,7 @@ const StyledToggletipContent = styled(ToggletipContent) `
21
22
  color: var(--cds-link-hover-text-color);
22
23
  }
23
24
  `;
24
- export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, userSideBar, notificationSideBar, }) => {
25
+ export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, actionButtons, userSideBar, notificationSideBar, }) => {
25
26
  const isLargeScreen = useMediaQuery(`(min-width: ${BREAKPOINT_LG_WIDTH}`);
26
27
  const appBarElementsLength = appBar.elements?.length ?? 0;
27
28
  const displayAppBar = appBarElementsLength > 0 || (!isLargeScreen && navbar.elements.length > 0);
@@ -73,6 +74,7 @@ export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, info
73
74
  overflow: "hidden",
74
75
  maxWidth: "150px",
75
76
  } }, navbar.orgName))),
77
+ actionButtons && React.createElement(C3ActionButtons, { elements: actionButtons }),
76
78
  notificationSideBar && (React.createElement(C3NotificationSidebar, { sideBar: { ...notificationSideBar, type: "notifications" } })),
77
79
  orgSideBar && (React.createElement(C3OrgSidebar, { sideBar: { ...orgSideBar, type: "org" } })),
78
80
  infoSideBar && (React.createElement(C3InfoSidebar, { sideBar: { ...infoSideBar, type: "info" } })),
@@ -2,6 +2,7 @@
2
2
  import { Tag } from "@carbon/react";
3
3
  import { Endpoints, Stage } from "../../api/endpoints.const";
4
4
  import { C3NavigationAppBarProps, C3NavigationInfoSideBarProps, C3NavigationNotificationsSideBarProps, C3NavigationOrgSideBarProps, C3NavigationUserSideBarProps } from "./c3-navigation-sidebar/c3-navigation-sidebar.types";
5
+ import { C3ActionButtonsProps } from "./c3-navigation-actions/c3-action-buttons.types";
5
6
  export interface C3NavigationAppProps {
6
7
  prefix: string;
7
8
  name: string;
@@ -53,6 +54,7 @@ export interface C3NavigationProps {
53
54
  appBar: WithoutType<C3NavigationAppBarProps>;
54
55
  orgSideBar?: WithoutType<C3NavigationOrgSideBarProps>;
55
56
  infoSideBar?: WithoutType<C3NavigationInfoSideBarProps>;
57
+ actionButtons?: C3ActionButtonsProps;
56
58
  userSideBar?: WithoutType<C3NavigationUserSideBarProps>;
57
59
  notificationSideBar?: WithoutType<C3NavigationNotificationsSideBarProps>;
58
60
  navbar: C3NavigationNavBarProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/camunda-composite-components",
3
- "version": "0.0.35",
3
+ "version": "0.0.36-actionbuttons",
4
4
  "scripts": {
5
5
  "clean": "rimraf lib/",
6
6
  "copy-css-files": "copyfiles -u 1 src/components/**/*.css lib/esm",