@camunda/camunda-composite-components 0.20.2 → 0.20.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 (88) hide show
  1. package/lib/esm/package.json +27 -28
  2. package/lib/esm/src/api/clusters.js +1 -1
  3. package/lib/esm/src/api/endpoints.const.js +2 -0
  4. package/lib/esm/src/api/help-center.d.ts +1 -1
  5. package/lib/esm/src/api/status.js +1 -1
  6. package/lib/esm/src/assets/c3-icons.d.ts +4 -4
  7. package/lib/esm/src/assets/c3-icons.js +5 -14
  8. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.d.ts +1 -1
  9. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.js +10 -19
  10. package/lib/esm/src/components/c3-app-teaser/app-teaster-card.d.ts +1 -1
  11. package/lib/esm/src/components/c3-app-teaser/app-teaster-card.js +4 -8
  12. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.d.ts +1 -1
  13. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.js +2 -2
  14. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.d.ts +1 -1
  15. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.js +8 -9
  16. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.d.ts +2 -1
  17. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.js +9 -8
  18. package/lib/esm/src/components/c3-data-table/c3-data-table.js +84 -70
  19. package/lib/esm/src/components/c3-data-table/c3-data-table.types.d.ts +3 -2
  20. package/lib/esm/src/components/c3-data-table/link-button/link-button.js +2 -4
  21. package/lib/esm/src/components/c3-data-table/link-button/link-button.types.d.ts +0 -1
  22. package/lib/esm/src/components/c3-empty-state/c3-empty-state.js +9 -29
  23. package/lib/esm/src/components/c3-help-center/c3-help-center-provider.js +3 -2
  24. package/lib/esm/src/components/c3-help-center/c3-help-center.js +3 -7
  25. package/lib/esm/src/components/c3-help-center/help-center-hint.d.ts +1 -1
  26. package/lib/esm/src/components/c3-help-center/help-center-hint.js +6 -10
  27. package/lib/esm/src/components/c3-help-center/help-center.d.ts +1 -1
  28. package/lib/esm/src/components/c3-help-center/help-center.js +69 -102
  29. package/lib/esm/src/components/c3-help-center/tabs/feedback.js +41 -89
  30. package/lib/esm/src/components/c3-help-center/tabs/tabContent.js +2 -5
  31. package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.js +4 -5
  32. package/lib/esm/src/components/c3-help-center/tile.js +16 -30
  33. package/lib/esm/src/components/c3-navigation/c3-info-button.d.ts +1 -1
  34. package/lib/esm/src/components/c3-navigation/c3-info-button.js +2 -3
  35. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.d.ts +1 -1
  36. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.js +9 -9
  37. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.js +72 -87
  38. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.d.ts +1 -5
  39. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.js +1 -0
  40. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.d.ts +1 -1
  41. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.js +20 -28
  42. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts +1 -1
  43. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js +23 -27
  44. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.d.ts +1 -1
  45. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.js +29 -37
  46. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js +18 -24
  47. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js +3 -2
  48. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.js +13 -37
  49. package/lib/esm/src/components/c3-navigation/c3-navigation.js +78 -120
  50. package/lib/esm/src/components/c3-navigation/c3-navigation.types.d.ts +5 -6
  51. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts +1 -1
  52. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.js +10 -18
  53. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.js +4 -4
  54. package/lib/esm/src/components/c3-navigation/c3-org-name.js +2 -4
  55. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.js +48 -60
  56. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.js +23 -13
  57. package/lib/esm/src/components/c3-navigation/helpers.d.ts +2 -3
  58. package/lib/esm/src/components/c3-navigation/index.d.ts +1 -2
  59. package/lib/esm/src/components/c3-navigation/stories/story-helpers.js +3 -5
  60. package/lib/esm/src/components/c3-navigation/stories/story-templates.d.ts +1 -1
  61. package/lib/esm/src/components/c3-navigation/stories/story-templates.js +23 -29
  62. package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.js +2 -1
  63. package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.js +25 -38
  64. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.js +45 -56
  65. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.js +24 -34
  66. package/lib/esm/src/components/c3-onboarding-survey/elements/textField.js +4 -9
  67. package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.d.ts +9 -9
  68. package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.js +31 -42
  69. package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.d.ts +9 -9
  70. package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.js +27 -39
  71. package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.js +9 -13
  72. package/lib/esm/src/components/c3-onboarding-survey/step.js +27 -27
  73. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.js +8 -17
  74. package/lib/esm/src/components/c3-page/c3-page.js +2 -9
  75. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.js +4 -5
  76. package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.d.ts +2 -0
  77. package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.js +13 -0
  78. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts +1 -1
  79. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.js +5 -4
  80. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.js +3 -2
  81. package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.js +3 -4
  82. package/lib/esm/src/contexts/c3-cluster-update-manager.d.ts +1 -1
  83. package/lib/esm/src/contexts/c3-cluster-update-manager.js +3 -2
  84. package/lib/esm/src/hooks/useApi.d.ts +4 -5
  85. package/lib/esm/src/index.d.ts +1 -0
  86. package/lib/esm/src/index.js +1 -0
  87. package/package.json +20 -27
  88. package/README.md +0 -197
