@camunda/camunda-composite-components 0.1.5-rc.9 → 0.2.1-rc.0

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 (59) hide show
  1. package/lib/esm/api/api.d.ts +5 -5
  2. package/lib/esm/api/api.js +8 -4
  3. package/lib/esm/api/help-center.d.ts +44 -0
  4. package/lib/esm/api/help-center.js +95 -0
  5. package/lib/esm/api/notifications.js +2 -0
  6. package/lib/esm/api/profile.js +1 -0
  7. package/lib/esm/components/c3-help-center/c3-help-center.d.ts +17 -0
  8. package/lib/esm/components/c3-help-center/c3-help-center.js +163 -0
  9. package/lib/esm/components/c3-help-center/c3-help-center.types.d.ts +54 -0
  10. package/lib/esm/components/c3-help-center/c3-help-center.types.js +1 -0
  11. package/lib/esm/components/c3-help-center/defaultHelpCenterConfig.d.ts +10 -0
  12. package/lib/esm/components/c3-help-center/defaultHelpCenterConfig.js +12 -0
  13. package/lib/esm/components/c3-help-center/help-center.d.ts +23 -0
  14. package/lib/esm/components/c3-help-center/help-center.js +173 -0
  15. package/lib/esm/components/c3-help-center/recommendations.d.ts +4 -0
  16. package/lib/esm/components/c3-help-center/recommendations.js +53 -0
  17. package/lib/esm/components/c3-help-center/tabs/feedback.d.ts +8 -0
  18. package/lib/esm/components/c3-help-center/tabs/feedback.js +183 -0
  19. package/lib/esm/components/c3-help-center/tabs/tabContent.d.ts +19 -0
  20. package/lib/esm/components/c3-help-center/tabs/tabContent.js +18 -0
  21. package/lib/esm/components/c3-help-center/tile.d.ts +10 -0
  22. package/lib/esm/components/c3-help-center/tile.js +51 -0
  23. package/lib/esm/components/c3-navigation/c3-navigation-appbar.js +2 -2
  24. package/lib/esm/components/c3-navigation/c3-navigation.d.ts +1 -1
  25. package/lib/esm/components/c3-navigation/c3-navigation.js +12 -4
  26. package/lib/esm/components/c3-navigation/c3-navigation.types.d.ts +3 -0
  27. package/lib/esm/components/c3-navigation/story-helpers.d.ts +2 -0
  28. package/lib/esm/components/c3-navigation/story-helpers.js +6 -0
  29. package/lib/esm/components/c3-onboarding-survey/c3-onboarding-survey.d.ts +14 -0
  30. package/lib/esm/components/c3-onboarding-survey/c3-onboarding-survey.js +96 -0
  31. package/lib/esm/components/c3-onboarding-survey/defaultOnboardingConfig.d.ts +12 -0
  32. package/lib/esm/components/c3-onboarding-survey/defaultOnboardingConfig.js +3 -0
  33. package/lib/esm/components/c3-onboarding-survey/elements/dropdownSelect.d.ts +15 -0
  34. package/lib/esm/components/c3-onboarding-survey/elements/dropdownSelect.js +61 -0
  35. package/lib/esm/components/c3-onboarding-survey/elements/radioGroupMulti.d.ts +7 -0
  36. package/lib/esm/components/c3-onboarding-survey/elements/radioGroupMulti.js +62 -0
  37. package/lib/esm/components/c3-onboarding-survey/elements/radioGroupSingle.d.ts +7 -0
  38. package/lib/esm/components/c3-onboarding-survey/elements/radioGroupSingle.js +42 -0
  39. package/lib/esm/components/c3-onboarding-survey/elements/textField.d.ts +6 -0
  40. package/lib/esm/components/c3-onboarding-survey/elements/textField.js +10 -0
  41. package/lib/esm/components/c3-onboarding-survey/onboarding.types.d.ts +33 -0
  42. package/lib/esm/components/c3-onboarding-survey/onboarding.types.js +8 -0
  43. package/lib/esm/components/c3-onboarding-survey/onboardingModal.d.ts +24 -0
  44. package/lib/esm/components/c3-onboarding-survey/onboardingModal.js +52 -0
  45. package/lib/esm/components/c3-onboarding-survey/onboardingPage.d.ts +20 -0
  46. package/lib/esm/components/c3-onboarding-survey/onboardingPage.js +42 -0
  47. package/lib/esm/components/c3-onboarding-survey/onboardingSurvey.d.ts +16 -0
  48. package/lib/esm/components/c3-onboarding-survey/onboardingSurvey.js +135 -0
  49. package/lib/esm/components/c3-onboarding-survey/step.d.ts +6 -0
  50. package/lib/esm/components/c3-onboarding-survey/step.js +36 -0
  51. package/lib/esm/components/c3-user-configuration/authToken.d.ts +29 -0
  52. package/lib/esm/components/c3-user-configuration/authToken.js +25 -0
  53. package/lib/esm/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts +3 -0
  54. package/lib/esm/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.js +32 -8
  55. package/lib/esm/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.d.ts +10 -0
  56. package/lib/esm/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.js +11 -28
  57. package/lib/esm/components/styles.d.ts +548 -0
  58. package/lib/esm/components/styles.js +62 -0
  59. package/package.json +7 -4
