@camunda/ccma-saas-frontend 0.39.8 → 0.40.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.
@@ -104,7 +104,7 @@ export function C4FeedbackForm({ onSubmit, isEnterprise = false, resetKey, }) {
104
104
  : 'Only .jpg and .png files are supported',
105
105
  ],
106
106
  ])
107
- : undefined, "aria-invalid": fileInvalid })), !isEnterprise && (_jsxs("div", { className: 'flex items-center gap-2', children: [_jsx(Checkbox, { id: 'c4-feedback-allow-contact', checked: allowContact, onCheckedChange: (checked) => setAllowContact(checked === true) }), _jsx(Label, { htmlFor: 'c4-feedback-allow-contact', children: "Camunda may contact me about my feedback" })] })), error && (_jsx(Alert, { variant: 'destructive', title: "Couldn't submit feedback", children: "Something went wrong. Please try again." })), _jsx("div", { children: _jsx(Button, { onClick: submit, disabled: !canSubmit, children: submitting ? 'Submitting…' : 'Submit feedback' }) })] }));
107
+ : undefined, "aria-invalid": fileInvalid })), !isEnterprise && (_jsxs("div", { className: 'flex items-center gap-2', children: [_jsx(Checkbox, { id: 'c4-feedback-allow-contact', checked: allowContact, onCheckedChange: (checked) => setAllowContact(checked === true) }), _jsx(Label, { htmlFor: 'c4-feedback-allow-contact', children: "Camunda may contact me about my feedback" })] })), error && (_jsx(Alert, { variant: 'destructive', title: "Couldn't submit feedback", children: "Something went wrong. Please try again." })), _jsx("div", { children: _jsx(Button, { onClick: submit, disabled: !canSubmit, "data-testid": 'c4-feedback-submit', children: submitting ? 'Submitting…' : 'Submit feedback' }) })] }));
108
108
  }
109
109
  /**
110
110
  * Design-system-native Help Center "Share your feedback" modal. Mirrors the c3
@@ -33,15 +33,31 @@ export interface C4HelpCenterProps {
33
33
  /** CMS-driven tabs and tiles fetched from the helpcenter API. */
34
34
  data?: C4HelpCenterData;
35
35
  isLoading?: boolean;
36
- /** Fallback links shown when no CMS data and no feedback tab is available. */
36
+ /**
37
+ * Fallback links shown when no CMS data and no feedback tab is available.
38
+ * They do not show in feedback-only mode (see `feedbackOnly`).
39
+ */
37
40
  helpLinks?: Array<{
38
41
  key: string;
39
42
  label: string;
40
43
  href: string;
41
44
  }>;
42
- /** When provided, a "Share your feedback" tab is added to the sidebar. */
45
+ /**
46
+ * When provided, a "Share your feedback" tab is added to the sidebar.
47
+ */
43
48
  onSubmitFeedback?: (payload: C4FeedbackPayload) => Promise<void>;
44
49
  feedbackEnterprise?: boolean;
50
+ /**
51
+ * With `onSubmitFeedback` and no CMS content (no tabs, no links), show the
52
+ * feedback form alone, with no sidebar. While `isLoading`, the "Help Center"
53
+ * skeleton shows first, then the dialog switches. Default: false, the
54
+ * sidebar layout.
55
+ */
56
+ feedbackOnly?: boolean;
57
+ /**
58
+ * Title of the feedback-only panel. The host passes its translation.
59
+ */
60
+ feedbackTitle?: string;
45
61
  /**
46
62
  * Tab ID to activate when the modal opens. Pass `FEEDBACK_TAB_ID` to open
47
63
  * directly to the feedback tab (e.g. from `openHelpCenter('feedback')`).
@@ -55,4 +71,4 @@ export interface C4HelpCenterProps {
55
71
  */
56
72
  linkPlaceholders?: C4HelpCenterLinkPlaceholders;
57
73
  }
58
- export declare function C4HelpCenter({ open, onOpenChange, data, isLoading, helpLinks, onSubmitFeedback, feedbackEnterprise, initialTabId, linkPlaceholders, }: C4HelpCenterProps): JSX.Element;
74
+ export declare function C4HelpCenter({ open, onOpenChange, data, isLoading, helpLinks, onSubmitFeedback, feedbackEnterprise, feedbackOnly, feedbackTitle, initialTabId, linkPlaceholders, }: C4HelpCenterProps): JSX.Element;
@@ -15,7 +15,7 @@ import { HUB_HELP_CENTER_LINKS_FLAG, isHubLinkStage, rewriteAppHostToHub, } from
15
15
  import { hasUnresolvedHelpCenterPlaceholder, resolveHelpCenterPlaceholders, } from './help-center-placeholders.js';