@@ -1,39 +1,33 @@
1
- import React, { useState } from "react";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
2
3
  import { C3Navigation } from "../c3-navigation";
3
4
  import { createAppBarProps, createAppProps, createNavBarBarProps, createUserSideBarProps, } from "./story-helpers";
4
5
  import { SwitcherDivider, Toggle } from "@carbon/react";
5
- export const DefaultTemplate = (args) => (React.createElement(React.Fragment, null,
6
- React.createElement(C3Navigation, { ...args }),
7
- React.createElement("div", { id: "main-content" })));
6
+ export const DefaultTemplate = (args) => (_jsxs(_Fragment, { children: [_jsx(C3Navigation, { ...args }), _jsx("div", { id: "main-content" })] }));
8
7
  export const SuperUserToggle = ({ isActive, onChange }) => {
9
- return (React.createElement(React.Fragment, null,
10
- React.createElement(SwitcherDivider, null),
11
- React.createElement("div", { style: { padding: ".5rem 1rem" } },
12
- React.createElement(Toggle, { size: "sm", id: "toggle-super-admin-mode", defaultToggled: isActive, onToggle: (superAdminModeActive) => onChange?.(superAdminModeActive), labelText: "Enter super-admin mode", "aria-label": "Enter super-admin mode" }))));
8
+ return (_jsxs(_Fragment, { children: [_jsx(SwitcherDivider, {}), _jsx("div", { style: { padding: ".5rem 1rem" }, children: _jsx(Toggle, { size: "sm", id: "toggle-super-admin-mode", defaultToggled: isActive, onToggle: (superAdminModeActive) => onChange?.(superAdminModeActive), labelText: "Enter super-admin mode", "aria-label": "Enter super-admin mode" }) })] }));
13
9
  };
14
10
  export const NavbarWithCustomSection = () => {
15
11
  const [isSuperAdminModeActive, setIsSuperAdminModeActive] = useState(true);
16
12
  const [appbarOpen, setAppBarOpen] = useState(false);
17
13
  const appbarProps = createAppBarProps();
18
- return (React.createElement(React.Fragment, null,
19
- React.createElement(C3Navigation, { app: createAppProps(), appBar: { ...appbarProps, isOpen: appbarProps.isOpen ?? appbarOpen }, toggleAppbar: (value) => {
20
- setAppBarOpen(value);
21
- }, navbar: {
22
- ...createNavBarBarProps(),
23
- tags: isSuperAdminModeActive
24
- ? [
25
- {
26
- key: "superUserMode",
27
- label: "Super-user mode",
28
- color: "high-contrast",
29
- },
30
- ]
31
- : undefined,
32
- }, userSideBar: {
33
- ...createUserSideBarProps({ isOpen: false }),
34
- customElements: {
35
- customSection: (React.createElement(SuperUserToggle, { isActive: isSuperAdminModeActive, onChange: setIsSuperAdminModeActive })),
36
- },
37
- } }),
38
- React.createElement("div", { id: "main-content" })));
14
+ return (_jsxs(_Fragment, { children: [_jsx(C3Navigation, { app: createAppProps(), appBar: { ...appbarProps, isOpen: appbarProps.isOpen ?? appbarOpen }, toggleAppbar: (value) => {
15
+ setAppBarOpen(value);
16
+ }, navbar: {
17
+ ...createNavBarBarProps(),
18
+ tags: isSuperAdminModeActive
19
+ ? [
20
+ {
21
+ key: "superUserMode",
22
+ label: "Super-user mode",
23
+ color: "high-contrast",
24
+ },
25
+ ]
26
+ : undefined,
27
+ }, userSideBar: {
28
+ ...createUserSideBarProps({ isOpen: false }),
29
+ customElements: {
30
+ customSection: (_jsx(SuperUserToggle, { isActive: isSuperAdminModeActive, onChange: setIsSuperAdminModeActive })),
31
+ },
32
+ } }), _jsx("div", { id: "main-content" })] }));
39
33
  };
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import React from "react";
2
3
  import { OnboardingSurvey } from "./onboardingSurvey";
3
4
  import { submitSurvey, updatePersona } from "../../api/help-center";
@@ -56,5 +57,5 @@ export const C3OnboardingSurvey = (props) => {
56
57
  setPersona(newPersona);
57
58
  props.personaCallback(newPersona);
58
59
  };
