@camunda/camunda-composite-components 0.22.2 → 0.22.4
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/package.json +19 -19
- package/lib/esm/package.json +0 -98
- package/lib/esm/src/api/api.d.ts +0 -29
- package/lib/esm/src/api/api.js +0 -92
- package/lib/esm/src/api/clusters.d.ts +0 -10
- package/lib/esm/src/api/clusters.js +0 -32
- package/lib/esm/src/api/endpoints.const.d.ts +0 -22
- package/lib/esm/src/api/endpoints.const.js +0 -70
- package/lib/esm/src/api/help-center.d.ts +0 -42
- package/lib/esm/src/api/help-center.js +0 -56
- package/lib/esm/src/api/jwt.utils.d.ts +0 -5
- package/lib/esm/src/api/jwt.utils.js +0 -26
- package/lib/esm/src/api/notifications.d.ts +0 -41
- package/lib/esm/src/api/notifications.js +0 -170
- package/lib/esm/src/api/organizations.d.ts +0 -15
- package/lib/esm/src/api/organizations.js +0 -16
- package/lib/esm/src/api/profile.d.ts +0 -20
- package/lib/esm/src/api/profile.js +0 -48
- package/lib/esm/src/api/status.d.ts +0 -7
- package/lib/esm/src/api/status.js +0 -46
- package/lib/esm/src/assets/c3-icons.d.ts +0 -5
- package/lib/esm/src/assets/c3-icons.js +0 -5
- package/lib/esm/src/assets/c3-icons.types.d.ts +0 -3
- package/lib/esm/src/assets/c3-icons.types.js +0 -6
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.d.ts +0 -5
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.js +0 -94
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.d.ts +0 -17
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.js +0 -31
- package/lib/esm/src/components/c3-app-teaser/app-teaster-card.d.ts +0 -14
- package/lib/esm/src/components/c3-app-teaser/app-teaster-card.js +0 -24
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.d.ts +0 -9
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.js +0 -48
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.test.d.ts +0 -1
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.test.js +0 -33
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.d.ts +0 -14
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.js +0 -53
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.d.ts +0 -6
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.js +0 -84
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.test.d.ts +0 -1
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.test.js +0 -13
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.types.d.ts +0 -26
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.types.js +0 -11
- package/lib/esm/src/components/c3-data-table/c3-data-table.d.ts +0 -3
- package/lib/esm/src/components/c3-data-table/c3-data-table.js +0 -509
- package/lib/esm/src/components/c3-data-table/c3-data-table.types.d.ts +0 -122
- package/lib/esm/src/components/c3-data-table/c3-data-table.types.js +0 -6
- package/lib/esm/src/components/c3-data-table/link-button/link-button.d.ts +0 -3
- package/lib/esm/src/components/c3-data-table/link-button/link-button.js +0 -15
- package/lib/esm/src/components/c3-data-table/link-button/link-button.types.d.ts +0 -8
- package/lib/esm/src/components/c3-data-table/link-button/link-button.types.js +0 -6
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.d.ts +0 -3
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.js +0 -15
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.test.d.ts +0 -1
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.test.js +0 -25
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.types.d.ts +0 -29
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.types.js +0 -6
- package/lib/esm/src/components/c3-help-center/c3-help-center-provider.d.ts +0 -19
- package/lib/esm/src/components/c3-help-center/c3-help-center-provider.js +0 -58
- package/lib/esm/src/components/c3-help-center/c3-help-center.d.ts +0 -16
- package/lib/esm/src/components/c3-help-center/c3-help-center.js +0 -218
- package/lib/esm/src/components/c3-help-center/c3-help-center.types.d.ts +0 -43
- package/lib/esm/src/components/c3-help-center/c3-help-center.types.js +0 -6
- package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.d.ts +0 -10
- package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.js +0 -17
- package/lib/esm/src/components/c3-help-center/help-center-hint.d.ts +0 -4
- package/lib/esm/src/components/c3-help-center/help-center-hint.js +0 -15
- package/lib/esm/src/components/c3-help-center/help-center.d.ts +0 -18
- package/lib/esm/src/components/c3-help-center/help-center.js +0 -189
- package/lib/esm/src/components/c3-help-center/recommendations.d.ts +0 -4
- package/lib/esm/src/components/c3-help-center/recommendations.js +0 -55
- package/lib/esm/src/components/c3-help-center/styles.d.ts +0 -4
- package/lib/esm/src/components/c3-help-center/styles.js +0 -48
- package/lib/esm/src/components/c3-help-center/tabs/feedback.d.ts +0 -9
- package/lib/esm/src/components/c3-help-center/tabs/feedback.js +0 -141
- package/lib/esm/src/components/c3-help-center/tabs/tabContent.d.ts +0 -20
- package/lib/esm/src/components/c3-help-center/tabs/tabContent.js +0 -22
- package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.d.ts +0 -2
- package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.js +0 -26
- package/lib/esm/src/components/c3-help-center/tile.d.ts +0 -10
- package/lib/esm/src/components/c3-help-center/tile.js +0 -61
- package/lib/esm/src/components/c3-navigation/c3-info-button.d.ts +0 -4
- package/lib/esm/src/components/c3-navigation/c3-info-button.js +0 -9
- package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.d.ts +0 -6
- package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.js +0 -18
- package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.d.ts +0 -10
- package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.js +0 -6
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.d.ts +0 -4
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.js +0 -380
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.d.ts +0 -2
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.js +0 -21
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.d.ts +0 -6
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.js +0 -38
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts +0 -12
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js +0 -68
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.d.ts +0 -10
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.js +0 -87
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts +0 -81
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.js +0 -6
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.d.ts +0 -5
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js +0 -107
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.d.ts +0 -29
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js +0 -54
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.d.ts +0 -6
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.js +0 -57
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.d.ts +0 -2
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.js +0 -11
- package/lib/esm/src/components/c3-navigation/c3-navigation.d.ts +0 -7
- package/lib/esm/src/components/c3-navigation/c3-navigation.js +0 -262
- package/lib/esm/src/components/c3-navigation/c3-navigation.test.d.ts +0 -1
- package/lib/esm/src/components/c3-navigation/c3-navigation.test.js +0 -89
- package/lib/esm/src/components/c3-navigation/c3-navigation.types.d.ts +0 -97
- package/lib/esm/src/components/c3-navigation/c3-navigation.types.js +0 -6
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts +0 -13
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.js +0 -100
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.d.ts +0 -19
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.js +0 -110
- package/lib/esm/src/components/c3-navigation/c3-org-name.d.ts +0 -6
- package/lib/esm/src/components/c3-navigation/c3-org-name.js +0 -34
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.d.ts +0 -6
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.js +0 -188
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.d.ts +0 -29
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.js +0 -92
- package/lib/esm/src/components/c3-navigation/helpers.d.ts +0 -8
- package/lib/esm/src/components/c3-navigation/helpers.js +0 -58
- package/lib/esm/src/components/c3-navigation/index.d.ts +0 -2
- package/lib/esm/src/components/c3-navigation/index.js +0 -8
- package/lib/esm/src/components/c3-navigation/stories/story-helpers.d.ts +0 -35
- package/lib/esm/src/components/c3-navigation/stories/story-helpers.js +0 -264
- package/lib/esm/src/components/c3-navigation/stories/story-templates.d.ts +0 -9
- package/lib/esm/src/components/c3-navigation/stories/story-templates.js +0 -38
- package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.d.ts +0 -14
- package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.js +0 -94
- package/lib/esm/src/components/c3-onboarding-survey/defaultOnboardingConfig.d.ts +0 -16
- package/lib/esm/src/components/c3-onboarding-survey/defaultOnboardingConfig.js +0 -8
- package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.d.ts +0 -15
- package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.js +0 -58
- package/lib/esm/src/components/c3-onboarding-survey/elements/inlineNotification.d.ts +0 -3
- package/lib/esm/src/components/c3-onboarding-survey/elements/inlineNotification.js +0 -10
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.d.ts +0 -7
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.js +0 -53
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.d.ts +0 -7
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.js +0 -36
- package/lib/esm/src/components/c3-onboarding-survey/elements/textField.d.ts +0 -6
- package/lib/esm/src/components/c3-onboarding-survey/elements/textField.js +0 -14
- package/lib/esm/src/components/c3-onboarding-survey/helpers.d.ts +0 -1
- package/lib/esm/src/components/c3-onboarding-survey/helpers.js +0 -10
- package/lib/esm/src/components/c3-onboarding-survey/onboarding.types.d.ts +0 -30
- package/lib/esm/src/components/c3-onboarding-survey/onboarding.types.js +0 -13
- package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.d.ts +0 -25
- package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.js +0 -52
- package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.d.ts +0 -21
- package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.js +0 -35
- package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.d.ts +0 -17
- package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.js +0 -148
- package/lib/esm/src/components/c3-onboarding-survey/step.d.ts +0 -7
- package/lib/esm/src/components/c3-onboarding-survey/step.js +0 -44
- package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.d.ts +0 -3
- package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.js +0 -28
- package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.types.d.ts +0 -19
- package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.types.js +0 -6
- package/lib/esm/src/components/c3-page/c3-page.d.ts +0 -4
- package/lib/esm/src/components/c3-page/c3-page.js +0 -16
- package/lib/esm/src/components/c3-page/c3-page.test.d.ts +0 -1
- package/lib/esm/src/components/c3-page/c3-page.test.js +0 -25
- package/lib/esm/src/components/c3-page/c3-page.types.d.ts +0 -18
- package/lib/esm/src/components/c3-page/c3-page.types.js +0 -6
- package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.d.ts +0 -3
- package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.js +0 -37
- package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.types.d.ts +0 -14
- package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.types.js +0 -6
- package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.d.ts +0 -2
- package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.js +0 -18
- package/lib/esm/src/components/c3-user-configuration/authToken.d.ts +0 -30
- package/lib/esm/src/components/c3-user-configuration/authToken.js +0 -30
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts +0 -26
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.js +0 -117
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.d.ts +0 -13
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.js +0 -29
- package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.d.ts +0 -54
- package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.js +0 -43
- package/lib/esm/src/components/styles.d.ts +0 -13
- package/lib/esm/src/components/styles.js +0 -90
- package/lib/esm/src/components/test-utils.d.ts +0 -3
- package/lib/esm/src/components/test-utils.js +0 -32
- package/lib/esm/src/contexts/c3-cluster-update-manager.d.ts +0 -12
- package/lib/esm/src/contexts/c3-cluster-update-manager.js +0 -27
- package/lib/esm/src/hooks/useApi.d.ts +0 -20
- package/lib/esm/src/hooks/useApi.js +0 -54
- package/lib/esm/src/index.d.ts +0 -23
- package/lib/esm/src/index.js +0 -19
- package/lib/esm/src/utils/camunda.d.ts +0 -21
- package/lib/esm/src/utils/camunda.js +0 -59
- package/lib/esm/src/utils/camunda.types.d.ts +0 -63
- package/lib/esm/src/utils/camunda.types.js +0 -6
- package/lib/esm/src/utils/versionCheck.utils.d.ts +0 -15
- package/lib/esm/src/utils/versionCheck.utils.js +0 -79
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } 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
|
-
// React import not required with automatic JSX runtime
|
|
8
|
-
import { Link } from '@carbon/react';
|
|
9
|
-
import { Add, ArrowRight, TrashCan } from '@carbon/react/icons/index.esm.js';
|
|
10
|
-
export function createAppProps() {
|
|
11
|
-
return {
|
|
12
|
-
name: 'Console',
|
|
13
|
-
ariaLabel: 'Camunda Console',
|
|
14
|
-
routeProps: {
|
|
15
|
-
href: 'https://www.camunda.com',
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export function createAppBarProps(options = {}) {
|
|
20
|
-
return {
|
|
21
|
-
isOpen: options.useElementsFromConfig
|
|
22
|
-
? undefined
|
|
23
|
-
: Boolean(options?.isOpen),
|
|
24
|
-
elements: options.useElementsFromConfig
|
|
25
|
-
? undefined
|
|
26
|
-
: (options?.elements ?? [
|
|
27
|
-
{
|
|
28
|
-
key: 'console',
|
|
29
|
-
label: 'Console',
|
|
30
|
-
active: true,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
key: 'modeler',
|
|
34
|
-
label: 'Modeler',
|
|
35
|
-
active: false,
|
|
36
|
-
routeProps: {
|
|
37
|
-
onClick: () => console.log('Redirecting to Modeler...'),
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
key: 'tasklist',
|
|
42
|
-
label: 'Tasklist',
|
|
43
|
-
active: false,
|
|
44
|
-
subElements: [
|
|
45
|
-
{
|
|
46
|
-
key: 'cluster-a',
|
|
47
|
-
label: 'Cluster A',
|
|
48
|
-
href: 'https://camunda.com/',
|
|
49
|
-
target: '_blank',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
key: 'cluster-b',
|
|
53
|
-
label: 'Cluster B',
|
|
54
|
-
onClick: () => console.log('Redirecting to Tasklist...'),
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
key: 'cluster-c',
|
|
58
|
-
label: 'Cluster C',
|
|
59
|
-
routeProps: {
|
|
60
|
-
onClick: () => console.log('Redirecting to Tasklist...'),
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
key: 'operate',
|
|
67
|
-
label: 'Operate',
|
|
68
|
-
active: false,
|
|
69
|
-
target: '_blank',
|
|
70
|
-
href: 'https://camunda.com/',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
key: 'optimize',
|
|
74
|
-
label: 'Optimize',
|
|
75
|
-
active: false,
|
|
76
|
-
target: '_blank',
|
|
77
|
-
href: 'https://camunda.com/',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
key: 'admin',
|
|
81
|
-
label: 'Admin',
|
|
82
|
-
active: false,
|
|
83
|
-
subElements: [
|
|
84
|
-
{
|
|
85
|
-
key: 'cluster-a',
|
|
86
|
-
label: 'Cluster A',
|
|
87
|
-
href: 'https://camunda.com/',
|
|
88
|
-
target: '_blank',
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
key: 'cluster-b',
|
|
92
|
-
label: 'Cluster B',
|
|
93
|
-
onClick: () => console.log('Redirecting to Admin...'),
|
|
94
|
-
},
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
]),
|
|
98
|
-
elementClicked: (element) => console.log(`event coming from the appBarProps: ${element} has been clicked`),
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
export function createNavBarBarProps({ orgName = 'Camunda', elements = undefined, showLicenseTag, showProductionLicense, isCommercial, expiresAt, } = {}) {
|
|
102
|
-
return {
|
|
103
|
-
elements: elements ?? [
|
|
104
|
-
{
|
|
105
|
-
key: 'dashboard',
|
|
106
|
-
label: 'Dashboard',
|
|
107
|
-
isCurrentPage: true,
|
|
108
|
-
routeProps: {},
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
key: 'clusters',
|
|
112
|
-
label: 'Clusters',
|
|
113
|
-
isCurrentPage: false,
|
|
114
|
-
routeProps: {
|
|
115
|
-
onClick: () => console.log('Redirecting to clusters...'),
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
orgName,
|
|
120
|
-
licenseTag: {
|
|
121
|
-
show: showLicenseTag || false,
|
|
122
|
-
isProductionLicense: showProductionLicense || false,
|
|
123
|
-
isCommercial: isCommercial || false,
|
|
124
|
-
expiresAt,
|
|
125
|
-
},
|
|
126
|
-
tags: [
|
|
127
|
-
{
|
|
128
|
-
key: 'githash',
|
|
129
|
-
label: 'example tag',
|
|
130
|
-
color: 'teal',
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
key: 'fooTooltip',
|
|
134
|
-
label: 'tooltip tag',
|
|
135
|
-
color: 'purple',
|
|
136
|
-
tooltip: {
|
|
137
|
-
content: (_jsxs("p", { children: ["tooltip popover with a", ' ', _jsx(Link, { href: 'http://camunda.com/', children: "link" })] })),
|
|
138
|
-
buttonLabel: 'open the tooltip',
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
export function createInfoSideBarProps(options) {
|
|
145
|
-
return {
|
|
146
|
-
isOpen: options.isOpen,
|
|
147
|
-
onOpen: () => console.log('Opened info sidebar'),
|
|
148
|
-
elements: [
|
|
149
|
-
{
|
|
150
|
-
key: 'info1',
|
|
151
|
-
label: 'Info 1',
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
key: 'info2',
|
|
155
|
-
label: 'Info 2',
|
|
156
|
-
preceedingDivider: options.preceedingDividerOn2ndElement,
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
export function createOrgSideBarProps(options) {
|
|
162
|
-
const elements = [];
|
|
163
|
-
if (options.orgCount !== undefined) {
|
|
164
|
-
for (let i = 0; i < options.orgCount; i++) {
|
|
165
|
-
elements.push({
|
|
166
|
-
key: `org-${i}`,
|
|
167
|
-
label: `Organization ${i}`,
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return {
|
|
172
|
-
isOpen: options.isOpen,
|
|
173
|
-
customElements: options.useConfig
|
|
174
|
-
? undefined
|
|
175
|
-
: {
|
|
176
|
-
activeOrganization: {
|
|
177
|
-
activeLabel: 'Active Organization',
|
|
178
|
-
otherLabel: 'Other Organization',
|
|
179
|
-
orgName: 'Camunda',
|
|
180
|
-
action: {
|
|
181
|
-
label: 'Manage',
|
|
182
|
-
onClick: () => console.log('Manage organization'),
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
elements: options.useConfig ? undefined : elements,
|
|
187
|
-
bottomElements: options.useConfig
|
|
188
|
-
? undefined
|
|
189
|
-
: [
|
|
190
|
-
{
|
|
191
|
-
key: 'createTrial',
|
|
192
|
-
label: 'Create new Trial Org',
|
|
193
|
-
renderIcon: Add,
|
|
194
|
-
onClick: () => {
|
|
195
|
-
console.log('clicked');
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
],
|
|
199
|
-
switchToOrg: options.useConfig
|
|
200
|
-
? (orgId) => console.log('Switch to org: ', orgId)
|
|
201
|
-
: undefined,
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
export function createUserSideBarProps(options) {
|
|
205
|
-
return {
|
|
206
|
-
isOpen: options.isOpen,
|
|
207
|
-
version: '8.3.0-alpha4',
|
|
208
|
-
customElements: {
|
|
209
|
-
customSection: options.customSection,
|
|
210
|
-
profile: {
|
|
211
|
-
label: 'Profile',
|
|
212
|
-
user: {
|
|
213
|
-
email: 'teamcloud@camunda.com',
|
|
214
|
-
name: 'Team Cloud',
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
themeSelector: options.hideThemeSelector
|
|
218
|
-
? undefined
|
|
219
|
-
: {
|
|
220
|
-
currentTheme: 'dark',
|
|
221
|
-
onChange: (newTheme) => console.log(`Selected ${newTheme} theme`),
|
|
222
|
-
},
|
|
223
|
-
stageToggle: {
|
|
224
|
-
prodFeaturesEnabled: true,
|
|
225
|
-
toggle: () => console.log('Toggle stage'),
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
elements: [
|
|
229
|
-
{
|
|
230
|
-
key: 'cookie',
|
|
231
|
-
label: 'Cookie Preferences',
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
key: 'terms',
|
|
235
|
-
label: 'Terms of use',
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
key: 'logout',
|
|
239
|
-
label: 'Log out',
|
|
240
|
-
kind: 'ghost',
|
|
241
|
-
renderIcon: ArrowRight,
|
|
242
|
-
},
|
|
243
|
-
],
|
|
244
|
-
bottomElements: [
|
|
245
|
-
{
|
|
246
|
-
key: 'delete',
|
|
247
|
-
label: 'Delete account',
|
|
248
|
-
kind: 'danger--ghost',
|
|
249
|
-
renderIcon: TrashCan,
|
|
250
|
-
},
|
|
251
|
-
],
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
export function createNotificationSideBarProps(options) {
|
|
255
|
-
return {
|
|
256
|
-
isOpen: options.isOpen,
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
export const createHelpCenterProps = (options) => ({
|
|
260
|
-
origin: options?.origin || 'console',
|
|
261
|
-
theme: options?.theme,
|
|
262
|
-
autoStartSurvey: options?.autoStartSurvey,
|
|
263
|
-
mixpanelTrack: (event, data) => console.log(`Mixpanel event ${event} tracked: ${JSON.stringify(data)}`),
|
|
264
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { StoryFn } from '@storybook/react';
|
|
2
|
-
import { type FC } from 'react';
|
|
3
|
-
import { C3Navigation } from '../c3-navigation';
|
|
4
|
-
export declare const DefaultTemplate: StoryFn<typeof C3Navigation>;
|
|
5
|
-
export declare const SuperUserToggle: FC<{
|
|
6
|
-
isActive?: boolean;
|
|
7
|
-
onChange?: (newValue: boolean) => void;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const NavbarWithCustomSection: FC;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } 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 { SwitcherDivider, Toggle } from '@carbon/react';
|
|
8
|
-
import { useState } from 'react';
|
|
9
|
-
import { C3Navigation } from '../c3-navigation.js';
|
|
10
|
-
import { createAppBarProps, createAppProps, createNavBarBarProps, createUserSideBarProps, } from './story-helpers.js';
|
|
11
|
-
export const DefaultTemplate = (args) => (_jsxs(_Fragment, { children: [_jsx(C3Navigation, { ...args }), _jsx("div", { id: 'main-content' })] }));
|
|
12
|
-
export const SuperUserToggle = ({ isActive, onChange }) => {
|
|
13
|
-
return (_jsxs(_Fragment, { children: [_jsx(SwitcherDivider, {}), _jsx("div", { style: { padding: '.5rem 1rem' }, children: _jsx(Toggle, { size: 'sm', id: 'toggle-super-admin-mode', defaultToggled: isActive, onToggle: (superAdminModeActive) => onChange?.(superAdminModeActive), labelText: 'Enter super-admin mode', "aria-label": 'Enter super-admin mode' }) })] }));
|
|
14
|
-
};
|
|
15
|
-
export const NavbarWithCustomSection = () => {
|
|
16
|
-
const [isSuperAdminModeActive, setIsSuperAdminModeActive] = useState(true);
|
|
17
|
-
const [appbarOpen, setAppBarOpen] = useState(false);
|
|
18
|
-
const appbarProps = createAppBarProps();
|
|
19
|
-
return (_jsxs(_Fragment, { children: [_jsx(C3Navigation, { app: createAppProps(), appBar: { ...appbarProps, isOpen: appbarProps.isOpen ?? appbarOpen }, toggleAppbar: (value) => {
|
|
20
|
-
setAppBarOpen(value);
|
|
21
|
-
}, navbar: {
|
|
22
|
-
...createNavBarBarProps(),
|
|
23
|
-
tags: isSuperAdminModeActive
|
|
24
|
-
? [
|
|
25
|
-
{
|
|
26
|
-
key: 'superUserMode',
|
|
27
|
-
label: 'Super-user mode',
|
|
28
|
-
color: 'high-contrast',
|
|
29
|
-
},
|
|
30
|
-
]
|
|
31
|
-
: undefined,
|
|
32
|
-
}, userSideBar: {
|
|
33
|
-
...createUserSideBarProps({ isOpen: false }),
|
|
34
|
-
customElements: {
|
|
35
|
-
customSection: (_jsx(SuperUserToggle, { isActive: isSuperAdminModeActive, onChange: setIsSuperAdminModeActive })),
|
|
36
|
-
},
|
|
37
|
-
} }), _jsx("div", { id: 'main-content' })] }));
|
|
38
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
2
|
-
import type { Persona } from '../c3-help-center/c3-help-center.types';
|
|
3
|
-
import { type MixPanelTrack } from '../c3-user-configuration/c3-user-configuration-provider';
|
|
4
|
-
export type C3OnboardingSurveyProps = {
|
|
5
|
-
onRequestClose: () => void;
|
|
6
|
-
onRequestSkip: () => void;
|
|
7
|
-
personaCallback: (persona: Persona) => void;
|
|
8
|
-
theme: 'light' | 'dark';
|
|
9
|
-
mixpanelTrack?: MixPanelTrack;
|
|
10
|
-
origin: 'console' | 'webmodeler' | 'operate' | 'tasklist' | 'optimize' | 'identity' | 'admin';
|
|
11
|
-
modal: boolean;
|
|
12
|
-
persona: Persona | undefined;
|
|
13
|
-
};
|
|
14
|
-
export declare const C3OnboardingSurvey: FC<C3OnboardingSurveyProps>;
|
|
@@ -1,94 +0,0 @@
|
|
|
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 React, { useState } from 'react';
|
|
8
|
-
import { getOnboardingConfig, submitSurvey, updatePersona, } from '../../api/help-center.js';
|
|
9
|
-
import { useC3UserConfiguration, } from '../c3-user-configuration/c3-user-configuration-provider.js';
|
|
10
|
-
import { defaultOnboardingConfig } from './defaultOnboardingConfig.js';
|
|
11
|
-
import { OnboardingSurvey } from './onboardingSurvey.js';
|
|
12
|
-
export const C3OnboardingSurvey = (props) => {
|
|
13
|
-
const { userToken, decodedToken, activeOrganizationId, decodedAudience } = useC3UserConfiguration();
|
|
14
|
-
const [persona, setPersona] = useState(props.persona);
|
|
15
|
-
const [userId, setUserId] = useState('');
|
|
16
|
-
const [onboardConfig, setOnboardConfig] = useState(defaultOnboardingConfig);
|
|
17
|
-
const [isLoadingConfig, setIsLoadingConfig] = useState(false);
|
|
18
|
-
const [givenName, setGivenName] = useState('');
|
|
19
|
-
const [email, setEmail] = useState('');
|
|
20
|
-
React.useEffect(() => {
|
|
21
|
-
if (!decodedToken || !decodedAudience)
|
|
22
|
-
return;
|
|
23
|
-
(async () => {
|
|
24
|
-
const { userId, meta, persona } = decodedToken;
|
|
25
|
-
if (props.persona === undefined && persona) {
|
|
26
|
-
setPersona(persona);
|
|
27
|
-
}
|
|
28
|
-
if (meta) {
|
|
29
|
-
setGivenName(meta.given_name);
|
|
30
|
-
setEmail(meta.email);
|
|
31
|
-
}
|
|
32
|
-
if (userId)
|
|
33
|
-
setUserId(userId);
|
|
34
|
-
setOnboardConfig(defaultOnboardingConfig);
|
|
35
|
-
setIsLoadingConfig(true);
|
|
36
|
-
const { result: config } = await getOnboardingConfig({
|
|
37
|
-
audience: decodedAudience,
|
|
38
|
-
camundaAuth: { token: userToken },
|
|
39
|
-
orgId: activeOrganizationId,
|
|
40
|
-
});
|
|
41
|
-
if (config)
|
|
42
|
-
setOnboardConfig(config);
|
|
43
|
-
setIsLoadingConfig(false);
|
|
44
|
-
})();
|
|
45
|
-
}, [JSON.stringify(decodedToken), decodedAudience]);
|
|
46
|
-
React.useEffect(() => {
|
|
47
|
-
setPersona(props.persona);
|
|
48
|
-
}, [props.persona]);
|
|
49
|
-
const closeFn = async (skip) => {
|
|
50
|
-
props.mixpanelTrack?.('survey:click', {
|
|
51
|
-
location: skip ? 'skip' : 'exit',
|
|
52
|
-
step: persona?.nextStep ?? 1,
|
|
53
|
-
from: props.origin,
|
|
54
|
-
});
|
|
55
|
-
const newPersona = { ...persona, ...{ complete: skip } };
|
|
56
|
-
if (activeOrganizationId && userToken && decodedAudience)
|
|
57
|
-
await updatePersona({
|
|
58
|
-
newPersona,
|
|
59
|
-
audience: decodedAudience,
|
|
60
|
-
orgId: activeOrganizationId,
|
|
61
|
-
userId,
|
|
62
|
-
accessToken: userToken,
|
|
63
|
-
});
|
|
64
|
-
props.personaCallback(newPersona);
|
|
65
|
-
setPersona(newPersona);
|
|
66
|
-
if (skip) {
|
|
67
|
-
props.onRequestSkip();
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
props.onRequestClose();
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
const syncPersona = async (newPersona, notifyHubspot) => {
|
|
74
|
-
if (activeOrganizationId && userToken && decodedAudience) {
|
|
75
|
-
await updatePersona({
|
|
76
|
-
newPersona,
|
|
77
|
-
audience: decodedAudience,
|
|
78
|
-
orgId: activeOrganizationId,
|
|
79
|
-
userId,
|
|
80
|
-
accessToken: userToken,
|
|
81
|
-
});
|
|
82
|
-
if (notifyHubspot) {
|
|
83
|
-
await submitSurvey({
|
|
84
|
-
audience: decodedAudience,
|
|
85
|
-
token: userToken,
|
|
86
|
-
data: { ...newPersona, ...{ email, orgUuid: activeOrganizationId } },
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
setPersona(newPersona);
|
|
91
|
-
props.personaCallback(newPersona);
|
|
92
|
-
};
|
|
93
|
-
return (_jsx(OnboardingSurvey, { appTheme: props.theme, userFirstName: givenName, persona: persona, syncPersona: syncPersona, setPersona: setPersona, mixpanelTrack: props.mixpanelTrack, onRequestClose: closeFn, onboardingConfiguration: onboardConfig, isLoadingConfig: isLoadingConfig, modal: props.modal, origin: props.origin }));
|
|
94
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Persona } from '../c3-help-center/c3-help-center.types';
|
|
2
|
-
export type Step = {
|
|
3
|
-
title?: string;
|
|
4
|
-
elements?: unknown[];
|
|
5
|
-
nextenabled?: {
|
|
6
|
-
[fieldName: string]: keyof Persona;
|
|
7
|
-
}[];
|
|
8
|
-
};
|
|
9
|
-
export type OnboardingConfig = {
|
|
10
|
-
steps: Step[];
|
|
11
|
-
header?: {
|
|
12
|
-
title: string;
|
|
13
|
-
description: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export declare const defaultOnboardingConfig: OnboardingConfig;
|
|
@@ -1,8 +0,0 @@
|
|
|
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 const defaultOnboardingConfig = {
|
|
7
|
-
steps: [],
|
|
8
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
2
|
-
import type { RadioGroupElementProps } from '../onboarding.types';
|
|
3
|
-
export declare const DropdownSelect: FC<RadioGroupElementProps & {
|
|
4
|
-
title: string;
|
|
5
|
-
label: string;
|
|
6
|
-
elements: {
|
|
7
|
-
label: string;
|
|
8
|
-
value: string;
|
|
9
|
-
}[];
|
|
10
|
-
selectedElement: string | undefined;
|
|
11
|
-
setSelectedElement: (value: string) => void;
|
|
12
|
-
exceptionTitle: string;
|
|
13
|
-
exceptionLabel: string;
|
|
14
|
-
exceptionValue: string;
|
|
15
|
-
}>;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } 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 { Select, SelectItem, Stack, TextInput } from '@carbon/react';
|
|
8
|
-
import { useState } from 'react';
|
|
9
|
-
import { getTitleId } from '../helpers.js';
|
|
10
|
-
export const DropdownSelect = ({ title, label, elements, selectedElement, setSelectedElement, exceptionTitle, exceptionLabel, exceptionValue, }) => {
|
|
11
|
-
let showSuggestion = false;
|
|
12
|
-
selectedElement = selectedElement ? selectedElement?.toString() : '';
|
|
13
|
-
const [suggestion, setSuggestion] = useState((selectedElement ?? '').split(' - ').length > 0
|
|
14
|
-
? (selectedElement ?? '').split(' - ')[1]
|
|
15
|
-
: '');
|
|
16
|
-
const setElement = (input, suggest) => {
|
|
17
|
-
showSuggestion = input === exceptionValue;
|
|
18
|
-
if (showSuggestion) {
|
|
19
|
-
setSelectedElement(`${input} - ${suggest}`);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
setSelectedElement(input);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const elementWithoutSuggestion = () => {
|
|
26
|
-
return selectedElement?.split(' - ')[0];
|
|
27
|
-
};
|
|
28
|
-
const calculateSuggestion = (input) => {
|
|
29
|
-
const rawElement = elementWithoutSuggestion() ?? '';
|
|
30
|
-
setSuggestion(input);
|
|
31
|
-
setElement(rawElement, input);
|
|
32
|
-
};
|
|
33
|
-
const titleId = getTitleId(title);
|
|
34
|
-
const exceptionTitleId = getTitleId(exceptionTitle);
|
|
35
|
-
return (_jsx(_Fragment, { children: _jsx(Stack, { children: (() => {
|
|
36
|
-
return (_jsx(_Fragment, { children: _jsxs("div", { style: {
|
|
37
|
-
display: 'grid',
|
|
38
|
-
gridTemplateColumns: '58% 42%',
|
|
39
|
-
}, children: [_jsxs(Stack, { gap: 1, children: [_jsx("h4", { id: titleId, children: title }), (() => {
|
|
40
|
-
if (label) {
|
|
41
|
-
return _jsx("p", { className: 'cds--modal-header__label', children: label });
|
|
42
|
-
}
|
|
43
|
-
return _jsx(_Fragment, {});
|
|
44
|
-
})(), ' '] }), _jsx(Select, { id: `select-${Math.random() * 10000}`, size: 'lg', defaultValue: elements[0].value, "aria-labelledby": titleId, labelText: '', onChange: (event) => {
|
|
45
|
-
const element = elements.find((e) => e.value === event.target.value);
|
|
46
|
-
if (element)
|
|
47
|
-
setElement(element.value, '');
|
|
48
|
-
}, value: elementWithoutSuggestion(), children: elements.map((e) => (_jsx(SelectItem, { id: `selectItem-${Math.random() * 10000}`, value: e.value, text: e.label }, `selectItem-${Math.random() * 10000}`))) }, `select-${Math.random() * 10000}`), (() => {
|
|
49
|
-
if (exceptionValue &&
|
|
50
|
-
elementWithoutSuggestion() === exceptionValue) {
|
|
51
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { style: { marginTop: '24px' } }), _jsx("div", { style: { marginTop: '24px' } }), _jsxs(Stack, { gap: 1, children: [_jsx("h4", { id: exceptionTitleId, children: exceptionTitle }), _jsx("p", { className: 'cds--modal-header__label', children: exceptionLabel })] }), _jsx(TextInput, { style: { height: '48px' }, id: `text-input-element-${Math.random() * 1000}`, placeholder: 'Enter your suggestion', labelText: '', value: suggestion, onChange: (event) => {
|
|
52
|
-
calculateSuggestion(event.target.value);
|
|
53
|
-
}, "aria-labelledby": exceptionTitleId, "aria-label": exceptionTitle, invalid: false, invalidText: _jsx(_Fragment, {}) })] }));
|
|
54
|
-
}
|
|
55
|
-
return _jsx(_Fragment, {});
|
|
56
|
-
})()] }) }));
|
|
57
|
-
})() }) }));
|
|
58
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
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 { InlineNotification } from '@carbon/react';
|
|
8
|
-
export const InlineNotificationElement = ({ hideclosebutton, kind, lowcontrast, title, label, }) => {
|
|
9
|
-
return (_jsx(InlineNotification, { hideCloseButton: hideclosebutton, kind: kind, lowContrast: lowcontrast, title: title, subtitle: label, style: { maxWidth: '100%' } }));
|
|
10
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { RadioGroupElementProps } from '../onboarding.types';
|
|
3
|
-
export declare const RadioGroupElementMulti: FC<RadioGroupElementProps & {
|
|
4
|
-
theme: string;
|
|
5
|
-
selectedElements: string[] | undefined;
|
|
6
|
-
setSelectedElements: (value: string[]) => void;
|
|
7
|
-
}>;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } 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 { Button, Column, FlexGrid, Row, SelectableTile, Stack, Tooltip, } from '@carbon/react';
|
|
8
|
-
import { Information } from '@carbon/react/icons/index.esm.js';
|
|
9
|
-
export const RadioGroupElementMulti = ({ theme, title, label, elements, columns, tooltip, selectedElements, setSelectedElements, }) => {
|
|
10
|
-
const backgroundColor = theme === 'dark' ? '#393939' : '#E5E5E5';
|
|
11
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Stack, { gap: 1, children: [_jsxs("h4", { children: [title, (() => {
|
|
12
|
-
if (tooltip) {
|
|
13
|
-
return (_jsx(Tooltip, { label: tooltip, align: 'bottom', children: _jsx("span", { className: 'onboarding', children: _jsx(Button, { kind: 'ghost', renderIcon: Information, iconDescription: 'Information', "aria-label": 'Information', style: {
|
|
14
|
-
marginTop: '-10px',
|
|
15
|
-
backgroundColor: theme === 'light' ? '#FFFFFF' : '#161616',
|
|
16
|
-
} }) }) }));
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
return _jsx(_Fragment, {});
|
|
20
|
-
}
|
|
21
|
-
})()] }), (() => {
|
|
22
|
-
if (label) {
|
|
23
|
-
return _jsx("p", { className: 'cds--modal-header__label', children: label });
|
|
24
|
-
}
|
|
25
|
-
return _jsx(_Fragment, {});
|
|
26
|
-
})(), ' '] }), _jsx(Stack, { gap: 3, children: elements
|
|
27
|
-
.reduce((result, item, index) => {
|
|
28
|
-
const chunkIndex = Math.floor(index / columns);
|
|
29
|
-
if (!result[chunkIndex]) {
|
|
30
|
-
result[chunkIndex] = [];
|
|
31
|
-
}
|
|
32
|
-
result[chunkIndex].push(item);
|
|
33
|
-
return result;
|
|
34
|
-
}, [])
|
|
35
|
-
.map((row, index) => (_jsx(FlexGrid, { style: {
|
|
36
|
-
width: '100%',
|
|
37
|
-
maxWidth: '100%',
|
|
38
|
-
paddingLeft: '0',
|
|
39
|
-
paddingRight: '0',
|
|
40
|
-
}, children: _jsx(Row, { children: row.map((element) => (_jsx(Column, { style: { maxWidth: `${100 / columns}%` }, children: _jsx(SelectableTile, { style: {
|
|
41
|
-
backgroundColor,
|
|
42
|
-
marginBottom: '24px',
|
|
43
|
-
}, selected: (() => {
|
|
44
|
-
return selectedElements?.includes(element.value);
|
|
45
|
-
})(), onClick: () => {
|
|
46
|
-
if (selectedElements?.includes(element.value)) {
|
|
47
|
-
setSelectedElements(selectedElements?.filter((e) => e !== element.value));
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
setSelectedElements(selectedElements?.concat([element.value]) || []);
|
|
51
|
-
}
|
|
52
|
-
}, value: element.value, children: element.label }) }, `tile-${element.value}`))) }) }, `onboarding-radio-row-${index}`))) })] }));
|
|
53
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { RadioGroupElementProps } from '../onboarding.types';
|
|
3
|
-
export declare const RadioGroupElementSingle: FC<RadioGroupElementProps & {
|
|
4
|
-
theme: string;
|
|
5
|
-
selectedElement: string | undefined;
|
|
6
|
-
setSelectedElement: (value: string) => void;
|
|
7
|
-
}>;
|
|
@@ -1,36 +0,0 @@
|
|
|
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 { Button, Column, FlexGrid, RadioTile, Row, Stack, Tooltip, } from '@carbon/react';
|
|
8
|
-
import { Information } from '@carbon/react/icons/index.esm.js';
|
|
9
|
-
import styled from 'styled-components';
|
|
10
|
-
const StyledRadioTile = styled(RadioTile) `
|
|
11
|
-
background-color: ${({ $backgroundColor }) => $backgroundColor};
|
|
12
|
-
margin-bottom: 24px;
|
|
13
|
-
`;
|
|
14
|
-
export const RadioGroupElementSingle = ({ theme, title, label, elements, columns, tooltip, selectedElement, setSelectedElement, }) => {
|
|
15
|
-
const backgroundColor = theme === 'dark' ? '#393939' : '#E5E5E5';
|
|
16
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Stack, { gap: 1, children: [_jsxs("h4", { children: [title, tooltip && (_jsx(Tooltip, { label: tooltip, align: 'bottom', children: _jsx("span", { className: 'onboarding', children: _jsx(Button, { kind: 'ghost', renderIcon: Information, iconDescription: 'Information', "aria-label": 'Information', style: {
|
|
17
|
-
marginTop: '-10px',
|
|
18
|
-
backgroundColor: theme === 'light' ? '#FFFFFF' : '#161616',
|
|
19
|
-
} }) }) }))] }), label && _jsx("p", { className: 'cds--modal-header__label', children: label })] }), _jsx(Stack, { gap: 3, children: elements
|
|
20
|
-
.reduce((result, item, index) => {
|
|
21
|
-
const chunkIndex = Math.floor(index / columns);
|
|
22
|
-
if (!result[chunkIndex]) {
|
|
23
|
-
result[chunkIndex] = [];
|
|
24
|
-
}
|
|
25
|
-
result[chunkIndex].push(item);
|
|
26
|
-
return result;
|
|
27
|
-
}, [])
|
|
28
|
-
.map((row, index) => (_jsx(FlexGrid, { style: {
|
|
29
|
-
width: '100%',
|
|
30
|
-
maxWidth: '100%',
|
|
31
|
-
paddingLeft: '0',
|
|
32
|
-
paddingRight: '0',
|
|
33
|
-
}, children: _jsx(Row, { children: row.map((element, index) => (_jsx(Column, { style: { maxWidth: `${100 / columns}%` }, children: _jsx(StyledRadioTile, { "$backgroundColor": backgroundColor, checked: (selectedElement ?? '') === element.value, onChange: (value) => {
|
|
34
|
-
setSelectedElement(value);
|
|
35
|
-
}, value: element.value, children: element.label }, `tile-${element.value}-${index}`) }, `column-${element.value}-${index}`))) }) }, `row-${index}`))) })] }));
|
|
36
|
-
};
|