mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
Make cursor in chat input take on selected agent color
This commit is contained in:
parent
1448b8b3fc
commit
2ac840e3f2
3 changed files with 19 additions and 3 deletions
|
@ -42,6 +42,13 @@ export function converColorToBgGradient(color: string) {
|
|||
return `${convertToBGGradientClass(color)} dark:border dark:border-neutral-700`;
|
||||
}
|
||||
|
||||
export function convertColorToCaretClass(color: string | undefined) {
|
||||
if (color && tailwindColors.includes(color)) {
|
||||
return `caret-${color}-500`;
|
||||
}
|
||||
return `caret-orange-500`;
|
||||
}
|
||||
|
||||
export function convertColorToRingClass(color: string | undefined) {
|
||||
if (color && tailwindColors.includes(color)) {
|
||||
return `focus-visible:ring-${color}-500`;
|
||||
|
|
|
@ -37,7 +37,11 @@ import { Popover, PopoverContent } from "@/components/ui/popover";
|
|||
import { PopoverTrigger } from "@radix-ui/react-popover";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { convertColorToTextClass, convertToBGClass } from "@/app/common/colorUtils";
|
||||
import {
|
||||
convertColorToCaretClass,
|
||||
convertColorToTextClass,
|
||||
convertToBGClass,
|
||||
} from "@/app/common/colorUtils";
|
||||
|
||||
import LoginPrompt from "../loginPrompt/loginPrompt";
|
||||
import { uploadDataForIndexing } from "../../common/chatFunctions";
|
||||
|
@ -494,8 +498,8 @@ export const ChatInputArea = forwardRef<HTMLTextAreaElement, ChatInputProps>((pr
|
|||
</div>
|
||||
<Textarea
|
||||
ref={chatInputRef}
|
||||
className={`border-none focus:border-none
|
||||
focus:outline-none focus-visible:ring-transparent
|
||||
className={`border-none focus:border-none focus:outline-none focus-visible:ring-transparent
|
||||
animate-carate-blink ${convertColorToCaretClass(props.agentColor)}
|
||||
w-full h-16 min-h-16 max-h-[128px] md:py-4 rounded-lg resize-none dark:bg-neutral-700
|
||||
${props.isMobileWidth ? "text-md" : "text-lg"}`}
|
||||
placeholder="Type / to see a list of commands"
|
||||
|
|
|
@ -32,6 +32,11 @@ const config = {
|
|||
/ring-(blue|yellow|green|pink|purple|orange|red|slate|gray|zinc|neutral|stone|amber|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|fuchsia|rose)-(50|100|200|400|500|950)/,
|
||||
variants: ["focus-visible", "dark"],
|
||||
},
|
||||
{
|
||||
pattern:
|
||||
/caret-(blue|yellow|green|pink|purple|orange|red|slate|gray|zinc|neutral|stone|amber|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|fuchsia|rose)-(50|100|200|400|500|950)/,
|
||||
variants: ["focus", "dark"],
|
||||
},
|
||||
],
|
||||
darkMode: ["class"],
|
||||
content: [
|
||||
|
|
Loading…
Reference in a new issue