@camunda/camunda-composite-components 0.22.2 → 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 +12 -12
  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 -380
  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 -87
  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,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,2 +0,0 @@
1
- declare const C3ResponsiveStack: any;
2
- export { C3ResponsiveStack };
@@ -1,18 +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 { styled } from 'styled-components';
7
- const C3ResponsiveStack = styled.div `
8
- display: flex;
9
- flex-direction: ${({ orientation }) => `${orientation === 'vertical' ? 'column' : 'row'}`};
10
- gap: ${({ gap }) => `${typeof gap === 'string' ? gap : `${(gap ?? 1) * 16}px`}`};
11
- ${({ alignItems }) => (alignItems ? `align-items: ${alignItems};` : '')}
12
- ${({ justifyContent }) => justifyContent ? `justify-content: ${justifyContent};` : ''}
13
-
14
- @media (max-width: 768px) {
15
- flex-direction: column;
16
- }
17
- `;
18
- export { C3ResponsiveStack };
@@ -1,30 +0,0 @@
1
- import { type JwtPayload } from 'jwt-decode';
2
- import type { Persona } from '../c3-help-center/c3-help-center.types';
3
- declare const AUTH0_BASE_CLAIM = "https://camunda.com";
4
- declare const AUTH0_TOKEN_ATTRIBUTE_SETTINGS = "settings";
5
- declare const AUTH0_TOKEN_ATTRIBUTE_META = "meta";
6
- declare const AUTH0_TOKEN_ATTRIBUTE_PERSONA = "persona";
7
- type SettingsKey = `${typeof AUTH0_BASE_CLAIM}/${typeof AUTH0_TOKEN_ATTRIBUTE_SETTINGS}`;
8
- type MetaKey = `${typeof AUTH0_BASE_CLAIM}/${typeof AUTH0_TOKEN_ATTRIBUTE_META}`;
9
- export type Token = JwtPayload & {
10
- [settings in SettingsKey]?: {
11
- [persona in typeof AUTH0_TOKEN_ATTRIBUTE_PERSONA]?: Persona;
12
- };
13
- } & {
14
- [meta in MetaKey]?: Meta;
15
- };
16
- export declare const getPersona: (token: Token) => Persona | undefined;
17
- export type Meta = {
18
- given_name: string;
19
- email: string;
20
- };
21
- export declare const getMeta: (token: Token) => Meta | undefined;
22
- export type DecodedToken = {
23
- audience?: string | string[];
24
- persona?: Persona;
25
- decodedToken: Token;
26
- userId?: string;
27
- meta?: Meta;
28
- };
29
- export declare const decodeJWT: (userToken: string) => null | DecodedToken;
30
- export {};
@@ -1,30 +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 { jwtDecode } from 'jwt-decode';
7
- const AUTH0_BASE_CLAIM = `https://camunda.com`;
8
- const AUTH0_TOKEN_ATTRIBUTE_SETTINGS = 'settings';
9
- const AUTH0_TOKEN_ATTRIBUTE_META = 'meta';
10
- const AUTH0_TOKEN_ATTRIBUTE_PERSONA = 'persona';
11
- export const getPersona = (token) => token[`${AUTH0_BASE_CLAIM}/${AUTH0_TOKEN_ATTRIBUTE_SETTINGS}`]?.[AUTH0_TOKEN_ATTRIBUTE_PERSONA];
12
- export const getMeta = (token) => token[`${AUTH0_BASE_CLAIM}/${AUTH0_TOKEN_ATTRIBUTE_META}`];
13
- export const decodeJWT = (userToken) => {
14
- let decodedToken = null;
15
- try {
16
- decodedToken = jwtDecode(userToken);
17
- }
18
- catch (_) {
19
- // do nothing
20
- }
21
- return !decodedToken
22
- ? null
23
- : {
24
- decodedToken,
25
- persona: getPersona(decodedToken),
26
- meta: getMeta(decodedToken),
27
- audience: decodedToken.aud,
28
- userId: decodedToken.sub,
29
- };
30
- };
@@ -1,26 +0,0 @@
1
- import type React from 'react';
2
- import { type JSX } from 'react';
3
- import type { RequestResponse } from '../../../api/api';
4
- import type { Cluster, Organization } from '../../../utils/camunda.types';
5
- import { type ResolvedTheme } from './carbon-theme-provider';
6
- export type Theme = 'light' | 'dark' | 'system';
7
- export declare const defaultTheme: "light";
8
- export type C3ProfileContextValue = {
9
- isEnabled: boolean;
10
- theme: Theme;
11
- orgs: Organization[] | null;
12
- activeOrg: Organization | null;
13
- reloadOrgs: () => void;
14
- removeOrg: (orgId: string) => void;
15
- clusters: Cluster[] | null;
16
- setClusters: React.Dispatch<React.SetStateAction<Cluster[] | null>>;
17
- reloadClusters: () => void;
18
- resolvedTheme: ResolvedTheme;
19
- onThemeChange: (newTheme: Theme) => void;
20
- loadClustersById: (orgId: string) => Promise<RequestResponse<Cluster[] | null>> | undefined;
21
- };
22
- export declare const C3ProfileContext: React.Context<C3ProfileContextValue>;
23
- export declare const C3ProfileProvider: ({ children }: {
24
- children: JSX.Element;
25
- }) => import("react/jsx-runtime").JSX.Element;
26
- export declare const useC3Profile: () => C3ProfileContextValue;
@@ -1,117 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { createContext, useContext, useEffect, useRef, useState, } from 'react';
3
- import { getClusters, getOrgs, getUserTheme, updateTheme, } from '../../../api/profile.js';
4
- import { useApi } from '../../../hooks/useApi.js';
5
- import { C3UserConfigurationContext } from '../c3-user-configuration-provider.js';
6
- import { CarbonThemeProvider, resolveTheme, } from './carbon-theme-provider.js';
7
- export const defaultTheme = 'light';
8
- export const C3ProfileContext = createContext({
9
- isEnabled: false,
10
- theme: defaultTheme,
11
- orgs: null,
12
- activeOrg: null,
13
- reloadOrgs: () => undefined,
14
- removeOrg: () => undefined,
15
- clusters: null,
16
- reloadClusters: () => undefined,
17
- resolvedTheme: defaultTheme,
18
- onThemeChange: () => undefined,
19
- loadClustersById: () => undefined,
20
- setClusters: () => undefined,
21
- });
22
- export const C3ProfileProvider = ({ children }) => {
23
- const { decodedAudience, analyticsTrack, setActiveOrgId, ...config } = useContext(C3UserConfigurationContext);
24
- const isEnabled = !!config;
25
- const themeRef = useRef(getUserTheme(config.userToken) || defaultTheme);
26
- const [resolvedTheme, setResolvedTheme] = useState(defaultTheme);
27
- const isConfigValid = !!(config.userToken && decodedAudience);
28
- // Check if features are enabled (default to true for backward compatibility)
29
- const organizationsEnabled = config.features?.organizations !== false;
30
- const clustersEnabled = config.features?.clusters !== false;
31
- const { data: orgs, setData: setOrgs, refetch: loadOrgs, } = useApi({
32
- queryFn: () => {
33
- return getOrgs(decodedAudience ?? '', config.userToken).then((response) => {
34
- return {
35
- ...response,
36
- data: response.result?.sort(({ name: a }, { name: b }) => a.localeCompare(b)),
37
- };
38
- });
39
- },
40
- onSuccess: (orgs) => {
41
- if (orgs && !config.activeOrganizationId) {
42
- setActiveOrgId(orgs[0].uuid);
43
- }
44
- },
45
- queryKey: [decodedAudience, config.userToken],
46
- enabled: isConfigValid && organizationsEnabled,
47
- });
48
- const { data: clusters, setData: setClusters, refetch: loadClusters, } = useApi({
49
- queryFn: () => {
50
- if (!isConfigValid)
51
- return;
52
- return getClusters(decodedAudience ?? '', config.userToken, config.activeOrganizationId);
53
- },
54
- queryKey: [decodedAudience, config.userToken, config.activeOrganizationId],
55
- enabled: isConfigValid && clustersEnabled,
56
- });
57
- const activeOrg = orgs?.find((org) => org.uuid === config.activeOrganizationId) ?? null;
58
- const loadClustersById = (orgId) => {
59
- if (!isConfigValid)
60
- return;
61
- return getClusters(decodedAudience, config.userToken, orgId);
62
- };
63
- const removeOrg = (orgId) => {
64
- if (orgs?.length === 1)
65
- return;
66
- setOrgs((orgs) => orgs?.filter((org) => org.uuid !== orgId) || null);
67
- };
68
- useEffect(() => {
69
- const updateSystemTheme = ({ matches }) => {
70
- if (themeRef.current === 'system')
71
- setResolvedTheme(matches ? 'dark' : 'light');
72
- };
73
- window
74
- .matchMedia('(prefers-color-scheme: dark)')
75
- .addEventListener('change', updateSystemTheme);
76
- return () => {
77
- window
78
- .matchMedia('(prefers-color-scheme: dark)')
79
- .removeEventListener('change', updateSystemTheme);
80
- };
81
- }, []);
82
- useEffect(() => {
83
- if (isEnabled && config.userToken && config.handleTheme) {
84
- const currentTheme = getUserTheme(config.userToken);
85
- if (currentTheme) {
86
- themeRef.current = currentTheme;
87
- setResolvedTheme(resolveTheme(currentTheme));
88
- }
89
- }
90
- }, [config.handleTheme, config.userToken, isEnabled]);
91
- const onThemeChange = (newTheme) => {
92
- if (isEnabled) {
93
- themeRef.current = newTheme;
94
- setResolvedTheme(resolveTheme(newTheme));
95
- updateTheme({ ...config, theme: newTheme });
96
- analyticsTrack?.('theme:update', { value: newTheme });
97
- }
98
- };
99
- if (!isEnabled)
100
- return children;
101
- const content = config.handleTheme ? (_jsx(CarbonThemeProvider, { children: children })) : (children);
102
- return (_jsx(C3ProfileContext.Provider, { value: {
103
- isEnabled,
104
- theme: themeRef.current,
105
- resolvedTheme,
106
- orgs,
107
- activeOrg,
108
- reloadOrgs: loadOrgs,
109
- clusters,
110
- setClusters,
111
- reloadClusters: loadClusters,
112
- removeOrg,
113
- onThemeChange,
114
- loadClustersById,
115
- }, children: content }));
116
- };
117
- export const useC3Profile = () => useContext(C3ProfileContext);
@@ -1,13 +0,0 @@
1
- import { type FC, type PropsWithChildren } from 'react';
2
- import { type Theme } from './c3-profile-provider';
3
- export type CarbonTheme = 'white' | 'g10' | 'g90' | 'g100';
4
- declare const THEMES: {
5
- readonly light: "g10";
6
- readonly dark: "g100";
7
- };
8
- export type ResolvedTheme = keyof typeof THEMES;
9
- export declare const getSystemTheme: () => ResolvedTheme;
10
- export declare const resolveTheme: (theme: Theme) => ResolvedTheme;
11
- export declare const setCarbonThemeAttribute: (theme: CarbonTheme) => void;
12
- export declare const CarbonThemeProvider: FC<PropsWithChildren>;
13
- export {};
@@ -1,29 +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 { GlobalTheme } from '@carbon/react';
8
- import { useEffect, useState } from 'react';
9
- import { useC3Profile } from './c3-profile-provider.js';
10
- const THEMES = {
11
- light: 'g10',
12
- dark: 'g100',
13
- };
14
- export const getSystemTheme = () => window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
15
- export const resolveTheme = (theme) => theme === 'system' ? getSystemTheme() : theme;
16
- const getCarbonTheme = (theme) => THEMES[resolveTheme(theme)];
17
- export const setCarbonThemeAttribute = (theme) => document.documentElement.setAttribute('data-carbon-theme', theme);
18
- export const CarbonThemeProvider = ({ children }) => {
19
- const { resolvedTheme } = useC3Profile();
20
- const [carbonTheme, setCarbonTheme] = useState(getCarbonTheme(resolvedTheme));
21
- const updateCarbonTheme = (newTheme) => {
22
- setCarbonTheme(newTheme);
23
- setCarbonThemeAttribute(newTheme);
24
- };
25
- useEffect(() => {
26
- updateCarbonTheme(getCarbonTheme(resolvedTheme));
27
- }, [resolvedTheme]);
28
- return _jsx(GlobalTheme, { theme: carbonTheme, children: children });
29
- };
@@ -1,54 +0,0 @@
1
- import type { Dict } from 'mixpanel-browser';
2
- import React, { type FC, type ReactNode } from 'react';
3
- import type { Endpoints, Stage } from '../../api/endpoints.const';
4
- import { type DecodedToken } from './authToken';
5
- export type MixPanelTrack = (event: string, data?: Dict) => void;
6
- type C3UserConfigurationBase = {
7
- activeOrganizationId: string;
8
- userToken: string;
9
- getNewUserToken: () => Promise<string>;
10
- analyticsTrack?: MixPanelTrack;
11
- currentApp?: 'console' | 'modeler' | 'tasklist' | 'operate' | 'optimize' | 'identity' | 'admin';
12
- currentClusterUuid?: string;
13
- handleTheme?: boolean;
14
- enableLogs?: boolean;
15
- noCloudInUrl?: boolean;
16
- /**
17
- * Control which features are enabled to optimize API requests.
18
- * If not provided, all features are enabled by default for backward compatibility.
19
- */
20
- features?: {
21
- /**
22
- * Enable fetching and displaying organizations.
23
- * When false, organizations API calls are disabled.
24
- * @default true
25
- */
26
- organizations?: boolean;
27
- /**
28
- * Enable fetching and displaying clusters.
29
- * When false, clusters API calls are disabled.
30
- * @default true
31
- */
32
- clusters?: boolean;
33
- };
34
- };
35
- type C3UserConfigurationWithEndpoints = C3UserConfigurationBase & {
36
- endpoints: Endpoints;
37
- };
38
- type C3UserConfigurationWithStage = C3UserConfigurationBase & {
39
- stage: Stage;
40
- };
41
- export type C3UserConfiguration = C3UserConfigurationWithEndpoints | C3UserConfigurationWithStage;
42
- export type C3UserConfigurationContextValue = C3UserConfiguration & {
43
- decodedToken: DecodedToken | null;
44
- decodedAudience: string | null;
45
- domain: string | null;
46
- setActiveOrgId: (id: string) => void;
47
- analyticsTrack?: MixPanelTrack;
48
- };
49
- export declare const C3UserConfigurationContext: React.Context<C3UserConfigurationContextValue>;
50
- declare const C3UserConfigurationProvider: FC<C3UserConfiguration & {
51
- children?: ReactNode;
52
- }>;
53
- export declare const useC3UserConfiguration: () => C3UserConfigurationContextValue;
54
- export default C3UserConfigurationProvider;
@@ -1,43 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import React, { useContext, useEffect, useState, } from 'react';
3
- import { C3HelpCenterProvider } from '../c3-help-center/c3-help-center-provider.js';
4
- import { decodeJWT } from './authToken.js';
5
- import { C3ProfileProvider } from './c3-profile-provider/c3-profile-provider.js';
6
- export const C3UserConfigurationContext = React.createContext({
7
- stage: 'dev',
8
- activeOrganizationId: '',
9
- setActiveOrgId: () => undefined,
10
- userToken: '',
11
- decodedToken: null,
12
- domain: null,
13
- decodedAudience: null,
14
- getNewUserToken: () => Promise.resolve(''),
15
- enableLogs: false,
16
- noCloudInUrl: false,
17
- });
18
- const C3UserConfigurationProvider = ({ children, activeOrganizationId, ...config }) => {
19
- const [decodedToken, setDecodedToken] = useState(null);
20
- const [activeOrgId, setActiveOrgId] = useState(activeOrganizationId);
21
- const { audience } = decodedToken || {};
22
- const decodedAudience = (typeof audience === 'string' ? audience : audience?.[0]) || null;
23
- const domain = config.noCloudInUrl
24
- ? (decodedAudience?.replace('cloud.', '') ?? null)
25
- : decodedAudience;
26
- useEffect(() => {
27
- if (config.userToken)
28
- setDecodedToken(decodeJWT(config.userToken));
29
- }, [config.userToken]);
30
- useEffect(() => {
31
- setActiveOrgId(activeOrganizationId);
32
- }, [activeOrganizationId]);
33
- return (_jsx(C3UserConfigurationContext.Provider, { value: {
34
- ...config,
35
- activeOrganizationId: activeOrgId,
36
- setActiveOrgId,
37
- decodedToken,
38
- decodedAudience,
39
- domain,
40
- }, children: _jsx(C3ProfileProvider, { children: _jsx(C3HelpCenterProvider, { children: children }) }) }));
41
- };
42
- export const useC3UserConfiguration = () => useContext(C3UserConfigurationContext);
43
- export default C3UserConfigurationProvider;
@@ -1,13 +0,0 @@
1
- export declare const heading01: import("styled-components").RuleSet<object>;
2
- export declare const heading02: import("styled-components").RuleSet<object>;
3
- export declare const heading03: import("styled-components").RuleSet<object>;
4
- export declare const heading04: import("styled-components").RuleSet<object>;
5
- export declare const heading05: import("styled-components").RuleSet<object>;
6
- export declare const heading06: import("styled-components").RuleSet<object>;
7
- export declare const body02: import("styled-components").RuleSet<object>;
8
- export declare const Body02: any;
9
- export declare const body01: import("styled-components").RuleSet<object>;
10
- export declare const Body01: any;
11
- export declare const label01: import("styled-components").RuleSet<object>;
12
- export declare const fontMapping: import("styled-components").RuleSet<object>;
13
- export declare const DefaultStyleWrapper: any;
@@ -1,90 +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 styled, { css } from 'styled-components';
7
- export const heading01 = css `
8
- font-size: var(--cds-heading-01-font-size);
9
- font-weight: var(--cds-heading-01-font-weight);
10
- letter-spacing: var(--cds-heading-01-letter-spacing);
11
- line-height: var(--cds-heading-01-line-height);
12
- `;
13
- export const heading02 = css `
14
- font-size: var(--cds-heading-02-font-size);
15
- font-weight: var(--cds-heading-02-font-weight);
16
- letter-spacing: var(--cds-heading-02-letter-spacing);
17
- line-height: var(--cds-heading-02-line-height);
18
- `;
19
- export const heading03 = css `
20
- font-size: var(--cds-heading-03-font-size);
21
- font-weight: var(--cds-heading-03-font-weight);
22
- letter-spacing: var(--cds-heading-03-letter-spacing);
23
- line-height: var(--cds-heading-03-line-height);
24
- `;
25
- export const heading04 = css `
26
- font-size: var(--cds-heading-04-font-size);
27
- font-weight: var(--cds-heading-04-font-weight);
28
- letter-spacing: var(--cds-heading-04-letter-spacing);
29
- line-height: var(--cds-heading-04-line-height);
30
- `;
31
- export const heading05 = css `
32
- font-size: var(--cds-heading-05-font-size);
33
- font-weight: var(--cds-heading-05-font-weight);
34
- letter-spacing: var(--cds-heading-05-letter-spacing);
35
- line-height: var(--cds-heading-05-line-height);
36
- `;
37
- export const heading06 = css `
38
- font-size: var(--cds-heading-06-font-size);
39
- font-weight: var(--cds-heading-06-font-weight);
40
- letter-spacing: var(--cds-heading-06-letter-spacing);
41
- line-height: var(--cds-heading-06-line-height);
42
- `;
43
- export const body02 = css `
44
- font-size: var(--cds-body-02-font-size);
45
- font-weight: var(--cds-body-02-font-weight);
46
- letter-spacing: var(--cds-body-02-letter-spacing);
47
- line-height: var(--cds-body-02-line-height);
48
- `;
49
- export const Body02 = styled.p `
50
- ${body02}
51
- `;
52
- export const body01 = css `
53
- font-size: var(--cds-body-01-font-size);
54
- font-weight: var(--cds-body-01-font-weight);
55
- letter-spacing: var(--cds-body-01-letter-spacing);
56
- line-height: var(--cds-body-01-line-height);
57
- `;
58
- export const Body01 = styled.p `
59
- ${body01}
60
- `;
61
- export const label01 = css `
62
- font-size: var(--cds-label-01-font-size);
63
- font-weight: var(--cds-label-01-font-weight);
64
- letter-spacing: var(--cds-label-01-letter-spacing);
65
- line-height: var(--cds-label-01-line-height);
66
- `;
67
- export const fontMapping = css `
68
- h1 {
69
- ${heading04}
70
- }
71
-
72
- h2 {
73
- ${heading03}
74
- }
75
-
76
- h3 {
77
- ${heading02}
78
- }
79
-
80
- h4 {
81
- ${heading01}
82
- }
83
-
84
- p {
85
- ${body01}
86
- }
87
- `;
88
- export const DefaultStyleWrapper = styled.div `
89
- ${fontMapping}
90
- `;
@@ -1,3 +0,0 @@
1
- import type * as Playwright from '@playwright/test';
2
- /** Load Storybook story for Playwright testing */
3
- export declare function getStory(page: Playwright.Page, storyID: string): Promise<void>;
@@ -1,32 +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 fs from 'fs';
7
- import path from 'path';
8
- import { fileURLToPath } from 'url';
9
- const __filename = fileURLToPath(import.meta.url);
10
- const __dirname = path.dirname(__filename);
11
- const STORYBOOK_DIR = path.resolve(__dirname, '../../storybook-static/');
12
- /** Load Storybook story for Playwright testing */
13
- export async function getStory(page, storyID) {
14
- // Load index.json
15
- const storiesManifestPath = path.resolve(STORYBOOK_DIR, 'index.json');
16
- if (!fs.existsSync(storiesManifestPath)) {
17
- throw new Error('Could not find storybook-static/index.json. Try rebuilding with `pnpm build-storybook`');
18
- }
19
- const storiesManifest = JSON.parse(fs.readFileSync(storiesManifestPath, 'utf8'));
20
- // Find the specified story
21
- const story = storiesManifest.entries[storyID];
22
- if (!story) {
23
- throw new Error(`Could not find story ID "${storyID}".`);
24
- }
25
- // Navigate to the specific story
26
- // Note: Using 'iframe' instead of 'iframe.html' to avoid 301 redirect
27
- // that would strip query parameters when using the 'serve' package
28
- const search = new URLSearchParams({ viewMode: 'story', id: storyID });
29
- await page.goto(`iframe?${search.toString()}`, {
30
- waitUntil: 'networkidle',
31
- });
32
- }
@@ -1,12 +0,0 @@
1
- import type React from 'react';
2
- import type { Stage } from '../api/endpoints.const';
3
- type C3ClusterUpdateManagerProps = {
4
- children: React.ReactNode;
5
- stage: Stage;
6
- userToken: string;
7
- };
8
- declare const C3ClusterUpdateManager: ({ children, stage, userToken, }: C3ClusterUpdateManagerProps) => import("react/jsx-runtime").JSX.Element;
9
- declare const useClusterUpdate: ({ onUpdate }: {
10
- onUpdate: (data: any) => void;
11
- }) => void;
12
- export { C3ClusterUpdateManager, useClusterUpdate };
@@ -1,27 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { createContext, useEffect, useRef } from 'react';
3
- import { ClustersService } from '../api/clusters.js';
4
- const C3ClusterUpdateManagerContext = createContext(null);
5
- const C3ClusterUpdateManager = ({ children, stage, userToken, }) => {
6
- useEffect(() => {
7
- const eventSource = ClustersService.clustersStream({ stage, userToken });
8
- return () => {
9
- eventSource.close();
10
- };
11
- }, [stage, userToken]);
12
- return (_jsx(C3ClusterUpdateManagerContext.Provider, { value: null, children: children }));
13
- };
14
- const useClusterUpdate = ({ onUpdate }) => {
15
- const onUpdateRef = useRef(onUpdate);
16
- onUpdateRef.current = onUpdate;
17
- useEffect(() => {
18
- const handler = (event) => {
19
- onUpdateRef.current(event.detail);
20
- };
21
- window.addEventListener('clusterchange', handler);
22
- return () => {
23
- window.removeEventListener('clusterchange', handler);
24
- };
25
- }, [onUpdateRef]);
26
- };
27
- export { C3ClusterUpdateManager, useClusterUpdate };
@@ -1,20 +0,0 @@
1
- import type { RequestResponse } from '../api/api';
2
- type QueryFn<R = undefined> = (...params: any[]) => Promise<RequestResponse<R>> | undefined;
3
- type OnSuccess<R = undefined> = (data: R | undefined) => void;
4
- type OnError = () => void;
5
- declare const useApi: <R = undefined>({ queryFn, queryKey, onSuccess, onError, enabled, }: {
6
- queryFn: QueryFn<R>;
7
- queryKey: unknown[];
8
- enabled?: boolean;
9
- onSuccess?: OnSuccess<R>;
10
- onError?: OnError;
11
- }) => {
12
- data: R | null;
13
- setData: import("react").Dispatch<import("react").SetStateAction<R | null>>;
14
- status: number;
15
- errors: string[] | null;
16
- loading: boolean;
17
- success: boolean;
18
- refetch: () => Promise<RequestResponse<R> | undefined>;
19
- };
20
- export { useApi };
@@ -1,54 +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 { useCallback, useEffect, useState } from 'react';
7
- const useApi = ({ queryFn, queryKey, onSuccess, onError, enabled = true, }) => {
8
- const [data, setData] = useState(null);
9
- const [status, setStatus] = useState(-1);
10
- const [errors, setErrors] = useState(null);
11
- const [loading, setLoading] = useState(enabled);
12
- const [success, setSuccess] = useState(false);
13
- const refetch = useCallback(async () => {
14
- const response = await queryFn(queryKey);
15
- return response;
16
- }, [JSON.stringify(queryKey)]);
17
- useEffect(() => {
18
- if (!enabled) {
19
- return;
20
- }
21
- const callQueryFn = async () => {
22
- try {
23
- setLoading(true);
24
- const response = await refetch();
25
- if (!response) {
26
- return;
27
- }
28
- if (response.success) {
29
- onSuccess && onSuccess(response.result);
30
- }
31
- else {
32
- onError && onError();
33
- }
34
- setData(response.result ?? null);
35
- setStatus(response.status ?? -1);
36
- setErrors(response.error ? [response.error] : null);
37
- setSuccess(response.success);
38
- }
39
- catch (_error) {
40
- setData(null);
41
- setStatus(-1);
42
- setErrors(null);
43
- setSuccess(false);
44
- onError && onError();
45
- }
46
- finally {
47
- setLoading(false);
48
- }
49
- };
50
- callQueryFn();
51
- }, [enabled, refetch]);
52
- return { data, setData, status, errors, loading, success, refetch };
53
- };
54
- export { useApi };