@camunda/camunda-composite-components 0.22.8 → 0.23.1

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.
Files changed (42) hide show
  1. package/lib/esm/package.json +1 -1
  2. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.d.ts +1 -0
  3. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.js +24 -3
  4. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.types.d.ts +1 -0
  5. package/lib/esm/src/components/c3-license-tag/c3-license-tag.d.ts +17 -0
  6. package/lib/esm/src/components/c3-license-tag/c3-license-tag.js +79 -0
  7. package/lib/esm/src/components/c3-license-tag/index.d.ts +1 -0
  8. package/lib/esm/src/components/c3-license-tag/index.js +6 -0
  9. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.js +3 -3
  10. package/lib/esm/src/components/c3-navigation-v2/c3-breadcrumb-bar.d.ts +7 -0
  11. package/lib/esm/src/components/c3-navigation-v2/c3-breadcrumb-bar.js +371 -0
  12. package/lib/esm/src/components/c3-navigation-v2/c3-navigation-v2.d.ts +9 -0
  13. package/lib/esm/src/components/c3-navigation-v2/c3-navigation-v2.js +72 -0
  14. package/lib/esm/src/components/c3-navigation-v2/c3-navigation-v2.types.d.ts +180 -0
  15. package/lib/esm/src/components/c3-navigation-v2/c3-navigation-v2.types.js +6 -0
  16. package/lib/esm/src/components/c3-navigation-v2/c3-sidebar.d.ts +8 -0
  17. package/lib/esm/src/components/c3-navigation-v2/c3-sidebar.js +357 -0
  18. package/lib/esm/src/components/c3-navigation-v2/c3-tools-area.d.ts +16 -0
  19. package/lib/esm/src/components/c3-navigation-v2/c3-tools-area.js +99 -0
  20. package/lib/esm/src/components/c3-navigation-v2/index.d.ts +18 -0
  21. package/lib/esm/src/components/c3-navigation-v2/index.js +15 -0
  22. package/lib/esm/src/components/c3-navigation-v2/stories/story-helpers.d.ts +10 -0
  23. package/lib/esm/src/components/c3-navigation-v2/stories/story-helpers.js +231 -0
  24. package/lib/esm/src/components/c3-navigation-v2/stories/story-templates.d.ts +11 -0
  25. package/lib/esm/src/components/c3-navigation-v2/stories/story-templates.js +796 -0
  26. package/lib/esm/src/components/c3-navigation-v2/tools/c3-info-panel.d.ts +11 -0
  27. package/lib/esm/src/components/c3-navigation-v2/tools/c3-info-panel.js +33 -0
  28. package/lib/esm/src/components/c3-navigation-v2/tools/c3-notifications-panel.d.ts +6 -0
  29. package/lib/esm/src/components/c3-navigation-v2/tools/c3-notifications-panel.js +52 -0
  30. package/lib/esm/src/components/c3-navigation-v2/tools/c3-user-panel.d.ts +30 -0
  31. package/lib/esm/src/components/c3-navigation-v2/tools/c3-user-panel.js +125 -0
  32. package/lib/esm/src/components/c3-navigation-v2/tools/panel-primitives.d.ts +7 -0
  33. package/lib/esm/src/components/c3-navigation-v2/tools/panel-primitives.js +16 -0
  34. package/lib/esm/src/components/c3-navigation-v2/use-c3-navigation-v2.d.ts +115 -0
  35. package/lib/esm/src/components/c3-navigation-v2/use-c3-navigation-v2.js +216 -0
  36. package/lib/esm/src/components/c3-navigation-v2/use-camunda-tools.d.ts +49 -0
  37. package/lib/esm/src/components/c3-navigation-v2/use-camunda-tools.js +75 -0
  38. package/lib/esm/src/components/c3-navigation-v2/use-cluster-webapp-breadcrumbs.d.ts +33 -0
  39. package/lib/esm/src/components/c3-navigation-v2/use-cluster-webapp-breadcrumbs.js +126 -0
  40. package/lib/esm/src/index.d.ts +5 -0
  41. package/lib/esm/src/index.js +3 -0
  42. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ export type { CamundaApp } from '../../utils/camunda.types';
