Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build-configs/src/ThemeType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export type TypeChat = {
answerMessageBackground: string
userMessageBackground: string
messageBorderColor: string
chatInputOutlineColor: string
chatInputPlaceholderColor: string
}

export type CommonColorPalette = CommonColors & {
Expand Down
4 changes: 4 additions & 0 deletions build-configs/src/common/theme/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export const commonLightColors: CommonColorPalette = {
answerMessageBackground: '#EAEEF9',
userMessageBackground: '#F5F5F5',
messageBorderColor: 'transparent',
chatInputOutlineColor: 'rgba(0, 0, 0, 0.38)',
chatInputPlaceholderColor: 'rgba(0, 0, 0, 0.6)',
},
}

Expand Down Expand Up @@ -104,5 +106,7 @@ export const commonDarkColors: CommonColorPalette = {
answerMessageBackground: '#181818',
userMessageBackground: '#20293A',
messageBorderColor: '#C9C9C9',
chatInputOutlineColor: 'rgba(255, 255, 255, 0.38)',
chatInputPlaceholderColor: 'rgba(255, 255, 255, 0.6)',
},
}
4 changes: 4 additions & 0 deletions web/src/@types/mui-theme.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ declare module '@mui/material/styles' {
answerMessageBackground: string
userMessageBackground: string
messageBorderColor: string
chatInputOutlineColor: string
chatInputPlaceholderColor: string
}
}

Expand All @@ -56,6 +58,8 @@ declare module '@mui/material/styles' {
answerMessageBackground: string
userMessageBackground: string
messageBorderColor: string
chatInputOutlineColor: string
chatInputPlaceholderColor: string
}
}
}
Expand Down
21 changes: 19 additions & 2 deletions web/src/components/ChatInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,27 @@ const StyledTextField = styled(TextField, { shouldForwardProp: prop => prop !==
[theme.breakpoints.up('md')]: {
flexDirection: 'row',
},
// MUI hovers to text.primary, excluding the focused state
[`&:hover:not(.${outlinedInputClasses.focused}) .${outlinedInputClasses.notchedOutline}`]: {
borderColor: theme.palette.chat.chatInputPlaceholderColor,
},
},

[`& .${outlinedInputClasses.notchedOutline}`]: {
borderColor: theme.palette.chat.chatInputOutlineColor,
borderWidth: 2,
},

[`& .${outlinedInputClasses.input}::placeholder`]: {
color: theme.palette.chat.chatInputPlaceholderColor,
// The global placeholder opacity must not dim the color any further
opacity: 1,
},
}),
)

const ChatIconButton = styled(IconButton)(({ theme }) => ({
color: theme.palette.text.secondary,
color: theme.palette.chat.chatInputPlaceholderColor,
[`&.${buttonBaseClasses.focusVisible}`]: { color: theme.palette.text.primary },
})) as typeof IconButton

Expand All @@ -51,7 +66,9 @@ const SendButton = styled(IconButton)(({ theme }) => ({
'&:hover': {
backgroundColor: theme.palette.primary.dark,
},

[`&.${buttonBaseClasses.disabled}`]: {
color: theme.palette.chat.chatInputOutlineColor,
},
[theme.breakpoints.up('md')]: {
borderRadius: 12,
},
Expand Down
Loading