@@ -4,21 +4,21 @@ export declare class HttpError extends Error {
4
4
  constructor(message: string, status: number);
5
5
  }
6
6
  export interface RequestPayload {
7
+ url: string;
7
8
  base?: "notifications" | "accounts";
8
9
  stage?: Stage;
9
10
  endpoints?: Endpoints;
10
- url: string;
11
- method: "get" | "post" | "put" | "delete" | "patch";
11
+ method?: "get" | "post" | "put" | "delete" | "patch";
12
12
  headers?: {
13
13
  [key: string]: string;
14
14
  };
15
- type?: "json" | "text" | "none";
15
+ type?: "json" | "text" | "form" | "none";
16
16
  responseType?: "json" | "text" | "none";
17
17
  camundaAuth?: {
18
18
  token: string;
19
- refreshTokenMethod: () => Promise<string>;
19
+ refreshTokenMethod?: () => Promise<string>;
20
20
  };
21
- body?: {
21
+ body?: string | FormData | {
22
22
  [key: string]: unknown;
23
23
  };
24
24
  }
@@ -11,7 +11,7 @@ export async function request(payload) {
11
11
  const headers = {};
12
12
  if (payload.camundaAuth) {
13
13
  if (JWTUtils.isExpired(payload.camundaAuth.token)) {
14
- const newToken = await payload.camundaAuth.refreshTokenMethod();
14
+ const newToken = await payload.camundaAuth?.refreshTokenMethod?.();
15
15
  headers.Authorization = `Bearer ${newToken}`;
16
16
  }
17
17
  else {
@@ -29,7 +29,11 @@ export async function request(payload) {
29
29
  break;
30
30
  }
31
31
  }
32
- const body = payload.body ? JSON.stringify(payload.body) : undefined;
32
+ const body = payload.body && type === "json"
33
+ ? JSON.stringify(payload.body)
34
+ : payload.body instanceof FormData
35
+ ? payload.body
36
+ : undefined;
33
37
  let base;
34
38
  if (payload.base) {
35
39
  switch (payload.base) {
@@ -52,7 +56,7 @@ export async function request(payload) {
52
56
  }
53
57
  const url = base ? `${base}/${payload.url}` : payload.url;
54
58
  const response = await fetch(url, {
55
- method: payload.method.toUpperCase(),
59
+ method: payload.method ? payload.method.toUpperCase() : "GET",
56
60
  headers,
57
61
  body,
58
62
  });
@@ -69,7 +73,7 @@ export async function request(payload) {
69
73
  const responseType = payload.responseType ?? type;
70
74
  switch (responseType) {
71
75
  case "json":
72
- return response.text().then((text) => (text ? JSON.parse(text) : {}));
76
+ return response.json();
73
77
  case "text":
74
78
  return response.text();
75
79
  default:
@@ -0,0 +1,44 @@
1
+ import { HelpCenterConfig } from "../components/c3-help-center/defaultHelpCenterConfig";
2
+ import { Cluster, Organization, Persona, TileConfig, WpCardType } from "../components/c3-help-center/c3-help-center.types";
3
+ import { OnboardingConfig } from "../components/c3-onboarding-survey/defaultOnboardingConfig";
4
+ import { RequestPayload } from "./api";
5
+ export declare const getOrg: (stage: string, accessToken: string, orgId: string) => Promise<Organization | null>;
6
+ export declare const getClusters: (stage: string, accessToken: string, orgId: string) => Promise<Cluster[] | null>;
7
+ export declare const getConfig: (accessToken: string, audience: string) => Promise<HelpCenterConfig | null>;
8
+ export declare const getTiles: ({ accessToken, tileConfig, salesPlanType, clusterIds, currentOrgId, persona, flags, email, cloudAudience, }: {
9
+ accessToken: string;
10
+ tileConfig: TileConfig[];
11
+ cloudAudience: string;
12
+ persona: {
13
+ [id: string]: unknown;
14
+ };
15
+ clusterIds: string[];
16
+ email: string;
17
+ currentOrgId: string;
18
+ salesPlanType: string;
19
+ flags: string[];
20
+ }) => Promise<WpCardType[]>;
21
+ export declare const getOnboardingConfig: ({ camundaAuth, audience, }: {
22
+ audience: string;
23
+ camundaAuth: RequestPayload["camundaAuth"];
24
+ }) => Promise<OnboardingConfig>;
25
+ export declare const updatePersona: ({ newPersona, audience, accessToken, orgId, userId, }: {
26
+ newPersona: Persona;
27
+ audience: string;
28
+ orgId: string;
29
+ userId: string;
30
+ accessToken: string;
31
+ }) => Promise<void>;
32
+ export declare const submitSurvey: ({ audience, token, data, }: {
33
+ audience: string;
34
+ token: string;
35
+ data: Persona & {
36
+ email: string;
37
+ orgUuid: string;
38
+ };
39
+ }) => Promise<void>;
40
+ export declare const submitFeedback: ({ token, audience, formData, }: {
41
+ token: string;
42
+ audience: string;
43
+ formData: FormData;
44
+ }) => Promise<any>;
@@ -0,0 +1,95 @@
1
+ import { recommendations } from "../components/c3-help-center/recommendations";
2
+ import { request } from "./api";
3
+ export const getOrg = async (stage, accessToken, orgId) => {
4
+ const headers = {};
5
+ headers.Authorization = `Bearer ${accessToken}`;
6
+ headers["Content-Type"] = "application/json";
7
+ try {
8
+ const response = await fetch(`https://accounts.${stage}/api/organizations/my`, {
9
+ method: "GET",
10
+ headers,
11
+ });
12
+ const orgs = await response.json();
13
+ return orgs.find((org) => org.uuid === orgId);
14
+ }
15
+ catch (error) {
16
+ console.log(error);
17
+ }
18
+ return null;
19
+ };
20
+ export const getClusters = async (stage, accessToken, orgId) => {
21
+ const headers = {};
22
+ headers.Authorization = `Bearer ${accessToken}`;
23
+ headers["Content-Type"] = "application/json";
24
+ try {
25
+ const response = await fetch(`https://console.${stage}/api/orgs/${orgId}/clusters`, {
26
+ method: "GET",
27
+ headers,
28
+ });
29
+ return response.json();
30
+ }
31
+ catch (error) {
32
+ console.log(error);
33
+ }
34
+ return null;
35
+ };
36
+ export const getConfig = async (accessToken, audience) => {
37
+ try {
38
+ const response = await fetch(`https://helpcenter.${audience}/helpcenter/config`, {
39
+ headers: {
40
+ authorization: `Bearer ${accessToken}`,
41
+ "Content-Type": "application/json",
42
+ },
43
+ });
44
+ return response.json();
45
+ }
46
+ catch (error) {
47
+ console.error(error);
48
+ }
49
+ return null;
50
+ };
51
+ export const getTiles = async ({ accessToken, tileConfig, salesPlanType, clusterIds, currentOrgId, persona, flags, email, cloudAudience, }) => {
52
+ const availableTileTypes = recommendations(persona, flags, tileConfig, salesPlanType, clusterIds?.length > 0);
53
+ let cards = await request({
54
+ url: `https://helpcenter.${cloudAudience}/cards?card_id=${availableTileTypes.join(",")}`,
55
+ responseType: "json",
56
+ camundaAuth: { token: accessToken },
57
+ });
58
+ cards = cards.map((card) => {
59
+ card.link = card.link?.replaceAll("{cloudAudience}", cloudAudience);
60
+ card.link = card.link?.replaceAll("{currentOrgId}", currentOrgId);
61
+ card.link = card.link?.replaceAll("{clusterId}", clusterIds[0]);
62
+ card.link = card.link?.replaceAll("{email}", email);
63
+ return card;
64
+ });
65
+ return cards;
66
+ };
67
+ export const getOnboardingConfig = ({ camundaAuth, audience, }) => request({
68
+ url: `https://helpcenter.${audience}/survey/config`,
69
+ camundaAuth,
70
+ type: "json",
71
+ });
72
+ export const updatePersona = async ({ newPersona, audience, accessToken, orgId, userId, }) => request({
73
+ url: `https://helpcenter.${audience}/persona`,
74
+ method: "patch",
75
+ camundaAuth: { token: accessToken },
76
+ type: "json",
77
+ body: { persona: newPersona, userId, orgId },
78
+ responseType: "text",
79
+ });
80
+ export const submitSurvey = async ({ audience, token, data, }) => request({
81
+ method: "post",
82
+ url: `https://helpcenter.${audience}/survey/submit`,
83
+ camundaAuth: { token },
84
+ type: "json",
85
+ body: { data },
86
+ responseType: "text",
87
+ });
88
+ export const submitFeedback = async ({ token, audience, formData, }) => request({
89
+ method: "post",
90
+ url: `https://feedback.${audience}/submit`,
91
+ camundaAuth: { token },
92
+ body: formData,
93
+ type: "form",
94
+ responseType: "text",
95
+ });
@@ -37,6 +37,7 @@ export class NotificationService {
37
37
  body: {
38
38
  id: eventOptions.id,
39
39
  },
40
+ type: "json",
40
41
  responseType: "text",
41
42
  })
42
43
  .then(() => {
@@ -82,6 +83,7 @@ export class NotificationService {
82
83
  body: {
83
84
  uuids: notificationIds,
84
85
  },
86
+ type: "json",
85
87
  })
86
88
  .then(() => {
87
89
  // do nothing
@@ -21,6 +21,7 @@ export const updateTheme = async ({ endpoints, stage, userToken, getNewUserToken
21
21
  camundaAuth: { token: userToken, refreshTokenMethod: getNewUserToken },
22
22
  url: `external/user/theme`,
23
23
  body: { theme },
24
+ responseType: "text",
24
25
  });
25
26
  }
26
27
  catch (error) {
@@ -0,0 +1,17 @@
1
+ import { FC } from "react";
2
+ import { Persona } from "./c3-help-center.types";
3
+ import { Dict } from "mixpanel-browser";
4
+ import { Theme } from "../c3-user-configuration/c3-profile-provider/c3-profile-provider";
5
+ export interface C3HelpCenterProps {
6
+ isOpen: boolean;
7
+ origin: "console" | "webmodeler" | "operate" | "tasklist" | "optimize";
8
+ theme?: Theme;
9
+ flags?: string[];
10
+ activeTab?: string;
11
+ autoStartSurvey?: boolean;
12
+ onPersonaChange?: (persona: Persona) => void;
13
+ onRequestClose?: () => void;
14
+ onRequestOpen?: () => void;
15
+ mixpanelTrack?: (event: string, data: Dict | undefined) => void;
16
+ }
17
+ export declare const C3HelpCenter: FC<C3HelpCenterProps>;
@@ -0,0 +1,163 @@
1
+ import { ComposedModal, Layer } from "@carbon/react";
2
+ import React, { useEffect, useRef, useState } from "react";
3
+ import { HelpCenter } from "./help-center";
4
+ import { defaultHelpCenterConfig } from "./defaultHelpCenterConfig";
5
+ import { C3OnboardingSurvey } from "../c3-onboarding-survey/c3-onboarding-survey";
6
+ import { getClusters, getConfig, getOrg, updatePersona, } from "../../api/help-center";
7
+ import { decodeJWT } from "../c3-user-configuration/authToken";
8
+ import { useC3UserConfiguration } from "../c3-user-configuration/c3-user-configuration-provider";
9
+ import { defaultTheme, useC3Profile, } from "../c3-user-configuration/c3-profile-provider/c3-profile-provider";
10
+ import { resolveTheme, } from "../c3-user-configuration/c3-profile-provider/carbon-theme-provider";
11
+ export const C3HelpCenter = ({ autoStartSurvey, origin, flags, isOpen, onRequestClose, mixpanelTrack, onRequestOpen, theme, onPersonaChange, activeTab, }) => {
12
+ const { userToken, activeOrganizationId, handleTheme } = useC3UserConfiguration() || {};
13
+ const { theme: themeConfig, isEnabled } = useC3Profile();
14
+ const themeHandlingEnabled = isEnabled && !!handleTheme && !!themeConfig;
15
+ const themeRef = useRef();
16
+ const [resolvedTheme, setResolvedTheme] = useState(defaultTheme);
17
+ const [persona, setPersona] = useState(undefined);
18
+ const [userId, setUserId] = useState("");
19
+ const [token, setToken] = useState("");
20
+ const [audience, setAudience] = useState("");
21
+ const [organization, setOrganization] = useState(null);
22
+ const [clusters, setClusters] = useState([]);
23
+ const [helpCenterConfig, setHelpCenterConfig] = useState(defaultHelpCenterConfig);
24
+ const [email, setEmail] = useState("");
25
+ const [showSurvey, setShowSurvey] = useState(autoStartSurvey);
26
+ useEffect(() => {
27
+ const updateResolvedTheme = ({ matches }) => {
28
+ if (themeRef.current === "system") {
29
+ setResolvedTheme(matches ? "light" : "dark");
30
+ }
31
+ };
32
+ window
33
+ .matchMedia("(prefers-color-scheme: light)")
34
+ .addEventListener("change", updateResolvedTheme);
35
+ return () => {
36
+ window
37
+ .matchMedia("(prefers-color-scheme: light)")
38
+ .removeEventListener("change", updateResolvedTheme);
39
+ };
40
+ }, []);
41
+ useEffect(() => {
42
+ const newTheme = themeHandlingEnabled ? themeConfig : theme;
43
+ themeRef.current = newTheme;
44
+ setResolvedTheme(resolveTheme(newTheme || "light"));
45
+ }, [theme, themeConfig, isOpen]);
46
+ const fetchData = async () => {
47
+ const decodedToken = decodeJWT(userToken);
48
+ if (!decodedToken)
49
+ return;
50
+ const { userId, meta, audience, persona } = decodedToken;
51
+ if (persona !== undefined) {
52
+ setPersona(persona);
53
+ if (persona.wasShown) {
54
+ setShowSurvey(false);
55
+ }
56
+ }
57
+ if (meta)
58
+ setEmail(meta.email);
59
+ const decodedAudience = typeof audience === "string" ? audience : audience?.[0];
60
+ if (userId)
61
+ setUserId(userId);
62
+ if (decodedAudience && userToken && activeOrganizationId) {
63
+ setAudience(decodedAudience);
64
+ const clusters = await getClusters(decodedAudience, userToken, activeOrganizationId);
65
+ setClusters(clusters);
66
+ const org = await getOrg(decodedAudience, userToken, activeOrganizationId);
67
+ setOrganization(org);
68
+ }
69
+ if (autoStartSurvey && !(persona?.wasShown ?? false)) {
70
+ onRequestOpen?.();
71
+ }
72
+ if (decodedAudience && userToken) {
73
+ const onboardConfig = await getConfig(userToken, decodedAudience);
74
+ setHelpCenterConfig(onboardConfig || defaultHelpCenterConfig);
75
+ }
76
+ };
77
+ React.useEffect(() => {
78
+ if (token !== userToken && !!userToken) {
79
+ setToken(userToken);
80
+ fetchData();
81
+ }
82
+ }, [userToken]);
83
+ React.useEffect(() => {
84
+ const tabs = helpCenterConfig.tabs;
85
+ const firstTab = tabs[0].id;
86
+ if (isOpen) {
87
+ mixpanelTrack?.(`helpcenter:open`, {
88
+ to: activeTab ?? firstTab,
89
+ from: origin,
90
+ });
91
+ }
92
+ else {
93
+ setShowSurvey(false);
94
+ }
95
+ }, [isOpen]);
96
+ const onRequestRetakeSurvey = () => {
97
+ const newPersona = {
98
+ ...persona,
99
+ ...{ nextStep: 0, complete: false },
100
+ };
101
+ setPersona(newPersona);
102
+ updatePersona({
103
+ newPersona,
104
+ audience,
105
+ accessToken: userToken || "",
106
+ orgId: activeOrganizationId || "",
107
+ userId,
108
+ });
109
+ onPersonaChange?.(newPersona);
110
+ setShowSurvey(true);
111
+ };
112
+ const onRequestResumeSurvey = () => {
113
+ if (!userToken || !activeOrganizationId)
114
+ return;
115
+ const newPersona = { ...persona, ...{ complete: false, wasShown: true } };
116
+ setPersona(newPersona);
117
+ updatePersona({
118
+ newPersona,
119
+ audience,
120
+ accessToken: userToken,
121
+ orgId: activeOrganizationId,
122
+ userId,
123
+ });
124
+ onPersonaChange?.(newPersona);
125
+ setShowSurvey(true);
126
+ };
127
+ const onRequestSkipSurvey = () => {
128
+ if (!userToken || !activeOrganizationId)
129
+ return;
130
+ const newPersona = { ...persona, ...{ complete: false, wasShown: true } };
131
+ setPersona(newPersona);
132
+ updatePersona({
133
+ newPersona,
134
+ audience,
135
+ accessToken: userToken,
136
+ orgId: activeOrganizationId,
137
+ userId,
138
+ });
139
+ onPersonaChange?.(newPersona);
140
+ setShowSurvey(false);
141
+ };
142
+ const personaCallback = (newPersona) => {
143
+ setPersona(newPersona);
144
+ onPersonaChange?.(newPersona);
145
+ if (newPersona.complete) {
146
+ setShowSurvey(false);
147
+ }
148
+ };
149
+ const closeFn = () => {
150
+ if (persona && userToken && activeOrganizationId) {
151
+ updatePersona({
152
+ newPersona: persona,
153
+ audience,
154
+ accessToken: userToken,
155
+ orgId: activeOrganizationId,
156
+ userId,
157
+ });
158
+ }
159
+ onRequestClose?.();
160
+ };
161
+ return (React.createElement(Layer, null,
162
+ React.createElement(ComposedModal, { open: isOpen, size: "lg", onClose: closeFn, className: "help-center", "aria-label": "HelpCenter" }, showSurvey || !persona ? (React.createElement(C3OnboardingSurvey, { personaCallback: personaCallback, persona: persona, mixpanelTrack: mixpanelTrack, onRequestClose: closeFn, onRequestSkip: onRequestSkipSurvey, theme: resolvedTheme, origin: origin, modal: true })) : (React.createElement(HelpCenter, { configuration: helpCenterConfig, persona: persona, audience: audience, organization: organization, clusters: clusters || [], flags: flags, onRequestResumeSurvey: onRequestResumeSurvey, onRequestRetakeSurvey: onRequestRetakeSurvey, onRequestClose: closeFn, mixpanelTrack: mixpanelTrack, email: email, theme: resolvedTheme, origin: origin, initialTab: activeTab })))));
163
+ };
@@ -0,0 +1,54 @@
1
+ import { TabType } from "./tabs/tabContent";
2
+ export interface Persona {
3
+ role?: string;
4
+ company?: string;
5
+ interestedInExecutingProcess?: boolean;
6
+ goal?: string[];
7
+ orchestrate?: string[];
8
+ client?: string;
9
+ clientToSupport?: string;
10
+ bpmnExperience?: string;
11
+ camunda7Experience?: string;
12
+ nextStep?: number;
13
+ complete?: boolean;
14
+ wasShown?: boolean;
15
+ [attribute: string]: unknown;
16
+ }
17
+ export interface WpCardType {
18
+ image: string;
19
+ title: string;
20
+ description: string;
21
+ timeToComplete?: string;
22
+ cta?: string;
23
+ link?: string;
24
+ card_id: string;
25
+ mixpanelId: string;
26
+ }
27
+ export interface Prerequestite {
28
+ id: string;
29
+ value: string;
30
+ not: boolean;
31
+ }
32
+ export interface TileConfig {
33
+ id: string;
34
+ bool: string;
35
+ prerequestites: Prerequestite[] | boolean;
36
+ }
37
+ export type Cluster = {
38
+ uuid: string;
39
+ };
40
+ export type Tab = {
41
+ id: string;
42
+ label: string;
43
+ title: string;
44
+ tiles: TileConfig[];
45
+ tiletype: TabType;
46
+ };
47
+ export type Organization = {
48
+ uuid: string;
49
+ organizationToSalesPlan?: {
50
+ salesPlan?: {
51
+ salesPlanType: string;
52
+ };
53
+ };
54
+ };
@@ -0,0 +1,10 @@
1
+ import { Tab } from "./c3-help-center.types";
2
+ export type HelpCenterConfig = {
3
+ tabs: Tab[];
4
+ links: {
5
+ label: string;
6
+ link: string;
7
+ id: string;
8
+ }[];
9
+ };
10
+ export declare const defaultHelpCenterConfig: HelpCenterConfig;
@@ -0,0 +1,12 @@
1
+ export const defaultHelpCenterConfig = {
2
+ tabs: [
3
+ {
4
+ id: "recommendations",
5
+ label: "Your recommendations",
6
+ title: "",
7
+ tiletype: "grid",
8
+ tiles: [],
9
+ },
10
+ ],
11
+ links: [],
12
+ };
@@ -0,0 +1,23 @@
1
+ import { ModalBodyProps, ModalHeaderProps } from "@carbon/react";
2
+ import { Dict } from "mixpanel-browser";
3
+ import { FC } from "react";
4
+ import { Cluster, Organization, Persona } from "./c3-help-center.types";
5
+ import { HelpCenterConfig } from "./defaultHelpCenterConfig";
6
+ export declare const StyledModalHeader: FC<ModalHeaderProps>;
7
+ export declare const StyledModalBody: FC<ModalBodyProps>;
8
+ export declare const HelpCenter: FC<{
9
+ configuration: HelpCenterConfig;
10
+ organization: Organization;
11
+ persona: Persona;
12
+ email: string;
13
+ audience: string;
14
+ clusters: Cluster[];
15
+ onRequestResumeSurvey: () => void;
16
+ onRequestRetakeSurvey: () => void;
17
+ onRequestClose: () => void;
18
+ theme: string;
19
+ origin: string;
20
+ initialTab: string | undefined;
21
+ flags?: string[];
22
+ mixpanelTrack?: (event: string, data: Dict | undefined) => void;
23
+ }>;