balibabu
commited on
Commit
·
e6a705f
1
Parent(s):
563b0d7
feat: Add banner #3221 (#3442)
Browse files### What problem does this PR solve?
feat: Add banner #3221
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
- web/package-lock.json +23 -0
- web/package.json +1 -0
- web/src/assets/banner.png +0 -0
- web/src/components/ui/aspect-ratio.tsx +7 -0
- web/src/components/ui/badge.tsx +36 -0
- web/src/pages/home/banner.tsx +51 -0
- web/src/pages/home/index.tsx +4 -2
- web/src/pages/home/next-banner.tsx +64 -0
- web/tailwind.config.js +4 -0
- web/tailwind.css +3 -0
web/package-lock.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
| 13 |
"@hookform/resolvers": "^3.9.1",
|
| 14 |
"@js-preview/excel": "^1.7.8",
|
| 15 |
"@monaco-editor/react": "^4.6.0",
|
|
|
|
| 16 |
"@radix-ui/react-avatar": "^1.1.1",
|
| 17 |
"@radix-ui/react-checkbox": "^1.1.2",
|
| 18 |
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
|
@@ -4085,6 +4086,28 @@
|
|
| 4085 |
}
|
| 4086 |
}
|
| 4087 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4088 |
"node_modules/@radix-ui/react-avatar": {
|
| 4089 |
"version": "1.1.1",
|
| 4090 |
"resolved": "https://registry.npmmirror.com/@radix-ui/react-avatar/-/react-avatar-1.1.1.tgz",
|
|
|
|
| 13 |
"@hookform/resolvers": "^3.9.1",
|
| 14 |
"@js-preview/excel": "^1.7.8",
|
| 15 |
"@monaco-editor/react": "^4.6.0",
|
| 16 |
+
"@radix-ui/react-aspect-ratio": "^1.1.0",
|
| 17 |
"@radix-ui/react-avatar": "^1.1.1",
|
| 18 |
"@radix-ui/react-checkbox": "^1.1.2",
|
| 19 |
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
|
|
|
| 4086 |
}
|
| 4087 |
}
|
| 4088 |
},
|
| 4089 |
+
"node_modules/@radix-ui/react-aspect-ratio": {
|
| 4090 |
+
"version": "1.1.0",
|
| 4091 |
+
"resolved": "https://registry.npmmirror.com/@radix-ui/react-aspect-ratio/-/react-aspect-ratio-1.1.0.tgz",
|
| 4092 |
+
"integrity": "sha512-dP87DM/Y7jFlPgUZTlhx6FF5CEzOiaxp2rBCKlaXlpH5Ip/9Fg5zZ9lDOQ5o/MOfUlf36eak14zoWYpgcgGoOg==",
|
| 4093 |
+
"dependencies": {
|
| 4094 |
+
"@radix-ui/react-primitive": "2.0.0"
|
| 4095 |
+
},
|
| 4096 |
+
"peerDependencies": {
|
| 4097 |
+
"@types/react": "*",
|
| 4098 |
+
"@types/react-dom": "*",
|
| 4099 |
+
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
|
| 4100 |
+
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
| 4101 |
+
},
|
| 4102 |
+
"peerDependenciesMeta": {
|
| 4103 |
+
"@types/react": {
|
| 4104 |
+
"optional": true
|
| 4105 |
+
},
|
| 4106 |
+
"@types/react-dom": {
|
| 4107 |
+
"optional": true
|
| 4108 |
+
}
|
| 4109 |
+
}
|
| 4110 |
+
},
|
| 4111 |
"node_modules/@radix-ui/react-avatar": {
|
| 4112 |
"version": "1.1.1",
|
| 4113 |
"resolved": "https://registry.npmmirror.com/@radix-ui/react-avatar/-/react-avatar-1.1.1.tgz",
|
web/package.json
CHANGED
|
@@ -24,6 +24,7 @@
|
|
| 24 |
"@hookform/resolvers": "^3.9.1",
|
| 25 |
"@js-preview/excel": "^1.7.8",
|
| 26 |
"@monaco-editor/react": "^4.6.0",
|
|
|
|
| 27 |
"@radix-ui/react-avatar": "^1.1.1",
|
| 28 |
"@radix-ui/react-checkbox": "^1.1.2",
|
| 29 |
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
|
|
|
| 24 |
"@hookform/resolvers": "^3.9.1",
|
| 25 |
"@js-preview/excel": "^1.7.8",
|
| 26 |
"@monaco-editor/react": "^4.6.0",
|
| 27 |
+
"@radix-ui/react-aspect-ratio": "^1.1.0",
|
| 28 |
"@radix-ui/react-avatar": "^1.1.1",
|
| 29 |
"@radix-ui/react-checkbox": "^1.1.2",
|
| 30 |
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
web/src/assets/banner.png
ADDED
|
web/src/components/ui/aspect-ratio.tsx
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client';
|
| 2 |
+
|
| 3 |
+
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
| 4 |
+
|
| 5 |
+
const AspectRatio = AspectRatioPrimitive.Root;
|
| 6 |
+
|
| 7 |
+
export { AspectRatio };
|
web/src/components/ui/badge.tsx
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { cva, type VariantProps } from 'class-variance-authority';
|
| 2 |
+
import * as React from 'react';
|
| 3 |
+
|
| 4 |
+
import { cn } from '@/lib/utils';
|
| 5 |
+
|
| 6 |
+
const badgeVariants = cva(
|
| 7 |
+
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
| 8 |
+
{
|
| 9 |
+
variants: {
|
| 10 |
+
variant: {
|
| 11 |
+
default:
|
| 12 |
+
'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
|
| 13 |
+
secondary:
|
| 14 |
+
'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
| 15 |
+
destructive:
|
| 16 |
+
'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
|
| 17 |
+
outline: 'text-foreground',
|
| 18 |
+
},
|
| 19 |
+
},
|
| 20 |
+
defaultVariants: {
|
| 21 |
+
variant: 'default',
|
| 22 |
+
},
|
| 23 |
+
},
|
| 24 |
+
);
|
| 25 |
+
|
| 26 |
+
export interface BadgeProps
|
| 27 |
+
extends React.HTMLAttributes<HTMLDivElement>,
|
| 28 |
+
VariantProps<typeof badgeVariants> {}
|
| 29 |
+
|
| 30 |
+
function Badge({ className, variant, ...props }: BadgeProps) {
|
| 31 |
+
return (
|
| 32 |
+
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
| 33 |
+
);
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
export { Badge, badgeVariants };
|
web/src/pages/home/banner.tsx
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Card, CardContent } from '@/components/ui/card';
|
| 2 |
+
import { ArrowRight } from 'lucide-react';
|
| 3 |
+
|
| 4 |
+
function BannerCard() {
|
| 5 |
+
return (
|
| 6 |
+
<Card className="w-auto border-none h-3/4">
|
| 7 |
+
<CardContent className="p-4">
|
| 8 |
+
<span className="inline-block bg-backgroundCoreWeak rounded-sm px-1 text-xs">
|
| 9 |
+
System
|
| 10 |
+
</span>
|
| 11 |
+
<div className="flex mt-1 gap-4">
|
| 12 |
+
<span className="text-lg truncate">Setting up your LLM</span>
|
| 13 |
+
<ArrowRight />
|
| 14 |
+
</div>
|
| 15 |
+
</CardContent>
|
| 16 |
+
</Card>
|
| 17 |
+
);
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
function MyCard() {
|
| 21 |
+
return (
|
| 22 |
+
<div className="w-[265px] h-[87px] pl-[17px] pr-[13px] py-[15px] bg-[#b8b5cb]/20 rounded-xl border border-[#e6e3f6]/10 backdrop-blur-md justify-between items-end inline-flex">
|
| 23 |
+
<div className="grow shrink basis-0 flex-col justify-start items-start gap-[9px] inline-flex">
|
| 24 |
+
<div className="px-1 py-0.5 bg-[#644bf7] rounded justify-center items-center gap-2 inline-flex">
|
| 25 |
+
<div className="text-white text-xs font-medium font-['IBM Plex Mono'] leading-none">
|
| 26 |
+
System
|
| 27 |
+
</div>
|
| 28 |
+
</div>
|
| 29 |
+
<div className="self-stretch text-white text-lg font-normal font-['Inter'] leading-7">
|
| 30 |
+
Setting up your LLM
|
| 31 |
+
</div>
|
| 32 |
+
</div>
|
| 33 |
+
<div className="w-6 h-6 relative" />
|
| 34 |
+
</div>
|
| 35 |
+
);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
export function Banner() {
|
| 39 |
+
return (
|
| 40 |
+
<section className="bg-[url('@/assets/banner.png')] bg-cover h-28 rounded-2xl mx-14 my-8 flex gap-8 justify-between">
|
| 41 |
+
<div className="h-full text-3xl font-bold items-center inline-flex ml-6">
|
| 42 |
+
Welcome to RAGFlow
|
| 43 |
+
</div>
|
| 44 |
+
<div className="flex justify-between items-center gap-10 mr-5">
|
| 45 |
+
<BannerCard></BannerCard>
|
| 46 |
+
<BannerCard></BannerCard>
|
| 47 |
+
<MyCard></MyCard>
|
| 48 |
+
</div>
|
| 49 |
+
</section>
|
| 50 |
+
);
|
| 51 |
+
}
|
web/src/pages/home/index.tsx
CHANGED
|
@@ -1,12 +1,14 @@
|
|
| 1 |
-
import {
|
| 2 |
import { HomeHeader } from './header';
|
|
|
|
| 3 |
|
| 4 |
const Home = () => {
|
| 5 |
return (
|
| 6 |
<div>
|
| 7 |
<HomeHeader></HomeHeader>
|
| 8 |
<section>
|
| 9 |
-
<
|
|
|
|
| 10 |
</section>
|
| 11 |
</div>
|
| 12 |
);
|
|
|
|
| 1 |
+
import { Banner } from './banner';
|
| 2 |
import { HomeHeader } from './header';
|
| 3 |
+
import NextBanner from './next-banner';
|
| 4 |
|
| 5 |
const Home = () => {
|
| 6 |
return (
|
| 7 |
<div>
|
| 8 |
<HomeHeader></HomeHeader>
|
| 9 |
<section>
|
| 10 |
+
<Banner></Banner>
|
| 11 |
+
<NextBanner></NextBanner>
|
| 12 |
</section>
|
| 13 |
</div>
|
| 14 |
);
|
web/src/pages/home/next-banner.tsx
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Badge } from '@/components/ui/badge';
|
| 2 |
+
import { Card, CardContent } from '@/components/ui/card';
|
| 3 |
+
import { ArrowRight, X } from 'lucide-react';
|
| 4 |
+
|
| 5 |
+
const guideCards = [
|
| 6 |
+
{
|
| 7 |
+
badge: 'System',
|
| 8 |
+
title: 'Setting up your LLM',
|
| 9 |
+
},
|
| 10 |
+
{
|
| 11 |
+
badge: 'Chat app',
|
| 12 |
+
title: 'Configuration guides',
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
badge: 'Search app',
|
| 16 |
+
title: 'Prompt setting guides',
|
| 17 |
+
},
|
| 18 |
+
];
|
| 19 |
+
|
| 20 |
+
export default function WelcomeGuide(): JSX.Element {
|
| 21 |
+
return (
|
| 22 |
+
<div className="flex w-full max-w-[1800px] items-center gap-4 px-[60px] py-6 relative bg-[#223d8e0d] rounded-3xl overflow-hidden">
|
| 23 |
+
<div
|
| 24 |
+
className="absolute inset-0 bg-gradient-to-r from-pink-300 via-purple-400 to-blue-500 opacity-75"
|
| 25 |
+
style={{
|
| 26 |
+
backgroundSize: 'cover',
|
| 27 |
+
backgroundPosition: 'center',
|
| 28 |
+
}}
|
| 29 |
+
/>
|
| 30 |
+
|
| 31 |
+
<h1 className="relative flex-1 text-4xl font-bold text-white">
|
| 32 |
+
Welcome to RAGFlow
|
| 33 |
+
</h1>
|
| 34 |
+
|
| 35 |
+
<div className="inline-flex items-center gap-[22px] relative">
|
| 36 |
+
{guideCards.map((card, index) => (
|
| 37 |
+
<Card
|
| 38 |
+
key={index}
|
| 39 |
+
className="w-[265px] backdrop-blur-md border-colors-outline-neutral-standard"
|
| 40 |
+
>
|
| 41 |
+
<CardContent className="flex items-end justify-between p-[15px]">
|
| 42 |
+
<div className="flex flex-col items-start gap-[9px] flex-1">
|
| 43 |
+
<Badge
|
| 44 |
+
variant="secondary"
|
| 45 |
+
className="bg-colors-background-core-weak text-colors-text-neutral-strong"
|
| 46 |
+
>
|
| 47 |
+
{card.badge}
|
| 48 |
+
</Badge>
|
| 49 |
+
<p className="text-lg text-colors-text-neutral-strong">
|
| 50 |
+
{card.title}
|
| 51 |
+
</p>
|
| 52 |
+
</div>
|
| 53 |
+
<ArrowRight className="w-6 h-6" />
|
| 54 |
+
</CardContent>
|
| 55 |
+
</Card>
|
| 56 |
+
))}
|
| 57 |
+
</div>
|
| 58 |
+
|
| 59 |
+
<button className="relative p-1 hover:bg-white/10 rounded-full transition-colors">
|
| 60 |
+
<X className="w-6 h-6 text-white" />
|
| 61 |
+
</button>
|
| 62 |
+
</div>
|
| 63 |
+
);
|
| 64 |
+
}
|
web/tailwind.config.js
CHANGED
|
@@ -65,6 +65,10 @@ module.exports = {
|
|
| 65 |
DEFAULT: 'var(--background-core-standard)',
|
| 66 |
foreground: 'var(--background-core-standard-foreground)',
|
| 67 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
},
|
| 69 |
borderRadius: {
|
| 70 |
lg: `var(--radius)`,
|
|
|
|
| 65 |
DEFAULT: 'var(--background-core-standard)',
|
| 66 |
foreground: 'var(--background-core-standard-foreground)',
|
| 67 |
},
|
| 68 |
+
backgroundCoreWeak: {
|
| 69 |
+
DEFAULT: 'var(--background-core-weak)',
|
| 70 |
+
foreground: 'var(--background-core-weak-foreground)',
|
| 71 |
+
},
|
| 72 |
},
|
| 73 |
borderRadius: {
|
| 74 |
lg: `var(--radius)`,
|
web/tailwind.css
CHANGED
|
@@ -84,6 +84,9 @@
|
|
| 84 |
|
| 85 |
--background-inverse-strong: rgba(255, 255, 255, 0.15);
|
| 86 |
--background-inverse-strong-foreground: rgba(255, 255, 255, 1);
|
|
|
|
|
|
|
|
|
|
| 87 |
}
|
| 88 |
}
|
| 89 |
|
|
|
|
| 84 |
|
| 85 |
--background-inverse-strong: rgba(255, 255, 255, 0.15);
|
| 86 |
--background-inverse-strong-foreground: rgba(255, 255, 255, 1);
|
| 87 |
+
|
| 88 |
+
--background-core-weak: rgb(101, 75, 248);
|
| 89 |
+
--background-core-weak-foreground: rgba(255, 255, 255, 1);
|
| 90 |
}
|
| 91 |
}
|
| 92 |
|