2
+ export { C3BreadcrumbBar } from './c3-breadcrumb-bar';
3
+ export { C3NavigationV2 } from './c3-navigation-v2';
4
+ export type { AppProps, BreadcrumbAction, BreadcrumbDropdownItem, BreadcrumbSegment, C3NavigationV2Props, GlobalActionButton, LinkComponent, LinkProps, SidebarGroup, SidebarGroupItem, SidebarItem, SidebarNode, SidebarProps, SidebarSection, ToolDescriptor, } from './c3-navigation-v2.types';
5
+ export { C3Sidebar } from './c3-sidebar';
6
+ export { C3ToolsArea } from './c3-tools-area';
7
+ export type { C3InfoPanelProps, InfoPanelElement } from './tools/c3-info-panel';
8
+ export { C3InfoPanel } from './tools/c3-info-panel';
9
+ export type { C3NotificationsPanelProps } from './tools/c3-notifications-panel';
10
+ export { C3NotificationsPanel } from './tools/c3-notifications-panel';
11
+ export type { C3UserPanelProps, UserPanelElement, } from './tools/c3-user-panel';
12
+ export { C3UserPanel } from './tools/c3-user-panel';
13
+ export type { BreadcrumbDescriptor, BreadcrumbDropdownItemDescriptor, GroupDescriptor, GroupItemDescriptor, ItemDescriptor, SectionDescriptor, SidebarNodeDescriptor, UseC3NavigationV2Options, UseC3NavigationV2Return, } from './use-c3-navigation-v2';
14
+ export { useC3NavigationV2 } from './use-c3-navigation-v2';
15
+ export type { HelpToolOptions, InfoToolOptions, NotificationsToolOptions, UseCamundaToolsOptions, UserToolOptions, } from './use-camunda-tools';
16
+ export { useCamundaTools } from './use-camunda-tools';
17
+ export type { UseClusterWebappBreadcrumbsOptions } from './use-cluster-webapp-breadcrumbs';
18
+ export { useClusterWebappBreadcrumbs } from './use-cluster-webapp-breadcrumbs';
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
3
+ * under one or more contributor license agreements. Licensed under a commercial license.
4
+ * You may not use this file except in compliance with the commercial license.
5
+ */
6
+ export { C3BreadcrumbBar } from './c3-breadcrumb-bar.js';
7
+ export { C3NavigationV2 } from './c3-navigation-v2.js';
8
+ export { C3Sidebar } from './c3-sidebar.js';
9
+ export { C3ToolsArea } from './c3-tools-area.js';
10
+ export { C3InfoPanel } from './tools/c3-info-panel.js';
11
+ export { C3NotificationsPanel } from './tools/c3-notifications-panel.js';
12
+ export { C3UserPanel } from './tools/c3-user-panel.js';
13
+ export { useC3NavigationV2 } from './use-c3-navigation-v2.js';
14
+ export { useCamundaTools } from './use-camunda-tools.js';
15
+ export { useClusterWebappBreadcrumbs } from './use-cluster-webapp-breadcrumbs.js';
@@ -0,0 +1,10 @@
1
+ import type { AppProps, BreadcrumbSegment, C3NavigationV2Props, GlobalActionButton, SidebarGroupItem, SidebarItem, SidebarNode, SidebarSection } from '../c3-navigation-v2.types';
2
+ export declare const createAppProps: (overrides?: Partial<AppProps>) => AppProps;
3
+ export declare const createGlobalActions: () => GlobalActionButton[];
4
+ export declare const createOrgBreadcrumb: (overrides?: Partial<BreadcrumbSegment>) => BreadcrumbSegment;
5
+ export declare const createOrgSidebarItems: () => SidebarItem[];
6
+ export declare const createWorkspaceSidebarItems: () => SidebarItem[];
7
+ export declare const createClusterGroupItems: (expandedClusters?: string[], onToggle?: (clusterId: string) => void) => SidebarGroupItem[];
8
+ export declare const createClusterSection: (expandedClusters?: string[], onToggle?: (clusterId: string) => void) => SidebarSection;
9
+ export declare const createDefaultSidebarChildren: (expandedClusters?: string[], onToggle?: (clusterId: string) => void) => SidebarNode[];
10
+ export declare const createDefaultProps: (overrides?: Partial<C3NavigationV2Props>) => C3NavigationV2Props;
@@ -0,0 +1,231 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /*
3
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
+ * under one or more contributor license agreements. Licensed under a commercial license.
5
+ * You may not use this file except in compliance with the commercial license.
6
+ */
7
+ import { Tag } from '@carbon/react';
8
+ import { Building, CloudApp, Dashboard, Folder, Help, IbmKnowledgeCatalog, Notification, Play, Search, Settings, Task, UserAvatar, UserMultiple, Workspace, } from '@carbon/react/icons/index.esm.js';
9
+ export const createAppProps = (overrides) => ({
10
+ ariaLabel: 'Camunda Console',
11
+ linkProps: { href: '#' },
12
+ ...overrides,
13
+ });
14
+ export const createGlobalActions = () => [
15
+ {
16
+ key: 'search',
17
+ label: 'Search',
18
+ icon: Search,
19
+ onClick: () => console.log('Search clicked'),
20
+ },
21
+ {
22
+ key: 'notifications',
23
+ label: 'Notifications',
24
+ icon: Notification,
25
+ onClick: () => console.log('Notifications clicked'),
26
+ },
27
+ {
28
+ key: 'help',
29
+ label: 'Help & Tutorials',
30
+ icon: Help,
31
+ onClick: () => console.log('Help clicked'),
32
+ },
33
+ {
34
+ key: 'user',
35
+ label: 'User Profile',
36
+ icon: UserAvatar,
37
+ onClick: () => console.log('User clicked'),
38
+ },
39
+ ];
40
+ export const createOrgBreadcrumb = (overrides) => ({
41
+ key: 'org',
42
+ label: 'Acme Corp',
43
+ icon: Building,
44
+ onClick: () => console.log('Navigate to org dashboard'),
45
+ dropdownTitle: 'Switch Organization',
46
+ dropdownItems: [
47
+ {
48
+ key: 'org-1',
49
+ label: 'Acme Corp',
50
+ icon: Building,
51
+ isSelected: true,
52
+ onClick: () => console.log('Switch to Acme Corp'),
53
+ },
54
+ {
55
+ key: 'org-2',
56
+ label: 'Beta Inc',
57
+ icon: Building,
58
+ isSelected: false,
59
+ onClick: () => console.log('Switch to Beta Inc'),
60
+ },
61
+ {
62
+ key: 'org-3',
63
+ label: 'Gamma LLC',
64
+ icon: Building,
65
+ isSelected: false,
66
+ onClick: () => console.log('Switch to Gamma LLC'),
67
+ },
68
+ ],
69
+ dropdownAriaLabel: 'Switch organization',
70
+ ...overrides,
71
+ });
72
+ export const createOrgSidebarItems = () => [
73
+ {
74
+ type: 'item',
75
+ key: 'dashboard',
76
+ label: 'Dashboard',
77
+ icon: Dashboard,
78
+ isActive: true,
79
+ onClick: () => console.log('Navigate to Dashboard'),
80
+ },
81
+ {
82
+ type: 'item',
83
+ key: 'workspaces',
84
+ label: 'Workspaces',
85
+ icon: Workspace,
86
+ onClick: () => console.log('Navigate to Workspaces'),
87
+ },
88
+ {
89
+ type: 'item',
90
+ key: 'clusters',
91
+ label: 'Clusters',
92
+ icon: CloudApp,
93
+ onClick: () => console.log('Navigate to Clusters'),
94
+ },
95
+ {
96
+ type: 'item',
97
+ key: 'catalog',
98
+ label: 'Catalog',
99
+ icon: IbmKnowledgeCatalog,
100
+ onClick: () => console.log('Navigate to Catalog'),
101
+ },
102
+ {
103
+ type: 'item',
104
+ key: 'members',
105
+ label: 'Members',
106
+ icon: UserMultiple,
107
+ onClick: () => console.log('Navigate to Members'),
108
+ },
109
+ {
110
+ type: 'item',
111
+ key: 'settings',
112
+ label: 'Settings',
113
+ icon: Settings,
114
+ onClick: () => console.log('Navigate to Settings'),
115
+ },
116
+ ];
117
+ export const createWorkspaceSidebarItems = () => [
118
+ {
119
+ type: 'item',
120
+ key: 'projects',
121
+ label: 'Projects',
122
+ icon: Folder,
123
+ isActive: true,
124
+ onClick: () => console.log('Navigate to Projects'),
125
+ },
126
+ {
127
+ type: 'item',
128
+ key: 'catalog',
129
+ label: 'Catalog',
130
+ icon: IbmKnowledgeCatalog,
131
+ onClick: () => console.log('Navigate to Catalog'),
132
+ },
133
+ {
134
+ type: 'item',
135
+ key: 'settings',
136
+ label: 'Settings',
137
+ icon: Settings,
138
+ onClick: () => console.log('Navigate to Settings'),
139
+ },
140
+ ];
141
+ export const createClusterGroupItems = (expandedClusters = ['cluster-1'], onToggle) => [
142
+ {
143
+ type: 'group-item',
144
+ key: 'cluster-1',
145
+ label: 'Cluster A',
146
+ icon: CloudApp,
147
+ onClick: () => console.log('Navigate to Cluster A'),
148
+ trailingElement: (_jsx(Tag, { type: 'gray', size: 'sm', style: { marginLeft: '0.375rem', flexShrink: 0 }, children: "Prod" })),
149
+ isExpanded: expandedClusters.includes('cluster-1'),
150
+ onToggleExpand: () => onToggle?.('cluster-1'),
151
+ children: [
152
+ {
153
+ type: 'item',
154
+ key: 'cluster-1-operate',
155
+ label: 'Operate',
156
+ icon: Play,
157
+ onClick: () => console.log('Navigate to Operate on Cluster A'),
158
+ },
159
+ {
160
+ type: 'item',
161
+ key: 'cluster-1-tasklist',
162
+ label: 'Tasklist',
163
+ icon: Task,
164
+ onClick: () => console.log('Navigate to Tasklist on Cluster A'),
165
+ },
166
+ {
167
+ type: 'item',
168
+ key: 'cluster-1-admin',
169
+ label: 'Admin',
170
+ icon: Settings,
171
+ onClick: () => console.log('Navigate to Admin on Cluster A'),
172
+ },
173
+ ],
174
+ },
175
+ {
176
+ type: 'group-item',
177
+ key: 'cluster-2',
178
+ label: 'Cluster B',
179
+ icon: CloudApp,
180
+ onClick: () => console.log('Navigate to Cluster B'),
181
+ trailingElement: (_jsx(Tag, { type: 'gray', size: 'sm', style: { marginLeft: '0.375rem', flexShrink: 0 }, children: "Stage" })),
182
+ isExpanded: expandedClusters.includes('cluster-2'),
183
+ onToggleExpand: () => onToggle?.('cluster-2'),
184
+ children: [
185
+ {
186
+ type: 'item',
187
+ key: 'cluster-2-operate',
188
+ label: 'Operate',
189
+ icon: Play,
190
+ onClick: () => console.log('Navigate to Operate on Cluster B'),
191
+ },
192
+ {
193
+ type: 'item',
194
+ key: 'cluster-2-tasklist',
195
+ label: 'Tasklist',
196
+ icon: Task,
197
+ onClick: () => console.log('Navigate to Tasklist on Cluster B'),
198
+ },
199
+ {
200
+ type: 'item',
201
+ key: 'cluster-2-admin',
202
+ label: 'Admin',
203
+ icon: Settings,
204
+ onClick: () => console.log('Navigate to Admin on Cluster B'),
205
+ },
206
+ ],
207
+ },
208
+ ];
209
+ export const createClusterSection = (expandedClusters = ['cluster-1'], onToggle) => ({
210
+ type: 'section',
211
+ key: 'clusters-section',
212
+ title: 'Clusters',
213
+ children: createClusterGroupItems(expandedClusters, onToggle),
214
+ });
215
+ export const createDefaultSidebarChildren = (expandedClusters = ['cluster-1'], onToggle) => [
216
+ ...createOrgSidebarItems(),
217
+ createClusterSection(expandedClusters, onToggle),
218
+ ];
219
+ export const createDefaultProps = (overrides) => ({
220
+ app: createAppProps(),
221
+ skipToContentTargetId: 'main-content',
222
+ breadcrumbs: [createOrgBreadcrumb()],
223
+ globalActions: createGlobalActions(),
224
+ sidebar: {
225
+ ariaLabel: 'Main sidebar navigation',
226
+ children: createDefaultSidebarChildren(),
227
+ isExpanded: true,
228
+ onToggleExpanded: () => console.log('Toggle sidebar'),
229
+ },
230
+ ...overrides,
231
+ });
@@ -0,0 +1,11 @@
1
+ import type { StoryFn } from '@storybook/react';
2
+ import { type FC } from 'react';
3
+ import { C3NavigationV2 } from '../c3-navigation-v2';
4
+ export declare const DefaultTemplate: StoryFn<typeof C3NavigationV2>;
5
+ export declare const HookDrivenTemplate: FC;
6
+ export declare const ComplexTreeTemplate: FC;
7
+ export declare const ToolPanelsTemplate: FC;
8
+ export declare const BreadcrumbActionsTemplate: FC;
9
+ export declare const ClusterWebappTemplate: FC;
10
+ export declare const HeaderTrailingContentTemplate: FC;
11
+ export declare const CompactSectionTemplate: FC;