@cognizant-ai-lab/ui-common 1.14.0 → 1.15.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/dist/Theme/Palettes.d.ts +1 -0
- package/dist/Theme/Palettes.js +13 -0
- package/dist/Theme/sheen.d.ts +172 -0
- package/dist/Theme/sheen.js +219 -0
- package/dist/components/AgentChat/ChatCommon/ChatCommon.js +111 -32
- package/dist/components/AgentChat/ChatCommon/ChatHistory.js +4 -3
- package/dist/components/AgentChat/ChatCommon/ControlButtons.js +27 -1
- package/dist/components/AgentChat/ChatCommon/Conversation.d.ts +2 -0
- package/dist/components/AgentChat/ChatCommon/Conversation.js +174 -18
- package/dist/components/AgentChat/ChatCommon/FormattedMarkdown.d.ts +12 -1
- package/dist/components/AgentChat/ChatCommon/FormattedMarkdown.js +20 -9
- package/dist/components/AgentChat/ChatCommon/SampleQueries.d.ts +1 -1
- package/dist/components/AgentChat/ChatCommon/SampleQueries.js +74 -17
- package/dist/components/AgentChat/ChatCommon/SendButton.js +32 -1
- package/dist/components/AgentChat/ChatCommon/SyntaxHighlighterThemes.d.ts +6 -0
- package/dist/components/AgentChat/ChatCommon/SyntaxHighlighterThemes.js +4 -1
- package/dist/components/AgentChat/Common/LlmChatButton.js +4 -2
- package/dist/components/AgentChat/VoiceChat/MicrophoneButton.js +5 -0
- package/dist/components/ChatBot/ChatBot.js +79 -25
- package/dist/components/CommandPalette/CommandPalette.d.ts +21 -0
- package/dist/components/CommandPalette/CommandPalette.js +411 -0
- package/dist/components/Common/ConfirmationModal.d.ts +2 -0
- package/dist/components/Common/ConfirmationModal.js +2 -2
- package/dist/components/Common/Footer.d.ts +2 -2
- package/dist/components/Common/Footer.js +86 -32
- package/dist/components/Common/LoadingSpinner.d.ts +2 -1
- package/dist/components/Common/LoadingSpinner.js +24 -3
- package/dist/components/Common/MUIDialog.js +1 -1
- package/dist/components/Common/Navbar.d.ts +4 -1
- package/dist/components/Common/Navbar.js +235 -43
- package/dist/components/Common/Snackbar.d.ts +1 -1
- package/dist/components/Common/Snackbar.js +81 -48
- package/dist/components/Common/Spotlight.d.ts +31 -0
- package/dist/components/Common/Spotlight.js +76 -0
- package/dist/components/ErrorPage/ErrorPage.js +1 -1
- package/dist/components/MultiAgentAccelerator/AgentFlow/AgentFlow.d.ts +14 -0
- package/dist/components/MultiAgentAccelerator/AgentFlow/AgentFlow.js +169 -96
- package/dist/components/MultiAgentAccelerator/AgentFlow/AgentNode.js +100 -23
- package/dist/components/MultiAgentAccelerator/AgentFlow/NetworkHud.d.ts +19 -0
- package/dist/components/MultiAgentAccelerator/AgentFlow/NetworkHud.js +128 -0
- package/dist/components/MultiAgentAccelerator/Editor/Const.d.ts +2 -1
- package/dist/components/MultiAgentAccelerator/Editor/Const.js +4 -2
- package/dist/components/MultiAgentAccelerator/Editor/NetworkEditorDock.js +62 -33
- package/dist/components/MultiAgentAccelerator/MultiAgentAccelerator.d.ts +2 -0
- package/dist/components/MultiAgentAccelerator/MultiAgentAccelerator.js +279 -72
- package/dist/components/MultiAgentAccelerator/NeuroSanStudioCallout.js +38 -22
- package/dist/components/MultiAgentAccelerator/PanelSeparator.d.ts +7 -1
- package/dist/components/MultiAgentAccelerator/PanelSeparator.js +44 -36
- package/dist/components/MultiAgentAccelerator/Publish/Publish.d.ts +30 -10
- package/dist/components/MultiAgentAccelerator/Publish/Publish.js +137 -42
- package/dist/components/MultiAgentAccelerator/Publish/PublishButton.d.ts +5 -2
- package/dist/components/MultiAgentAccelerator/Publish/PublishButton.js +45 -19
- package/dist/components/MultiAgentAccelerator/Publish/PublishConfirmation.d.ts +8 -2
- package/dist/components/MultiAgentAccelerator/Publish/PublishConfirmation.js +31 -4
- package/dist/components/MultiAgentAccelerator/Publish/PublishIconButton.d.ts +4 -2
- package/dist/components/MultiAgentAccelerator/Publish/PublishIconButton.js +17 -16
- package/dist/components/MultiAgentAccelerator/Publish/PublishPanel.d.ts +4 -2
- package/dist/components/MultiAgentAccelerator/Publish/PublishPanel.js +32 -2
- package/dist/components/MultiAgentAccelerator/Publish/PublishedNetworkUrl.js +3 -2
- package/dist/components/MultiAgentAccelerator/Publish/usePublishTarget.d.ts +2 -2
- package/dist/components/MultiAgentAccelerator/Publish/usePublishTarget.js +14 -7
- package/dist/components/MultiAgentAccelerator/Sidebar/AgentNetworkTreeItem.js +81 -53
- package/dist/components/MultiAgentAccelerator/Sidebar/Sidebar.js +40 -20
- package/dist/components/MultiAgentAccelerator/ThoughtBubbles/ThoughtBubbleOverlay.d.ts +4 -0
- package/dist/components/MultiAgentAccelerator/ThoughtBubbles/ThoughtBubbleOverlay.js +49 -28
- package/dist/components/MultiAgentAccelerator/Workspace/FloatingPanel.d.ts +21 -0
- package/dist/components/MultiAgentAccelerator/Workspace/FloatingPanel.js +57 -0
- package/dist/components/Settings/ApiKeyErrorBanner.d.ts +1 -0
- package/dist/components/Settings/ApiKeyErrorBanner.js +1 -1
- package/dist/components/Settings/ApiKeyInput.d.ts +2 -1
- package/dist/components/Settings/ApiKeyInput.js +31 -4
- package/dist/components/Settings/Byok/ByokInputs.d.ts +1 -1
- package/dist/components/Settings/Byok/ByokInputs.js +3 -1
- package/dist/components/Settings/Byok/ByokStorageTooltip.js +3 -2
- package/dist/components/Settings/Byok/ByokUnsavedChangesModal.d.ts +4 -0
- package/dist/components/Settings/Byok/ByokUnsavedChangesModal.js +3 -2
- package/dist/components/Settings/Byok/useByokKeyManager.d.ts +3 -2
- package/dist/components/Settings/Byok/useByokKeyManager.js +97 -27
- package/dist/components/Settings/FadingCheckmark.js +1 -1
- package/dist/components/Settings/PublishSettings.d.ts +4 -4
- package/dist/components/Settings/PublishSettings.js +33 -44
- package/dist/components/Settings/SettingsDialog.js +95 -41
- package/dist/components/Settings/SettingsLayout.d.ts +1 -3
- package/dist/components/Settings/SettingsLayout.js +41 -12
- package/dist/components/Settings/SettingsNav.d.ts +14 -0
- package/dist/components/Settings/SettingsNav.js +229 -0
- package/dist/components/Settings/SettingsRow.js +4 -1
- package/dist/controller/llm/Providers.d.ts +1 -0
- package/dist/controller/llm/Providers.js +4 -0
- package/dist/controller/publish/Publish.d.ts +34 -9
- package/dist/controller/publish/Publish.js +83 -23
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/state/Publish.d.ts +25 -11
- package/dist/state/Publish.js +38 -3
- package/dist/state/Settings.d.ts +5 -79
- package/dist/state/Settings.js +36 -6
- package/dist/state/TemporaryNetworks.d.ts +12 -1
- package/dist/state/TemporaryNetworks.js +15 -8
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -4
|
@@ -2,46 +2,100 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { styled } from "@mui/material/styles";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { ConfirmationModal } from "./ConfirmationModal.js";
|
|
5
|
+
import { LOGO_LIGHT_MODE_SX } from "./Navbar.js";
|
|
5
6
|
import { getContactUsConfirmationText } from "../../const.js";
|
|
7
|
+
import { getSheen, SHEEN_EASE, sheenGradient } from "../../Theme/sheen.js";
|
|
6
8
|
import { navigateToUrl } from "../../utils/BrowserNavigation.js";
|
|
7
|
-
const HeaderLine = styled("h6")({
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
const HeaderLine = styled("h6")(({ theme }) => ({
|
|
10
|
+
color: (theme.vars ?? theme).palette.text.secondary,
|
|
11
|
+
fontWeight: 600,
|
|
12
|
+
fontSize: "0.7rem",
|
|
13
|
+
letterSpacing: "0.12em",
|
|
10
14
|
margin: 0,
|
|
11
|
-
marginBottom: "0.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
marginBottom: "0.75rem",
|
|
16
|
+
opacity: 0.8,
|
|
17
|
+
textTransform: "uppercase",
|
|
18
|
+
}));
|
|
19
|
+
// Short iridescent tick under each section header
|
|
20
|
+
const LinkDivider = styled("div")(({ theme }) => ({
|
|
21
|
+
backgroundImage: sheenGradient(theme, 90),
|
|
22
|
+
borderRadius: 999,
|
|
23
|
+
height: "2px",
|
|
24
|
+
marginBottom: "0.6rem",
|
|
25
|
+
opacity: 0.8,
|
|
26
|
+
width: "1.6rem",
|
|
27
|
+
}));
|
|
18
28
|
const FooterSectionHeader = styled("div")({
|
|
19
29
|
display: "inline-flex",
|
|
20
30
|
flexDirection: "column",
|
|
21
31
|
alignItems: "flex-start",
|
|
22
32
|
marginTop: "0.1rem",
|
|
23
33
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
// Muted links; on hover the text brightens and a gradient underline draws in from the left
|
|
35
|
+
const FooterItemLink = styled("a")(({ theme }) => {
|
|
36
|
+
const palette = (theme.vars ?? theme).palette;
|
|
37
|
+
return {
|
|
38
|
+
backgroundImage: sheenGradient(theme, 90),
|
|
39
|
+
backgroundPosition: "0 100%",
|
|
40
|
+
backgroundRepeat: "no-repeat",
|
|
41
|
+
backgroundSize: "0% 1px",
|
|
42
|
+
color: palette.text.secondary,
|
|
43
|
+
display: "block",
|
|
44
|
+
fontSize: "0.8rem",
|
|
45
|
+
fontWeight: 400,
|
|
46
|
+
marginBottom: "0.45rem",
|
|
47
|
+
paddingBottom: "2px",
|
|
48
|
+
textDecoration: "none",
|
|
49
|
+
transition: `color 0.25s ease, background-size 0.4s ${SHEEN_EASE}`,
|
|
50
|
+
width: "fit-content",
|
|
51
|
+
"&:hover": {
|
|
52
|
+
backgroundSize: "100% 1px",
|
|
53
|
+
color: palette.text.primary,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
const FooterContainer = styled("footer")(({ theme }) => {
|
|
58
|
+
const sheen = getSheen(theme);
|
|
59
|
+
return {
|
|
60
|
+
alignItems: "flex-start",
|
|
61
|
+
backgroundColor: "transparent",
|
|
62
|
+
columnGap: "64px",
|
|
63
|
+
display: "flex",
|
|
64
|
+
isolation: "isolate",
|
|
65
|
+
justifyContent: "center",
|
|
66
|
+
marginTop: "1rem",
|
|
67
|
+
paddingBottom: "1.25rem",
|
|
68
|
+
paddingTop: "2.25rem",
|
|
69
|
+
position: "relative",
|
|
70
|
+
width: "100%",
|
|
71
|
+
"& #logo-img": { opacity: 0.7, transition: "opacity 0.25s ease" },
|
|
72
|
+
"& a:hover #logo-img": { opacity: 1 },
|
|
73
|
+
// Iridescent hairline that fades out toward both edges...
|
|
74
|
+
"&::before": {
|
|
75
|
+
background: `linear-gradient(90deg, transparent, ${sheen.gradientStart} 25%, ${sheen.gradientMid} 50%, ` +
|
|
76
|
+
`${sheen.gradientEnd} 75%, transparent)`,
|
|
77
|
+
content: '""',
|
|
78
|
+
height: "1px",
|
|
79
|
+
left: "8%",
|
|
80
|
+
opacity: 0.45,
|
|
81
|
+
pointerEvents: "none",
|
|
82
|
+
position: "absolute",
|
|
83
|
+
right: "8%",
|
|
84
|
+
top: 0,
|
|
85
|
+
},
|
|
86
|
+
// ...with a soft glow bleeding down from it
|
|
87
|
+
"&::after": {
|
|
88
|
+
background: `radial-gradient(50% 100% at 50% 0%, ${sheen.tint}, transparent 70%)`,
|
|
89
|
+
content: '""',
|
|
90
|
+
height: "64px",
|
|
91
|
+
left: "15%",
|
|
92
|
+
pointerEvents: "none",
|
|
93
|
+
position: "absolute",
|
|
94
|
+
right: "15%",
|
|
95
|
+
top: 0,
|
|
96
|
+
zIndex: -1,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
45
99
|
});
|
|
46
100
|
/**
|
|
47
101
|
* Footer for all pages, contains additional links and contact information
|
|
@@ -59,5 +113,5 @@ export const Footer = ({ logoLinkUrl, logoUrl, supportEmailAddress, sx }) => {
|
|
|
59
113
|
}, handleOk: () => {
|
|
60
114
|
navigateToUrl(`mailto:${supportEmailAddress}`);
|
|
61
115
|
setEmailDialogOpen(false);
|
|
62
|
-
}, 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" })] })] })] }));
|
|
116
|
+
}, id: "email-dialog", title: "Contact Us" })), _jsxs(FooterContainer, { id: "additional-links-container", sx: [LOGO_LIGHT_MODE_SX, ...(Array.isArray(sx) ? sx : [sx ?? false])], 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" })] })] })] }));
|
|
63
117
|
};
|
|
@@ -3,7 +3,8 @@ interface LoadingSpinnerProps {
|
|
|
3
3
|
id: string;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
* A simple loading spinner
|
|
6
|
+
* A simple loading spinner: an iridescent gradient ring (conic gradient masked to a ring) that spins, with a soft
|
|
7
|
+
* glow, next to a "Loading..." label.
|
|
7
8
|
* @param id The id for the spinner and text elements, for testing
|
|
8
9
|
*/
|
|
9
10
|
export declare const LoadingSpinner: FC<LoadingSpinnerProps>;
|
|
@@ -14,11 +14,32 @@ 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 Box from "@mui/material/Box";
|
|
18
|
+
import { keyframes } from "@mui/material/styles";
|
|
19
|
+
import { getSheen } from "../../Theme/sheen.js";
|
|
20
|
+
const SPINNER_SIZE = 35;
|
|
21
|
+
const rotate = keyframes({ to: { transform: "rotate(360deg)" } });
|
|
22
|
+
// Keeps only a thin ring of the element (masks are alpha-only, so the color here is irrelevant)
|
|
23
|
+
const RING_MASK = "radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px))";
|
|
18
24
|
/**
|
|
19
|
-
* A simple loading spinner
|
|
25
|
+
* A simple loading spinner: an iridescent gradient ring (conic gradient masked to a ring) that spins, with a soft
|
|
26
|
+
* glow, next to a "Loading..." label.
|
|
20
27
|
* @param id The id for the spinner and text elements, for testing
|
|
21
28
|
*/
|
|
22
29
|
export const LoadingSpinner = ({ id }) => {
|
|
23
|
-
return (_jsxs("h3",
|
|
30
|
+
return (_jsxs(Box, { component: "h3", id: id, sx: { alignItems: "center", display: "flex" }, children: [_jsx(Box, { component: "span", sx: (theme) => ({ display: "inline-flex", filter: `drop-shadow(0 0 6px ${getSheen(theme).glow})` }), children: _jsx(Box, { "aria-label": "Loading", id: `${id}-spinner`, role: "progressbar", sx: (theme) => {
|
|
31
|
+
const sheen = getSheen(theme);
|
|
32
|
+
return {
|
|
33
|
+
// The conic gradient gives the ring a bright iridescent head and a tail fading to nothing
|
|
34
|
+
animation: `${rotate} 0.9s linear infinite`,
|
|
35
|
+
background: `conic-gradient(from 0deg, transparent 8%, ${sheen.gradientEnd} 45%, ` +
|
|
36
|
+
`${sheen.gradientMid} 75%, ${sheen.gradientStart})`,
|
|
37
|
+
borderRadius: "50%",
|
|
38
|
+
flexShrink: 0,
|
|
39
|
+
height: SPINNER_SIZE,
|
|
40
|
+
mask: RING_MASK,
|
|
41
|
+
WebkitMask: RING_MASK,
|
|
42
|
+
width: SPINNER_SIZE,
|
|
43
|
+
};
|
|
44
|
+
} }) }), _jsx(Box, { component: "span", id: `${id}-loading-text`, sx: { color: "text.secondary", fontWeight: 500, letterSpacing: "-0.01em", marginLeft: "1em" }, children: "Loading..." })] }));
|
|
24
45
|
};
|
|
@@ -37,4 +37,4 @@ export const MUIDialog = ({ children, className, closeable = true, contentSx, di
|
|
|
37
37
|
position: "absolute",
|
|
38
38
|
right: 8,
|
|
39
39
|
top: 8,
|
|
40
|
-
}, children: _jsx(CloseIcon, { "data-testid": `${id}-close-icon`, id: `${id}-close-icon`, sx: { color: "
|
|
40
|
+
}, children: _jsx(CloseIcon, { "data-testid": `${id}-close-icon`, id: `${id}-close-icon`, sx: { color: "text.secondary", fontSize: "1rem" } }) })), _jsx(DialogContent, { id: `${id}-content`, sx: contentSx, children: children }), _jsx(DialogActions, { id: `${id}-footer`, sx: { padding: "10px" }, children: footer })] }));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SxProps, Theme } from "@mui/material/styles";
|
|
1
2
|
import { JSX as ReactJSX } from "react";
|
|
2
3
|
export interface NavbarProps {
|
|
3
4
|
readonly id: string;
|
|
@@ -15,5 +16,7 @@ export interface NavbarProps {
|
|
|
15
16
|
readonly logoServiceToken?: string;
|
|
16
17
|
readonly showSettingsButton?: boolean;
|
|
17
18
|
readonly onStartTour?: () => void;
|
|
19
|
+
readonly onNavigate?: (path: string) => void;
|
|
18
20
|
}
|
|
19
|
-
export declare const
|
|
21
|
+
export declare const LOGO_LIGHT_MODE_SX: SxProps<Theme>;
|
|
22
|
+
export declare const Navbar: ({ enableAuthentication, authenticationType, id, logo, logoServiceToken, onNavigate, onStartTour, pathname, query, showSettingsButton, signOut, supportEmailAddress, userInfo, }: NavbarProps) => ReactJSX.Element;
|
|
@@ -15,11 +15,15 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
|
-
* Main navigation bar that appears at the top of each page
|
|
18
|
+
* Main navigation bar that appears at the top of each page: a floating frosted-glass pill with the brand on the left,
|
|
19
|
+
* page links in the middle (with a gradient indicator that glides between them), and a cluster of actions on the right
|
|
20
|
+
* (command palette, menus, user, color scheme and settings).
|
|
19
21
|
*/
|
|
20
22
|
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
|
|
21
23
|
import Business from "@mui/icons-material/Business";
|
|
22
24
|
import DarkModeIcon from "@mui/icons-material/DarkMode";
|
|
25
|
+
import LightModeIcon from "@mui/icons-material/LightMode";
|
|
26
|
+
import SearchRoundedIcon from "@mui/icons-material/SearchRounded";
|
|
23
27
|
import SettingsIcon from "@mui/icons-material/Settings";
|
|
24
28
|
import Box from "@mui/material/Box";
|
|
25
29
|
import Grid from "@mui/material/Grid";
|
|
@@ -29,21 +33,118 @@ import MenuItem from "@mui/material/MenuItem";
|
|
|
29
33
|
import { useColorScheme } from "@mui/material/styles";
|
|
30
34
|
import Tooltip from "@mui/material/Tooltip";
|
|
31
35
|
import Typography from "@mui/material/Typography";
|
|
36
|
+
import { motion, useReducedMotion } from "motion/react";
|
|
32
37
|
import { useState } from "react";
|
|
33
38
|
import { ConfirmationModal } from "./ConfirmationModal.js";
|
|
34
39
|
import { DEFAULT_USER_IMAGE, getContactUsConfirmationText, NEURO_SAN_UI_VERSION } from "../../const.js";
|
|
35
40
|
import { useSettingsStore } from "../../state/Settings.js";
|
|
41
|
+
import { getSheen, glassSurface, glowShadow, gradientBorder, SHEEN_EASE, SHEEN_FONT_DISPLAY, SHEEN_FONT_MONO, sheenConic, sheenGradient, } from "../../Theme/sheen.js";
|
|
36
42
|
import { isDarkMode } from "../../Theme/Theme.js";
|
|
37
43
|
import { navigateToUrl } from "../../utils/BrowserNavigation.js";
|
|
44
|
+
import { openCommandPalette, useModifierKeyLabel } from "../CommandPalette/CommandPalette.js";
|
|
38
45
|
import { getCognizantLogoImage } from "../Logo/Common.js";
|
|
39
46
|
import { CustomerLogo } from "../Logo/CustomerLogo.js";
|
|
40
47
|
import { SettingsDialog } from "../Settings/SettingsDialog.js";
|
|
48
|
+
// Page links shown in the middle of the bar
|
|
49
|
+
const NAV_LINKS = [
|
|
50
|
+
{ id: "nav-link-home", label: "Home", path: "/" },
|
|
51
|
+
{ id: "nav-link-multi-agent-accelerator", label: "Multi-Agent Accelerator", path: "/multiAgentAccelerator" },
|
|
52
|
+
{ id: "nav-link-user-guide", label: "User Guide", path: "/UserGuide" },
|
|
53
|
+
];
|
|
41
54
|
const MENU_ITEM_TEXT_PROPS = {
|
|
42
|
-
color: "
|
|
43
|
-
backgroundColor: "var(--bs-primary)",
|
|
44
|
-
fontFamily: "var(--bs-body-font-family)",
|
|
55
|
+
color: "text.primary",
|
|
45
56
|
fontSize: "18px",
|
|
46
57
|
};
|
|
58
|
+
// The Cognizant logo asset is white; in light mode render it as a dark monochrome mark so it stays legible
|
|
59
|
+
export const LOGO_LIGHT_MODE_SX = (theme) => ({
|
|
60
|
+
"& #logo-img": theme.applyStyles("light", { filter: "brightness(0)", opacity: 0.85 }),
|
|
61
|
+
});
|
|
62
|
+
// Radius that turns any box into a pill / circle
|
|
63
|
+
const PILL_RADIUS = 999;
|
|
64
|
+
// The bar holds a lot; show the page links, build number and search label only when there is room for them
|
|
65
|
+
const WIDE = "@media (min-width: 1440px)";
|
|
66
|
+
const EXTRA_WIDE = "@media (min-width: 1800px)";
|
|
67
|
+
// Spring shared by the sliding nav indicator and the theme toggle morph
|
|
68
|
+
const NAV_SPRING = { type: "spring", stiffness: 480, damping: 36 };
|
|
69
|
+
// Floating, detached frosted-glass pill with a faint iridescent hairline, stuck just below the top of the viewport
|
|
70
|
+
const NAV_BAR_SX = (theme) => ({
|
|
71
|
+
...glassSurface(theme, PILL_RADIUS),
|
|
72
|
+
...gradientBorder(theme, PILL_RADIUS, 1, 0.35),
|
|
73
|
+
// The gradient hairline replaces the plain glass border
|
|
74
|
+
border: 0,
|
|
75
|
+
boxShadow: `inset 0 1px 0 ${getSheen(theme).highlight}, 0 12px 40px -16px rgba(0, 0, 0, 0.45)`,
|
|
76
|
+
flexWrap: "nowrap",
|
|
77
|
+
gap: "0.5rem",
|
|
78
|
+
margin: "12px 16px 0",
|
|
79
|
+
padding: "0.35rem 0.45rem 0.35rem 1.1rem",
|
|
80
|
+
position: "sticky",
|
|
81
|
+
top: "12px",
|
|
82
|
+
width: "auto",
|
|
83
|
+
zIndex: theme.zIndex.appBar,
|
|
84
|
+
// A slightly smaller wordmark leaves room for the page links
|
|
85
|
+
"& #logo-img": { height: "auto", width: 150 },
|
|
86
|
+
});
|
|
87
|
+
// Menu toggles: text pills that pick up a tint on hover
|
|
88
|
+
const MENU_PILL_SX = (theme) => ({
|
|
89
|
+
alignItems: "center",
|
|
90
|
+
borderRadius: `${PILL_RADIUS}px`,
|
|
91
|
+
display: "flex",
|
|
92
|
+
padding: "0.3rem 0.3rem 0.3rem 0.75rem",
|
|
93
|
+
transition: `background-color 0.25s ${SHEEN_EASE}`,
|
|
94
|
+
whiteSpace: "nowrap",
|
|
95
|
+
"&:hover": { backgroundColor: getSheen(theme).tint },
|
|
96
|
+
});
|
|
97
|
+
// Small glass circle for the icon buttons (dark mode, settings)
|
|
98
|
+
const ICON_CIRCLE_SX = (theme) => ({
|
|
99
|
+
...glassSurface(theme, PILL_RADIUS),
|
|
100
|
+
boxShadow: `inset 0 1px 0 ${getSheen(theme).highlight}`,
|
|
101
|
+
flexShrink: 0,
|
|
102
|
+
height: 34,
|
|
103
|
+
overflow: "hidden",
|
|
104
|
+
position: "relative",
|
|
105
|
+
transition: `box-shadow 0.3s ${SHEEN_EASE}, transform 0.3s ${SHEEN_EASE}`,
|
|
106
|
+
width: 34,
|
|
107
|
+
"&:hover": { boxShadow: glowShadow(theme, 18), transform: "translateY(-1px)" },
|
|
108
|
+
});
|
|
109
|
+
// "Search… ⌘K" pill that opens the command palette
|
|
110
|
+
const SEARCH_PILL_SX = (theme) => {
|
|
111
|
+
const sheen = getSheen(theme);
|
|
112
|
+
const border = gradientBorder(theme, PILL_RADIUS, 1, 0.25);
|
|
113
|
+
return {
|
|
114
|
+
...glassSurface(theme, PILL_RADIUS),
|
|
115
|
+
...border,
|
|
116
|
+
alignItems: "center",
|
|
117
|
+
border: 0,
|
|
118
|
+
boxShadow: `inset 0 1px 0 ${sheen.highlight}`,
|
|
119
|
+
color: "text.secondary",
|
|
120
|
+
cursor: "pointer",
|
|
121
|
+
display: "flex",
|
|
122
|
+
flexShrink: 0,
|
|
123
|
+
font: "inherit",
|
|
124
|
+
fontSize: "0.85rem",
|
|
125
|
+
gap: "0.45rem",
|
|
126
|
+
height: 34,
|
|
127
|
+
padding: "0 0.4rem 0 0.75rem",
|
|
128
|
+
transition: `box-shadow 0.3s ${SHEEN_EASE}, color 0.2s ease, transform 0.3s ${SHEEN_EASE}`,
|
|
129
|
+
"&::before": { ...border["&::before"], transition: "opacity 0.3s ease" },
|
|
130
|
+
"&:hover, &:focus-visible": {
|
|
131
|
+
boxShadow: glowShadow(theme, 18),
|
|
132
|
+
color: (theme.vars ?? theme).palette.text.primary,
|
|
133
|
+
outline: "none",
|
|
134
|
+
transform: "translateY(-1px)",
|
|
135
|
+
},
|
|
136
|
+
"&:hover::before, &:focus-visible::before": { opacity: 0.9 },
|
|
137
|
+
"& kbd": {
|
|
138
|
+
backgroundColor: sheen.highlight,
|
|
139
|
+
border: `1px solid ${sheen.glassBorder}`,
|
|
140
|
+
borderRadius: "999px",
|
|
141
|
+
fontFamily: SHEEN_FONT_MONO,
|
|
142
|
+
fontSize: "0.68rem",
|
|
143
|
+
lineHeight: 1,
|
|
144
|
+
padding: "4px 7px",
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
};
|
|
47
148
|
const DISABLE_OUTLINE_PROPS = {
|
|
48
149
|
outline: "none",
|
|
49
150
|
"&:focus": {
|
|
@@ -53,7 +154,9 @@ const DISABLE_OUTLINE_PROPS = {
|
|
|
53
154
|
outline: "none",
|
|
54
155
|
},
|
|
55
156
|
};
|
|
56
|
-
export const Navbar = ({ enableAuthentication, authenticationType, id, logo, logoServiceToken, onStartTour, pathname, query, showSettingsButton = true, signOut, supportEmailAddress, userInfo, }) => {
|
|
157
|
+
export const Navbar = ({ enableAuthentication, authenticationType, id, logo, logoServiceToken, onNavigate, onStartTour, pathname, query, showSettingsButton = true, signOut, supportEmailAddress, userInfo, }) => {
|
|
158
|
+
const reduceMotion = useReducedMotion();
|
|
159
|
+
const modifierKey = useModifierKeyLabel();
|
|
57
160
|
// For email dialog
|
|
58
161
|
const [emailDialogOpen, setEmailDialogOpen] = useState(false);
|
|
59
162
|
// Dark mode
|
|
@@ -79,6 +182,10 @@ export const Navbar = ({ enableAuthentication, authenticationType, id, logo, log
|
|
|
79
182
|
};
|
|
80
183
|
// Settings dialog state
|
|
81
184
|
const [settingsDialogOpen, setSettingsDialogOpen] = useState(false);
|
|
185
|
+
// Page link the indicator currently sits under: the hovered one, else the current page
|
|
186
|
+
const [hoveredLink, setHoveredLink] = useState(null);
|
|
187
|
+
const activeLink = NAV_LINKS.find((link) => link.path === pathname)?.path ?? null;
|
|
188
|
+
const indicatorLink = hoveredLink ?? activeLink;
|
|
82
189
|
// Customer for branding
|
|
83
190
|
const customer = useSettingsStore((state) => state.settings.branding.customer);
|
|
84
191
|
const primary = useSettingsStore((state) => state.settings.branding.primary);
|
|
@@ -86,13 +193,18 @@ export const Navbar = ({ enableAuthentication, authenticationType, id, logo, log
|
|
|
86
193
|
// Logo settings
|
|
87
194
|
const iconSuggestion = useSettingsStore((state) => state.settings.branding.iconSuggestion);
|
|
88
195
|
const logoSource = useSettingsStore((state) => state.settings.branding.logoSource);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
196
|
+
const iconTransition = reduceMotion ? { duration: 0 } : NAV_SPRING;
|
|
197
|
+
return (_jsxs(Grid, { id: "nav-bar-container", container: true, sx: [
|
|
198
|
+
NAV_BAR_SX,
|
|
199
|
+
LOGO_LIGHT_MODE_SX,
|
|
200
|
+
{
|
|
201
|
+
alignItems: "center",
|
|
202
|
+
...MENU_ITEM_TEXT_PROPS,
|
|
203
|
+
},
|
|
204
|
+
], children: [settingsDialogOpen && (_jsx(SettingsDialog, { id: "settings-dialog", isOpen: settingsDialogOpen, logoServiceToken: logoServiceToken, onClose: () => setSettingsDialogOpen(false) })), _jsx(Box, { sx: {
|
|
94
205
|
alignItems: "center",
|
|
95
206
|
display: "flex",
|
|
207
|
+
flexShrink: 0,
|
|
96
208
|
gap: 2,
|
|
97
209
|
}, children: hasCustomer ? (_jsxs(_Fragment, { children: [_jsx(CustomerLogo, { customer: customer, fallbackIcon: Business, iconSuggestion: iconSuggestion, logoServiceToken: logoServiceToken, logoSource: logoSource }), _jsx(Typography, { "data-testid": "customer-branding", sx: {
|
|
98
210
|
fontSize: "20px",
|
|
@@ -101,39 +213,91 @@ export const Navbar = ({ enableAuthentication, authenticationType, id, logo, log
|
|
|
101
213
|
width: "200px",
|
|
102
214
|
display: "flex",
|
|
103
215
|
alignItems: "center",
|
|
104
|
-
}, children: customer })] })) : (getCognizantLogoImage()) }), _jsxs(Grid, { id: id, sx: { display: "flex", alignItems: "center" }, children: [hasCustomer ? getCognizantLogoImage() : null, _jsx(Typography, { id: "nav-bar-brand", sx: {
|
|
216
|
+
}, children: customer })] })) : (getCognizantLogoImage()) }), _jsxs(Grid, { id: id, sx: { display: "flex", alignItems: "center", flexShrink: 0 }, children: [hasCustomer ? getCognizantLogoImage() : null, _jsx(Typography, { id: "nav-bar-brand", sx: {
|
|
105
217
|
...MENU_ITEM_TEXT_PROPS,
|
|
106
|
-
marginLeft: "0.
|
|
218
|
+
marginLeft: "0.6rem",
|
|
107
219
|
fontSize: "16px",
|
|
108
220
|
fontWeight: "bold",
|
|
221
|
+
whiteSpace: "nowrap",
|
|
109
222
|
}, children: _jsxs("a", { id: "navbar-brand-link", style: {
|
|
223
|
+
fontFamily: SHEEN_FONT_DISPLAY,
|
|
110
224
|
fontWeight: 500,
|
|
111
|
-
fontSize: "1.
|
|
112
|
-
|
|
225
|
+
fontSize: "1.3rem",
|
|
226
|
+
letterSpacing: "-0.025em",
|
|
227
|
+
color: "inherit",
|
|
113
228
|
position: "relative",
|
|
114
229
|
bottom: "1px",
|
|
115
230
|
textDecoration: "none",
|
|
116
231
|
}, href: Object.keys(query || {}).length > 0
|
|
117
232
|
? `/?${new URLSearchParams(query).toString()}`
|
|
118
|
-
: "/", children: [logo, " ", pathname === "/multiAgentAccelerator" ? "Multi-Agent Accelerator" : "Decisioning"] }) })] }), _jsx(
|
|
119
|
-
|
|
233
|
+
: "/", children: [logo, " ", pathname === "/multiAgentAccelerator" ? "Multi-Agent Accelerator" : "Decisioning"] }) })] }), _jsx(Box, { component: "nav", "aria-label": "Main", id: "nav-bar-links", onMouseLeave: () => setHoveredLink(null), sx: {
|
|
234
|
+
display: "none",
|
|
235
|
+
flex: 1,
|
|
236
|
+
justifyContent: "center",
|
|
237
|
+
minWidth: 0,
|
|
238
|
+
[WIDE]: { display: "flex" },
|
|
239
|
+
}, children: _jsx(Box, { component: "ul", sx: { display: "flex", gap: "0.15rem", listStyle: "none", margin: 0, padding: 0 }, children: NAV_LINKS.map((link) => {
|
|
240
|
+
const isActive = link.path === activeLink;
|
|
241
|
+
return (_jsxs("li", { style: { position: "relative" }, children: [indicatorLink === link.path && (_jsx(Box, { "aria-hidden": true, component: motion.span, layoutId: "nav-bar-active-indicator", transition: reduceMotion ? { duration: 0 } : NAV_SPRING, sx: (theme) => ({
|
|
242
|
+
backgroundColor: getSheen(theme).tint,
|
|
243
|
+
borderRadius: `${PILL_RADIUS}px`,
|
|
244
|
+
boxShadow: `inset 0 0 0 1px ${getSheen(theme).glassBorder}`,
|
|
245
|
+
inset: 0,
|
|
246
|
+
position: "absolute",
|
|
247
|
+
// Glowing gradient underline
|
|
248
|
+
"&::after": {
|
|
249
|
+
backgroundImage: sheenGradient(theme, 90),
|
|
250
|
+
borderRadius: 2,
|
|
251
|
+
bottom: 3,
|
|
252
|
+
boxShadow: `0 0 10px ${getSheen(theme).glow}`,
|
|
253
|
+
content: '""',
|
|
254
|
+
height: 2,
|
|
255
|
+
left: "28%",
|
|
256
|
+
position: "absolute",
|
|
257
|
+
right: "28%",
|
|
258
|
+
},
|
|
259
|
+
}) })), _jsx(Box, { "aria-current": isActive ? "page" : undefined, component: "a", href: link.path, id: link.id, onClick: (event) => {
|
|
260
|
+
if (onNavigate && !event.metaKey && !event.ctrlKey && !event.shiftKey) {
|
|
261
|
+
event.preventDefault();
|
|
262
|
+
onNavigate(link.path);
|
|
263
|
+
}
|
|
264
|
+
}, onFocus: () => setHoveredLink(link.path), onBlur: () => setHoveredLink(null), onMouseEnter: () => setHoveredLink(link.path), sx: {
|
|
265
|
+
color: isActive ? "text.primary" : "text.secondary",
|
|
266
|
+
display: "block",
|
|
267
|
+
fontSize: "0.9rem",
|
|
268
|
+
fontWeight: isActive ? 600 : 500,
|
|
269
|
+
outline: "none",
|
|
270
|
+
padding: "0.45rem 0.95rem",
|
|
271
|
+
position: "relative",
|
|
272
|
+
textDecoration: "none",
|
|
273
|
+
transition: "color 0.2s ease",
|
|
274
|
+
whiteSpace: "nowrap",
|
|
275
|
+
"&:hover, &:focus-visible": { color: "text.primary" },
|
|
276
|
+
}, children: link.label })] }, link.id));
|
|
277
|
+
}) }) }), _jsx(Grid, { id: "build", sx: {
|
|
278
|
+
flex: 1, // Fill the gap when the page links are hidden
|
|
279
|
+
[WIDE]: { flex: "0 0 auto" },
|
|
120
280
|
display: "flex",
|
|
121
281
|
justifyContent: "flex-end", // Right align
|
|
122
282
|
alignItems: "center", // Vertically center
|
|
123
|
-
marginRight: "
|
|
124
|
-
}, children: _jsxs(Typography, { id: "build-text", sx: {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
283
|
+
marginRight: "0.25rem",
|
|
284
|
+
}, children: _jsxs(Typography, { id: "build-text", sx: {
|
|
285
|
+
...MENU_ITEM_TEXT_PROPS,
|
|
286
|
+
color: "text.secondary",
|
|
287
|
+
display: "none",
|
|
288
|
+
fontSize: "11px",
|
|
289
|
+
fontVariantNumeric: "tabular-nums",
|
|
290
|
+
letterSpacing: "0.02em",
|
|
291
|
+
opacity: 0.75,
|
|
292
|
+
whiteSpace: "nowrap",
|
|
293
|
+
"@media (min-width: 1000px)": { display: "block" },
|
|
294
|
+
[WIDE]: { display: "none" },
|
|
295
|
+
[EXTRA_WIDE]: { display: "block" },
|
|
296
|
+
}, children: ["Build: ", _jsx("strong", { id: "build-strong", children: NEURO_SAN_UI_VERSION })] }) }), _jsxs(Box, { "aria-keyshortcuts": "Meta+K Control+K", "aria-label": "Open command palette", component: "button", id: "command-palette-trigger", onClick: openCommandPalette, sx: SEARCH_PILL_SX, type: "button", children: [_jsx(SearchRoundedIcon, { sx: { fontSize: "1.05rem" } }), _jsx(Box, { component: "span", sx: { display: "none", [EXTRA_WIDE]: { display: "inline" } }, children: "Search\u2026" }), _jsxs("kbd", { children: [modifierKey, " K"] })] }), _jsxs(Grid, { id: "explore-dropdown", sx: { cursor: "pointer" }, children: [_jsxs(Typography, { id: "explore-toggle", sx: [MENU_PILL_SX, { ...MENU_ITEM_TEXT_PROPS, fontSize: "15px", fontWeight: 500 }], onClick: (event) => {
|
|
129
297
|
setExploreMenuAnchorEl(event.currentTarget);
|
|
130
|
-
}, children: ["Explore", _jsx(ArrowDropDownIcon, { id: "nav-explore-dropdown-arrow", sx: { color: primary || "
|
|
131
|
-
...MENU_ITEM_TEXT_PROPS,
|
|
132
|
-
display: "flex",
|
|
133
|
-
alignItems: "center",
|
|
134
|
-
}, onClick: (event) => {
|
|
298
|
+
}, children: ["Explore", _jsx(ArrowDropDownIcon, { id: "nav-explore-dropdown-arrow", sx: { color: primary || "text.secondary", fontSize: 20 } })] }), _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", rel: "noopener noreferrer", sx: { ...DISABLE_OUTLINE_PROPS }, target: "_blank", 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", rel: "noopener noreferrer", sx: { ...DISABLE_OUTLINE_PROPS }, target: "_blank", children: "Neuro-san (core)" }, "explore-neuro-san")] })] }), _jsxs(Grid, { id: "help-dropdown", sx: { cursor: "pointer" }, children: [_jsxs(Typography, { id: "help-toggle", sx: [MENU_PILL_SX, { ...MENU_ITEM_TEXT_PROPS, fontSize: "15px", fontWeight: 500 }], onClick: (event) => {
|
|
135
299
|
setHelpMenuAnchorEl(event.currentTarget);
|
|
136
|
-
}, children: ["Help", _jsx(ArrowDropDownIcon, { id: "nav-help-dropdown-arrow", sx: { color: primary || "
|
|
300
|
+
}, children: ["Help", _jsx(ArrowDropDownIcon, { id: "nav-help-dropdown-arrow", sx: { color: primary || "text.secondary", fontSize: 20 } })] }), _jsxs(Menu, { id: "help-menu", anchorEl: helpMenuAnchorEl, open: helpMenuOpen, onClose: handleCloseHelpMenu, children: [_jsx(MenuItem, { id: "user-guide", component: "a", href: "/UserGuide", rel: "noopener noreferrer", sx: { ...DISABLE_OUTLINE_PROPS }, target: "_blank", children: "User guide" }, "user-guide"), _jsx(MenuItem, { id: "take-a-tour", onClick: () => {
|
|
137
301
|
handleCloseHelpMenu();
|
|
138
302
|
onStartTour?.();
|
|
139
303
|
}, sx: { ...DISABLE_OUTLINE_PROPS }, children: "Take a tour" }, "take-a-tour"), _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: () => {
|
|
@@ -143,27 +307,55 @@ export const Navbar = ({ enableAuthentication, authenticationType, id, logo, log
|
|
|
143
307
|
setEmailDialogOpen(false);
|
|
144
308
|
}, title: "Contact Us" })) : null, userInfo ? (_jsxs(Grid, { id: "user-dropdown", children: [_jsxs(IconButton, { "aria-label": "User dropdown toggle", id: "user-dropdown-toggle", onClick: (event) => {
|
|
145
309
|
setUserMenuAnchorEl(event.currentTarget);
|
|
146
|
-
}, sx: {
|
|
310
|
+
}, sx: (theme) => ({
|
|
147
311
|
...MENU_ITEM_TEXT_PROPS,
|
|
148
|
-
|
|
312
|
+
borderRadius: `${PILL_RADIUS}px`,
|
|
313
|
+
padding: "3px 2px 3px 3px",
|
|
314
|
+
"&:hover": { backgroundColor: getSheen(theme).tint },
|
|
315
|
+
// Avatar framed by an iridescent ring that starts turning on hover
|
|
316
|
+
"& .user-avatar-ring": {
|
|
317
|
+
background: sheenConic(theme),
|
|
318
|
+
borderRadius: "50%",
|
|
319
|
+
boxShadow: `0 0 14px -4px ${getSheen(theme).glow}`,
|
|
320
|
+
display: "flex",
|
|
321
|
+
padding: "2px",
|
|
322
|
+
},
|
|
323
|
+
"&:hover .user-avatar-ring": { animation: "sheenSpin 2.4s linear infinite" },
|
|
324
|
+
"& #user-image": {
|
|
325
|
+
borderRadius: "50%",
|
|
326
|
+
boxShadow: `0 0 0 2px ${(theme.vars ?? theme).palette.background.paper}`,
|
|
327
|
+
display: "block",
|
|
328
|
+
},
|
|
329
|
+
}), children: [_jsx("span", { className: "user-avatar-ring", children: _jsx("img", { id: "user-image", src: userInfo.image || DEFAULT_USER_IMAGE, width: 28, height: 28, title: userInfo.name, alt: "" }) }), _jsx(ArrowDropDownIcon, { id: "nav-user-dropdown-arrow", sx: { color: primary || "text.secondary", fontSize: 20 } })] }), _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: {
|
|
149
330
|
whiteSpace: "normal",
|
|
150
331
|
wordWrap: "break-word",
|
|
151
332
|
fontSize: "smaller",
|
|
152
333
|
}, 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 }), enableAuthentication && (_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: hasCustomer
|
|
153
334
|
? "Dark mode toggle is not available when customer branding is active. Reset via Settings menu."
|
|
154
|
-
: "Toggle dark mode", children:
|
|
155
|
-
marginRight: "1rem",
|
|
156
|
-
fontSize: "1rem",
|
|
157
|
-
cursor: hasCustomer ? "not-allowed" : "pointer",
|
|
158
|
-
color: darkMode ? "var(--bs-yellow)" : "var(--bs-gray-dark)",
|
|
159
|
-
}, onClick: () => {
|
|
335
|
+
: "Toggle dark mode", children: _jsxs(IconButton, { "aria-label": "Toggle dark mode", id: "dark-mode-button", onClick: () => {
|
|
160
336
|
!hasCustomer && setMode(darkMode ? "light" : "dark");
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
337
|
+
}, sx: [
|
|
338
|
+
ICON_CIRCLE_SX,
|
|
339
|
+
{
|
|
340
|
+
cursor: hasCustomer ? "not-allowed" : "pointer",
|
|
341
|
+
"& .theme-toggle-icon": {
|
|
342
|
+
alignItems: "center",
|
|
343
|
+
display: "flex",
|
|
344
|
+
inset: 0,
|
|
345
|
+
justifyContent: "center",
|
|
346
|
+
position: "absolute",
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
], children: [_jsx(motion.span, { animate: darkMode ? { rotate: 0, scale: 1, opacity: 1 } : { rotate: -90, scale: 0.3, opacity: 0 }, className: "theme-toggle-icon", initial: false, transition: iconTransition, children: _jsx(DarkModeIcon, { id: "dark-mode-icon", sx: {
|
|
350
|
+
fontSize: "1rem",
|
|
351
|
+
color: darkMode ? "secondary.main" : "text.secondary",
|
|
352
|
+
} }) }), _jsx(motion.span, { animate: darkMode ? { rotate: 90, scale: 0.3, opacity: 0 } : { rotate: 0, scale: 1, opacity: 1 }, "aria-hidden": true, className: "theme-toggle-icon", initial: false, transition: iconTransition, children: _jsx(LightModeIcon, { id: "light-mode-icon", sx: { color: "secondary.main", fontSize: "1.05rem" } }) })] }) }), showSettingsButton && (_jsx(Tooltip, { title: "Settings", children: _jsx(IconButton, { "aria-label": "Settings", id: "settings-button", onClick: () => {
|
|
167
353
|
setSettingsDialogOpen(true);
|
|
168
|
-
} }
|
|
354
|
+
}, sx: [ICON_CIRCLE_SX, { "&:hover #settings-icon": { color: "text.primary" } }], children: _jsx(SettingsIcon, { id: "settings-icon", sx: {
|
|
355
|
+
...MENU_ITEM_TEXT_PROPS,
|
|
356
|
+
color: "text.secondary",
|
|
357
|
+
fontSize: "1rem",
|
|
358
|
+
transition: `color 0.2s ease, transform 0.5s ${SHEEN_EASE}`,
|
|
359
|
+
"button:hover > &": { transform: "rotate(60deg)" },
|
|
360
|
+
} }) }) }))] }));
|
|
169
361
|
};
|
|
@@ -3,6 +3,6 @@ import { JSX as ReactJSX, Ref } from "react";
|
|
|
3
3
|
export interface SnackbarProps extends CustomContentProps {
|
|
4
4
|
description: string;
|
|
5
5
|
}
|
|
6
|
-
export declare const Snackbar: ({ ref, description, hideIconVariant, iconVariant, id, message, variant, }: SnackbarProps & {
|
|
6
|
+
export declare const Snackbar: ({ ref, anchorOrigin, autoHideDuration, description, hideIconVariant, iconVariant, id, message, persist, variant, }: SnackbarProps & {
|
|
7
7
|
ref?: Ref<HTMLDivElement>;
|
|
8
8
|
}) => ReactJSX.Element;
|