mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-24 23:11:01 +02:00
Improved theming (#3204)
This commit is contained in:
parent
bd2805b6df
commit
6b50f86cd2
@ -62,11 +62,11 @@ export default function Sidebar() {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-none w-[250px] bg-background text-default">
|
<div className="flex flex-none w-[250px] text-default">
|
||||||
<div
|
<div
|
||||||
className={`
|
className={`
|
||||||
fixed
|
fixed
|
||||||
bg-background-100
|
bg-background-sidebar
|
||||||
h-screen
|
h-screen
|
||||||
transition-all
|
transition-all
|
||||||
bg-opacity-80
|
bg-opacity-80
|
||||||
|
@ -812,6 +812,7 @@ export const HumanMessage = ({
|
|||||||
outline-none
|
outline-none
|
||||||
placeholder-gray-400
|
placeholder-gray-400
|
||||||
resize-none
|
resize-none
|
||||||
|
text-text-editing-message
|
||||||
pl-4
|
pl-4
|
||||||
overflow-y-auto
|
overflow-y-auto
|
||||||
pr-12
|
pr-12
|
||||||
@ -870,7 +871,6 @@ export const HumanMessage = ({
|
|||||||
py-2
|
py-2
|
||||||
px-3
|
px-3
|
||||||
w-fit
|
w-fit
|
||||||
bg-hover
|
|
||||||
bg-background-strong
|
bg-background-strong
|
||||||
text-sm
|
text-sm
|
||||||
rounded-lg
|
rounded-lg
|
||||||
@ -896,15 +896,13 @@ export const HumanMessage = ({
|
|||||||
<TooltipProvider delayDuration={1000}>
|
<TooltipProvider delayDuration={1000}>
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger>
|
<TooltipTrigger>
|
||||||
<button
|
<HoverableIcon
|
||||||
className="hover:bg-hover p-1.5 rounded"
|
icon={<FiEdit2 className="text-gray-600" />}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsEditing(true);
|
setIsEditing(true);
|
||||||
setIsHovered(false);
|
setIsHovered(false);
|
||||||
}}
|
}}
|
||||||
>
|
/>
|
||||||
<FiEdit2 className="!h-4 !w-4" />
|
|
||||||
</button>
|
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent>Edit</TooltipContent>
|
<TooltipContent>Edit</TooltipContent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
@ -47,7 +47,13 @@ export default function FixedLogo({
|
|||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
<div className="mobile:hidden fixed left-4 bottom-4">
|
<div className="mobile:hidden fixed left-4 bottom-4">
|
||||||
<FiSidebar className="text-text-mobile-sidebar" />
|
<FiSidebar
|
||||||
|
className={`${
|
||||||
|
backgroundToggled
|
||||||
|
? "text-text-mobile-sidebar-toggled"
|
||||||
|
: "text-text-mobile-sidebar-untoggled"
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -136,7 +136,7 @@ export function UserDropdown({
|
|||||||
<div
|
<div
|
||||||
className="
|
className="
|
||||||
my-auto
|
my-auto
|
||||||
bg-background-strong
|
bg-userdropdown-background
|
||||||
ring-2
|
ring-2
|
||||||
ring-transparent
|
ring-transparent
|
||||||
group-hover:ring-background-300/50
|
group-hover:ring-background-300/50
|
||||||
|
@ -45,7 +45,7 @@ export default function AssistantBanner({
|
|||||||
<div
|
<div
|
||||||
className={`${
|
className={`${
|
||||||
mobile ? "w-full" : "w-36 mx-3"
|
mobile ? "w-full" : "w-36 mx-3"
|
||||||
} flex py-1.5 scale-[1.] rounded-full border border-background-150 justify-center items-center gap-x-2 py-1 px-3 hover:bg-background-125 transition-colors cursor-pointer`}
|
} flex py-1.5 scale-[1.] rounded-full border border-border-recent-assistants justify-center items-center gap-x-2 py-1 px-3 hover:bg-background-125 transition-colors cursor-pointer`}
|
||||||
onClick={() => onAssistantChange(assistant)}
|
onClick={() => onAssistantChange(assistant)}
|
||||||
>
|
>
|
||||||
<AssistantIcon
|
<AssistantIcon
|
||||||
@ -53,7 +53,7 @@ export default function AssistantBanner({
|
|||||||
size="xs"
|
size="xs"
|
||||||
assistant={assistant}
|
assistant={assistant}
|
||||||
/>
|
/>
|
||||||
<span className="font-semibold text-text-800 text-xs truncate max-w-[120px]">
|
<span className="font-semibold text-text-recent-assistants text-xs truncate max-w-[120px]">
|
||||||
{assistant.name}
|
{assistant.name}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -54,7 +54,14 @@ export default function LogoType({
|
|||||||
onClick={() => toggleSidebar()}
|
onClick={() => toggleSidebar()}
|
||||||
className="flex gap-x-2 items-center ml-4 desktop:invisible "
|
className="flex gap-x-2 items-center ml-4 desktop:invisible "
|
||||||
>
|
>
|
||||||
<FiSidebar size={20} className="text-text-mobile-sidebar" />
|
<FiSidebar
|
||||||
|
size={20}
|
||||||
|
className={`${
|
||||||
|
toggled
|
||||||
|
? "text-text-mobile-sidebar-toggled"
|
||||||
|
: "text-text-mobile-sidebar-untoggled"
|
||||||
|
}`}
|
||||||
|
/>
|
||||||
{!showArrow && (
|
{!showArrow && (
|
||||||
<Logo className="desktop:hidden -my-2" height={24} width={24} />
|
<Logo className="desktop:hidden -my-2" height={24} width={24} />
|
||||||
)}
|
)}
|
||||||
|
@ -496,7 +496,6 @@ export function HorizontalSourceSelector({
|
|||||||
max-w-64
|
max-w-64
|
||||||
border-border
|
border-border
|
||||||
rounded-lg
|
rounded-lg
|
||||||
bg-background
|
|
||||||
max-h-96
|
max-h-96
|
||||||
overflow-y-scroll
|
overflow-y-scroll
|
||||||
overscroll-contain
|
overscroll-contain
|
||||||
@ -508,7 +507,6 @@ export function HorizontalSourceSelector({
|
|||||||
w-fit
|
w-fit
|
||||||
gap-x-1
|
gap-x-1
|
||||||
hover:bg-hover
|
hover:bg-hover
|
||||||
bg-hover-light
|
|
||||||
flex
|
flex
|
||||||
items-center
|
items-center
|
||||||
bg-background-search-filter
|
bg-background-search-filter
|
||||||
@ -522,7 +520,7 @@ export function HorizontalSourceSelector({
|
|||||||
</div>
|
</div>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent
|
<PopoverContent
|
||||||
className="bg-background border-border border rounded-md z-[200] p-0"
|
className="bg-background-search-filter border-border border rounded-md z-[200] p-0"
|
||||||
align="start"
|
align="start"
|
||||||
>
|
>
|
||||||
<Calendar
|
<Calendar
|
||||||
|
@ -94,7 +94,22 @@ export function TagFilter({
|
|||||||
<div
|
<div
|
||||||
key={tag.tag_key + tag.tag_value}
|
key={tag.tag_key + tag.tag_value}
|
||||||
onClick={() => onSelectTag(tag)}
|
onClick={() => onSelectTag(tag)}
|
||||||
className="max-w-full break-all line-clamp-1 text-ellipsis flex text-sm border border-border py-0.5 px-2 rounded cursor-pointer bg-background hover:bg-hover"
|
className={`
|
||||||
|
max-w-full
|
||||||
|
break-all
|
||||||
|
line-clamp-1
|
||||||
|
text-ellipsis
|
||||||
|
flex
|
||||||
|
text-sm
|
||||||
|
border
|
||||||
|
border-border
|
||||||
|
py-0.5
|
||||||
|
px-2
|
||||||
|
rounded
|
||||||
|
cursor-pointer
|
||||||
|
bg-background-search-filter
|
||||||
|
hover:bg-background-search-filter-dropdown
|
||||||
|
`}
|
||||||
>
|
>
|
||||||
{tag.tag_key}
|
{tag.tag_key}
|
||||||
<b>=</b>
|
<b>=</b>
|
||||||
@ -121,7 +136,7 @@ export function TagFilter({
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
ref={popupRef}
|
ref={popupRef}
|
||||||
className="p-2 border border-border rounded shadow-lg w-72 bg-background"
|
className="p-2 border border-border rounded shadow-lg w-72 bg-background-search-filter"
|
||||||
>
|
>
|
||||||
<div className="flex border-b border-border font-medium pb-1 text-xs mb-2">
|
<div className="flex border-b border-border font-medium pb-1 text-xs mb-2">
|
||||||
<FiTag className="mr-1 my-auto" />
|
<FiTag className="mr-1 my-auto" />
|
||||||
@ -144,7 +159,11 @@ export function TagFilter({
|
|||||||
cursor-pointer
|
cursor-pointer
|
||||||
bg-background
|
bg-background
|
||||||
hover:bg-hover
|
hover:bg-hover
|
||||||
${selectedTags.includes(tag) ? "bg-hover" : ""}
|
${
|
||||||
|
selectedTags.includes(tag)
|
||||||
|
? "bg-background-search-filter-dropdown"
|
||||||
|
: ""
|
||||||
|
}
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
{tag.tag_key}
|
{tag.tag_key}
|
||||||
|
@ -54,7 +54,8 @@ function Calendar({
|
|||||||
day_range_middle:
|
day_range_middle:
|
||||||
"aria-selected:bg-calendar-range-middle aria-selected:text-calendar-text-in-range dark:aria-selected:bg-calendar-range-middle-dark dark:aria-selected:text-calendar-text-in-range-dark",
|
"aria-selected:bg-calendar-range-middle aria-selected:text-calendar-text-in-range dark:aria-selected:bg-calendar-range-middle-dark dark:aria-selected:text-calendar-text-in-range-dark",
|
||||||
day_hidden: "invisible",
|
day_hidden: "invisible",
|
||||||
day_range_start: "bg-white text-text-900",
|
day_range_start:
|
||||||
|
"bg-calendar-background-selected ring-calendar-ring-selected ring text-text-900",
|
||||||
...classNames,
|
...classNames,
|
||||||
}}
|
}}
|
||||||
components={{
|
components={{
|
||||||
|
@ -108,6 +108,8 @@ module.exports = {
|
|||||||
"background-search-filter": "var(--background-100)",
|
"background-search-filter": "var(--background-100)",
|
||||||
"background-search-filter-dropdown": "var(--background-100)",
|
"background-search-filter-dropdown": "var(--background-100)",
|
||||||
|
|
||||||
|
"user-bubble": "var(--user-bubble)",
|
||||||
|
|
||||||
// colors for sidebar in chat, search, and manage settings
|
// colors for sidebar in chat, search, and manage settings
|
||||||
"background-sidebar": "var(--background-100)",
|
"background-sidebar": "var(--background-100)",
|
||||||
"background-chatbar": "var(--background-100)",
|
"background-chatbar": "var(--background-100)",
|
||||||
@ -141,6 +143,14 @@ module.exports = {
|
|||||||
// Background for chat messages (user bubbles)
|
// Background for chat messages (user bubbles)
|
||||||
user: "var(--user-bubble)",
|
user: "var(--user-bubble)",
|
||||||
|
|
||||||
|
"userdropdown-background": "var(--background-100)",
|
||||||
|
"text-mobile-sidebar-toggled": "var(--text-800)",
|
||||||
|
"text-mobile-sidebar-untoggled": "var(--text-500)",
|
||||||
|
"text-editing-message": "var(--text-800)",
|
||||||
|
"background-sidebar": "var(--background-100)",
|
||||||
|
"background-search-filter": "var(--background-100)",
|
||||||
|
"background-search-filter-dropdown": "var(--background-hover)",
|
||||||
|
|
||||||
"background-toggle": "var(--background-100)",
|
"background-toggle": "var(--background-100)",
|
||||||
|
|
||||||
// Colors for the search toggle buttons
|
// Colors for the search toggle buttons
|
||||||
@ -200,6 +210,8 @@ module.exports = {
|
|||||||
"calendar-today-bg-dark": "var(--background-800)",
|
"calendar-today-bg-dark": "var(--background-800)",
|
||||||
"calendar-today-text": "var(--text-800)",
|
"calendar-today-text": "var(--text-800)",
|
||||||
"calendar-today-text-dark": "var(--text-200)",
|
"calendar-today-text-dark": "var(--text-200)",
|
||||||
|
"calendar-background-selected": "var(--white)",
|
||||||
|
"calendar-ring-selected": "var(--background-900)",
|
||||||
|
|
||||||
"user-text": "var(--text-800)",
|
"user-text": "var(--text-800)",
|
||||||
|
|
||||||
@ -350,6 +362,39 @@ module.exports = {
|
|||||||
fontStyle: {
|
fontStyle: {
|
||||||
"token-italic": "italic",
|
"token-italic": "italic",
|
||||||
},
|
},
|
||||||
|
calendar: {
|
||||||
|
// Light mode
|
||||||
|
"bg-selected": "#4B5563",
|
||||||
|
"bg-outside-selected": "rgba(75, 85, 99, 0.2)",
|
||||||
|
"text-muted": "#6B7280",
|
||||||
|
"text-selected": "#FFFFFF",
|
||||||
|
"range-start": "#000000",
|
||||||
|
"range-middle": "#F3F4F6",
|
||||||
|
"range-end": "#000000",
|
||||||
|
"text-in-range": "#1F2937",
|
||||||
|
|
||||||
|
// Dark mode
|
||||||
|
"bg-selected-dark": "#6B7280",
|
||||||
|
"bg-outside-selected-dark": "rgba(107, 114, 128, 0.2)",
|
||||||
|
"text-muted-dark": "#9CA3AF",
|
||||||
|
"text-selected-dark": "#F3F4F6",
|
||||||
|
"range-start-dark": "#374151",
|
||||||
|
"range-middle-dark": "#4B5563",
|
||||||
|
"range-end-dark": "#374151",
|
||||||
|
"text-in-range-dark": "#E5E7EB",
|
||||||
|
|
||||||
|
// Hover effects
|
||||||
|
"hover-bg": "#9CA3AF",
|
||||||
|
"hover-bg-dark": "#6B7280",
|
||||||
|
"hover-text": "#374151",
|
||||||
|
"hover-text-dark": "#E5E7EB",
|
||||||
|
|
||||||
|
// Today's date
|
||||||
|
"today-bg": "#D1D5DB",
|
||||||
|
"today-bg-dark": "#4B5563",
|
||||||
|
"today-text": "#374151",
|
||||||
|
"today-text-dark": "#D1D5DB",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
safelist: [
|
safelist: [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user