16
16
  /** Reserved tab ID for the inline feedback form. */
17
17
  export const FEEDBACK_TAB_ID = 'feedback';
18
- export function C4HelpCenter({ open, onOpenChange, data, isLoading, helpLinks, onSubmitFeedback, feedbackEnterprise, initialTabId, linkPlaceholders, }) {
18
+ export function C4HelpCenter({ open, onOpenChange, data, isLoading, helpLinks, onSubmitFeedback, feedbackEnterprise, feedbackOnly = false, feedbackTitle = 'Share feedback', initialTabId, linkPlaceholders, }) {
19
19
  const [activeTabId, setActiveTabId] = useState('');
20
20
  // Set the active tab when the modal opens/closes or initialTabId changes.
21
21
  useEffect(() => {
@@ -60,6 +60,20 @@ export function C4HelpCenter({ open, onOpenChange, data, isLoading, helpLinks, o
60
60
  ? activeTabId
61
61
  : (tabs[0]?.id ?? '');
62
62
  const showFullUI = isLoading || tabs.length > 0 || hasFeedbackTab;
63
+ // With no CMS content to browse, the sidebar would hold a single tab and
64
+ // the "Help Center" title would name content that is not there. A host that
65
+ // sets `feedbackOnly` gets the feedback form alone, under its own title.
66
+ const isFeedbackOnly = feedbackOnly &&
67
+ onSubmitFeedback !== undefined &&
68
+ !isLoading &&
69
+ tabs.length === 0 &&
70
+ sidebarLinks.length === 0;
71
+ if (isFeedbackOnly) {
72
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: 'c4-ui flex flex-col gap-0 overflow-hidden p-0', style: {
73
+ maxWidth: 'min(640px, calc(100% - 2rem))',
74
+ maxHeight: '80vh',
75
+ }, children: [_jsx(DialogHeader, { className: 'shrink-0 border-b px-6 py-4', children: _jsx(DialogTitle, { children: feedbackTitle }) }), _jsx("div", { className: 'min-h-0 flex-1 overflow-y-auto p-6', children: _jsx(C4FeedbackForm, { onSubmit: onSubmitFeedback, isEnterprise: feedbackEnterprise, resetKey: open }) })] }) }));
76
+ }
63
77
  return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { className: 'c4-ui flex flex-col gap-0 overflow-hidden overflow-y-hidden p-0', style: { maxWidth: 'min(900px, calc(100% - 2rem))', height: '80vh' }, children: showFullUI ? (_jsxs(_Fragment, { children: [_jsx(DialogHeader, { className: 'shrink-0 border-b px-6 py-4', children: _jsx(DialogTitle, { children: "Help Center" }) }), _jsxs(Tabs, { orientation: 'vertical', value: effectiveActiveTabId, onValueChange: (id) => setActiveTabId(id), className: 'flex min-h-0 flex-1 flex-row overflow-hidden', children: [_jsxs("div", { className: 'flex shrink-0 flex-col overflow-hidden', style: {
64
78
  width: '15.5rem',
65
79
  padding: '1.5rem 0.75rem 1.5rem 1.5rem',
@@ -29,9 +29,8 @@ export type C4NavigationProps = Omit<C3NavigationProps, 'helpCenter'> & {
29
29
  href?: string;
30
30
  }>;
31
31
  /**
32
- * Submit handler for the "Share your feedback" modal. When provided, the
33
- * help center renders {@link C4FeedbackModal}, driven by the help-center
34
- * open state.
32
+ * Submit handler for the feedback form. When provided, the help center adds
33
+ * a "Share your feedback" tab. `openHelpCenter('feedback')` selects it.
35
34
  */
36
35
  onSubmitFeedback?: (payload: C4FeedbackPayload) => Promise<void>;
37
36
  /** Enterprise orgs get the Jira-support notice in the feedback modal. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/ccma-saas-frontend",
3
- "version": "0.39.8",
3
+ "version": "0.40.0",
4
4
  "description": "Camunda Composite Components",
5
5
  "bugs": {
6
6
  "url": "https://github.com/camunda/camunda-cloud-management-apps/issues"
@@ -85,8 +85,8 @@
85
85
  "react-markdown": "^8.0.7 || ^10.0.0"
86
86
  },
87
87
  "dependencies": {
88
- "@camunda/ccma-api": "14.1.0",
89
- "@camunda/ccma-shared-types": "18.14.0",
88
+ "@camunda/ccma-api": "14.2.0",
89
+ "@camunda/ccma-shared-types": "18.15.0",
90
90
  "@pactsafe/pactsafe-react-sdk": "2.15.0",
91
91
  "cron-parser": "5.10.6",
92
92
  "mobx": "6.16.1",