59
- return (React.createElement(OnboardingSurvey, { appTheme: props.theme, userFirstName: givenName, persona: persona, syncPersona: syncPersona, setPersona: setPersona, mixpanelTrack: props.mixpanelTrack, onRequestClose: closeFn, onboardingConfiguration: onboadingConfig, isLoadingConfig: isLoadingOnboardingConfig, modal: props.modal, origin: props.origin }));
60
+ return (_jsx(OnboardingSurvey, { appTheme: props.theme, userFirstName: givenName, persona: persona, syncPersona: syncPersona, setPersona: setPersona, mixpanelTrack: props.mixpanelTrack, onRequestClose: closeFn, onboardingConfiguration: onboadingConfig, isLoadingConfig: isLoadingOnboardingConfig, modal: props.modal, origin: props.origin }));
60
61
  };
@@ -1,5 +1,6 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { Select, SelectItem, Stack, TextInput } from "@carbon/react";
2
- import React, { useState } from "react";
3
+ import { useState } from "react";
3
4
  import { getTitleId } from "../helpers";
4
5
  export const DropdownSelect = ({ title, label, elements, selectedElement, setSelectedElement, exceptionTitle, exceptionLabel, exceptionValue, }) => {
5
6
  let showSuggestion = false;
@@ -26,41 +27,27 @@ export const DropdownSelect = ({ title, label, elements, selectedElement, setSel
26
27
  };
27
28
  const titleId = getTitleId(title);
28
29
  const exceptionTitleId = getTitleId(exceptionTitle);
29
- return (React.createElement(React.Fragment, null,
30
- React.createElement(Stack, null, (() => {
31
- return (React.createElement(React.Fragment, null,
32
- React.createElement("div", { style: {
33
- display: "grid",
34
- gridTemplateColumns: "58% 42%",
35
- } },
36
- React.createElement(Stack, { gap: 1 },
37
- React.createElement("h4", { id: titleId }, title),
38
- (() => {
39
- if (label) {
40
- return React.createElement("p", { className: "cds--modal-header__label" }, label);
41
- }
42
- return React.createElement(React.Fragment, null);
43
- })(),
44
- " "),
45
- React.createElement(Select, { key: `select-${Math.random() * 10000}`, id: `select-${Math.random() * 10000}`, size: "lg", defaultValue: elements[0].value, "aria-labelledby": titleId, labelText: "", onChange: (event) => {
46
- const element = elements.find((e) => e.value === event.target.value);
47
- if (element)
48
- setElement(element.value, "");
49
- }, value: elementWithoutSuggestion() }, elements.map((e) => (React.createElement(SelectItem, { key: `selectItem-${Math.random() * 10000}`, id: `selectItem-${Math.random() * 10000}`, value: e.value, text: e.label })))),
50
- (() => {
51
- if (exceptionValue &&
52
- elementWithoutSuggestion() === exceptionValue) {
53
- return (React.createElement(React.Fragment, null,
54
- React.createElement("div", { style: { marginTop: "24px" } }),
55
- React.createElement("div", { style: { marginTop: "24px" } }),
56
- React.createElement(Stack, { gap: 1 },
57
- React.createElement("h4", { id: exceptionTitleId }, exceptionTitle),
58
- React.createElement("p", { className: "cds--modal-header__label" }, exceptionLabel)),
59
- React.createElement(TextInput, { style: { height: "48px" }, id: `text-input-element-${Math.random() * 1000}`, placeholder: "Enter your suggestion", labelText: "", value: suggestion, onChange: (event) => {
60
- calculateSuggestion(event.target.value);
61
- }, "aria-labelledby": exceptionTitleId, "aria-label": exceptionTitle, invalid: false, invalidText: React.createElement(React.Fragment, null) })));
62
- }
63
- return React.createElement(React.Fragment, null);
64
- })())));
65
- })())));
30
+ return (_jsx(_Fragment, { children: _jsx(Stack, { children: (() => {
31
+ return (_jsx(_Fragment, { children: _jsxs("div", { style: {
32
+ display: "grid",
33
+ gridTemplateColumns: "58% 42%",
34
+ }, children: [_jsxs(Stack, { gap: 1, children: [_jsx("h4", { id: titleId, children: title }), (() => {
35
+ if (label) {
36
+ return _jsx("p", { className: "cds--modal-header__label", children: label });
37
+ }
38
+ return _jsx(_Fragment, {});
39
+ })(), " "] }), _jsx(Select, { id: `select-${Math.random() * 10000}`, size: "lg", defaultValue: elements[0].value, "aria-labelledby": titleId, labelText: "", onChange: (event) => {
40
+ const element = elements.find((e) => e.value === event.target.value);
41
+ if (element)
42
+ setElement(element.value, "");
43
+ }, value: elementWithoutSuggestion(), children: elements.map((e) => (_jsx(SelectItem, { id: `selectItem-${Math.random() * 10000}`, value: e.value, text: e.label }, `selectItem-${Math.random() * 10000}`))) }, `select-${Math.random() * 10000}`), (() => {
44
+ if (exceptionValue &&
45
+ elementWithoutSuggestion() === exceptionValue) {
46
+ return (_jsxs(_Fragment, { children: [_jsx("div", { style: { marginTop: "24px" } }), _jsx("div", { style: { marginTop: "24px" } }), _jsxs(Stack, { gap: 1, children: [_jsx("h4", { id: exceptionTitleId, children: exceptionTitle }), _jsx("p", { className: "cds--modal-header__label", children: exceptionLabel })] }), _jsx(TextInput, { style: { height: "48px" }, id: `text-input-element-${Math.random() * 1000}`, placeholder: "Enter your suggestion", labelText: "", value: suggestion, onChange: (event) => {
47
+ calculateSuggestion(event.target.value);
48
+ }, "aria-labelledby": exceptionTitleId, "aria-label": exceptionTitle, invalid: false, invalidText: _jsx(_Fragment, {}) })] }));
49
+ }
50
+ return _jsx(_Fragment, {});
51
+ })()] }) }));
52
+ })() }) }));
66
53
  };
@@ -1,62 +1,51 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { Button, Column, FlexGrid, Row, SelectableTile, Stack, Tooltip, } from "@carbon/react";
2
- import React from "react";
3
3
  import { Information } from "@carbon/react/icons";
4
4
  export const RadioGroupElementMulti = ({ theme, title, label, elements, columns, tooltip, selectedElements, setSelectedElements, }) => {
5
5
  const backgroundColor = theme === "dark" ? "#393939" : "#E5E5E5";
6
- return (React.createElement(React.Fragment, null,
7
- React.createElement(Stack, { gap: 1 },
8
- React.createElement("h4", null,
9
- title,
10
- (() => {
11
- if (tooltip) {
12
- return (
13
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
14
- // @ts-ignore
15
- React.createElement(Tooltip, { label: tooltip, align: "bottom" },
16
- React.createElement("span", { className: "onboarding" },
17
- React.createElement(Button, { kind: "ghost", renderIcon: Information, iconDescription: "Information", "aria-label": "Information", style: {
18
- marginTop: "-10px",
19
- backgroundColor: theme === "light" ? "#FFFFFF" : "#161616",
20
- } }))));
21
- }
22
- else {
23
- return React.createElement(React.Fragment, null);
24
- }
25
- })()),
26
- (() => {
27
- if (label) {
28
- return React.createElement("p", { className: "cds--modal-header__label" }, label);
29
- }
30
- return React.createElement(React.Fragment, null);
31
- })(),
32
- " "),
33
- React.createElement(Stack, { gap: 3 }, elements
34
- .reduce((result, item, index) => {
35
- const chunkIndex = Math.floor(index / columns);
36
- if (!result[chunkIndex]) {
37
- result[chunkIndex] = [];
38
- }
39
- result[chunkIndex].push(item);
40
- return result;
41
- }, [])
42
- .map((row, index) => (React.createElement(FlexGrid, { key: `onboarding-radio-row-${index}`, style: {
43
- width: "100%",
44
- maxWidth: "100%",
45
- paddingLeft: "0",
46
- paddingRight: "0",
47
- } },
48
- React.createElement(Row, null, row.map((element) => (React.createElement(Column, { key: `tile-${element.value}`, style: { maxWidth: `${100 / columns}%` } },
49
- React.createElement(SelectableTile, { style: {
50
- backgroundColor,
51
- marginBottom: "24px",
52
- }, selected: (() => {
53
- return selectedElements?.includes(element.value);
54
- })(), onClick: () => {
55
- if (selectedElements?.includes(element.value)) {
56
- setSelectedElements(selectedElements?.filter((e) => e !== element.value));
6
+ return (_jsxs(_Fragment, { children: [_jsxs(Stack, { gap: 1, children: [_jsxs("h4", { children: [title, (() => {
7
+ if (tooltip) {
8
+ return (
9
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
10
+ // @ts-ignore
11
+ _jsx(Tooltip, { label: tooltip, align: "bottom", children: _jsx("span", { className: "onboarding", children: _jsx(Button, { kind: "ghost", renderIcon: Information, iconDescription: "Information", "aria-label": "Information", style: {
12
+ marginTop: "-10px",
13
+ backgroundColor: theme === "light" ? "#FFFFFF" : "#161616",
14
+ } }) }) }));
15
+ }
16
+ else {
17
+ return _jsx(_Fragment, {});
18
+ }
19
+ })()] }), (() => {
20
+ if (label) {
21
+ return _jsx("p", { className: "cds--modal-header__label", children: label });
57
22
  }
58
- else {
59
- setSelectedElements(selectedElements?.concat([element.value]) || []);
60
- }
61
- }, value: element.value }, element.label)))))))))));
23
+ return _jsx(_Fragment, {});
24
+ })(), " "] }), _jsx(Stack, { gap: 3, children: elements
25
+ .reduce((result, item, index) => {
26
+ const chunkIndex = Math.floor(index / columns);
27
+ if (!result[chunkIndex]) {
28
+ result[chunkIndex] = [];
29
+ }
30
+ result[chunkIndex].push(item);
31
+ return result;
32
+ }, [])
33
+ .map((row, index) => (_jsx(FlexGrid, { style: {
34
+ width: "100%",
35
+ maxWidth: "100%",
36
+ paddingLeft: "0",
37
+ paddingRight: "0",
38
+ }, children: _jsx(Row, { children: row.map((element) => (_jsx(Column, { style: { maxWidth: `${100 / columns}%` }, children: _jsx(SelectableTile, { style: {
39
+ backgroundColor,
40
+ marginBottom: "24px",
41
+ }, selected: (() => {
42
+ return selectedElements?.includes(element.value);
43
+ })(), onClick: () => {
44
+ if (selectedElements?.includes(element.value)) {
45
+ setSelectedElements(selectedElements?.filter((e) => e !== element.value));
46
+ }
47
+ else {
48
+ setSelectedElements(selectedElements?.concat([element.value]) || []);
49
+ }
50
+ }, value: element.value, children: element.label }) }, `tile-${element.value}`))) }) }, `onboarding-radio-row-${index}`))) })] }));
62
51
  };
@@ -1,5 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
2
  import { Column, FlexGrid, RadioTile, Row, Stack, Tooltip, Button, } from "@carbon/react";
2
- import React from "react";
3
3
  import { Information } from "@carbon/react/icons";
4
4
  import styled from "styled-components";
5
5
  const StyledRadioTile = styled(RadioTile) `
@@ -8,37 +8,27 @@ const StyledRadioTile = styled(RadioTile) `
8
8
  `;
9
9
  export const RadioGroupElementSingle = ({ theme, title, label, elements, columns, tooltip, selectedElement, setSelectedElement, }) => {
10
10
  const backgroundColor = theme === "dark" ? "#393939" : "#E5E5E5";
11
- return (React.createElement(React.Fragment, null,
12
- React.createElement(Stack, { gap: 1 },
13
- React.createElement("h4", null,
14
- title,
15
- tooltip && (
16
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
17
- // @ts-ignore
18
- React.createElement(Tooltip, { label: tooltip, align: "bottom" },
19
- React.createElement("span", { className: "onboarding" },
20
- React.createElement(Button, { kind: "ghost", renderIcon: Information, iconDescription: "Information", "aria-label": "Information", style: {
21
- marginTop: "-10px",
22
- backgroundColor: theme === "light" ? "#FFFFFF" : "#161616",
23
- } }))))),
24
- label && React.createElement("p", { className: "cds--modal-header__label" }, label)),
25
- React.createElement(Stack, { gap: 3 }, elements
26
- .reduce((result, item, index) => {
27
- const chunkIndex = Math.floor(index / columns);
28
- if (!result[chunkIndex]) {
29
- result[chunkIndex] = [];
30
- }
31
- result[chunkIndex].push(item);
32
- return result;
33
- }, [])
34
- .map((row, index) => (React.createElement(FlexGrid, { key: `row-${index}`, style: {
35
- width: "100%",
36
- maxWidth: "100%",
37
- paddingLeft: "0",
38
- paddingRight: "0",
39
- } },
40
- React.createElement(Row, null, row.map((element, index) => (React.createElement(Column, { key: `column-${element.value}-${index}`, style: { maxWidth: `${100 / columns}%` } },
41
- React.createElement(StyledRadioTile, { "$backgroundColor": backgroundColor, key: `tile-${element.value}-${index}`, checked: (selectedElement ?? "") === element.value, onChange: (value) => {
42
- setSelectedElement(value);
43
- }, value: element.value }, element.label)))))))))));
11
+ return (_jsxs(_Fragment, { children: [_jsxs(Stack, { gap: 1, children: [_jsxs("h4", { children: [title, tooltip && (
12
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
13
+ // @ts-ignore
14
+ _jsx(Tooltip, { label: tooltip, align: "bottom", children: _jsx("span", { className: "onboarding", children: _jsx(Button, { kind: "ghost", renderIcon: Information, iconDescription: "Information", "aria-label": "Information", style: {
15
+ marginTop: "-10px",
16
+ backgroundColor: theme === "light" ? "#FFFFFF" : "#161616",
17
+ } }) }) }))] }), label && _jsx("p", { className: "cds--modal-header__label", children: label })] }), _jsx(Stack, { gap: 3, children: elements
18
+ .reduce((result, item, index) => {
19
+ const chunkIndex = Math.floor(index / columns);
20
+ if (!result[chunkIndex]) {
21
+ result[chunkIndex] = [];
22
+ }
23
+ result[chunkIndex].push(item);
24
+ return result;
25
+ }, [])
26
+ .map((row, index) => (_jsx(FlexGrid, { style: {
27
+ width: "100%",
28
+ maxWidth: "100%",
29
+ paddingLeft: "0",
30
+ paddingRight: "0",
31
+ }, children: _jsx(Row, { children: row.map((element, index) => (_jsx(Column, { style: { maxWidth: `${100 / columns}%` }, children: _jsx(StyledRadioTile, { "$backgroundColor": backgroundColor, checked: (selectedElement ?? "") === element.value, onChange: (value) => {
32
+ setSelectedElement(value);
33
+ }, value: element.value, children: element.label }, `tile-${element.value}-${index}`) }, `column-${element.value}-${index}`))) }) }, `row-${index}`))) })] }));
44
34
  };
@@ -1,14 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
2
  import { TextInput, Stack } from "@carbon/react";
2
- import React from "react";
3
3
  import { getTitleId } from "../helpers";
4
4
  export const TextInputElement = ({ title, label, preFiledValue, setValue, placeholder }) => {
5
5
  const titleId = getTitleId(title);
6
- return (React.createElement(React.Fragment, null,
7
- React.createElement(Stack, { orientation: "horizontal" },
8
- React.createElement(Stack, { gap: 1 },
9
- React.createElement("h4", { id: titleId }, title),
10
- label && React.createElement("p", { className: "cds--modal-header__label" }, label)),
11
- React.createElement(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: React.createElement(React.Fragment, null) }))));
6
+ 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) => {
7
+ setValue(event.target.value);
8
+ }, "aria-labelledby": titleId, invalid: false, invalidText: _jsx(_Fragment, {}) })] }) }));
14
9
  };
@@ -3,21 +3,21 @@ export declare const StyledModalBody: FC<any>;
3
3
  export declare const OnboardingModal: ({ isDoingAsyncWork, heading, headingLabel, primaryButtonText, primaryButtonDisabled, secondaryButtonText, tertiaryButtonText, loadingText, error, danger, theme, onRequestClose, onSecondary, onPrimary, onTertiary, children, }: {
4
4
  isDoingAsyncWork: boolean;
5
5
  heading: string;
6
- headingLabel?: string | undefined;
6
+ headingLabel?: string;
7
7
  primaryButtonText: string;
8
- primaryButtonDisabled?: boolean | undefined;
9
- secondaryButtonText?: string | undefined;
10
- tertiaryButtonText?: string | undefined;
8
+ primaryButtonDisabled?: boolean;
9
+ secondaryButtonText?: string;
10
+ tertiaryButtonText?: string;
11
11
  loadingText: string;
12
12
  error?: {
13
13
  title: string;
14
14
  description: string;
15
- } | undefined;
16
- danger?: boolean | undefined;
15
+ };
16
+ danger?: boolean;
17
17
  theme: string;
18
18
  onRequestClose: (skip: boolean) => void;
19
- onSecondary?: (() => void) | undefined;
20
- onPrimary?: (() => void) | undefined;
21
- onTertiary?: (() => void) | undefined;
19
+ onSecondary?: () => void;
20
+ onPrimary?: () => void;
21
+ onTertiary?: () => void;
22
22
  children?: React.ReactNode;
23
23
  }) => JSX.Element;
@@ -1,5 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
2
  import { Button, InlineLoading, InlineNotification, ModalBody, ModalFooter, ModalHeader, Stack, } from "@carbon/react";
2
- import React from "react";
3
3
  import styled from "styled-components";
4
4
  import { headingStyles } from "../c3-help-center/styles";
5
5
  export const StyledModalBody = styled(ModalBody) `
@@ -9,45 +9,34 @@ const StyledModalFooter = styled(ModalFooter) `
9
9
  background-color: ${({ $c3Theme }) => $c3Theme === "light" ? "#FFFFFF" : "#161616"};
10
10
  `;
11
11
  export const OnboardingModal = ({ isDoingAsyncWork, heading, headingLabel, primaryButtonText, primaryButtonDisabled = false, secondaryButtonText = "Cancel", tertiaryButtonText, loadingText, error = { title: "", description: "" }, danger = false, theme, onRequestClose, onSecondary, onPrimary, onTertiary, children, }) => {
12
- return (React.createElement(React.Fragment, null,
13
- React.createElement(ModalHeader, { title: heading, label: headingLabel, style: {
14
- pointerEvents: isDoingAsyncWork ? "none" : "unset",
15
- backgroundColor: theme === "light" ? "#FFFFFF" : "#161616",
16
- marginBottom: 0,
17
- }, closeModal: () => onRequestClose(false) }),
18
- React.createElement(StyledModalBody, { style: {
19
- marginBottom: "0px",
20
- paddingBottom: "3rem",
21
- backgroundColor: theme === "light" ? "#FFFFFF" : "#161616",
22
- } },
23
- React.createElement("div", { style: { minHeight: "520px" } },
24
- React.createElement(Stack, { gap: 6 },
25
- children,
26
- error.title ? (React.createElement(InlineNotification, { kind: "error", title: error.title, subtitle: error.description, hideCloseButton: true })) : ("")))),
27
- React.createElement(StyledModalFooter, { "$c3Theme": theme }, (() => {
28
- if (tertiaryButtonText && onTertiary !== undefined) {
29
- return (React.createElement(React.Fragment, null,
30
- React.createElement(Button, { kind: "ghost", disabled: isDoingAsyncWork, onClick: () => onTertiary() }, tertiaryButtonText),
31
- React.createElement(Button, { style: { paddingRight: "1rem", marginLeft: "33%" }, kind: danger ? "danger" : "primary", disabled: primaryButtonDisabled || isDoingAsyncWork, onClick: () => {
32
- if (onPrimary) {
33
- onPrimary();
34
- }
35
- } }, isDoingAsyncWork ? (React.createElement(InlineLoading, { description: loadingText })) : (primaryButtonText))));
36
- }
37
- else {
38
- return (React.createElement(React.Fragment, null,
39
- (() => {
40
- let button = React.createElement(React.Fragment, null);
41
- if (secondaryButtonText && onSecondary) {
42
- button = (React.createElement(Button, { kind: "secondary", disabled: isDoingAsyncWork, onClick: () => onSecondary?.(), style: { marginLeft: "33%" } }, secondaryButtonText));
43
- }
44
- return button;
45
- })(),
46
- React.createElement(Button, { style: { paddingRight: "1rem" }, kind: danger ? "danger" : "primary", disabled: primaryButtonDisabled || isDoingAsyncWork, onClick: () => {
47
- if (onPrimary) {
48
- onPrimary();
49
- }
50
- } }, isDoingAsyncWork ? (React.createElement(InlineLoading, { description: loadingText })) : (primaryButtonText))));
51
- }
52
- })())));
12
+ return (_jsxs(_Fragment, { children: [_jsx(ModalHeader, { title: heading, label: headingLabel, style: {
13
+ pointerEvents: isDoingAsyncWork ? "none" : "unset",
14
+ backgroundColor: theme === "light" ? "#FFFFFF" : "#161616",
15
+ marginBottom: 0,
16
+ }, closeModal: () => onRequestClose(false) }), _jsx(StyledModalBody, { style: {
17
+ marginBottom: "0px",
18
+ paddingBottom: "3rem",
19
+ backgroundColor: theme === "light" ? "#FFFFFF" : "#161616",
20
+ }, children: _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 })) : ("")] }) }) }), _jsx(StyledModalFooter, { "$c3Theme": theme, children: (() => {
21
+ if (tertiaryButtonText && onTertiary !== undefined) {
22
+ 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: () => {
23
+ if (onPrimary) {
24
+ onPrimary();
25
+ }
26
+ }, children: isDoingAsyncWork ? (_jsx(InlineLoading, { description: loadingText })) : (primaryButtonText) })] }));
27
+ }
28
+ else {
29
+ return (_jsxs(_Fragment, { children: [(() => {
30
+ let button = _jsx(_Fragment, {});
31
+ if (secondaryButtonText && onSecondary) {
32
+ button = (_jsx(Button, { kind: "secondary", disabled: isDoingAsyncWork, onClick: () => onSecondary?.(), style: { marginLeft: "33%" }, children: secondaryButtonText }));
33
+ }
34
+ return button;
35
+ })(), _jsx(Button, { style: { paddingRight: "1rem" }, kind: danger ? "danger" : "primary", disabled: primaryButtonDisabled || isDoingAsyncWork, onClick: () => {
36
+ if (onPrimary) {
37
+ onPrimary();
38
+ }
39
+ }, children: isDoingAsyncWork ? (_jsx(InlineLoading, { description: loadingText })) : (primaryButtonText) })] }));
40
+ }
41
+ })() })] }));
53
42
  };
