Browse Source

Feat: Configure colors according to the design draft#3221 (#9301)

### What problem does this PR solve?

Feat: Configure colors according to the design draft#3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
tags/v0.20.1
balibabu 2 months ago
parent
commit
23062cb27a
No account linked to committer's email address

+ 3
- 3
web/src/components/edit-tag/index.tsx View File

<HoverCardTrigger> <HoverCardTrigger>
<div <div
key={tag} key={tag}
className="w-fit flex items-center justify-center gap-2 border-dashed border px-1 rounded-sm bg-background-card"
className="w-fit flex items-center justify-center gap-2 border-dashed border px-1 rounded-sm bg-bg-card"
> >
<div className="flex gap-2 items-center"> <div className="flex gap-2 items-center">
<div className="max-w-80 overflow-hidden text-ellipsis"> <div className="max-w-80 overflow-hidden text-ellipsis">
<Input <Input
ref={inputRef} ref={inputRef}
type="text" type="text"
className="h-8 bg-background-card"
className="h-8 bg-bg-card"
value={inputValue} value={inputValue}
onChange={handleInputChange} onChange={handleInputChange}
onBlur={handleInputConfirm} onBlur={handleInputConfirm}
) : ( ) : (
<Button <Button
variant="dashed" variant="dashed"
className="w-fit flex items-center justify-center gap-2 bg-background-card"
className="w-fit flex items-center justify-center gap-2 bg-bg-card"
onClick={showInput} onClick={showInput}
style={tagPlusStyle} style={tagPlusStyle}
> >

+ 1
- 1
web/src/components/next-message-item/index.tsx View File

? styles.messageTextDark ? styles.messageTextDark
: styles.messageText]: isAssistant, : styles.messageText]: isAssistant,
[styles.messageUserText]: !isAssistant, [styles.messageUserText]: !isAssistant,
'bg-background-card': !isAssistant,
'bg-bg-card': !isAssistant,
})} })}
> >
{item.data ? ( {item.data ? (

+ 1
- 1
web/src/components/ui/badge.tsx View File

default: default:
'border-transparent bg-primary text-primary-foreground hover:bg-primary/80', 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
secondary: secondary:
'border-transparent bg-background-card text-text-sub-title-invert hover:bg-secondary/80 rounded-md',
'border-transparent bg-bg-card text-text-sub-title-invert hover:bg-secondary/80 rounded-md',
destructive: destructive:
'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80', 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
outline: 'text-foreground', outline: 'text-foreground',

+ 2
- 3
web/src/components/ui/button.tsx View File

'bg-destructive text-destructive-foreground hover:bg-destructive/90', 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
outline: outline:
'border border-text-sub-title-invert bg-transparent hover:bg-accent hover:text-accent-foreground', 'border border-text-sub-title-invert bg-transparent hover:bg-accent hover:text-accent-foreground',
secondary:
'bg-background-card text-secondary-foreground hover:bg-secondary/80',
secondary: 'bg-bg-card text-secondary-foreground hover:bg-secondary/80',
ghost: 'hover:bg-accent hover:text-accent-foreground', ghost: 'hover:bg-accent hover:text-accent-foreground',
link: 'text-primary underline-offset-4 hover:underline', link: 'text-primary underline-offset-4 hover:underline',
tertiary: tertiary:
return ( return (
<Comp <Comp
className={cn( className={cn(
'bg-background-card',
'bg-bg-card',
buttonVariants({ variant, size, className }), buttonVariants({ variant, size, className }),
)} )}
ref={ref} ref={ref}

+ 1
- 4
web/src/components/ui/card.tsx View File

>(({ className, ...props }, ref) => ( >(({ className, ...props }, ref) => (
<div <div
ref={ref} ref={ref}
className={cn(
'rounded-lg bg-background-card text-card-foreground shadow-sm',
className,
)}
className={cn('rounded-lg bg-bg-card shadow-sm', className)}
{...props} {...props}
/> />
)); ));

+ 1
- 1
web/src/components/ui/table.tsx View File

>(({ className, rootClassName, ...props }, ref) => ( >(({ className, rootClassName, ...props }, ref) => (
<div <div
className={cn( className={cn(
'relative w-full overflow-auto rounded-2xl bg-background-card',
'relative w-full overflow-auto rounded-2xl bg-bg-card',
rootClassName, rootClassName,
)} )}
> >

+ 1
- 1
web/src/locales/en.ts View File

'30d': '30 days', '30d': '30 days',
}, },
publish: 'API', publish: 'API',
exeSQL: 'ExeSQL',
exeSQL: 'Execute SQL',
exeSQLDescription: exeSQLDescription:
'A component that performs SQL queries on a relational database, supporting querying from MySQL, PostgreSQL, or MariaDB.', 'A component that performs SQL queries on a relational database, supporting querying from MySQL, PostgreSQL, or MariaDB.',
dbType: 'Database Type', dbType: 'Database Type',

+ 2
- 2
web/src/pages/agent/canvas/node/agent-node.tsx View File

></Handle> ></Handle>
<NodeHeader id={id} name={data.name} label={data.label}></NodeHeader> <NodeHeader id={id} name={data.name} label={data.label}></NodeHeader>
<section className="flex flex-col gap-2"> <section className="flex flex-col gap-2">
<div className={'bg-background-card rounded-sm p-1'}>
<div className={'bg-bg-card rounded-sm p-1'}>
<LLMLabel value={get(data, 'form.llm_id')}></LLMLabel> <LLMLabel value={get(data, 'form.llm_id')}></LLMLabel>
</div> </div>
{(isGotoMethod || {(isGotoMethod ||
exceptionMethod === AgentExceptionMethod.Comment) && ( exceptionMethod === AgentExceptionMethod.Comment) && (
<div className="bg-background-card rounded-sm p-1 flex justify-between gap-2">
<div className="bg-bg-card rounded-sm p-1 flex justify-between gap-2">
<span className="text-text-sub-title">On Failure</span> <span className="text-text-sub-title">On Failure</span>
<span className="truncate flex-1 text-right"> <span className="truncate flex-1 text-right">
{t(`flow.${exceptionMethod}`)} {t(`flow.${exceptionMethod}`)}

+ 2
- 2
web/src/pages/agent/canvas/node/categorize-node.tsx View File

<NodeHeader id={id} name={data.name} label={data.label}></NodeHeader> <NodeHeader id={id} name={data.name} label={data.label}></NodeHeader>


<section className="flex flex-col gap-2"> <section className="flex flex-col gap-2">
<div className={'bg-background-card rounded-sm px-1'}>
<div className={'bg-bg-card rounded-sm px-1'}>
<LLMLabel value={get(data, 'form.llm_id')}></LLMLabel> <LLMLabel value={get(data, 'form.llm_id')}></LLMLabel>
</div> </div>
{positions.map((position) => { {positions.map((position) => {
return ( return (
<div key={position.uuid}> <div key={position.uuid}>
<div className={'bg-background-card rounded-sm p-1 truncate'}>
<div className={'bg-bg-card rounded-sm p-1 truncate'}>
{position.name} {position.name}
</div> </div>
<CommonHandle <CommonHandle

+ 1
- 1
web/src/pages/agent/canvas/node/dropdown/next-step-dropdown.tsx View File

<TooltipTrigger asChild> <TooltipTrigger asChild>
<DropdownMenuItem <DropdownMenuItem
key={x} key={x}
className="hover:bg-background-card py-1 px-3 cursor-pointer rounded-sm flex gap-2 items-center justify-start"
className="hover:bg-bg-card py-1 px-3 cursor-pointer rounded-sm flex gap-2 items-center justify-start"
onClick={addCanvasNode(x, { onClick={addCanvasNode(x, {
nodeId, nodeId,
id, id,

+ 1
- 1
web/src/pages/agent/embed-dialog/index.tsx View File

{t(isAgent ? 'flow' : 'chat', { keyPrefix: 'header' })} {t(isAgent ? 'flow' : 'chat', { keyPrefix: 'header' })}
<span className="ml-1 inline-block">ID</span> <span className="ml-1 inline-block">ID</span>
</div> </div>
<div className="bg-background-card rounded-lg flex justify-between p-2">
<div className="bg-bg-card rounded-lg flex justify-between p-2">
<span>{token} </span> <span>{token} </span>
<CopyToClipboard text={token}></CopyToClipboard> <CopyToClipboard text={token}></CopyToClipboard>
</div> </div>

+ 1
- 1
web/src/pages/agent/form/agent-form/agent-tools.tsx View File

<li <li
{...props} {...props}
className={cn( className={cn(
'flex bg-background-card p-1 rounded-sm justify-between',
'flex bg-bg-card p-1 rounded-sm justify-between',
className, className,
)} )}
> >

+ 1
- 1
web/src/pages/agent/form/switch-form/index.tsx View File

}, },
)} )}
> >
<section className="p-2 bg-background-card flex justify-between items-center">
<section className="p-2 bg-bg-card flex justify-between items-center">
<FormField <FormField
control={form.control} control={form.control}
name={`${name}.${index}.cpn_id`} name={`${name}.${index}.cpn_id`}

+ 1
- 1
web/src/pages/agent/log-sheet/toolTimelineItem.tsx View File

<Accordion <Accordion
type="single" type="single"
collapsible collapsible
className="bg-background-card px-3"
className="bg-bg-card px-3"
> >
<AccordionItem value={idx.toString()}> <AccordionItem value={idx.toString()}>
<AccordionTrigger <AccordionTrigger

+ 1
- 1
web/src/pages/agent/log-sheet/workFlowTimeline.tsx View File

<Accordion <Accordion
type="single" type="single"
collapsible collapsible
className="bg-background-card px-3"
className="bg-bg-card px-3"
> >
<AccordionItem value={idx.toString()}> <AccordionItem value={idx.toString()}>
<AccordionTrigger <AccordionTrigger

+ 4
- 7
web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-result-bar/index.tsx View File

}; };
return ( return (
<div className="flex pr-[25px]"> <div className="flex pr-[25px]">
<div className="flex items-center gap-4 bg-background-card text-muted-foreground w-fit h-[35px] rounded-md px-4 py-2">
<div className="flex items-center gap-4 bg-bg-card text-muted-foreground w-fit h-[35px] rounded-md px-4 py-2">
{textSelectOptions.map((option) => ( {textSelectOptions.map((option) => (
<div <div
key={option.value} key={option.value}
</div> </div>
<div className="ml-auto"></div> <div className="ml-auto"></div>
<Input <Input
className="bg-background-card text-muted-foreground"
className="bg-bg-card text-muted-foreground"
style={{ width: 200 }} style={{ width: 200 }}
placeholder={t('search')} placeholder={t('search')}
icon={<SearchOutlined />} icon={<SearchOutlined />}
<div className="w-[20px]"></div> <div className="w-[20px]"></div>
<Popover> <Popover>
<PopoverTrigger asChild> <PopoverTrigger asChild>
<Button className="bg-background-card text-muted-foreground hover:bg-card">
<Button className="bg-bg-card text-muted-foreground hover:bg-card">
<ListFilter /> <ListFilter />
</Button> </Button>
</PopoverTrigger> </PopoverTrigger>
</PopoverContent> </PopoverContent>
</Popover> </Popover>
<div className="w-[20px]"></div> <div className="w-[20px]"></div>
<Button
onClick={() => createChunk()}
className="bg-background-card text-primary"
>
<Button onClick={() => createChunk()} className="bg-bg-card text-primary">
<Plus size={44} /> <Plus size={44} />
</Button> </Button>
</div> </div>

+ 1
- 1
web/src/pages/dataset/sidebar/index.tsx View File

className={cn( className={cn(
'w-full justify-start gap-2.5 px-3 relative h-10 text-text-sub-title-invert', 'w-full justify-start gap-2.5 px-3 relative h-10 text-text-sub-title-invert',
{ {
'bg-background-card': active,
'bg-bg-card': active,
'text-text-title': active, 'text-text-title': active,
}, },
)} )}

+ 1
- 1
web/src/pages/next-chats/chat/sessions.tsx View File

key={x.id} key={x.id}
onClick={handleCardClick(x.id, x.is_new)} onClick={handleCardClick(x.id, x.is_new)}
className={cn('cursor-pointer bg-transparent', { className={cn('cursor-pointer bg-transparent', {
'bg-background-card': conversationId === x.id,
'bg-bg-card': conversationId === x.id,
})} })}
> >
<CardContent className="px-3 py-2 flex justify-between items-center group"> <CardContent className="px-3 py-2 flex justify-between items-center group">

+ 22
- 0
web/tailwind.config.js View File

'dot-green': 'var(--dot-green)', 'dot-green': 'var(--dot-green)',
'dot-red': 'var(--dot-red)', 'dot-red': 'var(--dot-red)',


/* design colors */

'bg-base': 'var(--bg-base)',
'bg-card': 'var(--bg-card)',
'text-primary': 'var(--text-primary)',
'text-disabled': 'var(--text-disabled)',
'text-input-tip': 'var(--text-input-tip)',
'border-default': 'var(--border-default)',
'border-accent': 'var(--border-accent)',
'border-button': 'var(--border-button)',
'accent-primary': 'var(--accent-primary)',
'bg-accent': 'var(--bg-accent)',
'state--success': 'var(--state--success)',
'state--warning': 'var(--state--warning)',
'state--error': 'var(--state--error)',
'team-group': 'var(--team-group)',
'team-member': 'var(--team-member)',
'team-department': 'var(--team-department)',
'bg-group': 'var(--bg-group)',
'bg-member': 'var(--bg-member)',
'bg-department': 'var(--bg-department)',

primary: { primary: {
DEFAULT: 'hsl(var(--primary))', DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))', foreground: 'hsl(var(--primary-foreground))',

+ 44
- 0
web/tailwind.css View File

--input-border: rgba(22, 22, 24, 0.2); --input-border: rgba(22, 22, 24, 0.2);
--dot-green: rgba(59, 160, 92, 1); --dot-green: rgba(59, 160, 92, 1);
--dot-red: rgba(216, 73, 75, 1); --dot-red: rgba(216, 73, 75, 1);

/* design colors */

--bg-base: #f6f6f7;
/* card color , dividing line */
--bg-card: rgba(0, 0, 0, 0.05);
/* Button ,Body text, Input completed text */
--text-primary: #161618;
--text-secondary: #75787a;
--text-disabled: #b2b5b7;
/* input placeholder color */
--text-input-tip: #b2b5b7;
/* Input default color */
--border-default: rgba(0, 0, 0, 0.2);
/* Input accent color */
--border-accent: #000000;
--border-button: rgba(0, 0, 0, 0.1);
/* Regulators, parsing, switches, variables */
--accent-primary: #4ca4e7;
/* Output Variables Box */
--bg-accent: rgba(76, 164, 231, 0.05);

--state--success: #3ba05c;
--state--warning: #faad14;
--state-error: #d8494b;

--team-group: #5ab77e;
--team-member: #5c96c8;
--team-department: #8866d3;
--bg-group: rgba(90, 183, 126, 0.1);
--bg-member: rgba(92, 150, 200, 0.1);
--bg-department: rgba(136, 102, 211, 0.1);
} }


.dark { .dark {


--dot-green: rgba(59, 160, 92, 1); --dot-green: rgba(59, 160, 92, 1);
--dot-red: rgba(216, 73, 75, 1); --dot-red: rgba(216, 73, 75, 1);

/* design colors */

--bg-base: #161618;
--bg-card: rgba(255, 255, 255, 0.05);
--text-primary: #f6f6f7;
--text-secondary: #b2b5b7;
--text-disabled: #75787a;
--text-input-tip: #75787a;
--border-default: rgba(255, 255, 255, 0.2);
--border-accent: #ffffff;
--border-button: rgba(255, 255, 255, 0.1);
} }
} }



Loading…
Cancel
Save