@camunda/camunda-composite-components 0.22.1 → 0.22.3

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 (196) hide show
  1. package/package.json +16 -16
  2. package/lib/esm/package.json +0 -98
  3. package/lib/esm/src/api/api.d.ts +0 -29
  4. package/lib/esm/src/api/api.js +0 -92
  5. package/lib/esm/src/api/clusters.d.ts +0 -10
  6. package/lib/esm/src/api/clusters.js +0 -32
  7. package/lib/esm/src/api/endpoints.const.d.ts +0 -22
  8. package/lib/esm/src/api/endpoints.const.js +0 -70
  9. package/lib/esm/src/api/help-center.d.ts +0 -42
  10. package/lib/esm/src/api/help-center.js +0 -56
  11. package/lib/esm/src/api/jwt.utils.d.ts +0 -5
  12. package/lib/esm/src/api/jwt.utils.js +0 -26
  13. package/lib/esm/src/api/notifications.d.ts +0 -41
  14. package/lib/esm/src/api/notifications.js +0 -170
  15. package/lib/esm/src/api/organizations.d.ts +0 -15
  16. package/lib/esm/src/api/organizations.js +0 -16
  17. package/lib/esm/src/api/profile.d.ts +0 -20
  18. package/lib/esm/src/api/profile.js +0 -48
  19. package/lib/esm/src/api/status.d.ts +0 -7
  20. package/lib/esm/src/api/status.js +0 -46
  21. package/lib/esm/src/assets/c3-icons.d.ts +0 -5
  22. package/lib/esm/src/assets/c3-icons.js +0 -5
  23. package/lib/esm/src/assets/c3-icons.types.d.ts +0 -3
  24. package/lib/esm/src/assets/c3-icons.types.js +0 -6
  25. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.d.ts +0 -5
  26. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.js +0 -94
  27. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.d.ts +0 -17
  28. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.js +0 -31
  29. package/lib/esm/src/components/c3-app-teaser/app-teaster-card.d.ts +0 -14
  30. package/lib/esm/src/components/c3-app-teaser/app-teaster-card.js +0 -24
  31. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.d.ts +0 -9
  32. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.js +0 -48
  33. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.test.d.ts +0 -1
  34. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.test.js +0 -33
  35. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.d.ts +0 -14
  36. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.js +0 -53
  37. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.d.ts +0 -6
  38. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.js +0 -84
  39. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.test.d.ts +0 -1
  40. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.test.js +0 -13
  41. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.types.d.ts +0 -26
  42. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.types.js +0 -11
  43. package/lib/esm/src/components/c3-data-table/c3-data-table.d.ts +0 -3
  44. package/lib/esm/src/components/c3-data-table/c3-data-table.js +0 -509
  45. package/lib/esm/src/components/c3-data-table/c3-data-table.types.d.ts +0 -122
  46. package/lib/esm/src/components/c3-data-table/c3-data-table.types.js +0 -6
  47. package/lib/esm/src/components/c3-data-table/link-button/link-button.d.ts +0 -3
  48. package/lib/esm/src/components/c3-data-table/link-button/link-button.js +0 -15
  49. package/lib/esm/src/components/c3-data-table/link-button/link-button.types.d.ts +0 -8
  50. package/lib/esm/src/components/c3-data-table/link-button/link-button.types.js +0 -6
  51. package/lib/esm/src/components/c3-empty-state/c3-empty-state.d.ts +0 -3
  52. package/lib/esm/src/components/c3-empty-state/c3-empty-state.js +0 -15
  53. package/lib/esm/src/components/c3-empty-state/c3-empty-state.test.d.ts +0 -1
  54. package/lib/esm/src/components/c3-empty-state/c3-empty-state.test.js +0 -25
  55. package/lib/esm/src/components/c3-empty-state/c3-empty-state.types.d.ts +0 -29
  56. package/lib/esm/src/components/c3-empty-state/c3-empty-state.types.js +0 -6
  57. package/lib/esm/src/components/c3-help-center/c3-help-center-provider.d.ts +0 -19
  58. package/lib/esm/src/components/c3-help-center/c3-help-center-provider.js +0 -58
  59. package/lib/esm/src/components/c3-help-center/c3-help-center.d.ts +0 -16
  60. package/lib/esm/src/components/c3-help-center/c3-help-center.js +0 -218
  61. package/lib/esm/src/components/c3-help-center/c3-help-center.types.d.ts +0 -43
  62. package/lib/esm/src/components/c3-help-center/c3-help-center.types.js +0 -6
  63. package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.d.ts +0 -10
  64. package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.js +0 -17
  65. package/lib/esm/src/components/c3-help-center/help-center-hint.d.ts +0 -4
  66. package/lib/esm/src/components/c3-help-center/help-center-hint.js +0 -15
  67. package/lib/esm/src/components/c3-help-center/help-center.d.ts +0 -18
  68. package/lib/esm/src/components/c3-help-center/help-center.js +0 -189
  69. package/lib/esm/src/components/c3-help-center/recommendations.d.ts +0 -4
  70. package/lib/esm/src/components/c3-help-center/recommendations.js +0 -55
  71. package/lib/esm/src/components/c3-help-center/styles.d.ts +0 -4
  72. package/lib/esm/src/components/c3-help-center/styles.js +0 -48
  73. package/lib/esm/src/components/c3-help-center/tabs/feedback.d.ts +0 -9
  74. package/lib/esm/src/components/c3-help-center/tabs/feedback.js +0 -141
  75. package/lib/esm/src/components/c3-help-center/tabs/tabContent.d.ts +0 -20
  76. package/lib/esm/src/components/c3-help-center/tabs/tabContent.js +0 -22
  77. package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.d.ts +0 -2
  78. package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.js +0 -26
  79. package/lib/esm/src/components/c3-help-center/tile.d.ts +0 -10
  80. package/lib/esm/src/components/c3-help-center/tile.js +0 -61
  81. package/lib/esm/src/components/c3-navigation/c3-info-button.d.ts +0 -4
  82. package/lib/esm/src/components/c3-navigation/c3-info-button.js +0 -9
  83. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.d.ts +0 -6
  84. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.js +0 -18
  85. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.d.ts +0 -10
  86. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.js +0 -6
  87. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.d.ts +0 -4
  88. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.js +0 -364
  89. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.d.ts +0 -2
  90. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.js +0 -21
  91. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.d.ts +0 -6
  92. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.js +0 -38
  93. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts +0 -12
  94. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js +0 -68
  95. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.d.ts +0 -10
  96. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.js +0 -89
  97. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts +0 -81
  98. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.js +0 -6
  99. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.d.ts +0 -5
  100. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js +0 -107
  101. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.d.ts +0 -29
  102. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js +0 -54
  103. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.d.ts +0 -6
  104. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.js +0 -57
  105. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.d.ts +0 -2
  106. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.js +0 -11
  107. package/lib/esm/src/components/c3-navigation/c3-navigation.d.ts +0 -7
  108. package/lib/esm/src/components/c3-navigation/c3-navigation.js +0 -262
  109. package/lib/esm/src/components/c3-navigation/c3-navigation.test.d.ts +0 -1
  110. package/lib/esm/src/components/c3-navigation/c3-navigation.test.js +0 -89
  111. package/lib/esm/src/components/c3-navigation/c3-navigation.types.d.ts +0 -97
  112. package/lib/esm/src/components/c3-navigation/c3-navigation.types.js +0 -6
  113. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts +0 -13
  114. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.js +0 -100
  115. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.d.ts +0 -19
  116. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.js +0 -110
  117. package/lib/esm/src/components/c3-navigation/c3-org-name.d.ts +0 -6
  118. package/lib/esm/src/components/c3-navigation/c3-org-name.js +0 -34
  119. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.d.ts +0 -6
  120. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.js +0 -188
  121. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.d.ts +0 -29
  122. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.js +0 -92
  123. package/lib/esm/src/components/c3-navigation/helpers.d.ts +0 -8
  124. package/lib/esm/src/components/c3-navigation/helpers.js +0 -58
  125. package/lib/esm/src/components/c3-navigation/index.d.ts +0 -2
  126. package/lib/esm/src/components/c3-navigation/index.js +0 -8
  127. package/lib/esm/src/components/c3-navigation/stories/story-helpers.d.ts +0 -35
  128. package/lib/esm/src/components/c3-navigation/stories/story-helpers.js +0 -264
  129. package/lib/esm/src/components/c3-navigation/stories/story-templates.d.ts +0 -9
  130. package/lib/esm/src/components/c3-navigation/stories/story-templates.js +0 -38
  131. package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.d.ts +0 -14
  132. package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.js +0 -94
  133. package/lib/esm/src/components/c3-onboarding-survey/defaultOnboardingConfig.d.ts +0 -16
  134. package/lib/esm/src/components/c3-onboarding-survey/defaultOnboardingConfig.js +0 -8
  135. package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.d.ts +0 -15
  136. package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.js +0 -58
  137. package/lib/esm/src/components/c3-onboarding-survey/elements/inlineNotification.d.ts +0 -3
  138. package/lib/esm/src/components/c3-onboarding-survey/elements/inlineNotification.js +0 -10
  139. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.d.ts +0 -7
  140. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.js +0 -53
  141. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.d.ts +0 -7
  142. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.js +0 -36
  143. package/lib/esm/src/components/c3-onboarding-survey/elements/textField.d.ts +0 -6
  144. package/lib/esm/src/components/c3-onboarding-survey/elements/textField.js +0 -14
  145. package/lib/esm/src/components/c3-onboarding-survey/helpers.d.ts +0 -1
  146. package/lib/esm/src/components/c3-onboarding-survey/helpers.js +0 -10
  147. package/lib/esm/src/components/c3-onboarding-survey/onboarding.types.d.ts +0 -30
  148. package/lib/esm/src/components/c3-onboarding-survey/onboarding.types.js +0 -13
  149. package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.d.ts +0 -25
  150. package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.js +0 -52
  151. package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.d.ts +0 -21
  152. package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.js +0 -35
  153. package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.d.ts +0 -17
  154. package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.js +0 -148
  155. package/lib/esm/src/components/c3-onboarding-survey/step.d.ts +0 -7
  156. package/lib/esm/src/components/c3-onboarding-survey/step.js +0 -44
  157. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.d.ts +0 -3
  158. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.js +0 -28
  159. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.types.d.ts +0 -19
  160. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.types.js +0 -6
  161. package/lib/esm/src/components/c3-page/c3-page.d.ts +0 -4
  162. package/lib/esm/src/components/c3-page/c3-page.js +0 -16
  163. package/lib/esm/src/components/c3-page/c3-page.test.d.ts +0 -1
  164. package/lib/esm/src/components/c3-page/c3-page.test.js +0 -25
  165. package/lib/esm/src/components/c3-page/c3-page.types.d.ts +0 -18
  166. package/lib/esm/src/components/c3-page/c3-page.types.js +0 -6
  167. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.d.ts +0 -3
  168. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.js +0 -37
  169. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.types.d.ts +0 -14
  170. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.types.js +0 -6
  171. package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.d.ts +0 -2
  172. package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.js +0 -18
  173. package/lib/esm/src/components/c3-user-configuration/authToken.d.ts +0 -30
  174. package/lib/esm/src/components/c3-user-configuration/authToken.js +0 -30
  175. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts +0 -26
  176. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.js +0 -117
  177. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.d.ts +0 -13
  178. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.js +0 -29
  179. package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.d.ts +0 -54
  180. package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.js +0 -43
  181. package/lib/esm/src/components/styles.d.ts +0 -13
  182. package/lib/esm/src/components/styles.js +0 -90
  183. package/lib/esm/src/components/test-utils.d.ts +0 -3
  184. package/lib/esm/src/components/test-utils.js +0 -32
  185. package/lib/esm/src/contexts/c3-cluster-update-manager.d.ts +0 -12
  186. package/lib/esm/src/contexts/c3-cluster-update-manager.js +0 -27
  187. package/lib/esm/src/hooks/useApi.d.ts +0 -20
  188. package/lib/esm/src/hooks/useApi.js +0 -54
  189. package/lib/esm/src/index.d.ts +0 -23
  190. package/lib/esm/src/index.js +0 -19
  191. package/lib/esm/src/utils/camunda.d.ts +0 -21
  192. package/lib/esm/src/utils/camunda.js +0 -59
  193. package/lib/esm/src/utils/camunda.types.d.ts +0 -63
  194. package/lib/esm/src/utils/camunda.types.js +0 -6
  195. package/lib/esm/src/utils/versionCheck.utils.d.ts +0 -15
  196. package/lib/esm/src/utils/versionCheck.utils.js +0 -79