@@ -2,19 +2,19 @@ import React from "react";
2
2
  export declare const OnboardingPage: ({ isDoingAsyncWork, heading, headingLabel, primaryButtonText, primaryButtonDisabled, secondaryButtonText, tertiaryButtonText, loadingText, error, danger, onSecondary, onPrimary, onTertiary, children, }: {
3
3
  isDoingAsyncWork: boolean;
4
4
  heading: string;
5
- headingLabel?: string | undefined;
5
+ headingLabel?: string;
6
6
  primaryButtonText: string;
7
- primaryButtonDisabled?: boolean | undefined;
8
- secondaryButtonText?: string | undefined;
9
- tertiaryButtonText?: string | undefined;
7
+ primaryButtonDisabled?: boolean;
8
+ secondaryButtonText?: string;
9
+ tertiaryButtonText?: string;
10
10
  loadingText: string;
11
11
  error?: {
12
12
  title: string;
13
13
  description: string;
14
- } | undefined;
15
- danger?: boolean | undefined;
16
- onSecondary?: (() => void) | undefined;
17
- onPrimary?: (() => void) | undefined;
18
- onTertiary?: (() => void) | undefined;
14
+ };
15
+ danger?: boolean;
16
+ onSecondary?: () => void;
17
+ onPrimary?: () => void;
18
+ onTertiary?: () => void;
19
19
  children?: React.ReactNode;
20
20
  }) => JSX.Element;
