@cognizant-ai-lab/ui-common 1.3.3 → 1.4.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.
- package/README.md +287 -0
- package/dist/Theme/Palettes.d.ts +18 -0
- package/dist/Theme/Palettes.js +94 -0
- package/dist/Theme/Theme.d.ts +22 -0
- package/dist/Theme/Theme.js +58 -0
- package/dist/components/AgentChat/ChatCommon.d.ts +4 -2
- package/dist/components/AgentChat/ChatCommon.js +141 -105
- package/dist/components/AgentChat/ControlButtons.js +3 -1
- package/dist/components/AgentChat/FormattedMarkdown.d.ts +4 -4
- package/dist/components/AgentChat/FormattedMarkdown.js +5 -7
- package/dist/components/AgentChat/LlmChatButton.d.ts +2 -6
- package/dist/components/AgentChat/LlmChatButton.js +3 -3
- package/dist/components/AgentChat/UserQueryDisplay.js +2 -4
- package/dist/components/AgentChat/Utils.d.ts +2 -1
- package/dist/components/AgentChat/Utils.js +4 -1
- package/dist/components/AgentChat/VoiceChat/MicrophoneButton.d.ts +2 -2
- package/dist/components/AgentChat/VoiceChat/VoiceChat.d.ts +3 -3
- package/dist/components/AgentChat/VoiceChat/VoiceChat.js +5 -5
- package/dist/components/ChatBot/ChatBot.js +2 -2
- package/dist/components/Common/Breadcrumbs.js +1 -1
- package/dist/components/Common/{confirmationModal.js → ConfirmationModal.js} +2 -5
- package/dist/components/Common/CustomerLogo.d.ts +17 -0
- package/dist/components/Common/CustomerLogo.js +49 -0
- package/dist/components/Common/Footer.d.ts +18 -0
- package/dist/components/Common/Footer.js +59 -0
- package/dist/components/Common/LlmChatOptionsButton.d.ts +1 -4
- package/dist/components/Common/LlmChatOptionsButton.js +4 -4
- package/dist/components/Common/LoadingSpinner.js +1 -1
- package/dist/components/Common/MUIAccordion.d.ts +2 -2
- package/dist/components/Common/MUIAccordion.js +2 -12
- package/dist/components/Common/MUIAlert.d.ts +2 -1
- package/dist/components/Common/MUIAlert.js +4 -1
- package/dist/components/Common/MUIDialog.d.ts +1 -1
- package/dist/components/Common/MUIDialog.js +1 -1
- package/dist/components/Common/Navbar.d.ts +3 -1
- package/dist/components/Common/Navbar.js +60 -35
- package/dist/components/Common/PageLoader.js +3 -4
- package/dist/components/Common/Snackbar.d.ts +4 -1
- package/dist/components/Common/Snackbar.js +11 -19
- package/dist/components/Common/notification.d.ts +3 -3
- package/dist/components/Common/notification.js +6 -6
- package/dist/components/ErrorPage/ErrorBoundary.d.ts +2 -2
- package/dist/components/ErrorPage/ErrorBoundary.js +1 -1
- package/dist/components/ErrorPage/ErrorPage.js +6 -5
- package/dist/components/MultiAgentAccelerator/AgentConversations.d.ts +17 -0
- package/dist/components/MultiAgentAccelerator/AgentConversations.js +77 -0
- package/dist/components/MultiAgentAccelerator/AgentCounts.d.ts +12 -0
- package/dist/components/MultiAgentAccelerator/AgentCounts.js +21 -0
- package/dist/components/MultiAgentAccelerator/AgentFlow.d.ts +6 -4
- package/dist/components/MultiAgentAccelerator/AgentFlow.js +106 -185
- package/dist/components/MultiAgentAccelerator/AgentNode.d.ts +7 -5
- package/dist/components/MultiAgentAccelerator/AgentNode.js +93 -50
- package/dist/components/MultiAgentAccelerator/GraphLayouts.d.ts +20 -17
- package/dist/components/MultiAgentAccelerator/GraphLayouts.js +16 -14
- package/dist/components/MultiAgentAccelerator/MultiAgentAccelerator.d.ts +2 -3
- package/dist/components/MultiAgentAccelerator/MultiAgentAccelerator.js +214 -55
- package/dist/components/MultiAgentAccelerator/PlasmaEdge.d.ts +1 -1
- package/dist/components/MultiAgentAccelerator/PlasmaEdge.js +14 -12
- package/dist/components/MultiAgentAccelerator/Sidebar/AgentNetworkTreeItem.d.ts +15 -0
- package/dist/components/MultiAgentAccelerator/Sidebar/AgentNetworkTreeItem.js +104 -0
- package/dist/components/MultiAgentAccelerator/Sidebar/Sidebar.d.ts +17 -0
- package/dist/components/MultiAgentAccelerator/{Sidebar.js → Sidebar/Sidebar.js} +146 -59
- package/dist/components/MultiAgentAccelerator/Sidebar/TreeBuilder.d.ts +19 -0
- package/dist/components/MultiAgentAccelerator/Sidebar/TreeBuilder.js +113 -0
- package/dist/components/MultiAgentAccelerator/TemporaryNetworks.d.ts +26 -0
- package/dist/components/MultiAgentAccelerator/TemporaryNetworks.js +20 -0
- package/dist/components/MultiAgentAccelerator/ThoughtBubbleEdge.d.ts +10 -8
- package/dist/components/MultiAgentAccelerator/ThoughtBubbleEdge.js +1 -1
- package/dist/components/MultiAgentAccelerator/ThoughtBubbleOverlay.d.ts +3 -2
- package/dist/components/MultiAgentAccelerator/ThoughtBubbleOverlay.js +10 -13
- package/dist/components/MultiAgentAccelerator/const.d.ts +1 -3
- package/dist/components/MultiAgentAccelerator/const.js +4 -18
- package/dist/components/Settings/FadingCheckmark.d.ts +14 -0
- package/dist/components/Settings/FadingCheckmark.js +43 -0
- package/dist/components/Settings/SettingsDialog.d.ts +9 -0
- package/dist/components/Settings/SettingsDialog.js +265 -0
- package/dist/const.d.ts +1 -2
- package/dist/const.js +2 -3
- package/dist/controller/Types/AgentIconSuggestions.d.ts +4 -0
- package/dist/controller/Types/AgentIconSuggestions.js +1 -0
- package/dist/controller/Types/Branding.d.ts +12 -0
- package/dist/controller/Types/Branding.js +1 -0
- package/dist/controller/Types/NetworkIconSuggestions.d.ts +4 -0
- package/dist/controller/Types/NetworkIconSuggestions.js +1 -0
- package/dist/controller/agent/Agent.d.ts +32 -12
- package/dist/controller/agent/Agent.js +71 -19
- package/dist/controller/llm/LlmChat.d.ts +1 -1
- package/dist/controller/llm/LlmChat.js +2 -2
- package/dist/index.d.ts +10 -5
- package/dist/index.js +10 -5
- package/dist/state/{environment.d.ts → Environment.d.ts} +2 -0
- package/dist/state/{environment.js → Environment.js} +2 -0
- package/dist/state/Settings.d.ts +62 -0
- package/dist/state/Settings.js +62 -0
- package/dist/state/TemporaryNetworks.d.ts +32 -0
- package/dist/state/TemporaryNetworks.js +26 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/Authentication.d.ts +2 -2
- package/dist/utils/Authentication.js +6 -6
- package/dist/utils/text.d.ts +2 -2
- package/dist/utils/text.js +3 -5
- package/dist/utils/title.d.ts +1 -1
- package/dist/utils/title.js +2 -2
- package/dist/utils/useLocalStorage.d.ts +1 -1
- package/dist/utils/useLocalStorage.js +3 -3
- package/dist/utils/zIndexLayers.d.ts +1 -1
- package/dist/utils/zIndexLayers.js +3 -15
- package/package.json +23 -21
- package/dist/components/MultiAgentAccelerator/Sidebar.d.ts +0 -12
- package/dist/utils/Theme.d.ts +0 -7
- package/dist/utils/Theme.js +0 -7
- package/dist/utils/agentConversations.d.ts +0 -24
- package/dist/utils/agentConversations.js +0 -113
- /package/dist/components/Common/{confirmationModal.d.ts → ConfirmationModal.d.ts} +0 -0
|
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
// #endregion: Types
|
|
17
|
-
// Check if browser is Chrome (excluding Edge). Only Chrome (on
|
|
17
|
+
// Check if browser is Chrome (excluding Edge). Only Chrome (on macOS and Windows) has full support for
|
|
18
18
|
// SpeechRecognition. Also, tested that this will exclude Firefox and Safari.
|
|
19
19
|
const isChrome = () => /Chrome/u.test(navigator.userAgent) && !/Edge/u.test(navigator.userAgent) && !/Edg\//u.test(navigator.userAgent);
|
|
20
20
|
// Check browser/platform support
|
|
@@ -88,7 +88,7 @@ const handleRecognitionError = (setVoiceInputState) => (event) => {
|
|
|
88
88
|
}));
|
|
89
89
|
};
|
|
90
90
|
// Remove speech recognition event handlers and stop speech recognition
|
|
91
|
-
export
|
|
91
|
+
export const cleanupAndStopSpeechRecognition = (speechRecognitionRef, handlers) => {
|
|
92
92
|
const speechRecognition = speechRecognitionRef.current;
|
|
93
93
|
if (!speechRecognition || !handlers)
|
|
94
94
|
return;
|
|
@@ -103,8 +103,8 @@ export function cleanupAndStopSpeechRecognition(speechRecognitionRef, handlers)
|
|
|
103
103
|
console.warn("Error stopping speechRecognition:", error);
|
|
104
104
|
}
|
|
105
105
|
speechRecognitionRef.current = null;
|
|
106
|
-
}
|
|
107
|
-
export
|
|
106
|
+
};
|
|
107
|
+
export const setupSpeechRecognition = (setChatInput, setVoiceInputState, speechRecognitionRef) => {
|
|
108
108
|
const speechSupported = checkSpeechSupport();
|
|
109
109
|
if (speechSupported) {
|
|
110
110
|
const speechRecognition = new SpeechRecognition();
|
|
@@ -129,7 +129,7 @@ export function setupSpeechRecognition(setChatInput, setVoiceInputState, speechR
|
|
|
129
129
|
speechRecognitionRef.current = null;
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
132
|
-
}
|
|
132
|
+
};
|
|
133
133
|
// Request microphone permission
|
|
134
134
|
const requestMicrophonePermission = async () => {
|
|
135
135
|
if (!isChrome())
|
|
@@ -15,13 +15,13 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import ContactSupportIcon from "@mui/icons-material/ContactSupport";
|
|
18
|
-
import { useColorScheme, useTheme } from "@mui/material";
|
|
19
18
|
import Box from "@mui/material/Box";
|
|
20
19
|
import Grow from "@mui/material/Grow";
|
|
20
|
+
import { useColorScheme, useTheme } from "@mui/material/styles";
|
|
21
21
|
import { useState } from "react";
|
|
22
22
|
import { CHATBOT_ENDPOINT } from "../../controller/llm/endpoints.js";
|
|
23
|
+
import { isDarkMode } from "../../Theme/Theme.js";
|
|
23
24
|
import { useAuthentication } from "../../utils/Authentication.js";
|
|
24
|
-
import { isDarkMode } from "../../utils/Theme.js";
|
|
25
25
|
import { getZIndex } from "../../utils/zIndexLayers.js";
|
|
26
26
|
import { ChatCommon } from "../AgentChat/ChatCommon.js";
|
|
27
27
|
import { LegacyAgentType } from "../AgentChat/Types.js";
|
|
@@ -15,9 +15,9 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
|
18
|
-
import { Typography } from "@mui/material";
|
|
19
18
|
import Breadcrumbs from "@mui/material/Breadcrumbs";
|
|
20
19
|
import Grid from "@mui/material/Grid";
|
|
20
|
+
import Typography from "@mui/material/Typography";
|
|
21
21
|
import startCase from "lodash-es/startCase.js";
|
|
22
22
|
export const NeuroAIBreadcrumbs = ({ pathname }) => {
|
|
23
23
|
const urlPaths = pathname?.split("/").filter((path) => path !== "");
|
|
@@ -14,9 +14,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
14
14
|
See the License for the specific language governing permissions and
|
|
15
15
|
limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { styled } from "@mui/material";
|
|
18
17
|
import Box from "@mui/material/Box";
|
|
19
18
|
import Button from "@mui/material/Button";
|
|
19
|
+
import { styled } from "@mui/material/styles";
|
|
20
20
|
import { useState } from "react";
|
|
21
21
|
import { MUIDialog } from "./MUIDialog.js";
|
|
22
22
|
// #region: Styled Components
|
|
@@ -24,9 +24,6 @@ const StyledButton = styled(Button)({
|
|
|
24
24
|
fontSize: "0.8em",
|
|
25
25
|
padding: "0px 7px",
|
|
26
26
|
});
|
|
27
|
-
const StyledOKButton = styled(StyledButton)(({ disabled }) => ({
|
|
28
|
-
backgroundColor: disabled ? "rgba(0, 0, 0, 0.12) !important" : "var(--bs-primary) !important",
|
|
29
|
-
}));
|
|
30
27
|
// #endregion: Types
|
|
31
28
|
export const ConfirmationModal = ({ cancelBtnLabel, closeable = true, content = "", handleCancel = null, handleOk = null, id = "", maskCloseable = false, okBtnLabel, title = "", }) => {
|
|
32
29
|
const [modalOpen, setModalOpen] = useState(true);
|
|
@@ -56,7 +53,7 @@ export const ConfirmationModal = ({ cancelBtnLabel, closeable = true, content =
|
|
|
56
53
|
// This ID needs to be dynamic because there can be several instances of this on the page
|
|
57
54
|
, {
|
|
58
55
|
// This ID needs to be dynamic because there can be several instances of this on the page
|
|
59
|
-
id: `${id}-confirm-cancel-btn`, onClick: () => handleCloseWrapper(), disabled: isLoading, variant: "outlined", children: cancelBtnLabel ?? "Cancel" }, "confirm-cancel")), _jsx(
|
|
56
|
+
id: `${id}-confirm-cancel-btn`, onClick: () => handleCloseWrapper(), disabled: isLoading, variant: "outlined", children: cancelBtnLabel ?? "Cancel" }, "confirm-cancel")), _jsx(StyledButton
|
|
60
57
|
// This ID needs to be dynamic because there can be several instances of this on the page
|
|
61
58
|
, {
|
|
62
59
|
// This ID needs to be dynamic because there can be several instances of this on the page
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC, ReactElement } from "react";
|
|
2
|
+
interface CustomerLogoProps {
|
|
3
|
+
readonly fallbackElement?: ReactElement | string;
|
|
4
|
+
readonly logoServiceToken?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Returns a JSX element for the Cognizant logo, wrapped in a link to the Cognizant website.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getCognizantLogoImage: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* Component to display the customer's logo based on the settings.
|
|
12
|
+
* @param logoServiceToken - Optional token for fetching the logo from logo.dev
|
|
13
|
+
* @returns JSX element representing the customer's logo, MUI icon, or Cognizant fallback, or null if no logo
|
|
14
|
+
* should be displayed or if the logo.dev token is missing/invalid.
|
|
15
|
+
*/
|
|
16
|
+
export declare const CustomerLogo: FC<CustomerLogoProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Have to suppress this lint error to allow dynamic access of MUI icons
|
|
3
|
+
// eslint-disable-next-line no-restricted-imports
|
|
4
|
+
import * as MuiIcons from "@mui/icons-material";
|
|
5
|
+
import { useSettingsStore } from "../../state/Settings.js";
|
|
6
|
+
/**
|
|
7
|
+
* Returns a JSX element for the Cognizant logo, wrapped in a link to the Cognizant website.
|
|
8
|
+
*/
|
|
9
|
+
export const getCognizantLogoImage = () => (_jsx("a", { id: "splash-logo-link", href: "https://www.cognizant.com/us/en", style: {
|
|
10
|
+
display: "flex",
|
|
11
|
+
paddingLeft: "0.15rem",
|
|
12
|
+
}, target: "_blank", rel: "noopener noreferrer", children: _jsx("img", { id: "logo-img", width: "200", height: "45", src: "/cognizant-logo-white.svg", alt: "Cognizant Logo" }) }));
|
|
13
|
+
/**
|
|
14
|
+
* Component to display the customer's logo based on the settings.
|
|
15
|
+
* @param logoServiceToken - Optional token for fetching the logo from logo.dev
|
|
16
|
+
* @returns JSX element representing the customer's logo, MUI icon, or Cognizant fallback, or null if no logo
|
|
17
|
+
* should be displayed or if the logo.dev token is missing/invalid.
|
|
18
|
+
*/
|
|
19
|
+
export const CustomerLogo = ({ fallbackElement, logoServiceToken }) => {
|
|
20
|
+
const customer = useSettingsStore((state) => state.settings.branding.customer);
|
|
21
|
+
const iconSuggestion = useSettingsStore((state) => state.settings.branding.iconSuggestion);
|
|
22
|
+
const logoSource = useSettingsStore((state) => state.settings.branding.logoSource);
|
|
23
|
+
// null: render Cognizant logo (default)
|
|
24
|
+
if (logoSource === null) {
|
|
25
|
+
return getCognizantLogoImage();
|
|
26
|
+
}
|
|
27
|
+
// "none": explicitly render no logo
|
|
28
|
+
if (logoSource === "none") {
|
|
29
|
+
return fallbackElement;
|
|
30
|
+
}
|
|
31
|
+
// "generic": try MUI icon, then Cognizant fallback
|
|
32
|
+
if (logoSource === "generic") {
|
|
33
|
+
const MuiIcon = MuiIcons[iconSuggestion];
|
|
34
|
+
if (MuiIcon) {
|
|
35
|
+
return _jsx(MuiIcon, { sx: { fontSize: "2rem" } });
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
console.warn(`Icon "${iconSuggestion}" not found in MUI icons. Falling back to default.`);
|
|
39
|
+
return fallbackElement;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// "auto": use logo.dev service
|
|
43
|
+
const logoUrl = logoServiceToken && customer?.trim().length > 0
|
|
44
|
+
? `https://img.logo.dev/name/${encodeURIComponent(customer)}?token=${logoServiceToken}&theme=light&format=png&size=75`
|
|
45
|
+
: null;
|
|
46
|
+
return logoUrl ? (
|
|
47
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
48
|
+
_jsx("img", { src: logoUrl, alt: `${customer} Logo`, width: 40, height: 40, style: { borderRadius: "50%" } })) : (fallbackElement);
|
|
49
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SxProps } from "@mui/material/styles";
|
|
2
|
+
import { FC } from "react";
|
|
3
|
+
interface FooterProps {
|
|
4
|
+
readonly logoUrl: string;
|
|
5
|
+
readonly logoLinkUrl: string;
|
|
6
|
+
readonly supportEmailAddress: string;
|
|
7
|
+
readonly sx?: SxProps;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Footer for all pages, contains additional links and contact information
|
|
11
|
+
*
|
|
12
|
+
* @param logoLinkUrl - The URL that the logo will link to when clicked
|
|
13
|
+
* @param logoUrl - The URL of the logo image to be displayed in the footer. Can be a local or external URL.
|
|
14
|
+
* @param supportEmailAddress - The email address that will be used in the Contact Us link
|
|
15
|
+
* @param sx - Optional MUI sx prop for additional styling overrides
|
|
16
|
+
*/
|
|
17
|
+
export declare const Footer: FC<FooterProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { styled } from "@mui/material/styles";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { ConfirmationModal } from "./ConfirmationModal.js";
|
|
5
|
+
import { getContactUsConfirmationText } from "../../const.js";
|
|
6
|
+
import { navigateToUrl } from "../../utils/BrowserNavigation.js";
|
|
7
|
+
const HeaderLine = styled("h6")({
|
|
8
|
+
fontWeight: "bold",
|
|
9
|
+
fontSize: "smaller",
|
|
10
|
+
});
|
|
11
|
+
const LinkDivider = styled("div")({
|
|
12
|
+
border: "1px solid var(--bs-accent3-medium)",
|
|
13
|
+
marginBottom: "0.5rem",
|
|
14
|
+
width: "2.4rem",
|
|
15
|
+
});
|
|
16
|
+
const FooterSectionHeader = styled("div")({
|
|
17
|
+
display: "inline-flex",
|
|
18
|
+
flexDirection: "column",
|
|
19
|
+
marginTop: "0.1rem",
|
|
20
|
+
});
|
|
21
|
+
const FooterItemLink = styled("a")(({ theme }) => ({
|
|
22
|
+
color: theme.palette.grey[500],
|
|
23
|
+
display: "block",
|
|
24
|
+
marginBottom: "0.37rem",
|
|
25
|
+
width: "fit-content",
|
|
26
|
+
fontSize: "smaller",
|
|
27
|
+
"&:hover": {
|
|
28
|
+
color: theme.palette.text.primary,
|
|
29
|
+
},
|
|
30
|
+
}));
|
|
31
|
+
const FooterContainer = styled("footer")({
|
|
32
|
+
backgroundColor: "var(--bs-primary)",
|
|
33
|
+
borderTop: "var(--bs-border-width) var(--bs-border-style) var(--bs-gray-lighter)",
|
|
34
|
+
columnGap: "60px",
|
|
35
|
+
display: "flex",
|
|
36
|
+
justifyContent: "center",
|
|
37
|
+
marginTop: "1rem",
|
|
38
|
+
paddingTop: "2rem",
|
|
39
|
+
paddingBottom: "1rem",
|
|
40
|
+
width: "100%",
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* Footer for all pages, contains additional links and contact information
|
|
44
|
+
*
|
|
45
|
+
* @param logoLinkUrl - The URL that the logo will link to when clicked
|
|
46
|
+
* @param logoUrl - The URL of the logo image to be displayed in the footer. Can be a local or external URL.
|
|
47
|
+
* @param supportEmailAddress - The email address that will be used in the Contact Us link
|
|
48
|
+
* @param sx - Optional MUI sx prop for additional styling overrides
|
|
49
|
+
*/
|
|
50
|
+
export const Footer = ({ logoLinkUrl, logoUrl, supportEmailAddress, sx }) => {
|
|
51
|
+
// For email dialog
|
|
52
|
+
const [emailDialogOpen, setEmailDialogOpen] = useState(false);
|
|
53
|
+
return (_jsxs(_Fragment, { children: [emailDialogOpen && (_jsx(ConfirmationModal, { content: getContactUsConfirmationText(supportEmailAddress), handleCancel: () => {
|
|
54
|
+
setEmailDialogOpen(false);
|
|
55
|
+
}, handleOk: () => {
|
|
56
|
+
navigateToUrl(`mailto:${supportEmailAddress}`);
|
|
57
|
+
setEmailDialogOpen(false);
|
|
58
|
+
}, id: "email-dialog", title: "Contact Us" })), _jsxs(FooterContainer, { id: "additional-links-container", sx: sx, children: [_jsx("a", { href: logoLinkUrl, target: "_blank", rel: "noopener noreferrer", children: _jsx("img", { id: "logo-img", width: 200, height: 45, src: logoUrl, alt: "Cognizant Logo" }) }), _jsxs(FooterSectionHeader, { id: "team-links", children: [_jsx(HeaderLine, { id: "additional-links-header", children: "Team" }), _jsx(LinkDivider, { id: "additional-links-divider" }), _jsx(FooterItemLink, { id: "learn-more-link", href: "https://www.cognizant.com/us/en/services/ai/ai-lab", target: "_blank", rel: "noopener noreferrer", children: "About" }), _jsx(FooterItemLink, { id: "contact-us-footer-link", href: null, onClick: () => setEmailDialogOpen(true), rel: "noopener noreferrer", sx: { cursor: "pointer" }, children: "Contact Us" })] }), _jsxs(FooterSectionHeader, { id: "services-links", children: [_jsx(HeaderLine, { id: "additional-links-header", children: "Services" }), _jsx(LinkDivider, {}), _jsx(FooterItemLink, { id: "ai-innovation-studios-link", href: "https://portal-innovationstudio-apps-prod-we-001.azurewebsites.net/", target: "_blank", rel: "noopener noreferrer", children: "AI Innovation Studios" }), _jsx(FooterItemLink, { id: "neuro-it-ops-link", href: "https://www.cognizant.com/us/en/services/neuro-intelligent-automation/neuro-ai-it-operations", target: "_blank", rel: "noopener noreferrer", children: "Neuro IT Ops" }), _jsx(FooterItemLink, { id: "flowsource-link", href: "https://www.cognizant.com/us/en/services/software-engineering-services/flowsource", target: "_blank", rel: "noopener noreferrer", children: "Flowsource" }), _jsx(FooterItemLink, { id: "skygrade-link", href: "https://www.cognizant.com/us/en/services/cloud-solutions/cognizant-skygrade", target: "_blank", rel: "noopener noreferrer", children: "Skygrade" }), _jsx(FooterItemLink, { id: "cdit-link", href: "https://cditoolkit.cognizant.com/cditlive2.0/", target: "_blank", rel: "noopener noreferrer", children: "Cognizant Ignition" })] }), _jsxs(FooterSectionHeader, { children: [_jsx(HeaderLine, { children: "Other" }), _jsx(LinkDivider, {}), _jsx(FooterItemLink, { id: "learn-more-link", href: "https://logo.dev", target: "_blank", rel: "noreferrer", children: "Logos provided by Logo.dev" })] })] })] }));
|
|
59
|
+
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
type LLMChatGroupConfigBtnProps = {
|
|
2
2
|
enabled?: boolean;
|
|
3
3
|
posRight?: number;
|
|
4
|
-
posBottom?: number;
|
|
5
4
|
};
|
|
6
|
-
export declare const LlmChatOptionsButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<
|
|
7
|
-
ref?: import("react").Ref<HTMLButtonElement>;
|
|
8
|
-
}, "className" | "style" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "href" | "color" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "loading" | "loadingIndicator" | "loadingPosition" | "size" | "startIcon" | "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & LLMChatGroupConfigBtnProps, {}, {}>;
|
|
5
|
+
export declare const LlmChatOptionsButton: import("@emotion/styled").StyledComponent<import("@mui/material/Button").ButtonOwnProps & Omit<import("@mui/material/ButtonBase").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "className" | "style" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "href" | "color" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "loading" | "loadingIndicator" | "loadingPosition" | "size" | "startIcon" | "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & LLMChatGroupConfigBtnProps, {}, {}>;
|
|
9
6
|
export {};
|
|
@@ -13,18 +13,18 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { styled } from "@mui/material";
|
|
17
16
|
import Button from "@mui/material/Button";
|
|
17
|
+
import { styled } from "@mui/material/styles";
|
|
18
18
|
import { getZIndex } from "../../utils/zIndexLayers.js";
|
|
19
19
|
export const LlmChatOptionsButton = styled(Button, {
|
|
20
20
|
shouldForwardProp: (prop) => prop !== "enabled" && prop !== "posRight" && prop !== "posBottom",
|
|
21
|
-
})(({ enabled, posRight }) => ({
|
|
21
|
+
})(({ theme, enabled, posRight }) => ({
|
|
22
22
|
position: "absolute",
|
|
23
23
|
top: 10,
|
|
24
24
|
right: posRight || null,
|
|
25
25
|
zIndex: getZIndex(1, null), // Seems to only be needed on Analytics Chat, but apply to all.
|
|
26
|
-
background: `${enabled ?
|
|
27
|
-
borderColor: `${enabled ?
|
|
26
|
+
background: `${enabled ? theme.palette.primary.main : theme.palette.grey[600]} !important`,
|
|
27
|
+
borderColor: `${enabled ? theme.palette.primary.main : theme.palette.grey[600]} !important`,
|
|
28
28
|
borderRadius: "var(--bs-border-radius)",
|
|
29
29
|
width: "30px",
|
|
30
30
|
height: "30px",
|
|
@@ -20,5 +20,5 @@ import CircularProgress from "@mui/material/CircularProgress";
|
|
|
20
20
|
* @param id The id for the spinner and text elements, for testing
|
|
21
21
|
*/
|
|
22
22
|
export const LoadingSpinner = ({ id }) => {
|
|
23
|
-
return (_jsxs("h3", { id: id, children: [_jsx(CircularProgress, { id: `${id}-spinner`,
|
|
23
|
+
return (_jsxs("h3", { id: id, children: [_jsx(CircularProgress, { id: `${id}-spinner`, size: 35 }), _jsx("span", { id: `${id}-loading-text`, style: { marginLeft: "1em" }, children: "Loading..." })] }));
|
|
24
24
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { SxProps } from "@mui/material";
|
|
1
|
+
import { SxProps } from "@mui/material/styles";
|
|
2
2
|
import { FC, ReactNode } from "react";
|
|
3
3
|
interface MUIAccordionItem {
|
|
4
4
|
content: ReactNode;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
title: ReactNode;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
interface MUIAccordionProps {
|
|
9
9
|
arrowPosition?: "left" | "right";
|
|
10
10
|
defaultExpandedPanelKey?: number;
|
|
11
11
|
expandOnlyOnePanel?: boolean;
|
|
@@ -15,13 +15,12 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import ArrowForwardIosSharpIcon from "@mui/icons-material/ArrowForwardIosSharp";
|
|
18
|
-
import { styled, useColorScheme } from "@mui/material";
|
|
19
18
|
import MuiAccordion from "@mui/material/Accordion";
|
|
20
19
|
import MuiAccordionDetails from "@mui/material/AccordionDetails";
|
|
21
20
|
import MuiAccordionSummary, { accordionSummaryClasses } from "@mui/material/AccordionSummary";
|
|
21
|
+
import { styled } from "@mui/material/styles";
|
|
22
22
|
import Typography from "@mui/material/Typography";
|
|
23
23
|
import { useCallback, useState } from "react";
|
|
24
|
-
import { isDarkMode } from "../../utils/Theme.js";
|
|
25
24
|
// #region: Styled Components
|
|
26
25
|
const Accordion = styled((props) => (_jsx(MuiAccordion, { disableGutters: true, elevation: 0, id: "mui-accordion", ...props })))(({ theme }) => ({
|
|
27
26
|
border: `1px solid ${theme.palette.divider}`,
|
|
@@ -43,9 +42,6 @@ const AccordionDetails = styled(MuiAccordionDetails)(({ theme }) => ({
|
|
|
43
42
|
}));
|
|
44
43
|
// #endregion: Types
|
|
45
44
|
export const MUIAccordion = ({ arrowPosition = "left", defaultExpandedPanelKey, expandOnlyOnePanel = false, id, items, sx, }) => {
|
|
46
|
-
// Dark mode
|
|
47
|
-
const { mode, systemMode } = useColorScheme();
|
|
48
|
-
const darkMode = isDarkMode(mode, systemMode);
|
|
49
45
|
const [expandedList, setExpandedList] = useState(defaultExpandedPanelKey ? [defaultExpandedPanelKey] : []);
|
|
50
46
|
const handleChange = useCallback((panelKey) => (_event, newExpanded) => {
|
|
51
47
|
setExpandedList((prevExpandedList) => {
|
|
@@ -64,13 +60,7 @@ export const MUIAccordion = ({ arrowPosition = "left", defaultExpandedPanelKey,
|
|
|
64
60
|
const panelKey = index + 1; // Start with index 1
|
|
65
61
|
const baseIdAndPanelKey = `${id}-${panelKey}`;
|
|
66
62
|
return (_jsxs(Accordion, { disabled: disabled, expanded: isExpanded(panelKey), id: `${baseIdAndPanelKey}-accordion`, onChange: handleChange(panelKey), sx: sx, children: [_jsx(AccordionSummary, { "aria-controls": `${baseIdAndPanelKey}-summary`, id: `${baseIdAndPanelKey}-summary`, sx: {
|
|
67
|
-
backgroundColor: darkMode ? "var(--bs-dark-mode-dim)" : "var(--bs-gray-background)",
|
|
68
|
-
color: darkMode ? "var(--bs-white)" : "var(--bs-primary)",
|
|
69
63
|
flexDirection: arrowPosition === "left" ? "row-reverse" : undefined,
|
|
70
|
-
}, children: _jsx(Typography, { component: "span", id: `${baseIdAndPanelKey}-summary-typography`, sx: { fontSize: "0.9rem" }, children: title }) }), _jsx(AccordionDetails, { id: `${baseIdAndPanelKey}-details`, sx: {
|
|
71
|
-
backgroundColor: darkMode ? "var(--bs-dark-mode-dim)" : "rgba(0, 0, 0, 0.02)",
|
|
72
|
-
borderColor: darkMode ? "var(--bs-white)" : "var(--bs-border-color)",
|
|
73
|
-
color: darkMode ? "var(--bs-white)" : "var(--bs-primary)",
|
|
74
|
-
}, children: _jsx(Typography, { component: "span", id: `${baseIdAndPanelKey}-details-typography`, sx: { fontSize: "0.85rem" }, children: content }) })] }, `${baseIdAndPanelKey}-accordion`));
|
|
64
|
+
}, children: _jsx(Typography, { component: "span", id: `${baseIdAndPanelKey}-summary-typography`, sx: { fontSize: "0.9rem" }, children: title }) }), _jsx(AccordionDetails, { id: `${baseIdAndPanelKey}-details`, children: _jsx(Typography, { component: "span", id: `${baseIdAndPanelKey}-details-typography`, sx: { fontSize: "0.85rem" }, children: content }) })] }, `${baseIdAndPanelKey}-accordion`));
|
|
75
65
|
}) }));
|
|
76
66
|
};
|
|
@@ -15,7 +15,10 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import CloseIcon from "@mui/icons-material/Close";
|
|
18
|
-
import
|
|
18
|
+
import Alert from "@mui/material/Alert";
|
|
19
|
+
import Collapse from "@mui/material/Collapse";
|
|
20
|
+
import IconButton from "@mui/material/IconButton";
|
|
21
|
+
import { styled } from "@mui/material/styles";
|
|
19
22
|
import { useState } from "react";
|
|
20
23
|
// #region: Styled Components
|
|
21
24
|
const StyledAlert = styled(Alert)({
|
|
@@ -15,12 +15,12 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import CloseIcon from "@mui/icons-material/Close";
|
|
18
|
-
import { styled } from "@mui/material";
|
|
19
18
|
import Dialog from "@mui/material/Dialog";
|
|
20
19
|
import DialogActions from "@mui/material/DialogActions";
|
|
21
20
|
import DialogContent from "@mui/material/DialogContent";
|
|
22
21
|
import DialogTitle from "@mui/material/DialogTitle";
|
|
23
22
|
import IconButton from "@mui/material/IconButton";
|
|
23
|
+
import { styled } from "@mui/material/styles";
|
|
24
24
|
// #region: Styled Components
|
|
25
25
|
const StyledDialogTitle = styled(DialogTitle)({
|
|
26
26
|
fontSize: "1rem",
|
|
@@ -11,5 +11,7 @@ export interface NavbarProps {
|
|
|
11
11
|
readonly authenticationType: string;
|
|
12
12
|
readonly signOut: () => void;
|
|
13
13
|
readonly supportEmailAddress: string;
|
|
14
|
+
readonly logoServiceToken?: string;
|
|
15
|
+
readonly showSettingsButton?: boolean;
|
|
14
16
|
}
|
|
15
|
-
export declare const Navbar: ({ authenticationType, id, logo, pathname, query, signOut, supportEmailAddress, userInfo, }: NavbarProps) => ReactJSX.Element;
|
|
17
|
+
export declare const Navbar: ({ authenticationType, id, logo, logoServiceToken, pathname, query, showSettingsButton, signOut, supportEmailAddress, userInfo, }: NavbarProps) => ReactJSX.Element;
|
|
@@ -19,14 +19,24 @@ limitations under the License.
|
|
|
19
19
|
*/
|
|
20
20
|
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
|
|
21
21
|
import DarkModeIcon from "@mui/icons-material/DarkMode";
|
|
22
|
-
import
|
|
22
|
+
import SettingsIcon from "@mui/icons-material/Settings";
|
|
23
|
+
import Box from "@mui/material/Box";
|
|
23
24
|
import Grid from "@mui/material/Grid";
|
|
25
|
+
import IconButton from "@mui/material/IconButton";
|
|
26
|
+
import Menu from "@mui/material/Menu";
|
|
27
|
+
import MenuItem from "@mui/material/MenuItem";
|
|
28
|
+
import { useColorScheme } from "@mui/material/styles";
|
|
29
|
+
import Tooltip from "@mui/material/Tooltip";
|
|
30
|
+
import Typography from "@mui/material/Typography";
|
|
24
31
|
import { useEffect, useState } from "react";
|
|
25
|
-
import { ConfirmationModal } from "./
|
|
32
|
+
import { ConfirmationModal } from "./ConfirmationModal.js";
|
|
33
|
+
import { CustomerLogo, getCognizantLogoImage } from "./CustomerLogo.js";
|
|
26
34
|
import { LoadingSpinner } from "./LoadingSpinner.js";
|
|
27
|
-
import { authenticationEnabled,
|
|
35
|
+
import { authenticationEnabled, DEFAULT_USER_IMAGE, getContactUsConfirmationText, NEURO_SAN_UI_VERSION, } from "../../const.js";
|
|
36
|
+
import { useSettingsStore } from "../../state/Settings.js";
|
|
37
|
+
import { isDarkMode } from "../../Theme/Theme.js";
|
|
28
38
|
import { navigateToUrl } from "../../utils/BrowserNavigation.js";
|
|
29
|
-
import {
|
|
39
|
+
import { SettingsDialog } from "../Settings/SettingsDialog.js";
|
|
30
40
|
const MENU_ITEM_TEXT_PROPS = {
|
|
31
41
|
color: "var(--bs-white)",
|
|
32
42
|
backgroundColor: "var(--bs-primary)",
|
|
@@ -42,7 +52,7 @@ const DISABLE_OUTLINE_PROPS = {
|
|
|
42
52
|
outline: "none",
|
|
43
53
|
},
|
|
44
54
|
};
|
|
45
|
-
export const Navbar = ({ authenticationType, id, logo, pathname, query, signOut, supportEmailAddress, userInfo, }) => {
|
|
55
|
+
export const Navbar = ({ authenticationType, id, logo, logoServiceToken, pathname, query, showSettingsButton = true, signOut, supportEmailAddress, userInfo, }) => {
|
|
46
56
|
// For email dialog
|
|
47
57
|
const [emailDialogOpen, setEmailDialogOpen] = useState(false);
|
|
48
58
|
// Dark mode
|
|
@@ -72,34 +82,40 @@ export const Navbar = ({ authenticationType, id, logo, pathname, query, signOut,
|
|
|
72
82
|
const handleCloseExploreMenu = () => {
|
|
73
83
|
setExploreMenuAnchorEl(null);
|
|
74
84
|
};
|
|
85
|
+
// Settings dialog state
|
|
86
|
+
const [settingsDialogOpen, setSettingsDialogOpen] = useState(false);
|
|
87
|
+
// Customer for branding
|
|
88
|
+
const customer = useSettingsStore((state) => state.settings.branding.customer);
|
|
89
|
+
const primary = useSettingsStore((state) => state.settings.branding.primary);
|
|
75
90
|
return hydrated ? (_jsxs(Grid, { id: "nav-bar-container", container: true, alignItems: "center", sx: {
|
|
76
91
|
...MENU_ITEM_TEXT_PROPS,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
fontWeight:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
padding: "0.5rem",
|
|
93
|
+
}, children: [settingsDialogOpen && (_jsx(SettingsDialog, { id: "settings-dialog", isOpen: settingsDialogOpen, logoServiceToken: logoServiceToken, onClose: () => setSettingsDialogOpen(false) })), _jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 2 }, children: [_jsx(CustomerLogo, { logoServiceToken: logoServiceToken }), _jsx(Typography, { id: "customer-branding", sx: {
|
|
94
|
+
fontSize: "20px",
|
|
95
|
+
fontWeight: "600",
|
|
96
|
+
paddingLeft: "0.15rem",
|
|
97
|
+
width: "200px",
|
|
98
|
+
display: "flex",
|
|
99
|
+
alignItems: "center",
|
|
100
|
+
}, children: customer })] }), _jsxs(Grid, { id: id, sx: { display: "flex", alignItems: "center" }, children: [customer ? getCognizantLogoImage() : null, _jsx(Typography, { id: "nav-bar-brand", sx: {
|
|
101
|
+
...MENU_ITEM_TEXT_PROPS,
|
|
102
|
+
marginLeft: "0.85rem",
|
|
103
|
+
fontSize: "16px",
|
|
104
|
+
fontWeight: "bold",
|
|
105
|
+
}, children: _jsxs("a", { id: "navbar-brand-link", style: {
|
|
106
|
+
fontWeight: 500,
|
|
107
|
+
fontSize: "1.1rem",
|
|
108
|
+
color: "var(--bs-white)",
|
|
109
|
+
position: "relative",
|
|
110
|
+
bottom: "1px",
|
|
111
|
+
textDecoration: "none",
|
|
112
|
+
}, href: Object.keys(query || {}).length > 0
|
|
113
|
+
? `/?${new URLSearchParams(query).toString()}`
|
|
114
|
+
: "/", children: [logo, " ", pathname === "/multiAgentAccelerator" ? "Multi-Agent Accelerator" : "Decisioning"] }) })] }), _jsx(Grid, { id: "build", sx: {
|
|
98
115
|
flex: 1, // Take available space
|
|
99
116
|
display: "flex",
|
|
100
117
|
justifyContent: "flex-end", // Right align
|
|
101
118
|
alignItems: "center", // Vertically center
|
|
102
|
-
color: "var(--bs-white)",
|
|
103
119
|
marginRight: "50px",
|
|
104
120
|
}, children: _jsxs(Typography, { id: "build-text", sx: { ...MENU_ITEM_TEXT_PROPS }, children: ["Build: ", _jsx("strong", { id: "build-strong", children: NEURO_SAN_UI_VERSION })] }) }), _jsxs(Grid, { id: "explore-dropdown", sx: { cursor: "pointer", marginRight: "30px" }, children: [_jsxs(Typography, { id: "explore-toggle", sx: {
|
|
105
121
|
...MENU_ITEM_TEXT_PROPS,
|
|
@@ -107,31 +123,40 @@ export const Navbar = ({ authenticationType, id, logo, pathname, query, signOut,
|
|
|
107
123
|
alignItems: "center",
|
|
108
124
|
}, onClick: (event) => {
|
|
109
125
|
setExploreMenuAnchorEl(event.currentTarget);
|
|
110
|
-
}, children: ["Explore", _jsx(ArrowDropDownIcon, { id: "nav-explore-dropdown-arrow", sx: { color: "var(--bs-white)", fontSize: 22 } })] }), _jsxs(Menu, { id: "explore-menu", anchorEl: exploreMenuAnchorEl, open: exploreMenuOpen, onClose: handleCloseExploreMenu, children: [_jsx(MenuItem, { id: "explore-neuro-san-studio", component: "a", href: "https://github.com/cognizant-ai-lab/neuro-san-studio", target: "_blank", sx: { ...DISABLE_OUTLINE_PROPS }, children: "Neuro-san studio (examples)" }, "explore-neuro-san-studio"), _jsx(MenuItem, { id: "explore-neuro-san", component: "a", href: "https://github.com/cognizant-ai-lab/neuro-san", target: "_blank", sx: { ...DISABLE_OUTLINE_PROPS }, children: "Neuro-san (core)" }, "explore-neuro-san")] })] }), _jsxs(Grid, { id: "help-dropdown", sx: { cursor: "pointer", marginRight: "30px" }, children: [_jsxs(Typography, { id: "help-toggle", sx: {
|
|
126
|
+
}, children: ["Explore", _jsx(ArrowDropDownIcon, { id: "nav-explore-dropdown-arrow", sx: { color: primary || "var(--bs-white)", fontSize: 22 } })] }), _jsxs(Menu, { id: "explore-menu", anchorEl: exploreMenuAnchorEl, open: exploreMenuOpen, onClose: handleCloseExploreMenu, children: [_jsx(MenuItem, { id: "explore-neuro-san-studio", component: "a", href: "https://github.com/cognizant-ai-lab/neuro-san-studio", target: "_blank", sx: { ...DISABLE_OUTLINE_PROPS }, children: "Neuro-san studio (examples)" }, "explore-neuro-san-studio"), _jsx(MenuItem, { id: "explore-neuro-san", component: "a", href: "https://github.com/cognizant-ai-lab/neuro-san", target: "_blank", sx: { ...DISABLE_OUTLINE_PROPS }, children: "Neuro-san (core)" }, "explore-neuro-san")] })] }), _jsxs(Grid, { id: "help-dropdown", sx: { cursor: "pointer", marginRight: "30px" }, children: [_jsxs(Typography, { id: "help-toggle", sx: {
|
|
111
127
|
...MENU_ITEM_TEXT_PROPS,
|
|
112
128
|
display: "flex",
|
|
113
129
|
alignItems: "center",
|
|
114
130
|
}, onClick: (event) => {
|
|
115
131
|
setHelpMenuAnchorEl(event.currentTarget);
|
|
116
|
-
}, children: ["Help", _jsx(ArrowDropDownIcon, { id: "nav-help-dropdown-arrow", sx: { color: "var(--bs-white)", fontSize: 22 } })] }), _jsxs(Menu, { id: "help-menu", anchorEl: helpMenuAnchorEl, open: helpMenuOpen, onClose: handleCloseHelpMenu, children: [_jsx(MenuItem, { id: "user-guide", component: "a", href: "/userguide", target: "_blank", sx: { ...DISABLE_OUTLINE_PROPS }, children: "User guide" }, "user-guide"), _jsx(MenuItem, { href: null, id: "contact-us-help", onClick: () => setEmailDialogOpen(true), children: "Contact Us" }, "contact-us-help")] })] }), emailDialogOpen ? (_jsx(ConfirmationModal, { id: "email-dialog", content:
|
|
132
|
+
}, children: ["Help", _jsx(ArrowDropDownIcon, { id: "nav-help-dropdown-arrow", sx: { color: primary || "var(--bs-white)", fontSize: 22 } })] }), _jsxs(Menu, { id: "help-menu", anchorEl: helpMenuAnchorEl, open: helpMenuOpen, onClose: handleCloseHelpMenu, children: [_jsx(MenuItem, { id: "user-guide", component: "a", href: "/userguide", target: "_blank", sx: { ...DISABLE_OUTLINE_PROPS }, children: "User guide" }, "user-guide"), _jsx(MenuItem, { href: null, id: "contact-us-help", onClick: () => setEmailDialogOpen(true), children: "Contact Us" }, "contact-us-help")] })] }), emailDialogOpen ? (_jsx(ConfirmationModal, { id: "email-dialog", content: getContactUsConfirmationText(supportEmailAddress), handleCancel: () => {
|
|
117
133
|
setEmailDialogOpen(false);
|
|
118
134
|
}, handleOk: () => {
|
|
119
135
|
navigateToUrl(`mailto:${supportEmailAddress}`);
|
|
120
136
|
setEmailDialogOpen(false);
|
|
121
|
-
}, title:
|
|
137
|
+
}, title: "Contact Us" })) : null, userInfo ? (_jsxs(Grid, { id: "user-dropdown", children: [_jsxs(IconButton, { "aria-label": "User dropdown toggle", id: "user-dropdown-toggle", onClick: (event) => {
|
|
122
138
|
setUserMenuAnchorEl(event.currentTarget);
|
|
123
139
|
}, sx: {
|
|
124
140
|
...MENU_ITEM_TEXT_PROPS,
|
|
125
|
-
}, children: [_jsx("img", { id: "user-image", src: userInfo.image || DEFAULT_USER_IMAGE, width: 30, height: 30, title: userInfo.name, alt: "" }), _jsx(ArrowDropDownIcon, { id: "nav-user-dropdown-arrow", sx: { color: "var(--bs-white)", fontSize: 22 } })] }), _jsxs(Menu, { id: "user-menu", anchorEl: userMenuAnchorEl, open: userMenuOpen, onClose: handleCloseUserMenu, children: [_jsx(MenuItem, { id: "user-signed-in-as", disabled: true, sx: { fontWeight: "bold" }, children: "Signed in as" }), _jsx(MenuItem, { id: "user-name", disabled: true, sx: {
|
|
141
|
+
}, children: [_jsx("img", { id: "user-image", src: userInfo.image || DEFAULT_USER_IMAGE, width: 30, height: 30, title: userInfo.name, alt: "" }), _jsx(ArrowDropDownIcon, { id: "nav-user-dropdown-arrow", sx: { color: primary || "var(--bs-white)", fontSize: 22 } })] }), _jsxs(Menu, { id: "user-menu", anchorEl: userMenuAnchorEl, open: userMenuOpen, onClose: handleCloseUserMenu, children: [_jsx(MenuItem, { id: "user-signed-in-as", disabled: true, sx: { fontWeight: "bold" }, children: "Signed in as" }), _jsx(MenuItem, { id: "user-name", disabled: true, sx: {
|
|
126
142
|
whiteSpace: "normal",
|
|
127
143
|
wordWrap: "break-word",
|
|
128
144
|
fontSize: "smaller",
|
|
129
|
-
}, children: userInfo.name }), _jsx(MenuItem, { id: "auth-type-title", disabled: true, sx: { fontWeight: "bold" }, children: "Authentication" }), _jsx(MenuItem, { id: "authentication-type-menu-item", disabled: true, sx: { fontSize: "smaller" }, children: authenticationType }), authenticationEnabled() && (_jsx(MenuItem, { id: "user-sign-out", sx: { ...DISABLE_OUTLINE_PROPS, fontWeight: "bold" }, onClick: signOut, children: "Sign out" }))] })] })) : null, _jsx(Tooltip, { id: "dark-mode-toggle", title:
|
|
145
|
+
}, children: userInfo.name }), _jsx(MenuItem, { id: "auth-type-title", disabled: true, sx: { fontWeight: "bold" }, children: "Authentication" }), _jsx(MenuItem, { id: "authentication-type-menu-item", disabled: true, sx: { fontSize: "smaller" }, children: authenticationType }), authenticationEnabled() && (_jsx(MenuItem, { id: "user-sign-out", sx: { ...DISABLE_OUTLINE_PROPS, fontWeight: "bold" }, onClick: signOut, children: "Sign out" }))] })] })) : null, _jsx(Tooltip, { id: "dark-mode-toggle", title: customer
|
|
146
|
+
? "Dark mode toggle is not available when customer branding is active. Reset via Settings menu."
|
|
147
|
+
: "Toggle dark mode", children: _jsx(DarkModeIcon, { id: "dark-mode-icon", sx: {
|
|
130
148
|
marginRight: "1rem",
|
|
131
149
|
fontSize: "1rem",
|
|
132
|
-
cursor: "pointer",
|
|
150
|
+
cursor: customer ? "not-allowed" : "pointer",
|
|
133
151
|
color: darkMode ? "var(--bs-yellow)" : "var(--bs-gray-dark)",
|
|
134
152
|
}, onClick: () => {
|
|
135
|
-
setMode(darkMode ? "light" : "dark");
|
|
136
|
-
} }) })
|
|
153
|
+
!customer && setMode(darkMode ? "light" : "dark");
|
|
154
|
+
} }) }), showSettingsButton && (_jsx(Tooltip, { title: "Settings", children: _jsx(SettingsIcon, { sx: {
|
|
155
|
+
...MENU_ITEM_TEXT_PROPS,
|
|
156
|
+
marginRight: "1rem",
|
|
157
|
+
fontSize: "1rem",
|
|
158
|
+
cursor: "pointer",
|
|
159
|
+
}, onClick: () => {
|
|
160
|
+
setSettingsDialogOpen(true);
|
|
161
|
+
} }) }))] })) : (_jsx(LoadingSpinner, { id: "navbar-loading-spinner" }));
|
|
137
162
|
};
|
|
@@ -14,13 +14,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
14
14
|
See the License for the specific language governing permissions and
|
|
15
15
|
limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
17
|
+
import CircularProgress from "@mui/material/CircularProgress";
|
|
18
|
+
import Typography from "@mui/material/Typography";
|
|
18
19
|
export const PageLoader = ({ id }) => (_jsxs("div", { id: `${id}__loader`, style: {
|
|
19
20
|
left: "0",
|
|
20
21
|
position: "absolute",
|
|
21
22
|
right: "0",
|
|
22
23
|
textAlign: "center",
|
|
23
24
|
top: "50%",
|
|
24
|
-
}, children: [_jsx(Typography, { id: `${id}-loader__message`, variant: "h3", children: "Loading... Please wait" }), _jsx(CircularProgress, { id: `${id}-loader__spinner`,
|
|
25
|
-
color: "var(--bs-primary)",
|
|
26
|
-
}, size: "100px" })] }));
|
|
25
|
+
}, children: [_jsx(Typography, { id: `${id}-loader__message`, variant: "h3", children: "Loading... Please wait" }), _jsx(CircularProgress, { id: `${id}-loader__spinner`, size: "100px" })] }));
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { CustomContentProps } from "notistack";
|
|
2
|
+
import { JSX as ReactJSX, Ref } from "react";
|
|
2
3
|
export interface SnackbarProps extends CustomContentProps {
|
|
3
4
|
description: string;
|
|
4
5
|
}
|
|
5
|
-
export declare const Snackbar:
|
|
6
|
+
export declare const Snackbar: ({ ref, description, hideIconVariant, iconVariant, id, message, variant, }: SnackbarProps & {
|
|
7
|
+
ref?: Ref<HTMLDivElement>;
|
|
8
|
+
}) => ReactJSX.Element;
|