@@ -1,14 +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 { Stack, TextInput } from '@carbon/react';
8
- import { getTitleId } from '../helpers.js';
9
- export const TextInputElement = ({ title, label, preFiledValue, setValue, placeholder }) => {
10
- const titleId = getTitleId(title);
11
- return (_jsx(_Fragment, { children: _jsxs(Stack, { orientation: 'horizontal', children: [_jsxs(Stack, { gap: 1, children: [_jsx("h4", { id: titleId, children: title }), label && _jsx("p", { className: 'cds--modal-header__label', children: label })] }), _jsx(TextInput, { id: `text-input-element-${Math.random() * 1000}`, placeholder: placeholder ?? '', labelText: '', value: preFiledValue ?? '', onChange: (event) => {
12
- setValue(event.target.value);
13
- }, "aria-labelledby": titleId, invalid: false, invalidText: _jsx(_Fragment, {}) })] }) }));
14
- };
@@ -1 +0,0 @@
1
- export declare const getTitleId: (title: string) => string;
@@ -1,10 +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 getTitleId = (title) => title
7
- .toLowerCase()
8
- .replace(/[^a-zA-Z0-9]+/g, '-')
9
- .replace(/^-/, '')
10
- .replace(/-$/, '');
@@ -1,30 +0,0 @@
1
- export interface Element {
2
- label: string;
3
- value: string;
4
- }
5
- export interface RadioGroupElementProps {
6
- title: string;
7
- label: string;
8
- tooltip: string | undefined;
9
- columns: number;
10
- elements: Element[];
11
- }
12
- export interface TextFieldElementProps {
13
- title: string;
14
- label: string;
15
- placeholder: string;
16
- }
17
- export declare enum OnboardingQuestionType {
18
- TileSingleSelect = "TileSingleSelect",
19
- TileMultiSelect = "TileMultiSelect",
20
- DropdownSelect = "DropdownSelect",
21
- TextInput = "TextInput",
22
- InlineNotification = "InlineNotification"
23
- }
24
- export interface InlineNotificationElementProps {
25
- hideclosebutton: boolean;
26
- kind: 'error' | 'info' | 'info-square' | 'success' | 'warning' | 'warning-alt';
27
- lowcontrast: boolean;
28
- title: string;
29
- label: string;
30
- }
@@ -1,13 +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 var OnboardingQuestionType;
7
- (function (OnboardingQuestionType) {
8
- OnboardingQuestionType["TileSingleSelect"] = "TileSingleSelect";
9
- OnboardingQuestionType["TileMultiSelect"] = "TileMultiSelect";
10
- OnboardingQuestionType["DropdownSelect"] = "DropdownSelect";
11
- OnboardingQuestionType["TextInput"] = "TextInput";
12
- OnboardingQuestionType["InlineNotification"] = "InlineNotification";
13
- })(OnboardingQuestionType || (OnboardingQuestionType = {}));
@@ -1,25 +0,0 @@
1
- import type React from 'react';
2
- import type { FC, JSX } from 'react';
3
- export declare const StyledModalBody: FC<any>;
4
- export declare const StyledModalHeader: FC<any>;
5
- export declare const OnboardingModal: ({ isDoingAsyncWork, heading, headingLabel, primaryButtonText, primaryButtonDisabled, secondaryButtonText, tertiaryButtonText, loadingText, error, danger, theme, onRequestClose, onSecondary, onPrimary, onTertiary, children, }: {
6
- isDoingAsyncWork: boolean;
7
- heading: string;
8
- headingLabel?: string;
9
- primaryButtonText: string;
10
- primaryButtonDisabled?: boolean;
11
- secondaryButtonText?: string;
12
- tertiaryButtonText?: string;
13
- loadingText: string;
14
- error?: {
15
- title: string;
16
- description: string;
17
- };
18
- danger?: boolean;
19
- theme: string;
20
- onRequestClose: (skip: boolean) => void;
21
- onSecondary?: () => void;
22
- onPrimary?: () => void;
23
- onTertiary?: () => void;
24
- children?: React.ReactNode;
25
- }) => JSX.Element;
@@ -1,52 +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, InlineLoading, InlineNotification, ModalBody, ModalFooter, ModalHeader, Stack, } from '@carbon/react';
8
- import styled from 'styled-components';
9
- import { headingStyles } from '../c3-help-center/styles.js';
10
- export const StyledModalBody = styled(ModalBody) `
11
- ${headingStyles}
12
- `;
13
- export const StyledModalHeader = styled(ModalHeader) `
14
- .cds--modal-header__heading {
15
- font-size: 14px !important;
16
- }
17
- `;
18
- const StyledModalFooter = styled(ModalFooter) `
19
- background-color: ${({ $c3Theme }) => $c3Theme === 'light' ? '#FFFFFF' : '#161616'};
20
- `;
21
- export const OnboardingModal = ({ isDoingAsyncWork, heading, headingLabel, primaryButtonText, primaryButtonDisabled = false, secondaryButtonText = 'Cancel', tertiaryButtonText, loadingText, error = { title: '', description: '' }, danger = false, theme, onRequestClose, onSecondary, onPrimary, onTertiary, children, }) => {
22
- return (_jsxs(_Fragment, { children: [_jsx(StyledModalHeader, { title: heading, label: headingLabel, style: {
23
- pointerEvents: isDoingAsyncWork ? 'none' : 'unset',
24
- backgroundColor: theme === 'light' ? '#FFFFFF' : '#161616',
25
- marginBottom: 0,
26
- }, closeModal: () => onRequestClose(false) }), _jsx(StyledModalBody, { style: {
27
- marginBottom: '0px',
28
- paddingBottom: '3rem',
29
- backgroundColor: theme === 'light' ? '#FFFFFF' : '#161616',
30
- }, children: _jsx("div", { style: { minHeight: '520px', marginTop: '-0.5rem' }, children: _jsxs(Stack, { gap: 6, children: [children, error.title ? (_jsx(InlineNotification, { kind: 'error', title: error.title, subtitle: error.description, hideCloseButton: true })) : ('')] }) }) }), _jsx(StyledModalFooter, { "$c3Theme": theme, children: (() => {
31
- if (tertiaryButtonText && onTertiary !== undefined) {
32
- return (_jsxs(_Fragment, { children: [_jsx(Button, { kind: 'ghost', disabled: isDoingAsyncWork, onClick: () => onTertiary(), children: tertiaryButtonText }), _jsx(Button, { style: { paddingRight: '1rem', marginLeft: '33%' }, kind: danger ? 'danger' : 'primary', disabled: primaryButtonDisabled || isDoingAsyncWork, onClick: () => {
33
- if (onPrimary) {
34
- onPrimary();
35
- }
36
- }, children: isDoingAsyncWork ? (_jsx(InlineLoading, { description: loadingText })) : (primaryButtonText) })] }));
37
- }
38
- else {
39
- return (_jsxs(_Fragment, { children: [(() => {
40
- let button = _jsx(_Fragment, {});
41
- if (secondaryButtonText && onSecondary) {
42
- button = (_jsx(Button, { kind: 'secondary', disabled: isDoingAsyncWork, onClick: () => onSecondary?.(), style: { marginLeft: '33%' }, children: secondaryButtonText }));
43
- }
44
- return button;
45
- })(), _jsx(Button, { style: { paddingRight: '1rem' }, kind: danger ? 'danger' : 'primary', disabled: primaryButtonDisabled || isDoingAsyncWork, onClick: () => {
46
- if (onPrimary) {
47
- onPrimary();
48
- }
49
- }, children: isDoingAsyncWork ? (_jsx(InlineLoading, { description: loadingText })) : (primaryButtonText) })] }));
50
- }
51
- })() })] }));
52
- };
@@ -1,21 +0,0 @@
1
- import type React from 'react';
2
- import type { JSX } from 'react';
3
- export declare const OnboardingPage: ({ isDoingAsyncWork, heading, headingLabel, primaryButtonText, primaryButtonDisabled, secondaryButtonText, tertiaryButtonText, loadingText, error, danger, onSecondary, onPrimary, onTertiary, children, }: {
4
- isDoingAsyncWork: boolean;
5
- heading: string;
6
- headingLabel?: string;
7
- primaryButtonText: string;
8
- primaryButtonDisabled?: boolean;
9
- secondaryButtonText?: string;
10
- tertiaryButtonText?: string;
11
- loadingText: string;
12
- error?: {
13
- title: string;
14
- description: string;
15
- };
16
- danger?: boolean;
17
- onSecondary?: () => void;
18
- onPrimary?: () => void;
19
- onTertiary?: () => void;
20
- children?: React.ReactNode;
21
- }) => JSX.Element;
@@ -1,35 +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, InlineLoading, InlineNotification, Stack } from '@carbon/react';
8
- export const OnboardingPage = ({ isDoingAsyncWork, heading, headingLabel, primaryButtonText, primaryButtonDisabled = false, secondaryButtonText = 'Cancel', tertiaryButtonText, loadingText, error = { title: '', description: '' }, danger = false, onSecondary, onPrimary, onTertiary, children, }) => {
9
- return (_jsxs(Stack, { children: [_jsxs(Stack, { children: [_jsx("h1", { children: heading }), _jsx("p", { children: headingLabel })] }), _jsx("div", { style: { minHeight: '520px' }, children: _jsxs(Stack, { gap: 6, children: [children, error.title ? (_jsx(InlineNotification, { kind: 'error', title: error.title, subtitle: error.description, hideCloseButton: true })) : ('')] }) }), (() => {
10
- if (tertiaryButtonText && onTertiary !== undefined) {
11
- return (_jsxs(Stack, { orientation: 'horizontal', children: [_jsx(Button, { kind: 'ghost', disabled: isDoingAsyncWork, onClick: () => onTertiary(), children: tertiaryButtonText }), _jsx(Button, { style: {
12
- paddingRight: '1rem',
13
- marginLeft: 'auto',
14
- marginRight: '0px',
15
- }, kind: danger ? 'danger' : 'primary', disabled: primaryButtonDisabled || isDoingAsyncWork, onClick: () => {
16
- if (onPrimary) {
17
- onPrimary();
18
- }
19
- }, children: isDoingAsyncWork ? (_jsx(InlineLoading, { description: loadingText })) : (primaryButtonText) })] }));
20
- }
21
- else {
22
- return (_jsxs(Stack, { orientation: 'horizontal', children: [(() => {
23
- let button = _jsx(_Fragment, {});
24
- if (secondaryButtonText && onSecondary) {
25
- button = (_jsx(Button, { kind: 'secondary', disabled: isDoingAsyncWork, onClick: () => onSecondary?.(), style: { marginLeft: '0px' }, children: secondaryButtonText }));
26
- }
27
- return button;
28
- })(), _jsx(Button, { style: { marginLeft: 'auto', marginRight: '0px' }, kind: danger ? 'danger' : 'primary', disabled: primaryButtonDisabled || isDoingAsyncWork, onClick: () => {
29
- if (onPrimary) {
30
- onPrimary();
31
- }
32
- }, children: isDoingAsyncWork ? (_jsx(InlineLoading, { description: loadingText })) : (primaryButtonText) })] }));
33
- }
34
- })()] }));
35
- };
@@ -1,17 +0,0 @@
1
- import type { Dict } from 'mixpanel-browser';
2
- import { type FC } from 'react';
3
- import type { Persona } from '../c3-help-center/c3-help-center.types';
4
- import type { OnboardingConfig } from './defaultOnboardingConfig';
5
- export declare const OnboardingSurvey: FC<{
6
- appTheme: string;
7
- persona?: Persona;
8
- userFirstName: string;
9
- syncPersona: (persona: Persona, notifyHubspot: boolean) => Promise<void>;
10
- setPersona: (persona: Persona) => void;
11
- onRequestClose: (skip: boolean) => Promise<void>;
12
- onboardingConfiguration: OnboardingConfig;
13
- isLoadingConfig: boolean;
14
- modal: boolean;
15
- origin: string;
16
- mixpanelTrack?: (event: string, data: Dict | undefined) => void;
17
- }>;
@@ -1,148 +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 { Loading, ProgressIndicator, ProgressStep, Stack } from '@carbon/react';
8
- import React, { useState } from 'react';
9
- import { HelpCenterHintType, useC3HelpCenter, } from '../c3-help-center/c3-help-center-provider.js';
10
- import { OnboardingModal } from './onboardingModal.js';
11
- import { OnboardingPage } from './onboardingPage.js';
12
- import { OnboardingStep } from './step.js';
13
- export const OnboardingSurvey = ({ appTheme, persona, userFirstName, syncPersona, setPersona, mixpanelTrack, onRequestClose, onboardingConfiguration, isLoadingConfig, modal, origin, }) => {
14
- const { setHintType } = useC3HelpCenter();
15
- const [step, setStep] = useState(persona?.nextStep ?? 0);
16
- const [isDoingAsyncWork, setIsDoingAsyncWork] = useState(false);
17
- const hasMultipleSteps = onboardingConfiguration.steps.length > 1;
18
- React.useEffect(() => {
19
- setStep(persona?.nextStep ?? 0);
20
- }, [persona]);
21
- const stepForward = async () => {
22
- setIsDoingAsyncWork(true);
23
- const committedStep = step + 1;
24
- const newPersona = {
25
- ...persona,
26
- ...{
27
- wasShown: true,
28
- },
29
- };
30
- if (committedStep >= onboardingConfiguration.steps.length) {
31
- setHintType(HelpCenterHintType.HelpCenter);
32
- newPersona.nextStep = 0;
33
- newPersona.complete = true;
34
- await syncPersona(newPersona, true);
35
- }
36
- else {
37
- newPersona.nextStep = step + 1;
38
- newPersona.complete = false;
39
- await syncPersona(newPersona, false);
40
- }
41
- mixpanelTrack?.('survey:click', {
42
- location: 'next',
43
- step: committedStep,
44
- from: origin,
45
- });
46
- setIsDoingAsyncWork(false);
47
- };
48
- const tryStepTo = (step) => {
49
- if (nextEnabled(step - 1)) {
50
- setStep(step);
51
- }
52
- };
53
- const secondaryButtonAction = async () => {
54
- setIsDoingAsyncWork(true);
55
- if (step === 0) {
56
- await onRequestClose(true);
57
- }
58
- else {
59
- const committedStep = step - 1;
60
- setStep(step - 1);
61
- const newPersona = {
62
- ...persona,
63
- ...{
64
- nextStep: committedStep,
65
- },
66
- };
67
- await syncPersona(newPersona, false);
68
- mixpanelTrack?.('syrvey:click', {
69
- location: 'previous',
70
- step: committedStep,
71
- from: origin,
72
- });
73
- }
74
- setIsDoingAsyncWork(false);
75
- };
76
- const nextEnabled = (step) => {
77
- if (step < 0) {
78
- return true;
79
- }
80
- if (onboardingConfiguration.steps.length <= step) {
81
- return false;
82
- }
83
- const requirements = onboardingConfiguration.steps[step]?.nextenabled?.map((field) => field.personaattribute);
84
- if (!requirements) {
85
- return true;
86
- }
87
- else {
88
- return requirements.reduce((prev, key) => {
89
- let elementIndex = onboardingConfiguration.steps[step].elements?.findIndex((el) => el?.mapto === key);
90
- elementIndex = elementIndex ?? -1;
91
- return (prev &&
92
- (onboardingConfiguration.steps[step].elements?.[elementIndex]
93
- ?.elements?.[0]?.value ||
94
- (!!persona?.[key] &&
95
- (!(typeof persona[key] === 'object' ||
96
- typeof persona[key] === 'string') ||
97
- (typeof persona[key] === 'string' &&
98
- !!persona[key].trim()) ||
99
- (typeof persona[key] === 'object' &&
100
- persona[key].length !== 0)))));
101
- }, true);
102
- }
103
- };
104
- const generic = (gen) => {
105
- if (persona && persona[gen]) {
106
- return persona[gen];
107
- }
108
- else {
109
- return undefined;
110
- }
111
- };
112
- const setGeneric = async (gen, value) => {
113
- const pers = { ...persona };
114
- pers[gen] = value;
115
- setPersona(pers);
116
- };
117
- let theme;
118
- if (appTheme === 'system') {
119
- if (window.matchMedia('(prefers-color-scheme: light)').matches) {
120
- theme = 'light';
121
- }
122
- else {
123
- theme = 'dark';
124
- }
125
- }
126
- else if (appTheme === 'light') {
127
- theme = 'light';
128
- }
129
- else {
130
- theme = 'dark';
131
- }
132
- const content = (_jsxs(_Fragment, { children: [_jsx(Stack, { style: { marginBottom: '0.5rem' }, children: _jsx("p", { className: 'cds--modal-header__heading cds--type-beta', children: isLoadingConfig
133
- ? ''
134
- : onboardingConfiguration?.header?.description ||
135
- 'Get personalized next steps and educational content by answering this 1-minute survey.' }) }), _jsxs(Stack, { gap: 8, children: [hasMultipleSteps && (_jsx(ProgressIndicator, { currentIndex: step, spaceEqually: true, onChange: tryStepTo, children: isLoadingConfig ? (_jsx(Loading, {})) : (onboardingConfiguration.steps.map((currentStep, index) => (_jsx(ProgressStep, { label: `Step ${index + 1}`, secondaryLabel: currentStep.title, disabled: step !== index }, `onboarding-step-${index}`)))) })), _jsx(OnboardingStep, { theme: theme, generic: generic, setGeneric: setGeneric, config: onboardingConfiguration.steps[step] })] })] }));
136
- if (modal) {
137
- return (_jsx(OnboardingModal, { isDoingAsyncWork: isDoingAsyncWork, heading: isLoadingConfig
138
- ? ''
139
- : onboardingConfiguration.header?.title ||
140
- `Welcome to Camunda, ${userFirstName}!`, headingLabel: '', primaryButtonText: hasMultipleSteps ? 'Next' : 'Submit', primaryButtonDisabled: !nextEnabled(step), secondaryButtonText: step === 0 ? undefined : 'Previous', tertiaryButtonText: step === 0 ? 'Skip customization' : undefined, loadingText: 'Loading', theme: theme, onPrimary: stepForward, onRequestClose: onRequestClose, onSecondary: secondaryButtonAction, onTertiary: step === 0 ? secondaryButtonAction : undefined, children: content }));
141
- }
142
- else {
143
- return (_jsx(_Fragment, { children: _jsx(OnboardingPage, { isDoingAsyncWork: isDoingAsyncWork, heading: isLoadingConfig
144
- ? ''
145
- : onboardingConfiguration?.header?.title ||
146
- `Welcome to Camunda, ${userFirstName}!`, headingLabel: '', primaryButtonText: 'Next', primaryButtonDisabled: !nextEnabled(step), secondaryButtonText: step === 0 ? undefined : 'Previous', tertiaryButtonText: step === 0 ? 'Skip customization' : undefined, loadingText: 'Loading', onPrimary: stepForward, onSecondary: secondaryButtonAction, onTertiary: step === 0 ? secondaryButtonAction : undefined, children: content }) }));
147
- }
148
- };
@@ -1,7 +0,0 @@
1
- import type { JSX } from 'react';
2
- export declare const OnboardingStep: ({ theme, config, generic, setGeneric, }: {
3
- theme: string;
4
- config: any;
5
- generic: (mapto: string) => any;
6
- setGeneric: (mapto: string, value: any) => void;
7
- }) => JSX.Element;
@@ -1,44 +0,0 @@
1
- import { Fragment as _Fragment, 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 { Stack } from '@carbon/react';
8
- import { DropdownSelect } from './elements/dropdownSelect.js';
9
- import { InlineNotificationElement } from './elements/inlineNotification.js';
10
- import { RadioGroupElementMulti } from './elements/radioGroupMulti.js';
11
- import { RadioGroupElementSingle } from './elements/radioGroupSingle.js';
12
- import { TextInputElement } from './elements/textField.js';
13
- import { OnboardingQuestionType } from './onboarding.types.js';
14
- export const OnboardingStep = ({ theme, config, generic, setGeneric, }) => {
15
- return (_jsx(Stack, { gap: 6, children: (() => {
16
- if (!config?.elements) {
17
- return _jsx(_Fragment, {});
18
- }
19
- return config?.elements.map((element, index) => {
20
- switch (element.type) {
21
- case OnboardingQuestionType.TileSingleSelect:
22
- return (_jsx(RadioGroupElementSingle, { theme: theme, tooltip: element.tooltip, elements: element.elements, selectedElement: generic(element.mapto), setSelectedElement: (e) => {
23
- setGeneric(element.mapto, e);
24
- }, title: element.title, label: element.label, columns: element.columns }, `onboarding-step-element-${index}`));
25
- case OnboardingQuestionType.TileMultiSelect:
26
- return (_jsx(RadioGroupElementMulti, { theme: theme, tooltip: element.tooltip, elements: element.elements, selectedElements: generic(element.mapto) ?? [], setSelectedElements: (e) => {
27
- setGeneric(element.mapto, e);
28
- }, title: element.title, label: element.label, columns: element.columns }, `onboarding-step-element-${index}`));
29
- case OnboardingQuestionType.DropdownSelect:
30
- return (_jsx(DropdownSelect, { tooltip: element.tooltip, elements: element.elements, selectedElement: generic(element.mapto), setSelectedElement: (e) => {
31
- setGeneric(element.mapto, e);
32
- }, title: element.title, label: element.label, columns: element.columns, exceptionTitle: element.exceptiontextinput?.title, exceptionLabel: element.exceptiontextinput?.label, exceptionValue: element.exceptiontextinput?.forvalue }, `onboarding-step-element-${index}`));
33
- case OnboardingQuestionType.TextInput:
34
- return (_jsx(TextInputElement, { title: element.title, label: element.label, preFiledValue: generic(element.mapto), setValue: (value) => {
35
- setGeneric(element.mapto, value);
36
- }, placeholder: 'Your company\u2019s name' }, `onboarding-step-element-${index}`));
37
- case OnboardingQuestionType.InlineNotification:
38
- return (_jsx(InlineNotificationElement, { hideclosebutton: element.hideclosebutton, kind: element.kind, lowcontrast: element.lowcontrast, title: element.title, label: element.label }, `onboarding-step-element-${index}`));
39
- default:
40
- return _jsx(_Fragment, {});
41
- }
42
- });
43
- })() }));
44
- };
@@ -1,3 +0,0 @@
1
- import type { FC } from 'react';
2
- import type { C3BreadcrumbProps } from './c3-breadcrumb.types';
3
- export declare const C3Breadcrumb: FC<C3BreadcrumbProps>;
@@ -1,28 +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
- import { Breadcrumb, BreadcrumbItem, BreadcrumbSkeleton, Link, OverflowMenu, OverflowMenuItem, SkeletonText, Stack, Tag, } from '@carbon/react';
8
- const breadCrumbWrapperStyles = {
9
- minHeight: '40px',
10
- display: 'grid',
11
- gridAutoFlow: 'column',
12
- gridAutoColumns: 'max-content',
13
- alignItems: 'center',
14
- };
15
- export const C3Breadcrumb = ({ loading, noTrailingSlash, elements, title, menu, tag, forwardRef, }) => {
16
- let breadcrumb = null;
17
- if (loading) {
18
- breadcrumb = (_jsxs(Stack, { children: [_jsx(BreadcrumbSkeleton, {}), title && _jsx(SkeletonText, {})] }));
19
- }
20
- else {
21
- breadcrumb = (_jsxs(Stack, { gap: 1, children: [_jsx(Breadcrumb, { noTrailingSlash: noTrailingSlash ?? false, children: elements.map((element) => {
22
- return (_jsx(BreadcrumbItem, { children: _jsx(Link, { as: forwardRef, style: { cursor: 'pointer' }, ...element.routeProps, children: element.label }) }, element.key));
23
- }) }), (menu || title || tag) && (_jsxs("div", { style: breadCrumbWrapperStyles, children: [_jsxs(Stack, { orientation: 'horizontal', gap: 4, children: [title && _jsx("h2", { children: title }), tag && _jsx(Tag, { type: 'blue', children: tag })] }), menu && (_jsx(OverflowMenu, { style: { float: 'right' }, "aria-label": 'breadcrumb menu', children: menu.map((item) => {
24
- return (_jsx(OverflowMenuItem, { id: item.key, onClick: () => item.onClick(), itemText: item.label, isDelete: item.isDelete }, item.key));
25
- }) }))] }))] }));
26
- }
27
- return _jsx("div", { style: breadCrumbWrapperStyles, children: breadcrumb });
28
- };
@@ -1,19 +0,0 @@
1
- import type React from 'react';
2
- export interface C3BreadcrumbProps {
3
- elements: Array<{
4
- key: string;
5
- label: string;
6
- routeProps: any;
7
- }>;
8
- loading?: boolean;
9
- noTrailingSlash?: boolean;
10
- title?: string;
11
- tag?: string;
12
- menu?: Array<{
13
- key: string;
14
- label: string;
15
- onClick: () => void;
16
- isDelete?: boolean;
17
- }>;
18
- forwardRef?: React.ForwardRefExoticComponent<any>;
19
- }
@@ -1,6 +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 {};
@@ -1,4 +0,0 @@
1
- import type { FC } from 'react';
2
- import type { C3PageProps } from './c3-page.types';
3
- declare const C3Page: FC<C3PageProps>;
4
- export { C3Page };
@@ -1,16 +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
- import { Column, Grid, Stack } from '@carbon/react';
8
- import { DefaultStyleWrapper } from '../styles.js';
9
- import { C3Breadcrumb } from './c3-breadcrumb/c3-breadcrumb.js';
10
- import { C3Tabs } from './c3-tabs/c3-tabs.js';
11
- const gridStyles = { paddingRight: 0, paddingLeft: 0 };
12
- const gridColumnStyles = { marginInline: 0 };
13
- const C3Page = ({ header, tabs, children, isLoading = false, breadcrumbs = { elements: [] }, }) => {
14
- return (_jsx(DefaultStyleWrapper, { children: _jsx(Grid, { style: gridStyles, children: _jsx(Column, { span: '100%', style: gridColumnStyles, children: _jsxs(Stack, { orientation: 'vertical', gap: 7, children: [(breadcrumbs.elements?.length || header) && (_jsx(C3Breadcrumb, { ...breadcrumbs, title: header?.title, menu: header?.menuItems, tag: header?.tag, loading: isLoading })), tabs && (_jsx(Stack, { orientation: 'vertical', gap: 5, children: _jsx(C3Tabs, { tabs: tabs.list, desiredTabId: tabs?.activeTabId, onTabChange: tabs?.onChange, loading: isLoading }) })), children] }) }) }) }));
15
- };
16
- export { C3Page };
@@ -1 +0,0 @@
1
- export {};
@@ -1,25 +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
- import { expect, test } from '@playwright/test';
7
- import { getStory } from '../test-utils.js';
8
- test.describe('C3Page', () => {
9
- test('Basic', async ({ page }) => {
10
- await getStory(page, 'components-c3page--basic');
11
- await expect(page).toHaveScreenshot();
12
- });
13
- test('Loading', async ({ page }) => {
14
- await getStory(page, 'components-c3page--loading');
15
- await expect(page).toHaveScreenshot();
16
- });
17
- test('With tag', async ({ page }) => {
18
- await getStory(page, 'components-c3page--with-tag');
19
- await expect(page).toHaveScreenshot();
20
- });
21
- test('Without tabs', async ({ page }) => {
22
- await getStory(page, 'components-c3page--without-tabs');
23
- await expect(page).toHaveScreenshot();
24
- });
25
- });
@@ -1,18 +0,0 @@
1
- import type React from 'react';
2
- import type { C3BreadcrumbProps } from './c3-breadcrumb/c3-breadcrumb.types';
3
- import type { C3TabsProps } from './c3-tabs/c3-tabs.types';
4
- export type C3PageProps = {
5
- breadcrumbs?: Omit<C3BreadcrumbProps, 'title' | 'menu' | 'tag'>;
6
- header?: {
7
- title: string;
8
- tag?: string;
9
- menuItems?: C3BreadcrumbProps['menu'];
10
- };
11
- tabs?: {
12
- list: C3TabsProps['tabs'];
13
- activeTabId?: C3TabsProps['desiredTabId'];
14
- onChange?: C3TabsProps['onTabChange'];
15
- };
16
- children?: React.ReactNode;
17
- isLoading?: boolean;
18
- };
@@ -1,6 +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 {};
@@ -1,3 +0,0 @@
1
- import { type FC } from 'react';
2
- import type { C3TabsProps } from './c3-tabs.types';
3
- export declare const C3Tabs: FC<C3TabsProps>;
@@ -1,37 +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
- import { Tab, TabList, TabPanel, TabPanels, Tabs, TabsSkeleton, } from '@carbon/react';
8
- import React from 'react';
9
- const TabPanelStyles = { paddingLeft: 0, paddingRight: 0 };
10
- export const C3Tabs = ({ tabs, desiredTabId, onTabChange, loading = false, }) => {
11
- const initializedTabs = React.useRef([]);
12
- const visibleTabs = tabs.filter((tab) => tab.visible === undefined || tab.visible);
13
- visibleTabs.forEach((tab) => {
14
- if (tab.initializeTab && !initializedTabs.current.includes(tab.id)) {
15
- initializedTabs.current = [...initializedTabs.current, tab.id];
16
- tab.initializeTab();
17
- }
18
- });
19
- const foundTab = desiredTabId
20
- ? visibleTabs.findIndex((tab) => tab.id === desiredTabId)
21
- : -1;
22
- const selectedTab = foundTab === -1 ? 0 : foundTab;
23
- const [activeTabIndex, setActiveTabIndex] = React.useState(selectedTab);
24
- React.useEffect(() => {
25
- setActiveTabIndex(selectedTab);
26
- }, [selectedTab]);
27
- if (loading) {
28
- return _jsx(TabsSkeleton, {}, 'tabs-skeleton');
29
- }
30
- return (_jsxs(Tabs, { selectedIndex: activeTabIndex, onChange: (event) => {
31
- setActiveTabIndex(event.selectedIndex);
32
- const newDesiredTab = visibleTabs[event.selectedIndex].id;
33
- if (event.selectedIndex !== activeTabIndex && onTabChange) {
34
- onTabChange(newDesiredTab);
35
- }
36
- }, children: [_jsx(TabList, { "aria-label": 'tabs', children: visibleTabs.map((tab) => (_jsx(Tab, { children: tab.label }, `${tab.id}-label`))) }), _jsx(TabPanels, { children: visibleTabs.map((tab) => (_jsx(TabPanel, { style: TabPanelStyles, children: tab.content }, tab.id))) })] }));
37
- };
@@ -1,14 +0,0 @@
1
- import type React from 'react';
2
- export interface C3TabsProps {
3
- tabs: C3TabProps[];
4
- desiredTabId?: string;
5
- onTabChange?: (tabId: string) => void;
6
- loading?: boolean;
7
- }
8
- export interface C3TabProps {
9
- id: string;
10
- label: string;
11
- content: React.ReactNode;
12
- visible?: boolean;
13
- initializeTab?: () => void;
14
- }