@@ -1,42 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
2
  import { Button, InlineLoading, InlineNotification, Stack } from "@carbon/react";
2
- import React from "react";
3
3
  export const OnboardingPage = ({ isDoingAsyncWork, heading, headingLabel, primaryButtonText, primaryButtonDisabled = false, secondaryButtonText = "Cancel", tertiaryButtonText, loadingText, error = { title: "", description: "" }, danger = false, onSecondary, onPrimary, onTertiary, children, }) => {
4
- return (React.createElement(Stack, null,
5
- React.createElement(Stack, null,
6
- React.createElement("h1", null, heading),
7
- React.createElement("p", null, headingLabel)),
8
- React.createElement("div", { style: { minHeight: "520px" } },
9
- React.createElement(Stack, { gap: 6 },
10
- children,
11
- error.title ? (React.createElement(InlineNotification, { kind: "error", title: error.title, subtitle: error.description, hideCloseButton: true })) : (""))),
12
- (() => {
13
- if (tertiaryButtonText && onTertiary !== undefined) {
14
- return (React.createElement(Stack, { orientation: "horizontal" },
15
- React.createElement(Button, { kind: "ghost", disabled: isDoingAsyncWork, onClick: () => onTertiary() }, tertiaryButtonText),
16
- React.createElement(Button, { style: {
17
- paddingRight: "1rem",
18
- marginLeft: "auto",
19
- marginRight: "0px",
20
- }, kind: danger ? "danger" : "primary", disabled: primaryButtonDisabled || isDoingAsyncWork, onClick: () => {
21
- if (onPrimary) {
22
- onPrimary();
23
- }
24
- } }, isDoingAsyncWork ? (React.createElement(InlineLoading, { description: loadingText })) : (primaryButtonText))));
25
- }
26
- else {
27
- return (React.createElement(Stack, { orientation: "horizontal" },
28
- (() => {
29
- let button = React.createElement(React.Fragment, null);
30
- if (secondaryButtonText && onSecondary) {
31
- button = (React.createElement(Button, { kind: "secondary", disabled: isDoingAsyncWork, onClick: () => onSecondary?.(), style: { marginLeft: "0px" } }, secondaryButtonText));
32
- }
33
- return button;
34
- })(),
35
- React.createElement(Button, { style: { marginLeft: "auto", marginRight: "0px" }, kind: danger ? "danger" : "primary", disabled: primaryButtonDisabled || isDoingAsyncWork, onClick: () => {
36
- if (onPrimary) {
37
- onPrimary();
38
- }
39
- } }, isDoingAsyncWork ? (React.createElement(InlineLoading, { description: loadingText })) : (primaryButtonText))));
40
- }
41
- })()));
4
+ 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 })) : ("")] }) }), (() => {
5
+ if (tertiaryButtonText && onTertiary !== undefined) {
6
+ return (_jsxs(Stack, { orientation: "horizontal", children: [_jsx(Button, { kind: "ghost", disabled: isDoingAsyncWork, onClick: () => onTertiary(), children: tertiaryButtonText }), _jsx(Button, { style: {
7
+ paddingRight: "1rem",
8
+ marginLeft: "auto",
9
+ marginRight: "0px",
10
+ }, kind: danger ? "danger" : "primary", disabled: primaryButtonDisabled || isDoingAsyncWork, onClick: () => {
11
+ if (onPrimary) {
12
+ onPrimary();
13
+ }
14
+ }, children: isDoingAsyncWork ? (_jsx(InlineLoading, { description: loadingText })) : (primaryButtonText) })] }));
15
+ }
16
+ else {
17
+ return (_jsxs(Stack, { orientation: "horizontal", children: [(() => {
18
+ let button = _jsx(_Fragment, {});
19
+ if (secondaryButtonText && onSecondary) {
20
+ button = (_jsx(Button, { kind: "secondary", disabled: isDoingAsyncWork, onClick: () => onSecondary?.(), style: { marginLeft: "0px" }, children: secondaryButtonText }));
21
+ }
22
+ return button;
23
+ })(), _jsx(Button, { style: { marginLeft: "auto", marginRight: "0px" }, kind: danger ? "danger" : "primary", disabled: primaryButtonDisabled || isDoingAsyncWork, onClick: () => {
24
+ if (onPrimary) {
25
+ onPrimary();
26
+ }
27
+ }, children: isDoingAsyncWork ? (_jsx(InlineLoading, { description: loadingText })) : (primaryButtonText) })] }));
28
+ }
29
+ })()] }));
42
30
  };