@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,796 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 { HeaderGlobalAction, Tag } from '@carbon/react';
8
+ import { Analytics, Application, ArrowLeft, Building, CloudApp, Dashboard, DataBase, Debug, Diagram, Document, Folder, Help, IbmKnowledgeCatalog, Information, Network_3, Notification, Play, Search, Security, Settings, Task, Terminal, UserAvatar, UserMultiple, Workspace, } from '@carbon/react/icons/index.esm.js';
9
+ import { useState } from 'react';
10
+ import { C3NavigationV2 } from '../c3-navigation-v2.js';
11
+ import { C3InfoPanel } from '../tools/c3-info-panel.js';
12
+ import { C3UserPanel } from '../tools/c3-user-panel.js';
13
+ import { useC3NavigationV2 } from '../use-c3-navigation-v2.js';
14
+ // ─── Shared layout wrapper ──────────────────────────────────────────────────
15
+ const MainContent = ({ sidebarExpanded = true, hasSidebar = true, children }) => (_jsx("main", { id: 'main-content', style: {
16
+ marginLeft: hasSidebar ? (sidebarExpanded ? '16rem' : '3rem') : '0',
17
+ marginTop: '3rem',
18
+ padding: '2rem',
19
+ transition: 'margin-left 0.15s ease-out',
20
+ minHeight: 'calc(100vh - 3rem)',
21
+ background: 'var(--cds-background)',
22
+ }, children: children }));
23
+ // ─── Default (args-driven) ──────────────────────────────────────────────────
24
+ export const DefaultTemplate = (args) => (_jsxs(_Fragment, { children: [_jsx(C3NavigationV2, { ...args }), _jsxs(MainContent, { sidebarExpanded: args.sidebar?.isExpanded !== false, hasSidebar: !!args.sidebar, children: [_jsx("h1", { children: "Main Content Area" }), _jsx("p", { style: { marginTop: '1rem', color: 'var(--cds-text-secondary)' }, children: "This area receives focus when using \"Skip to main content\"." })] })] }));
25
+ // ─── Hook-driven with interactive sidebar ───────────────────────────────────
26
+ export const HookDrivenTemplate = () => {
27
+ const [activeKey, setActiveKey] = useState('dashboard');
28
+ const { navProps, isSidebarExpanded } = useC3NavigationV2({
29
+ app: {
30
+ ariaLabel: 'Camunda Console',
31
+ linkProps: { href: '#' },
32
+ },
33
+ skipToContentTargetId: 'main-content',
34
+ activeItemKey: activeKey,
35
+ breadcrumbs: [
36
+ {
37
+ key: 'org',
38
+ label: 'Acme Corp',
39
+ icon: Building,
40
+ onClick: () => setActiveKey('dashboard'),
41
+ dropdownTitle: 'Switch Organization',
42
+ dropdownItems: [
43
+ {
44
+ key: 'org-1',
45
+ label: 'Acme Corp',
46
+ icon: Building,
47
+ isSelected: 'org-1',
48
+ onClick: () => { },
49
+ },
50
+ {
51
+ key: 'org-2',
52
+ label: 'Beta Inc',
53
+ icon: Building,
54
+ isSelected: 'org-2',
55
+ onClick: () => { },
56
+ },
57
+ ],
58
+ },
59
+ ],
60
+ globalActions: [
61
+ {
62
+ key: 'search',
63
+ label: 'Search',
64
+ icon: Search,
65
+ onClick: () => console.log('search'),
66
+ },
67
+ { key: 'notifications', label: 'Notifications', icon: Notification },
68
+ { key: 'help', label: 'Help', icon: Help },
69
+ { key: 'user', label: 'User', icon: UserAvatar },
70
+ ],
71
+ sidebarChildren: [
72
+ {
73
+ type: 'item',
74
+ key: 'dashboard',
75
+ label: 'Dashboard',
76
+ icon: Dashboard,
77
+ onClick: () => setActiveKey('dashboard'),
78
+ },
79
+ {
80
+ type: 'item',
81
+ key: 'workspaces',
82
+ label: 'Workspaces',
83
+ icon: Workspace,
84
+ onClick: () => setActiveKey('workspaces'),
85
+ },
86
+ {
87
+ type: 'item',
88
+ key: 'clusters-page',
89
+ label: 'Clusters',
90
+ icon: CloudApp,
91
+ onClick: () => setActiveKey('clusters-page'),
92
+ },
93
+ {
94
+ type: 'item',
95
+ key: 'catalog',
96
+ label: 'Catalog',
97
+ icon: IbmKnowledgeCatalog,
98
+ onClick: () => setActiveKey('catalog'),
99
+ },
100
+ {
101
+ type: 'item',
102
+ key: 'members',
103
+ label: 'Members',
104
+ icon: UserMultiple,
105
+ onClick: () => setActiveKey('members'),
106
+ },
107
+ {
108
+ type: 'item',
109
+ key: 'settings',
110
+ label: 'Settings',
111
+ icon: Settings,
112
+ onClick: () => setActiveKey('settings'),
113
+ },
114
+ {
115
+ type: 'section',
116
+ key: 'clusters-section',
117
+ title: 'Clusters',
118
+ children: [
119
+ {
120
+ type: 'group-item',
121
+ key: 'cluster-1',
122
+ label: 'Cluster A',
123
+ icon: CloudApp,
124
+ defaultExpanded: true,
125
+ trailingElement: (_jsx(Tag, { type: 'gray', size: 'sm', style: { marginLeft: '0.375rem' }, children: "Prod" })),
126
+ onClick: () => setActiveKey('cluster-1'),
127
+ children: [
128
+ {
129
+ type: 'item',
130
+ key: 'cluster-1-operate',
131
+ label: 'Operate',
132
+ icon: Play,
133
+ onClick: () => setActiveKey('cluster-1-operate'),
134
+ },
135
+ {
136
+ type: 'item',
137
+ key: 'cluster-1-tasklist',
138
+ label: 'Tasklist',
139
+ icon: Task,
140
+ onClick: () => setActiveKey('cluster-1-tasklist'),
141
+ },
142
+ {
143
+ type: 'item',
144
+ key: 'cluster-1-admin',
145
+ label: 'Admin',
146
+ icon: Settings,
147
+ onClick: () => setActiveKey('cluster-1-admin'),
148
+ },
149
+ ],
150
+ },
151
+ {
152
+ type: 'group-item',
153
+ key: 'cluster-2',
154
+ label: 'Cluster B',
155
+ icon: CloudApp,
156
+ trailingElement: (_jsx(Tag, { type: 'gray', size: 'sm', style: { marginLeft: '0.375rem' }, children: "Stage" })),
157
+ onClick: () => setActiveKey('cluster-2'),
158
+ children: [
159
+ {
160
+ type: 'item',
161
+ key: 'cluster-2-operate',
162
+ label: 'Operate',
163
+ icon: Play,
164
+ onClick: () => setActiveKey('cluster-2-operate'),
165
+ },
166
+ {
167
+ type: 'item',
168
+ key: 'cluster-2-tasklist',
169
+ label: 'Tasklist',
170
+ icon: Task,
171
+ onClick: () => setActiveKey('cluster-2-tasklist'),
172
+ },
173
+ {
174
+ type: 'item',
175
+ key: 'cluster-2-admin',
176
+ label: 'Admin',
177
+ icon: Settings,
178
+ onClick: () => setActiveKey('cluster-2-admin'),
179
+ },
180
+ ],
181
+ },
182
+ ],
183
+ },
184
+ ],
185
+ });
186
+ return (_jsxs(_Fragment, { children: [_jsx(C3NavigationV2, { ...navProps }), _jsxs(MainContent, { sidebarExpanded: isSidebarExpanded, children: [_jsx("h1", { children: "Hook-Driven Navigation" }), _jsxs("p", { style: { marginTop: '1rem', color: 'var(--cds-text-secondary)' }, children: ["Active key: ", _jsx("code", { children: activeKey })] }), _jsxs("p", { style: { marginTop: '0.5rem', color: 'var(--cds-text-secondary)' }, children: ["Click sidebar items to change the active state. The hook resolves", _jsx("code", { children: " isActive" }), " automatically from ", _jsx("code", { children: "activeItemKey" }), "."] })] })] }));
187
+ };
188
+ // ─── Complex tree (all node types) ──────────────────────────────────────────
189
+ export const ComplexTreeTemplate = () => {
190
+ const [activeKey, setActiveKey] = useState('overview');
191
+ const { navProps, isSidebarExpanded } = useC3NavigationV2({
192
+ app: {
193
+ ariaLabel: 'Camunda Console',
194
+ linkProps: { href: '#' },
195
+ },
196
+ skipToContentTargetId: 'main-content',
197
+ activeItemKey: activeKey,
198
+ breadcrumbs: [
199
+ {
200
+ key: 'org',
201
+ label: 'Acme Corp',
202
+ icon: Building,
203
+ onClick: () => setActiveKey('overview'),
204
+ dropdownTitle: 'Switch Organization',
205
+ dropdownItems: [
206
+ {
207
+ key: 'org-acme',
208
+ label: 'Acme Corp',
209
+ icon: Building,
210
+ isSelected: 'org-acme',
211
+ onClick: () => { },
212
+ },
213
+ {
214
+ key: 'org-beta',
215
+ label: 'Beta Inc',
216
+ icon: Building,
217
+ isSelected: 'org-beta',
218
+ onClick: () => { },
219
+ },
220
+ ],
221
+ },
222
+ {
223
+ key: 'env',
224
+ label: (activeKey) => {
225
+ if (activeKey.startsWith('env-prod'))
226
+ return 'Production';
227
+ if (activeKey.startsWith('env-staging'))
228
+ return 'Staging';
229
+ return 'All Environments';
230
+ },
231
+ icon: CloudApp,
232
+ dropdownTitle: 'Switch Environment',
233
+ dropdownItems: [
234
+ {
235
+ key: 'env-prod',
236
+ label: 'Production',
237
+ icon: CloudApp,
238
+ isSelected: (activeKey) => activeKey.startsWith('env-prod'),
239
+ onClick: () => setActiveKey('env-prod'),
240
+ },
241
+ {
242
+ key: 'env-staging',
243
+ label: 'Staging',
244
+ icon: CloudApp,
245
+ isSelected: (activeKey) => activeKey.startsWith('env-staging'),
246
+ onClick: () => setActiveKey('env-staging'),
247
+ },
248
+ ],
249
+ },
250
+ ],
251
+ globalActions: [
252
+ {
253
+ key: 'search',
254
+ label: 'Search',
255
+ icon: Search,
256
+ onClick: () => console.log('search'),
257
+ },
258
+ { key: 'notifications', label: 'Notifications', icon: Notification },
259
+ { key: 'help', label: 'Help', icon: Help },
260
+ { key: 'user', label: 'User', icon: UserAvatar },
261
+ ],
262
+ sidebarChildren: [
263
+ {
264
+ type: 'item',
265
+ key: 'overview',
266
+ label: 'Overview',
267
+ icon: Dashboard,
268
+ onClick: () => setActiveKey('overview'),
269
+ },
270
+ {
271
+ type: 'item',
272
+ key: 'catalog',
273
+ label: 'Catalog',
274
+ icon: IbmKnowledgeCatalog,
275
+ onClick: () => setActiveKey('catalog'),
276
+ },
277
+ {
278
+ type: 'section',
279
+ key: 'environments-section',
280
+ title: 'Environments',
281
+ children: [
282
+ {
283
+ type: 'group-item',
284
+ key: 'env-prod',
285
+ label: 'Production',
286
+ icon: CloudApp,
287
+ defaultExpanded: true,
288
+ trailingElement: (_jsx(Tag, { type: 'green', size: 'sm', style: { marginLeft: '0.375rem' }, children: "Live" })),
289
+ onClick: () => setActiveKey('env-prod'),
290
+ children: [
291
+ {
292
+ type: 'item',
293
+ key: 'env-prod-operate',
294
+ label: 'Operate',
295
+ icon: Play,
296
+ onClick: () => setActiveKey('env-prod-operate'),
297
+ },
298
+ {
299
+ type: 'item',
300
+ key: 'env-prod-tasklist',
301
+ label: 'Tasklist',
302
+ icon: Task,
303
+ onClick: () => setActiveKey('env-prod-tasklist'),
304
+ },
305
+ {
306
+ type: 'item',
307
+ key: 'env-prod-monitor',
308
+ label: 'Monitoring',
309
+ icon: Debug,
310
+ onClick: () => setActiveKey('env-prod-monitor'),
311
+ },
312
+ ],
313
+ },
314
+ {
315
+ type: 'group-item',
316
+ key: 'env-staging',
317
+ label: 'Staging',
318
+ icon: CloudApp,
319
+ trailingElement: (_jsx(Tag, { type: 'gray', size: 'sm', style: { marginLeft: '0.375rem' }, children: "Stage" })),
320
+ onClick: () => setActiveKey('env-staging'),
321
+ children: [
322
+ {
323
+ type: 'item',
324
+ key: 'env-staging-operate',
325
+ label: 'Operate',
326
+ icon: Play,
327
+ onClick: () => setActiveKey('env-staging-operate'),
328
+ },
329
+ {
330
+ type: 'item',
331
+ key: 'env-staging-tasklist',
332
+ label: 'Tasklist',
333
+ icon: Task,
334
+ onClick: () => setActiveKey('env-staging-tasklist'),
335
+ },
336
+ ],
337
+ },
338
+ ],
339
+ },
340
+ {
341
+ type: 'section',
342
+ key: 'infra-section',
343
+ title: 'Infrastructure',
344
+ children: [
345
+ {
346
+ type: 'group',
347
+ key: 'networking',
348
+ label: 'Networking',
349
+ icon: Network_3,
350
+ defaultExpanded: true,
351
+ children: [
352
+ {
353
+ type: 'item',
354
+ key: 'dns',
355
+ label: 'DNS Records',
356
+ icon: Document,
357
+ onClick: () => setActiveKey('dns'),
358
+ },
359
+ {
360
+ type: 'item',
361
+ key: 'load-balancers',
362
+ label: 'Load Balancers',
363
+ icon: Application,
364
+ onClick: () => setActiveKey('load-balancers'),
365
+ },
366
+ {
367
+ type: 'item',
368
+ key: 'firewall',
369
+ label: 'Firewall Rules',
370
+ icon: Security,
371
+ onClick: () => setActiveKey('firewall'),
372
+ },
373
+ ],
374
+ },
375
+ {
376
+ type: 'group',
377
+ key: 'storage',
378
+ label: 'Storage',
379
+ icon: DataBase,
380
+ children: [
381
+ {
382
+ type: 'item',
383
+ key: 'databases',
384
+ label: 'Databases',
385
+ icon: DataBase,
386
+ onClick: () => setActiveKey('databases'),
387
+ },
388
+ {
389
+ type: 'item',
390
+ key: 'blob-storage',
391
+ label: 'Blob Storage',
392
+ icon: Folder,
393
+ onClick: () => setActiveKey('blob-storage'),
394
+ },
395
+ ],
396
+ },
397
+ ],
398
+ },
399
+ {
400
+ type: 'section',
401
+ key: 'advanced-section',
402
+ title: 'Projects',
403
+ children: [
404
+ {
405
+ type: 'group',
406
+ key: 'project-alpha',
407
+ label: 'Project Alpha',
408
+ icon: Folder,
409
+ defaultExpanded: true,
410
+ children: [
411
+ {
412
+ type: 'item',
413
+ key: 'alpha-readme',
414
+ label: 'README',
415
+ icon: Document,
416
+ onClick: () => setActiveKey('alpha-readme'),
417
+ },
418
+ {
419
+ type: 'group-item',
420
+ key: 'alpha-services',
421
+ label: 'Services',
422
+ icon: Application,
423
+ defaultExpanded: true,
424
+ onClick: () => setActiveKey('alpha-services'),
425
+ children: [
426
+ {
427
+ type: 'item',
428
+ key: 'alpha-api',
429
+ label: 'API Gateway',
430
+ icon: Network_3,
431
+ onClick: () => setActiveKey('alpha-api'),
432
+ },
433
+ {
434
+ type: 'item',
435
+ key: 'alpha-worker',
436
+ label: 'Worker',
437
+ icon: Terminal,
438
+ onClick: () => setActiveKey('alpha-worker'),
439
+ },
440
+ ],
441
+ },
442
+ ],
443
+ },
444
+ {
445
+ type: 'group',
446
+ key: 'project-beta',
447
+ label: 'Project Beta',
448
+ icon: Folder,
449
+ children: [
450
+ {
451
+ type: 'item',
452
+ key: 'beta-readme',
453
+ label: 'README',
454
+ icon: Document,
455
+ onClick: () => setActiveKey('beta-readme'),
456
+ },
457
+ ],
458
+ },
459
+ ],
460
+ },
461
+ {
462
+ type: 'section',
463
+ key: 'admin-section',
464
+ title: 'Administration',
465
+ children: [
466
+ {
467
+ type: 'item',
468
+ key: 'members',
469
+ label: 'Members',
470
+ icon: UserMultiple,
471
+ onClick: () => setActiveKey('members'),
472
+ },
473
+ {
474
+ type: 'item',
475
+ key: 'settings',
476
+ label: 'Settings',
477
+ icon: Settings,
478
+ onClick: () => setActiveKey('settings'),
479
+ },
480
+ ],
481
+ },
482
+ ],
483
+ });
484
+ return (_jsxs(_Fragment, { children: [_jsx(C3NavigationV2, { ...navProps }), _jsxs(MainContent, { sidebarExpanded: isSidebarExpanded, children: [_jsx("h1", { children: "Complex Sidebar Tree" }), _jsxs("p", { style: { marginTop: '1rem', color: 'var(--cds-text-secondary)' }, children: ["Active key: ", _jsx("code", { children: activeKey })] }), _jsxs("p", { style: { marginTop: '0.5rem', color: 'var(--cds-text-secondary)' }, children: ["Exercises all four node types: ", _jsx("strong", { children: "item" }), ",", ' ', _jsx("strong", { children: "group-item" }), " (selectable groups),", ' ', _jsx("strong", { children: "group" }), " (non-selectable groups), and", ' ', _jsx("strong", { children: "section" }), " (root dividers). Also demonstrates nested groups (a group containing a group-item) and dynamic breadcrumb labels."] })] })] }));
485
+ };
486
+ // ─── Tool panels ────────────────────────────────────────────────────────────
487
+ const createStoryTools = () => [
488
+ {
489
+ key: 'info',
490
+ label: 'Info',
491
+ renderButton: ({ onClick, isActive }) => (_jsx(HeaderGlobalAction, { "aria-label": 'Info', onClick: onClick, isActive: isActive, children: _jsx(Information, { size: 20 }) })),
492
+ panel: (_jsx(C3InfoPanel, { elements: [
493
+ {
494
+ key: 'docs',
495
+ label: 'Documentation',
496
+ onClick: () => console.log('docs'),
497
+ },
498
+ {
499
+ key: 'academy',
500
+ label: 'Camunda Academy',
501
+ onClick: () => console.log('academy'),
502
+ },
503
+ {
504
+ key: 'forum',
505
+ label: 'Community Forum',
506
+ onClick: () => console.log('forum'),
507
+ },
508
+ ] })),
509
+ },
510
+ {
511
+ key: 'help',
512
+ label: 'Help',
513
+ renderButton: ({ onClick }) => (_jsx(HeaderGlobalAction, { "aria-label": 'Help', onClick: () => {
514
+ onClick();
515
+ console.log('Help clicked, no panel, external action');
516
+ }, children: _jsx(Help, { size: 20 }) })),
517
+ // no panel, help is a plain button
518
+ },
519
+ {
520
+ key: 'user',
521
+ label: 'Account',
522
+ renderButton: ({ onClick, isActive }) => (_jsx(HeaderGlobalAction, { "aria-label": 'Account', onClick: onClick, isActive: isActive, tooltipAlignment: 'end', children: _jsx(UserAvatar, { size: 20 }) })),
523
+ panel: (_jsx(C3UserPanel, { name: 'Jane Doe', email: 'jane.doe@acme.com', version: '8.7.0-alpha.1', onLogout: () => console.log('logout'), elements: [
524
+ {
525
+ key: 'cookie',
526
+ label: 'Cookie preferences',
527
+ onClick: () => console.log('cookies'),
528
+ },
529
+ ] })),
530
+ },
531
+ ];
532
+ export const ToolPanelsTemplate = () => {
533
+ const [activeKey, setActiveKey] = useState('dashboard');
534
+ const tools = createStoryTools();
535
+ const { navProps, isSidebarExpanded } = useC3NavigationV2({
536
+ app: { ariaLabel: 'Camunda', linkProps: { href: '#' } },
537
+ skipToContentTargetId: 'main-content',
538
+ activeItemKey: activeKey,
539
+ tools,
540
+ breadcrumbs: [
541
+ {
542
+ key: 'org',
543
+ label: 'Acme Corp',
544
+ icon: Building,
545
+ },
546
+ ],
547
+ sidebarChildren: [
548
+ {
549
+ type: 'item',
550
+ key: 'dashboard',
551
+ label: 'Dashboard',
552
+ icon: Dashboard,
553
+ onClick: () => setActiveKey('dashboard'),
554
+ },
555
+ {
556
+ type: 'item',
557
+ key: 'settings',
558
+ label: 'Settings',
559
+ icon: Settings,
560
+ onClick: () => setActiveKey('settings'),
561
+ },
562
+ ],
563
+ });
564
+ return (_jsxs(_Fragment, { children: [_jsx(C3NavigationV2, { ...navProps }), _jsxs(MainContent, { sidebarExpanded: isSidebarExpanded, children: [_jsx("h1", { children: "Tool Panels" }), _jsxs("p", { style: { marginTop: '1rem', color: 'var(--cds-text-secondary)' }, children: ["Click ", _jsx("strong", { children: "Info" }), " or ", _jsx("strong", { children: "Account" }), " in the header to open their slide-over panels. ", _jsx("strong", { children: "Help" }), " is a plain button with no panel. Click outside or click the active tool button again to close."] }), _jsx("p", { style: { marginTop: '0.5rem', color: 'var(--cds-text-secondary)' }, children: "The Account panel shows the simplified user panel: flat name/email, built-in legal links (Terms, Privacy, Imprint), and an onLogout button. Consumer-specific elements (Cookie preferences) render above the built-in links." })] })] }));
565
+ };
566
+ // ─── Breadcrumb actions ─────────────────────────────────────────────────────
567
+ export const BreadcrumbActionsTemplate = () => {
568
+ const { navProps, isSidebarExpanded } = useC3NavigationV2({
569
+ app: { ariaLabel: 'Camunda Modeler', linkProps: { href: '#' } },
570
+ skipToContentTargetId: 'main-content',
571
+ activeItemKey: 'readme',
572
+ breadcrumbs: [
573
+ {
574
+ key: 'org',
575
+ label: 'Acme Corp',
576
+ icon: Building,
577
+ dropdownTitle: 'Switch Organization',
578
+ dropdownItems: [
579
+ {
580
+ key: 'org-1',
581
+ label: 'Acme Corp',
582
+ icon: Building,
583
+ isSelected: true,
584
+ },
585
+ { key: 'org-2', label: 'Beta Inc', icon: Building },
586
+ ],
587
+ },
588
+ {
589
+ key: 'project',
590
+ label: 'Payment Service',
591
+ icon: Folder,
592
+ actions: [
593
+ {
594
+ key: 'rename',
595
+ label: 'Rename',
596
+ onClick: () => console.log('rename'),
597
+ },
598
+ {
599
+ key: 'duplicate',
600
+ label: 'Duplicate',
601
+ onClick: () => console.log('duplicate'),
602
+ },
603
+ {
604
+ key: 'delete',
605
+ label: 'Delete project',
606
+ isDanger: true,
607
+ hasDivider: true,
608
+ onClick: () => console.log('delete'),
609
+ },
610
+ ],
611
+ },
612
+ {
613
+ key: 'file',
614
+ label: 'payment-flow.bpmn',
615
+ icon: Diagram,
616
+ },
617
+ ],
618
+ sidebarChildren: [],
619
+ });
620
+ return (_jsxs(_Fragment, { children: [_jsx(C3NavigationV2, { ...navProps }), _jsxs(MainContent, { sidebarExpanded: isSidebarExpanded, hasSidebar: false, children: [_jsx("h1", { children: "Breadcrumb Actions" }), _jsxs("p", { style: { marginTop: '1rem', color: 'var(--cds-text-secondary)' }, children: ["The ", _jsx("strong", { children: "Payment Service" }), " breadcrumb has an overflow menu (triple-dot) with actions: Rename, Duplicate, and Delete (danger + divider). The ", _jsx("strong", { children: "Acme Corp" }), " breadcrumb has a dropdown for org switching. Both features can coexist on the same segment."] })] })] }));
621
+ };
622
+ // ─── Cluster webapp (Org > Cluster > App with app switching) ────────────────
623
+ export const ClusterWebappTemplate = () => {
624
+ const [activeKey, setActiveKey] = useState('processes');
625
+ const { navProps, isSidebarExpanded } = useC3NavigationV2({
626
+ app: { ariaLabel: 'Camunda Operate', linkProps: { href: '#' } },
627
+ skipToContentTargetId: 'main-content',
628
+ activeItemKey: activeKey,
629
+ breadcrumbs: [
630
+ {
631
+ key: 'org',
632
+ label: 'Acme Corp',
633
+ icon: Building,
634
+ linkProps: { href: '#modeler-org' },
635
+ },
636
+ {
637
+ key: 'cluster',
638
+ label: 'Production Cluster',
639
+ icon: CloudApp,
640
+ linkProps: { href: '#console-cluster' },
641
+ },
642
+ {
643
+ key: 'app',
644
+ label: 'Operate',
645
+ icon: Play,
646
+ dropdownTitle: 'Switch application',
647
+ dropdownAriaLabel: 'Switch application',
648
+ dropdownItems: [
649
+ { key: 'operate', label: 'Operate', icon: Play, isSelected: true },
650
+ {
651
+ key: 'tasklist',
652
+ label: 'Tasklist',
653
+ icon: Task,
654
+ linkProps: { href: '#tasklist' },
655
+ },
656
+ {
657
+ key: 'optimize',
658
+ label: 'Optimize',
659
+ icon: Analytics,
660
+ linkProps: { href: '#optimize' },
661
+ },
662
+ {
663
+ key: 'admin',
664
+ label: 'Admin',
665
+ icon: Settings,
666
+ linkProps: { href: '#admin' },
667
+ },
668
+ ],
669
+ },
670
+ ],
671
+ sidebarChildren: [
672
+ {
673
+ type: 'item',
674
+ key: 'dashboard',
675
+ label: 'Dashboard',
676
+ icon: Dashboard,
677
+ onClick: () => setActiveKey('dashboard'),
678
+ },
679
+ {
680
+ type: 'item',
681
+ key: 'processes',
682
+ label: 'Processes',
683
+ icon: Play,
684
+ onClick: () => setActiveKey('processes'),
685
+ },
686
+ {
687
+ type: 'item',
688
+ key: 'decisions',
689
+ label: 'Decisions',
690
+ icon: Document,
691
+ onClick: () => setActiveKey('decisions'),
692
+ },
693
+ ],
694
+ });
695
+ return (_jsxs(_Fragment, { children: [_jsx(C3NavigationV2, { ...navProps }), _jsxs(MainContent, { sidebarExpanded: isSidebarExpanded, children: [_jsx("h1", { children: "Cluster Webapp Pattern" }), _jsxs("p", { style: { marginTop: '1rem', color: 'var(--cds-text-secondary)' }, children: ["Standard ", _jsx("strong", { children: "Org > Cluster > App" }), " breadcrumb chain for cluster-scoped webapps (Operate, Tasklist, Optimize, Admin). The app crumb has a dropdown to switch between sibling apps on the same cluster. Org and cluster crumbs link back to web modeler / console."] }), _jsxs("p", { style: { marginTop: '0.5rem', color: 'var(--cds-text-secondary)' }, children: ["This pattern is what ", _jsx("code", { children: "useClusterWebappBreadcrumbs" }), " builds automatically from C3 profile data."] })] })] }));
696
+ };
697
+ // ─── Header trailing content (license tag slot) ─────────────────────────────
698
+ export const HeaderTrailingContentTemplate = () => {
699
+ const [activeKey, setActiveKey] = useState('dashboard');
700
+ const { navProps, isSidebarExpanded } = useC3NavigationV2({
701
+ app: { ariaLabel: 'Camunda Operate', linkProps: { href: '#' } },
702
+ skipToContentTargetId: 'main-content',
703
+ activeItemKey: activeKey,
704
+ headerTrailingContent: (_jsx("span", { style: {
705
+ display: 'inline-flex',
706
+ alignItems: 'center',
707
+ padding: '0 0.5rem',
708
+ height: '1.5rem',
709
+ borderRadius: '1rem',
710
+ background: 'var(--cds-layer-02)',
711
+ color: 'var(--cds-text-secondary)',
712
+ fontSize: '0.75rem',
713
+ whiteSpace: 'nowrap',
714
+ }, children: "Non-production license" })),
715
+ breadcrumbs: [{ key: 'app', label: 'Operate', icon: Play }],
716
+ sidebarChildren: [
717
+ {
718
+ type: 'item',
719
+ key: 'dashboard',
720
+ label: 'Dashboard',
721
+ icon: Dashboard,
722
+ onClick: () => setActiveKey('dashboard'),
723
+ },
724
+ {
725
+ type: 'item',
726
+ key: 'processes',
727
+ label: 'Processes',
728
+ icon: Play,
729
+ onClick: () => setActiveKey('processes'),
730
+ },
731
+ ],
732
+ globalActions: [
733
+ { key: 'help', label: 'Help', icon: Help },
734
+ { key: 'user', label: 'User', icon: UserAvatar },
735
+ ],
736
+ });
737
+ return (_jsxs(_Fragment, { children: [_jsx(C3NavigationV2, { ...navProps }), _jsxs(MainContent, { sidebarExpanded: isSidebarExpanded, children: [_jsx("h1", { children: "Header Trailing Content" }), _jsxs("p", { style: { marginTop: '1rem', color: 'var(--cds-text-secondary)' }, children: ["The ", _jsx("code", { children: "headerTrailingContent" }), " prop renders content in the right-aligned header area, before the tool/action buttons. Used for license tags, environment badges, etc."] })] })] }));
738
+ };
739
+ // ─── Compact sections (back button pattern) ─────────────────────────────────
740
+ export const CompactSectionTemplate = () => {
741
+ const [activeKey, setActiveKey] = useState('email-notifications');
742
+ const { navProps, isSidebarExpanded } = useC3NavigationV2({
743
+ app: { ariaLabel: 'Camunda Modeler', linkProps: { href: '#' } },
744
+ skipToContentTargetId: 'main-content',
745
+ activeItemKey: activeKey,
746
+ breadcrumbs: [
747
+ { key: 'org', label: 'Acme Corp', icon: Building },
748
+ { key: 'settings', label: 'Settings', icon: Settings },
749
+ ],
750
+ sidebarChildren: [
751
+ {
752
+ type: 'section',
753
+ key: 'back',
754
+ compact: true,
755
+ children: [
756
+ {
757
+ type: 'item',
758
+ key: 'back-home',
759
+ label: 'Back to home',
760
+ icon: ArrowLeft,
761
+ onClick: () => console.log('navigate back'),
762
+ },
763
+ ],
764
+ },
765
+ {
766
+ type: 'section',
767
+ key: 'settings-section',
768
+ title: 'Settings',
769
+ children: [
770
+ {
771
+ type: 'item',
772
+ key: 'email-notifications',
773
+ label: 'Email notifications',
774
+ icon: Notification,
775
+ onClick: () => setActiveKey('email-notifications'),
776
+ },
777
+ {
778
+ type: 'item',
779
+ key: 'deployment-settings',
780
+ label: 'Process application deployment',
781
+ icon: Application,
782
+ onClick: () => setActiveKey('deployment-settings'),
783
+ },
784
+ {
785
+ type: 'item',
786
+ key: 'accessibility',
787
+ label: 'Accessibility',
788
+ icon: Settings,
789
+ onClick: () => setActiveKey('accessibility'),
790
+ },
791
+ ],
792
+ },
793
+ ],
794
+ });
795
+ return (_jsxs(_Fragment, { children: [_jsx(C3NavigationV2, { ...navProps }), _jsxs(MainContent, { sidebarExpanded: isSidebarExpanded, children: [_jsx("h1", { children: "Compact Section (Back Button)" }), _jsxs("p", { style: { marginTop: '1rem', color: 'var(--cds-text-secondary)' }, children: ["The \"Back to home\" item sits in a ", _jsx("strong", { children: "compact section" }), ' ', "that renders flush against the sidebar chrome (no extra margin). The next section (\"Settings\") follows normally with its title and divider."] })] })] }));
796
+ };