@cognizant-ai-lab/ui-common 1.13.0 → 1.14.0-main.2aceee5.162
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 +109 -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.js +56 -14
- 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 +18 -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.d.ts +4 -0
- package/dist/components/MultiAgentAccelerator/Editor/NetworkEditorDock.js +65 -35
- package/dist/components/MultiAgentAccelerator/MultiAgentAccelerator.js +288 -91
- 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 +26 -14
- package/dist/components/MultiAgentAccelerator/TemporaryNetworks.d.ts +1 -1
- package/dist/components/MultiAgentAccelerator/TemporaryNetworks.js +2 -2
- 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/agent/Agent.d.ts +1 -1
- package/dist/controller/agent/Agent.js +2 -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 +37 -7
- 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
package/dist/Theme/Palettes.d.ts
CHANGED
package/dist/Theme/Palettes.js
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
// Palettes for progressive coloring of nodes based on depth or heatmap value
|
|
2
2
|
export const PALETTES = {
|
|
3
|
+
// Iridescent "sheen" ramp: ice → electric blue → indigo → purple → deep night. Default for the app.
|
|
4
|
+
sheen: [
|
|
5
|
+
"#EEF2FF",
|
|
6
|
+
"#C9D7FF",
|
|
7
|
+
"#9DB8FF",
|
|
8
|
+
"#6E9BFF",
|
|
9
|
+
"#3D7BFF",
|
|
10
|
+
"#6A4CFF",
|
|
11
|
+
"#8B4DFF",
|
|
12
|
+
"#A64DFF",
|
|
13
|
+
"#5B2AA8",
|
|
14
|
+
"#1E1446",
|
|
15
|
+
],
|
|
3
16
|
blue: [
|
|
4
17
|
"#f7fbff",
|
|
5
18
|
"#deebf7",
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import type { CSSObject, Theme } from "@mui/material/styles";
|
|
2
|
+
export interface SheenPalette {
|
|
3
|
+
glow: string;
|
|
4
|
+
glassBg: string;
|
|
5
|
+
glassBorder: string;
|
|
6
|
+
highlight: string;
|
|
7
|
+
gradientStart: string;
|
|
8
|
+
gradientMid: string;
|
|
9
|
+
gradientEnd: string;
|
|
10
|
+
auroraA: string;
|
|
11
|
+
auroraB: string;
|
|
12
|
+
auroraC: string;
|
|
13
|
+
tint: string;
|
|
14
|
+
}
|
|
15
|
+
declare module "@mui/material/styles" {
|
|
16
|
+
interface Palette {
|
|
17
|
+
sheen: SheenPalette;
|
|
18
|
+
}
|
|
19
|
+
interface PaletteOptions {
|
|
20
|
+
sheen?: Partial<SheenPalette>;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export declare const SHEEN_FONT_BODY = "\"Inter Variable\", \"Inter\", system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif";
|
|
24
|
+
export declare const SHEEN_FONT_DISPLAY = "\"Newsreader Variable\", \"Newsreader\", Georgia, \"Times New Roman\", serif";
|
|
25
|
+
export declare const SHEEN_FONT_MONO = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", monospace";
|
|
26
|
+
export declare const SHEEN_RADIUS = 14;
|
|
27
|
+
export declare const SHEEN_RADIUS_SURFACE = 22;
|
|
28
|
+
export declare const SHEEN_EASE = "cubic-bezier(0.22, 1, 0.36, 1)";
|
|
29
|
+
export declare const SHEEN_DARK: {
|
|
30
|
+
readonly background: {
|
|
31
|
+
readonly default: "#06060C";
|
|
32
|
+
readonly paper: "#11101C";
|
|
33
|
+
};
|
|
34
|
+
readonly text: {
|
|
35
|
+
readonly primary: "#F2F0FF";
|
|
36
|
+
readonly secondary: "#A6A3C2";
|
|
37
|
+
};
|
|
38
|
+
readonly primary: "#9D7BFF";
|
|
39
|
+
readonly secondary: "#6E9BFF";
|
|
40
|
+
readonly success: "#5EE6B0";
|
|
41
|
+
readonly warning: "#F5C66B";
|
|
42
|
+
readonly error: "#FF5D8F";
|
|
43
|
+
readonly info: "#6EC8FF";
|
|
44
|
+
readonly divider: "rgba(200, 190, 255, 0.09)";
|
|
45
|
+
readonly sheen: {
|
|
46
|
+
glow: string;
|
|
47
|
+
glassBg: string;
|
|
48
|
+
glassBorder: string;
|
|
49
|
+
highlight: string;
|
|
50
|
+
gradientStart: string;
|
|
51
|
+
gradientMid: string;
|
|
52
|
+
gradientEnd: string;
|
|
53
|
+
auroraA: string;
|
|
54
|
+
auroraB: string;
|
|
55
|
+
auroraC: string;
|
|
56
|
+
tint: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export declare const SHEEN_LIGHT: {
|
|
60
|
+
readonly background: {
|
|
61
|
+
readonly default: "#F5F4FB";
|
|
62
|
+
readonly paper: "#FFFFFF";
|
|
63
|
+
};
|
|
64
|
+
readonly text: {
|
|
65
|
+
readonly primary: "#12101F";
|
|
66
|
+
readonly secondary: "#56536D";
|
|
67
|
+
};
|
|
68
|
+
readonly primary: "#5B3FE0";
|
|
69
|
+
readonly secondary: "#2F64D8";
|
|
70
|
+
readonly success: "#1C8763";
|
|
71
|
+
readonly warning: "#A06B14";
|
|
72
|
+
readonly error: "#D2336B";
|
|
73
|
+
readonly info: "#1F78C8";
|
|
74
|
+
readonly divider: "rgba(18, 16, 31, 0.08)";
|
|
75
|
+
readonly sheen: {
|
|
76
|
+
glow: string;
|
|
77
|
+
glassBg: string;
|
|
78
|
+
glassBorder: string;
|
|
79
|
+
highlight: string;
|
|
80
|
+
gradientStart: string;
|
|
81
|
+
gradientMid: string;
|
|
82
|
+
gradientEnd: string;
|
|
83
|
+
auroraA: string;
|
|
84
|
+
auroraB: string;
|
|
85
|
+
auroraC: string;
|
|
86
|
+
tint: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Returns the sheen palette from a theme, as CSS variable references when available (so values follow the active
|
|
91
|
+
* color scheme without re-render), falling back to raw values, and finally to the dark defaults for themes that
|
|
92
|
+
* don't define palette.sheen (e.g. consumers of ui-common with their own theme, or tests using a bare createTheme()).
|
|
93
|
+
*/
|
|
94
|
+
export declare const getSheen: (theme: Theme) => SheenPalette;
|
|
95
|
+
/**
|
|
96
|
+
* Resets the branding-overridable palette colors (text and background) to the default sheen values for the active
|
|
97
|
+
* color scheme, by redefining MUI's CSS variables on the element this is applied to. Used for surfaces that must stay
|
|
98
|
+
* readable whatever branding the user picked, e.g. the settings dialog, where branding is reset.
|
|
99
|
+
*/
|
|
100
|
+
export declare const unbrandedPalette: (theme: Theme) => CSSObject;
|
|
101
|
+
/**
|
|
102
|
+
* The signature iridescent gradient: indigo → purple → electric blue.
|
|
103
|
+
*/
|
|
104
|
+
export declare const sheenGradient: (theme: Theme, angle?: number) => string;
|
|
105
|
+
/**
|
|
106
|
+
* Conic version of the gradient, rotating with the animatable --sheen-angle property (see `spinningBorder`).
|
|
107
|
+
*/
|
|
108
|
+
export declare const sheenConic: (theme: Theme) => string;
|
|
109
|
+
/**
|
|
110
|
+
* Multi-hue "aurora" mesh made of radial blobs. Layer it over background.default.
|
|
111
|
+
*/
|
|
112
|
+
export declare const auroraBackground: (theme: Theme) => string;
|
|
113
|
+
export declare const GRAIN_TEXTURE: string;
|
|
114
|
+
/**
|
|
115
|
+
* Hairline border painted with the iridescent gradient, via a masked ::before pseudo-element.
|
|
116
|
+
* The host gets position: relative. Use for hero surfaces (dialogs, featured cards, focused inputs).
|
|
117
|
+
*/
|
|
118
|
+
export declare const gradientBorder: (theme: Theme, radius?: number, width?: number, opacity?: number) => {
|
|
119
|
+
position: "relative";
|
|
120
|
+
"&::before": {
|
|
121
|
+
content: string;
|
|
122
|
+
position: "absolute";
|
|
123
|
+
inset: number;
|
|
124
|
+
padding: string;
|
|
125
|
+
borderRadius: string;
|
|
126
|
+
background: string;
|
|
127
|
+
opacity: number;
|
|
128
|
+
pointerEvents: "none";
|
|
129
|
+
WebkitMask: string;
|
|
130
|
+
WebkitMaskComposite: string;
|
|
131
|
+
mask: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Animated rotating iridescent border (for "live" elements: streaming chat input, active node, primary CTA).
|
|
136
|
+
*/
|
|
137
|
+
export declare const spinningBorder: (theme: Theme, radius?: number, width?: number) => {
|
|
138
|
+
"&::before": {
|
|
139
|
+
background: string;
|
|
140
|
+
animation: string;
|
|
141
|
+
content: string;
|
|
142
|
+
position: "absolute";
|
|
143
|
+
inset: number;
|
|
144
|
+
padding: string;
|
|
145
|
+
borderRadius: string;
|
|
146
|
+
opacity: number;
|
|
147
|
+
pointerEvents: "none";
|
|
148
|
+
WebkitMask: string;
|
|
149
|
+
WebkitMaskComposite: string;
|
|
150
|
+
mask: string;
|
|
151
|
+
};
|
|
152
|
+
position: "relative";
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* Specular glass surface: a nearly opaque tinted fill with a bright top edge highlight, hairline border and soft depth
|
|
156
|
+
* shadow. No backdrop-filter blur on purpose: it makes every repaint of the window very expensive, especially in
|
|
157
|
+
* Firefox and in browsers without GPU acceleration, which pins the CPU whenever anything on screen animates.
|
|
158
|
+
*/
|
|
159
|
+
export declare const glassSurface: (theme: Theme, radius?: number) => CSSObject;
|
|
160
|
+
/**
|
|
161
|
+
* Text filled with the signature gradient (for display headings / highlighted words). Static on purpose: an infinite
|
|
162
|
+
* background-position animation repaints the text every frame.
|
|
163
|
+
*/
|
|
164
|
+
export declare const gradientText: (theme: Theme) => CSSObject;
|
|
165
|
+
/**
|
|
166
|
+
* Luminous glow used for focus/hover on interactive elements.
|
|
167
|
+
*/
|
|
168
|
+
export declare const glowShadow: (theme: Theme, spread?: number) => string;
|
|
169
|
+
/**
|
|
170
|
+
* Light sweep that runs across an element on hover. Host needs overflow: hidden.
|
|
171
|
+
*/
|
|
172
|
+
export declare const shimmerOnHover: () => CSSObject;
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2025 Cognizant Technology Solutions Corp, www.cognizant.com.
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export const SHEEN_FONT_BODY = '"Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';
|
|
17
|
+
export const SHEEN_FONT_DISPLAY = '"Newsreader Variable", "Newsreader", Georgia, "Times New Roman", serif';
|
|
18
|
+
export const SHEEN_FONT_MONO = 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace';
|
|
19
|
+
// Radii (px)
|
|
20
|
+
export const SHEEN_RADIUS = 14;
|
|
21
|
+
export const SHEEN_RADIUS_SURFACE = 22;
|
|
22
|
+
// Shared easing for interactive motion
|
|
23
|
+
export const SHEEN_EASE = "cubic-bezier(0.22, 1, 0.36, 1)";
|
|
24
|
+
export const SHEEN_DARK = {
|
|
25
|
+
background: { default: "#06060C", paper: "#11101C" },
|
|
26
|
+
text: { primary: "#F2F0FF", secondary: "#A6A3C2" },
|
|
27
|
+
primary: "#9D7BFF",
|
|
28
|
+
secondary: "#6E9BFF",
|
|
29
|
+
success: "#5EE6B0",
|
|
30
|
+
warning: "#F5C66B",
|
|
31
|
+
error: "#FF5D8F",
|
|
32
|
+
info: "#6EC8FF",
|
|
33
|
+
divider: "rgba(200, 190, 255, 0.09)",
|
|
34
|
+
sheen: {
|
|
35
|
+
glow: "rgba(140, 100, 255, 0.55)",
|
|
36
|
+
glassBg: "rgba(17, 16, 30, 0.9)",
|
|
37
|
+
glassBorder: "rgba(200, 190, 255, 0.11)",
|
|
38
|
+
highlight: "rgba(255, 255, 255, 0.07)",
|
|
39
|
+
gradientStart: "#6A4CFF",
|
|
40
|
+
gradientMid: "#A64DFF",
|
|
41
|
+
gradientEnd: "#3D7BFF",
|
|
42
|
+
auroraA: "rgba(106, 76, 255, 0.42)",
|
|
43
|
+
auroraB: "rgba(40, 110, 255, 0.36)",
|
|
44
|
+
auroraC: "rgba(170, 70, 255, 0.26)",
|
|
45
|
+
tint: "rgba(140, 100, 255, 0.16)",
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
export const SHEEN_LIGHT = {
|
|
49
|
+
background: { default: "#F5F4FB", paper: "#FFFFFF" },
|
|
50
|
+
text: { primary: "#12101F", secondary: "#56536D" },
|
|
51
|
+
primary: "#5B3FE0",
|
|
52
|
+
secondary: "#2F64D8",
|
|
53
|
+
success: "#1C8763",
|
|
54
|
+
warning: "#A06B14",
|
|
55
|
+
error: "#D2336B",
|
|
56
|
+
info: "#1F78C8",
|
|
57
|
+
divider: "rgba(18, 16, 31, 0.08)",
|
|
58
|
+
sheen: {
|
|
59
|
+
glow: "rgba(91, 63, 224, 0.35)",
|
|
60
|
+
glassBg: "rgba(255, 255, 255, 0.9)",
|
|
61
|
+
glassBorder: "rgba(18, 16, 31, 0.08)",
|
|
62
|
+
highlight: "rgba(255, 255, 255, 0.85)",
|
|
63
|
+
gradientStart: "#6A4CFF",
|
|
64
|
+
gradientMid: "#A64DFF",
|
|
65
|
+
gradientEnd: "#3D7BFF",
|
|
66
|
+
auroraA: "rgba(106, 76, 255, 0.24)",
|
|
67
|
+
auroraB: "rgba(61, 123, 255, 0.22)",
|
|
68
|
+
auroraC: "rgba(166, 77, 255, 0.18)",
|
|
69
|
+
tint: "rgba(91, 63, 224, 0.10)",
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Returns the sheen palette from a theme, as CSS variable references when available (so values follow the active
|
|
74
|
+
* color scheme without re-render), falling back to raw values, and finally to the dark defaults for themes that
|
|
75
|
+
* don't define palette.sheen (e.g. consumers of ui-common with their own theme, or tests using a bare createTheme()).
|
|
76
|
+
*/
|
|
77
|
+
export const getSheen = (theme) => theme.vars?.palette?.sheen ??
|
|
78
|
+
theme.palette.sheen ??
|
|
79
|
+
(theme.palette.mode === "light" ? SHEEN_LIGHT.sheen : SHEEN_DARK.sheen);
|
|
80
|
+
// "#RRGGBB" -> "R G B", the format MUI uses for its *Channel CSS variables
|
|
81
|
+
const toChannel = (hex) => [1, 3, 5].map((start) => Number.parseInt(hex.slice(start, start + 2), 16)).join(" ");
|
|
82
|
+
const paletteVars = (tokens) => ({
|
|
83
|
+
"--mui-palette-text-primary": tokens.text.primary,
|
|
84
|
+
"--mui-palette-text-primaryChannel": toChannel(tokens.text.primary),
|
|
85
|
+
"--mui-palette-text-secondary": tokens.text.secondary,
|
|
86
|
+
"--mui-palette-text-secondaryChannel": toChannel(tokens.text.secondary),
|
|
87
|
+
"--mui-palette-background-default": tokens.background.default,
|
|
88
|
+
"--mui-palette-background-defaultChannel": toChannel(tokens.background.default),
|
|
89
|
+
"--mui-palette-background-paper": tokens.background.paper,
|
|
90
|
+
"--mui-palette-background-paperChannel": toChannel(tokens.background.paper),
|
|
91
|
+
});
|
|
92
|
+
/**
|
|
93
|
+
* Resets the branding-overridable palette colors (text and background) to the default sheen values for the active
|
|
94
|
+
* color scheme, by redefining MUI's CSS variables on the element this is applied to. Used for surfaces that must stay
|
|
95
|
+
* readable whatever branding the user picked, e.g. the settings dialog, where branding is reset.
|
|
96
|
+
*/
|
|
97
|
+
export const unbrandedPalette = (theme) => ({
|
|
98
|
+
...paletteVars(SHEEN_DARK),
|
|
99
|
+
...theme.applyStyles("light", paletteVars(SHEEN_LIGHT)),
|
|
100
|
+
});
|
|
101
|
+
/**
|
|
102
|
+
* The signature iridescent gradient: indigo → purple → electric blue.
|
|
103
|
+
*/
|
|
104
|
+
export const sheenGradient = (theme, angle = 135) => {
|
|
105
|
+
const sheen = getSheen(theme);
|
|
106
|
+
return `linear-gradient(${angle}deg, ${sheen.gradientStart}, ${sheen.gradientMid} 55%, ${sheen.gradientEnd})`;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Conic version of the gradient, rotating with the animatable --sheen-angle property (see `spinningBorder`).
|
|
110
|
+
*/
|
|
111
|
+
export const sheenConic = (theme) => {
|
|
112
|
+
const sheen = getSheen(theme);
|
|
113
|
+
return (`conic-gradient(from var(--sheen-angle, 0deg), ${sheen.gradientStart}, ${sheen.gradientMid}, ` +
|
|
114
|
+
`${sheen.gradientEnd}, ${sheen.gradientStart})`);
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Multi-hue "aurora" mesh made of radial blobs. Layer it over background.default.
|
|
118
|
+
*/
|
|
119
|
+
export const auroraBackground = (theme) => {
|
|
120
|
+
const sheen = getSheen(theme);
|
|
121
|
+
return [
|
|
122
|
+
`radial-gradient(45% 40% at 12% 8%, ${sheen.auroraA}, transparent 70%)`,
|
|
123
|
+
`radial-gradient(40% 38% at 88% 14%, ${sheen.auroraB}, transparent 70%)`,
|
|
124
|
+
`radial-gradient(50% 45% at 70% 92%, ${sheen.auroraC}, transparent 70%)`,
|
|
125
|
+
`radial-gradient(35% 30% at 20% 85%, ${sheen.auroraB}, transparent 70%)`,
|
|
126
|
+
].join(", ");
|
|
127
|
+
};
|
|
128
|
+
// Film grain (fractal noise), very low alpha. Adds texture to large flat areas so gradients don't band.
|
|
129
|
+
export const GRAIN_TEXTURE = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter " +
|
|
130
|
+
"id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E" +
|
|
131
|
+
"%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E\")";
|
|
132
|
+
/**
|
|
133
|
+
* Hairline border painted with the iridescent gradient, via a masked ::before pseudo-element.
|
|
134
|
+
* The host gets position: relative. Use for hero surfaces (dialogs, featured cards, focused inputs).
|
|
135
|
+
*/
|
|
136
|
+
export const gradientBorder = (theme, radius = SHEEN_RADIUS_SURFACE, width = 1, opacity = 0.7) => ({
|
|
137
|
+
position: "relative",
|
|
138
|
+
"&::before": {
|
|
139
|
+
content: '""',
|
|
140
|
+
position: "absolute",
|
|
141
|
+
inset: 0,
|
|
142
|
+
padding: `${width}px`,
|
|
143
|
+
borderRadius: `${radius}px`,
|
|
144
|
+
background: sheenGradient(theme),
|
|
145
|
+
opacity,
|
|
146
|
+
pointerEvents: "none",
|
|
147
|
+
WebkitMask: "linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",
|
|
148
|
+
WebkitMaskComposite: "xor",
|
|
149
|
+
mask: "linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0)",
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
/**
|
|
153
|
+
* Animated rotating iridescent border (for "live" elements: streaming chat input, active node, primary CTA).
|
|
154
|
+
*/
|
|
155
|
+
export const spinningBorder = (theme, radius = SHEEN_RADIUS_SURFACE, width = 1.5) => {
|
|
156
|
+
const base = gradientBorder(theme, radius, width, 1);
|
|
157
|
+
return {
|
|
158
|
+
...base,
|
|
159
|
+
"&::before": {
|
|
160
|
+
...base["&::before"],
|
|
161
|
+
background: sheenConic(theme),
|
|
162
|
+
animation: "sheenSpin 4s linear infinite",
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Specular glass surface: a nearly opaque tinted fill with a bright top edge highlight, hairline border and soft depth
|
|
168
|
+
* shadow. No backdrop-filter blur on purpose: it makes every repaint of the window very expensive, especially in
|
|
169
|
+
* Firefox and in browsers without GPU acceleration, which pins the CPU whenever anything on screen animates.
|
|
170
|
+
*/
|
|
171
|
+
export const glassSurface = (theme, radius = SHEEN_RADIUS_SURFACE) => {
|
|
172
|
+
const sheen = getSheen(theme);
|
|
173
|
+
return {
|
|
174
|
+
backgroundColor: sheen.glassBg,
|
|
175
|
+
backgroundImage: `linear-gradient(180deg, ${sheen.highlight}, transparent 38%)`,
|
|
176
|
+
border: `1px solid ${sheen.glassBorder}`,
|
|
177
|
+
boxShadow: `inset 0 1px 0 ${sheen.highlight}, 0 10px 40px -12px rgba(0, 0, 0, 0.45)`,
|
|
178
|
+
// Explicit px: a bare number would be multiplied by theme.shape.borderRadius when spread into sx
|
|
179
|
+
borderRadius: `${radius}px`,
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Text filled with the signature gradient (for display headings / highlighted words). Static on purpose: an infinite
|
|
184
|
+
* background-position animation repaints the text every frame.
|
|
185
|
+
*/
|
|
186
|
+
export const gradientText = (theme) => ({
|
|
187
|
+
backgroundImage: sheenGradient(theme, 100),
|
|
188
|
+
backgroundClip: "text",
|
|
189
|
+
WebkitBackgroundClip: "text",
|
|
190
|
+
color: "transparent",
|
|
191
|
+
WebkitTextFillColor: "transparent",
|
|
192
|
+
});
|
|
193
|
+
/**
|
|
194
|
+
* Luminous glow used for focus/hover on interactive elements.
|
|
195
|
+
*/
|
|
196
|
+
export const glowShadow = (theme, spread = 32) => {
|
|
197
|
+
const { glow } = getSheen(theme);
|
|
198
|
+
return `0 0 0 1px ${glow}, 0 0 ${spread}px -4px ${glow}, 0 12px ${spread * 1.5}px -12px ${glow}`;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Light sweep that runs across an element on hover. Host needs overflow: hidden.
|
|
202
|
+
*/
|
|
203
|
+
export const shimmerOnHover = () => ({
|
|
204
|
+
position: "relative",
|
|
205
|
+
overflow: "hidden",
|
|
206
|
+
isolation: "isolate",
|
|
207
|
+
"&::after": {
|
|
208
|
+
content: '""',
|
|
209
|
+
position: "absolute",
|
|
210
|
+
inset: 0,
|
|
211
|
+
zIndex: -1,
|
|
212
|
+
background: "linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%)",
|
|
213
|
+
transform: "translateX(-120%)",
|
|
214
|
+
pointerEvents: "none",
|
|
215
|
+
},
|
|
216
|
+
"&:hover::after": {
|
|
217
|
+
animation: "sheenShimmer 0.9s ease",
|
|
218
|
+
},
|
|
219
|
+
});
|
|
@@ -33,9 +33,10 @@ import ListItemIcon from "@mui/material/ListItemIcon";
|
|
|
33
33
|
import ListItemText from "@mui/material/ListItemText";
|
|
34
34
|
import Menu from "@mui/material/Menu";
|
|
35
35
|
import MenuItem from "@mui/material/MenuItem";
|
|
36
|
-
import { useTheme } from "@mui/material/styles";
|
|
36
|
+
import { keyframes, useTheme } from "@mui/material/styles";
|
|
37
37
|
import Typography from "@mui/material/Typography";
|
|
38
38
|
import { isEmpty } from "lodash-es";
|
|
39
|
+
import { motion } from "motion/react";
|
|
39
40
|
import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState, } from "react";
|
|
40
41
|
import { v4 as uuid } from "uuid";
|
|
41
42
|
import { ChatHistory, toTurns } from "./ChatHistory.js";
|
|
@@ -52,6 +53,7 @@ import { sendLlmRequest, StreamingUnit } from "../../../controller/llm/LlmChat.j
|
|
|
52
53
|
import { ChatMessageType } from "../../../generated/neuro-san/NeuroSanClient.js";
|
|
53
54
|
import { useAgentChatHistoryStore } from "../../../state/ChatHistory.js";
|
|
54
55
|
import { useSettingsStore } from "../../../state/Settings.js";
|
|
56
|
+
import { getSheen, glassSurface, glowShadow, gradientBorder, gradientText, SHEEN_EASE, SHEEN_RADIUS, SHEEN_RADIUS_SURFACE, sheenConic, spinningBorder, } from "../../../Theme/sheen.js";
|
|
55
57
|
import { toDisplayName } from "../../../utils/AgentName.js";
|
|
56
58
|
import { downloadFile, toSafeFilename } from "../../../utils/File.js";
|
|
57
59
|
import { hasOnlyWhitespace } from "../../../utils/text.js";
|
|
@@ -93,6 +95,17 @@ const EXPORT_ROLE_LABELS = {
|
|
|
93
95
|
* @returns The label for the message role
|
|
94
96
|
*/
|
|
95
97
|
export const roleToExportLabel = (role) => EXPORT_ROLE_LABELS[role];
|
|
98
|
+
// Radius of the chat input pill (large enough to stay fully rounded as the input grows to several rows)
|
|
99
|
+
const INPUT_PILL_RADIUS = 28;
|
|
100
|
+
// The "thinking" orb: an iridescent blob that slowly morphs its outline and breathes
|
|
101
|
+
const ORB_MORPH = keyframes `
|
|
102
|
+
0%, 100% { border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%; transform: scale(1); }
|
|
103
|
+
25% { border-radius: 58% 42% 55% 45% / 46% 58% 42% 54%; transform: scale(1.08); }
|
|
104
|
+
50% { border-radius: 44% 56% 42% 58% / 56% 44% 56% 44%; transform: scale(0.94); }
|
|
105
|
+
75% { border-radius: 52% 48% 60% 40% / 40% 56% 44% 60%; transform: scale(1.05); }
|
|
106
|
+
`;
|
|
107
|
+
// Size of the thinking orb (px)
|
|
108
|
+
const ORB_SIZE = 22;
|
|
96
109
|
/**
|
|
97
110
|
* Common chat component for agent chat. This component is used by all agent chat components to provide a consistent
|
|
98
111
|
* experience for users when chatting with agents. It handles user input as well as displaying and nicely formatting
|
|
@@ -588,18 +601,17 @@ export const ChatCommon = ({ ref, ...props }) => {
|
|
|
588
601
|
}, children: errorText }) }));
|
|
589
602
|
const getTitle = () => (_jsxs(Box, { id: `llm-chat-title-container-${id}`, sx: {
|
|
590
603
|
alignItems: "center",
|
|
591
|
-
borderTopLeftRadius:
|
|
592
|
-
borderTopRightRadius:
|
|
604
|
+
borderTopLeftRadius: `${SHEEN_RADIUS_SURFACE}px`,
|
|
605
|
+
borderTopRightRadius: `${SHEEN_RADIUS_SURFACE}px`,
|
|
593
606
|
display: "flex",
|
|
594
607
|
justifyContent: "space-between",
|
|
595
608
|
paddingLeft: "1rem",
|
|
596
609
|
paddingRight: "0.5rem",
|
|
597
610
|
paddingTop: "0.25rem",
|
|
598
611
|
paddingBottom: "0.25rem",
|
|
599
|
-
}, children: [_jsx(Typography, { id: `llm-chat-title-${id}-text`, sx: { fontSize: "0.9rem" }, children: title }), onClose && (_jsx(IconButton, { "data-testid": `close-button-${id}`, id: `close-button-${id}`, onClick: onClose, children: _jsx(CloseIcon, { id: `close-icon-${id}` }) }))] }));
|
|
612
|
+
}, children: [_jsx(Typography, { id: `llm-chat-title-${id}-text`, sx: { color: "text.primary", fontSize: "0.9rem", fontWeight: 600 }, children: title }), onClose && (_jsx(IconButton, { "data-testid": `close-button-${id}`, id: `close-button-${id}`, onClick: onClose, children: _jsx(CloseIcon, { id: `close-icon-${id}` }) }))] }));
|
|
600
613
|
const getOptionsMenuButton = () => (_jsx(Box, { id: `${id}-options-menu-button-container`, sx: {
|
|
601
|
-
|
|
602
|
-
borderRadius: "var(--bs-border-radius)",
|
|
614
|
+
...glassSurface(theme, SHEEN_RADIUS),
|
|
603
615
|
position: "absolute",
|
|
604
616
|
right: theme.spacing(2.5),
|
|
605
617
|
top: theme.spacing(1),
|
|
@@ -649,16 +661,54 @@ export const ChatCommon = ({ ref, ...props }) => {
|
|
|
649
661
|
position: "absolute",
|
|
650
662
|
zIndex: getZIndex(2, theme),
|
|
651
663
|
}, children: _jsx(ControlButtons, { enableClearChatButton: enableClearChatButton, enableSaveChatButton: enableSaveChatButton, handleClearChat: () => setClearChatConfirmationDialogOpen(true), handleSave: handleSaveChat, handleSend: handleSend, handleStop: handleStop, isAwaitingLlm: isAwaitingLlm, previousUserQuery: previousUserQuery, shouldEnableRegenerateButton: shouldEnableRegenerateButton }) }));
|
|
652
|
-
const getWorkingSpinner = () => (_jsx(_Fragment, { children: isAwaitingLlm && (_jsxs(Box, { id: "awaitingOutputContainer", sx: {
|
|
653
|
-
|
|
654
|
-
|
|
664
|
+
const getWorkingSpinner = () => (_jsx(_Fragment, { children: isAwaitingLlm && (_jsxs(Box, { id: "awaitingOutputContainer", sx: {
|
|
665
|
+
alignItems: "center",
|
|
666
|
+
animation: `sheenRise 0.4s ${SHEEN_EASE} both`,
|
|
667
|
+
display: "flex",
|
|
668
|
+
fontSize: "smaller",
|
|
669
|
+
gap: "0.75rem",
|
|
670
|
+
my: "0.5rem",
|
|
671
|
+
}, children: [_jsx(Box, { "aria-label": "Working", component: motion.div, id: "awaitingOutputSpinner", initial: { opacity: 0, scale: 0.3 }, animate: { opacity: 1, scale: 1 }, transition: { type: "spring", stiffness: 420, damping: 20 }, role: "progressbar", sx: {
|
|
672
|
+
flexShrink: 0,
|
|
673
|
+
height: ORB_SIZE,
|
|
674
|
+
position: "relative",
|
|
675
|
+
width: ORB_SIZE,
|
|
676
|
+
// Halo
|
|
677
|
+
"&::before": {
|
|
678
|
+
animation: "sheenSpin 3s linear infinite",
|
|
679
|
+
background: sheenConic(theme),
|
|
680
|
+
borderRadius: "50%",
|
|
681
|
+
content: '""',
|
|
682
|
+
filter: "blur(8px)",
|
|
683
|
+
inset: -4,
|
|
684
|
+
opacity: 0.7,
|
|
685
|
+
position: "absolute",
|
|
686
|
+
},
|
|
687
|
+
// Blob
|
|
688
|
+
"&::after": {
|
|
689
|
+
animation: `sheenSpin 2.4s linear infinite, ${ORB_MORPH} 3.2s ${SHEEN_EASE} infinite`,
|
|
690
|
+
background: [
|
|
691
|
+
"radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.85), transparent 42%)",
|
|
692
|
+
sheenConic(theme),
|
|
693
|
+
].join(", "),
|
|
694
|
+
boxShadow: `inset 0 -2px 6px rgba(0, 0, 0, 0.25), 0 0 16px ${getSheen(theme).glow}`,
|
|
695
|
+
content: '""',
|
|
696
|
+
inset: 0,
|
|
697
|
+
position: "absolute",
|
|
698
|
+
},
|
|
699
|
+
} }), _jsx(Box, { component: "span", id: "working-span", sx: {
|
|
700
|
+
...gradientText(theme),
|
|
701
|
+
animationDuration: "2.4s",
|
|
702
|
+
fontWeight: 600,
|
|
703
|
+
letterSpacing: "0.02em",
|
|
704
|
+
}, children: "Working..." })] })) }));
|
|
655
705
|
const getThinking = () => (_jsx(_Fragment, { children: !isAwaitingLlm && turns.length > 0 && (
|
|
656
706
|
// Only show thinking once streaming is complete
|
|
657
707
|
_jsx(Thinking, { id: id, turns: turns, useNativeNames: useNativeNames })) }));
|
|
658
708
|
const getResponseBox = () => (_jsxs(Box, { id: "llm-response-div", sx: {
|
|
659
709
|
...divStyle,
|
|
660
|
-
border:
|
|
661
|
-
borderRadius:
|
|
710
|
+
border: `1px solid ${getSheen(theme).glassBorder}`,
|
|
711
|
+
borderRadius: `${SHEEN_RADIUS_SURFACE}px`,
|
|
662
712
|
display: "flex",
|
|
663
713
|
flexGrow: 1,
|
|
664
714
|
marginLeft: "10px",
|
|
@@ -675,7 +725,7 @@ export const ChatCommon = ({ ref, ...props }) => {
|
|
|
675
725
|
currentResponse.current = "";
|
|
676
726
|
}, okBtnLabel: "Yes, clear chat", title: `Clear all chat including history for ${networkDisplayName}?` })) : null, slyDataDialogOpen ? (_jsx(SlyDataDialog, { extraSlyDataKeys: getMergedSlyDataKeys(), id: `${id}-sly-data-dialog`, isOpen: slyDataDialogOpen, networkDisplayName: networkDisplayName, networkId: selectedNetwork, onClose: () => setSlyDataDialogOpen(false), slyDataSchema: slyDataSchema })) : null, _jsxs(Box, { id: "llm-responses", ref: chatOutputRef, sx: {
|
|
677
727
|
backgroundColor,
|
|
678
|
-
borderRadius:
|
|
728
|
+
borderRadius: `${SHEEN_RADIUS}px`,
|
|
679
729
|
fontSize: "16px",
|
|
680
730
|
overflowY: "auto",
|
|
681
731
|
paddingBottom: "60px",
|
|
@@ -684,29 +734,56 @@ export const ChatCommon = ({ ref, ...props }) => {
|
|
|
684
734
|
paddingTop: "7.5px",
|
|
685
735
|
scrollbarGutter: "stable",
|
|
686
736
|
width: "100%",
|
|
687
|
-
}, tabIndex: -1, children: [getOptionsMenu(), getOptionsMenuButton(), getChatHistory(), getNetworkIntro(), getAgentGreeting(), _jsx(SampleQueries, { disabled: isAwaitingLlm, handleSend: handleSend, sampleQueries: sampleQueries }), _jsx(Box, { role: "region", "aria-label": "Current conversation", children: _jsx(Conversation, { id: id, includeAgentMessages: !givesFinalAnswer(selectedNetwork), shouldWrapOutput: shouldWrapOutput, turns: turns }) }), getThinking(), getWorkingSpinner(), getControlButtons()] })] }));
|
|
737
|
+
}, tabIndex: -1, children: [getOptionsMenu(), getOptionsMenuButton(), getChatHistory(), getNetworkIntro(), getAgentGreeting(), _jsx(SampleQueries, { disabled: isAwaitingLlm, handleSend: handleSend, sampleQueries: sampleQueries }), _jsx(Box, { role: "region", "aria-label": "Current conversation", children: _jsx(Conversation, { id: id, includeAgentMessages: !givesFinalAnswer(selectedNetwork), isStreaming: isAwaitingLlm, shouldWrapOutput: shouldWrapOutput, turns: turns }) }), getThinking(), getWorkingSpinner(), getControlButtons()] })] }));
|
|
738
|
+
/**
|
|
739
|
+
* Floating glass pill. A faint gradient hairline brightens on hover/focus; while awaiting a response it becomes a
|
|
740
|
+
* rotating iridescent border so the input visibly "thinks".
|
|
741
|
+
*/
|
|
742
|
+
const getUserInputSx = () => {
|
|
743
|
+
const sheen = getSheen(theme);
|
|
744
|
+
const border = isAwaitingLlm
|
|
745
|
+
? spinningBorder(theme, INPUT_PILL_RADIUS, 1.5)
|
|
746
|
+
: gradientBorder(theme, INPUT_PILL_RADIUS, 1, 0.35);
|
|
747
|
+
const restingShadow = `inset 0 1px 0 ${sheen.highlight}, 0 14px 40px -16px rgba(0, 0, 0, 0.45)`;
|
|
748
|
+
return {
|
|
749
|
+
...glassSurface(theme),
|
|
750
|
+
...border,
|
|
751
|
+
borderColor: "transparent",
|
|
752
|
+
borderRadius: `${INPUT_PILL_RADIUS}px`,
|
|
753
|
+
boxShadow: isAwaitingLlm ? `${restingShadow}, 0 0 28px -10px ${sheen.glow}` : restingShadow,
|
|
754
|
+
color: "text.primary",
|
|
755
|
+
display: "flex",
|
|
756
|
+
flexGrow: 1,
|
|
757
|
+
fontSize: "17px",
|
|
758
|
+
marginRight: "0.75rem",
|
|
759
|
+
paddingBottom: "0.5rem",
|
|
760
|
+
paddingTop: "0.5rem",
|
|
761
|
+
paddingLeft: "1.1rem",
|
|
762
|
+
paddingRight: "1rem",
|
|
763
|
+
transition: `margin-right 0.2s, box-shadow 0.3s ${SHEEN_EASE}`,
|
|
764
|
+
"&::before": { ...border["&::before"], transition: "opacity 0.3s ease" },
|
|
765
|
+
"&:hover::before": { opacity: isAwaitingLlm ? 1 : 0.6 },
|
|
766
|
+
"&.Mui-focused": {
|
|
767
|
+
boxShadow: `${restingShadow}, 0 0 0 4px ${sheen.tint}, ${glowShadow(theme)}`,
|
|
768
|
+
},
|
|
769
|
+
"&.Mui-focused::before": { opacity: 1 },
|
|
770
|
+
"& textarea": {
|
|
771
|
+
overflowY: "auto",
|
|
772
|
+
},
|
|
773
|
+
// The pill grows smoothly with its content (MUI's autosize sets an explicit pixel height on the visible
|
|
774
|
+
// textarea; the hidden measuring copy is aria-hidden and left alone)
|
|
775
|
+
"& textarea:not([aria-hidden])": {
|
|
776
|
+
transition: `height 0.28s ${SHEEN_EASE}`,
|
|
777
|
+
},
|
|
778
|
+
};
|
|
779
|
+
};
|
|
688
780
|
const getUserInputBox = () => (_jsxs(Box, { id: "user-input-div", sx: {
|
|
689
781
|
...divStyle,
|
|
690
782
|
alignItems: "center",
|
|
691
783
|
display: "flex",
|
|
692
784
|
margin: "10px",
|
|
693
785
|
position: "relative",
|
|
694
|
-
}, children: [_jsx(Input, { autoComplete: "off", id: "user-input", maxRows: MAX_CHAT_INPUT_ROWS, multiline: true, placeholder: getPlaceholder(), ref: chatInputRef, sx: {
|
|
695
|
-
border: "var(--bs-border-style) var(--bs-border-width) var(--bs-gray-light)",
|
|
696
|
-
borderRadius: "var(--bs-border-radius)",
|
|
697
|
-
display: "flex",
|
|
698
|
-
flexGrow: 1,
|
|
699
|
-
fontSize: "17px",
|
|
700
|
-
marginRight: "0.75rem",
|
|
701
|
-
paddingBottom: "0.5rem",
|
|
702
|
-
paddingTop: "0.5rem",
|
|
703
|
-
paddingLeft: "1rem",
|
|
704
|
-
paddingRight: "1rem",
|
|
705
|
-
transition: "margin-right 0.2s",
|
|
706
|
-
"& textarea": {
|
|
707
|
-
overflowY: "auto",
|
|
708
|
-
},
|
|
709
|
-
}, onChange: (event) => {
|
|
786
|
+
}, children: [_jsx(Input, { autoComplete: "off", id: "user-input", maxRows: MAX_CHAT_INPUT_ROWS, multiline: true, placeholder: getPlaceholder(), ref: chatInputRef, disableUnderline: true, sx: getUserInputSx(), onChange: (event) => {
|
|
710
787
|
setChatInput(event.target.value);
|
|
711
788
|
}, onKeyDown: async (event) => {
|
|
712
789
|
if (event.key === "Enter" && !event.shiftKey) {
|
|
@@ -714,12 +791,12 @@ export const ChatCommon = ({ ref, ...props }) => {
|
|
|
714
791
|
await handleSend(chatInput);
|
|
715
792
|
}
|
|
716
793
|
}, value: chatInput, endAdornment: _jsxs(InputAdornment, { id: "input-adornments", position: "end", disableTypography: true, children: [voiceInputState.isProcessingSpeech && (_jsx(CircularProgress, { size: 16, sx: {
|
|
717
|
-
color: "
|
|
794
|
+
color: "primary.main",
|
|
718
795
|
marginRight: "0.5rem",
|
|
719
796
|
} })), _jsx(IconButton, { id: "clear-input-button", onClick: () => {
|
|
720
797
|
setChatInput("");
|
|
721
798
|
}, sx: {
|
|
722
|
-
color: "
|
|
799
|
+
color: "text.secondary",
|
|
723
800
|
opacity: userInputEmpty ? "25%" : "100%",
|
|
724
801
|
}, disabled: userInputEmpty, tabIndex: -1, edge: "end", children: _jsx(ClearIcon, { id: "clear-input-icon" }) })] }) }), _jsxs(Box, { sx: { display: "flex", gap: "0.25rem", position: "relative", alignItems: "center" }, children: [_jsx(MicrophoneButton, { isMicOn: isMicOn, onMicToggle: setIsMicOn, setVoiceInputState: setVoiceInputState, speechRecognitionRef: speechRecognitionRef, voiceInputState: voiceInputState }), _jsx(SendButton, { enableSendButton: shouldEnableSendButton, id: "submit-query-button", onClickCallback: () => handleSend(chatInput) })] })] }));
|
|
725
802
|
const getChatBox = () => (_jsxs(Box, { id: `llm-chat-${id}`, sx: {
|
|
@@ -736,7 +813,7 @@ export const ChatCommon = ({ ref, ...props }) => {
|
|
|
736
813
|
verticalAlign: "middle",
|
|
737
814
|
mb: "4px",
|
|
738
815
|
}, children: _jsx(AddBoxRounded, { sx: {
|
|
739
|
-
color: "
|
|
816
|
+
color: "primary.main",
|
|
740
817
|
fontSize: "1rem",
|
|
741
818
|
} }) }), "to design your own network!"] }));
|
|
742
819
|
return (_jsx(Box, { id: `llm-chat-${id}`, sx: {
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTheme } from "@mui/material/styles";
|
|
3
3
|
import { Conversation } from "./Conversation.js";
|
|
4
4
|
import { MessageRole } from "./ConversationTurn.js";
|
|
5
|
-
import {
|
|
5
|
+
import { glassSurface, SHEEN_RADIUS } from "../../../Theme/sheen.js";
|
|
6
6
|
import { AccordionLite } from "../../Common/AccordionLite.js";
|
|
7
7
|
// #endregion: Types
|
|
8
8
|
/**
|
|
@@ -31,8 +31,9 @@ export const ChatHistory = ({ id, messages }) => {
|
|
|
31
31
|
// messages in chat history.
|
|
32
32
|
includeAgentMessages: true, shouldWrapOutput: true, turns: turns }, `${id}-conversation`));
|
|
33
33
|
return (_jsx(AccordionLite, { id: `${id}-history-items`, items: conversation, contentSx: {
|
|
34
|
-
//
|
|
35
|
-
|
|
34
|
+
// Frosted-glass panel to set past conversations apart from the live chat
|
|
35
|
+
...glassSurface(theme, SHEEN_RADIUS),
|
|
36
36
|
opacity: 0.5,
|
|
37
|
+
px: 2,
|
|
37
38
|
}, title: "Chat History" }));
|
|
38
39
|
};
|