balibabu
commited on
Commit
·
8446e15
1
Parent(s):
08913be
Feat: Modify the style of the home page in bright mode #3221 (#3832)
Browse files### What problem does this PR solve?
Feat: Modify the style of the home page in bright mode #3221
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
- web/src/components/ui/button.tsx +1 -0
- web/src/components/ui/container.tsx +1 -1
- web/src/components/ui/segmented .tsx +4 -2
- web/src/layouts/next-header.tsx +6 -3
- web/src/layouts/next.tsx +1 -1
- web/src/pages/dataset/settings/index.tsx +6 -1
- web/src/pages/home/applications.tsx +7 -4
- web/src/pages/home/datasets.tsx +2 -2
- web/src/pages/home/index.tsx +1 -3
- web/src/routes.ts +7 -1
- web/tailwind.config.js +9 -1
- web/tailwind.css +11 -4
web/src/components/ui/button.tsx
CHANGED
@@ -20,6 +20,7 @@ const buttonVariants = cva(
|
|
20 |
link: 'text-primary underline-offset-4 hover:underline',
|
21 |
tertiary:
|
22 |
'bg-colors-text-core-standard text-foreground hover:bg-colors-text-core-standard/80',
|
|
|
23 |
},
|
24 |
size: {
|
25 |
default: 'h-10 px-4 py-2',
|
|
|
20 |
link: 'text-primary underline-offset-4 hover:underline',
|
21 |
tertiary:
|
22 |
'bg-colors-text-core-standard text-foreground hover:bg-colors-text-core-standard/80',
|
23 |
+
icon: 'bg-colors-background-inverse-standard text-foreground hover:bg-colors-background-inverse-standard/80',
|
24 |
},
|
25 |
size: {
|
26 |
default: 'h-10 px-4 py-2',
|
web/src/components/ui/container.tsx
CHANGED
@@ -8,7 +8,7 @@ export function Container({
|
|
8 |
return (
|
9 |
<div
|
10 |
className={cn(
|
11 |
-
'px-2 py-1 bg-
|
12 |
className,
|
13 |
)}
|
14 |
{...props}
|
|
|
8 |
return (
|
9 |
<div
|
10 |
className={cn(
|
11 |
+
'px-2 py-1 bg-colors-background-inverse-standard inline-flex items-center rounded-sm gap-2',
|
12 |
className,
|
13 |
)}
|
14 |
{...props}
|
web/src/components/ui/segmented .tsx
CHANGED
@@ -47,8 +47,10 @@ export function Segmented({
|
|
47 |
key={actualValue}
|
48 |
className={cn(
|
49 |
'inline-flex items-center px-3 py-2 text-sm font-medium rounded-sm cursor-pointer',
|
50 |
-
|
51 |
-
|
|
|
|
|
52 |
)}
|
53 |
onClick={() => onChange?.(actualValue)}
|
54 |
>
|
|
|
47 |
key={actualValue}
|
48 |
className={cn(
|
49 |
'inline-flex items-center px-3 py-2 text-sm font-medium rounded-sm cursor-pointer',
|
50 |
+
{
|
51 |
+
'bg-colors-background-inverse-strong': value === actualValue,
|
52 |
+
'text-colors-text-inverse-strong': value === actualValue,
|
53 |
+
},
|
54 |
)}
|
55 |
onClick={() => onChange?.(actualValue)}
|
56 |
>
|
web/src/layouts/next-header.tsx
CHANGED
@@ -72,7 +72,10 @@ export function Header() {
|
|
72 |
className="w-[100] h-[100] mr-[12]"
|
73 |
onClick={handleLogoClick}
|
74 |
/>
|
75 |
-
<Button
|
|
|
|
|
|
|
76 |
<Github />
|
77 |
21.5k stars
|
78 |
<Star />
|
@@ -87,13 +90,13 @@ export function Header() {
|
|
87 |
></Segmented>
|
88 |
</div>
|
89 |
<div className="flex items-center gap-4">
|
90 |
-
<Container>
|
91 |
V 0.13.0
|
92 |
<Button variant="secondary" className="size-8">
|
93 |
<ChevronDown />
|
94 |
</Button>
|
95 |
</Container>
|
96 |
-
<Container className="px-3 py-2">
|
97 |
<Avatar className="w-[30px] h-[30px]">
|
98 |
<AvatarImage src="https://github.com/shadcn.png" />
|
99 |
<AvatarFallback>CN</AvatarFallback>
|
|
|
72 |
className="w-[100] h-[100] mr-[12]"
|
73 |
onClick={handleLogoClick}
|
74 |
/>
|
75 |
+
<Button
|
76 |
+
variant="secondary"
|
77 |
+
className="bg-colors-background-inverse-standard"
|
78 |
+
>
|
79 |
<Github />
|
80 |
21.5k stars
|
81 |
<Star />
|
|
|
90 |
></Segmented>
|
91 |
</div>
|
92 |
<div className="flex items-center gap-4">
|
93 |
+
<Container className="bg-colors-background-inverse-standard">
|
94 |
V 0.13.0
|
95 |
<Button variant="secondary" className="size-8">
|
96 |
<ChevronDown />
|
97 |
</Button>
|
98 |
</Container>
|
99 |
+
<Container className="px-3 py-2 bg-colors-background-inverse-standard">
|
100 |
<Avatar className="w-[30px] h-[30px]">
|
101 |
<AvatarImage src="https://github.com/shadcn.png" />
|
102 |
<AvatarFallback>CN</AvatarFallback>
|
web/src/layouts/next.tsx
CHANGED
@@ -3,7 +3,7 @@ import { Header } from './next-header';
|
|
3 |
|
4 |
export default function NextLayout() {
|
5 |
return (
|
6 |
-
<section className="h-full flex flex-col">
|
7 |
<Header></Header>
|
8 |
<Outlet />
|
9 |
</section>
|
|
|
3 |
|
4 |
export default function NextLayout() {
|
5 |
return (
|
6 |
+
<section className="h-full flex flex-col text-colors-text-neutral-strong">
|
7 |
<Header></Header>
|
8 |
<Outlet />
|
9 |
</section>
|
web/src/pages/dataset/settings/index.tsx
CHANGED
@@ -1,3 +1,8 @@
|
|
1 |
export default function DatasetSettings() {
|
2 |
-
return
|
|
|
|
|
|
|
|
|
|
|
3 |
}
|
|
|
1 |
export default function DatasetSettings() {
|
2 |
+
return (
|
3 |
+
<section>
|
4 |
+
<span className="text-3xl font-bold ">Basic settings</span>
|
5 |
+
<span className="text-3xl font-bold ">Advanced settings</span>
|
6 |
+
</section>
|
7 |
+
);
|
8 |
}
|
web/src/pages/home/applications.tsx
CHANGED
@@ -65,19 +65,22 @@ export function Applications() {
|
|
65 |
return (
|
66 |
<section className="mt-12">
|
67 |
<div className="flex justify-between items-center mb-6">
|
68 |
-
<h2 className="text-2xl font-bold">Applications</h2>
|
69 |
<Segmented
|
70 |
options={options}
|
71 |
value={val}
|
72 |
onChange={handleChange}
|
73 |
-
className="bg-colors-background-inverse-standard"
|
74 |
></Segmented>
|
75 |
</div>
|
76 |
<div className="grid grid-cols-4 gap-6">
|
77 |
{[...Array(12)].map((_, i) => {
|
78 |
const app = applications[i % 4];
|
79 |
return (
|
80 |
-
<Card
|
|
|
|
|
|
|
81 |
<CardContent className="p-4 flex items-center gap-6">
|
82 |
<div className="w-[70px] h-[70px] rounded-xl flex items-center justify-center bg-gradient-to-br from-[#45A7FA] via-[#AE63E3] to-[#4433FF]">
|
83 |
{app.icon}
|
@@ -87,7 +90,7 @@ export function Applications() {
|
|
87 |
<p className="text-sm opacity-80">{app.type}</p>
|
88 |
<p className="text-sm opacity-80">{app.date}</p>
|
89 |
</div>
|
90 |
-
<Button variant="
|
91 |
<ChevronRight className="h-6 w-6" />
|
92 |
</Button>
|
93 |
</CardContent>
|
|
|
65 |
return (
|
66 |
<section className="mt-12">
|
67 |
<div className="flex justify-between items-center mb-6">
|
68 |
+
<h2 className="text-2xl font-bold ">Applications</h2>
|
69 |
<Segmented
|
70 |
options={options}
|
71 |
value={val}
|
72 |
onChange={handleChange}
|
73 |
+
className="bg-colors-background-inverse-standard text-colors-text-neutral-standard"
|
74 |
></Segmented>
|
75 |
</div>
|
76 |
<div className="grid grid-cols-4 gap-6">
|
77 |
{[...Array(12)].map((_, i) => {
|
78 |
const app = applications[i % 4];
|
79 |
return (
|
80 |
+
<Card
|
81 |
+
key={i}
|
82 |
+
className="bg-colors-background-inverse-weak border-colors-outline-neutral-standard"
|
83 |
+
>
|
84 |
<CardContent className="p-4 flex items-center gap-6">
|
85 |
<div className="w-[70px] h-[70px] rounded-xl flex items-center justify-center bg-gradient-to-br from-[#45A7FA] via-[#AE63E3] to-[#4433FF]">
|
86 |
{app.icon}
|
|
|
90 |
<p className="text-sm opacity-80">{app.type}</p>
|
91 |
<p className="text-sm opacity-80">{app.date}</p>
|
92 |
</div>
|
93 |
+
<Button variant="icon" size="icon">
|
94 |
<ChevronRight className="h-6 w-6" />
|
95 |
</Button>
|
96 |
</CardContent>
|
web/src/pages/home/datasets.tsx
CHANGED
@@ -45,7 +45,7 @@ export function Datasets() {
|
|
45 |
{datasets.map((dataset) => (
|
46 |
<Card
|
47 |
key={dataset.id}
|
48 |
-
className="bg-colors-background-inverse-weak flex-1"
|
49 |
>
|
50 |
<CardContent className="p-4">
|
51 |
<div className="flex justify-between mb-4">
|
@@ -69,7 +69,7 @@ export function Datasets() {
|
|
69 |
Created {dataset.created}
|
70 |
</p>
|
71 |
</div>
|
72 |
-
<Button variant="
|
73 |
<ChevronRight className="h-6 w-6" />
|
74 |
</Button>
|
75 |
</div>
|
|
|
45 |
{datasets.map((dataset) => (
|
46 |
<Card
|
47 |
key={dataset.id}
|
48 |
+
className="bg-colors-background-inverse-weak flex-1 border-colors-outline-neutral-standard"
|
49 |
>
|
50 |
<CardContent className="p-4">
|
51 |
<div className="flex justify-between mb-4">
|
|
|
69 |
Created {dataset.created}
|
70 |
</p>
|
71 |
</div>
|
72 |
+
<Button variant="icon" size="icon">
|
73 |
<ChevronRight className="h-6 w-6" />
|
74 |
</Button>
|
75 |
</div>
|
web/src/pages/home/index.tsx
CHANGED
@@ -1,12 +1,10 @@
|
|
1 |
import { Applications } from './applications';
|
2 |
import { Banner } from './banner';
|
3 |
import { Datasets } from './datasets';
|
4 |
-
import { HomeHeader } from './header';
|
5 |
|
6 |
const Home = () => {
|
7 |
return (
|
8 |
-
<div className="
|
9 |
-
<HomeHeader></HomeHeader>
|
10 |
<section>
|
11 |
<Banner></Banner>
|
12 |
<Datasets></Datasets>
|
|
|
1 |
import { Applications } from './applications';
|
2 |
import { Banner } from './banner';
|
3 |
import { Datasets } from './datasets';
|
|
|
4 |
|
5 |
const Home = () => {
|
6 |
return (
|
7 |
+
<div className="mx-8">
|
|
|
8 |
<section>
|
9 |
<Banner></Banner>
|
10 |
<Datasets></Datasets>
|
web/src/routes.ts
CHANGED
@@ -129,7 +129,13 @@ const routes = [
|
|
129 |
{
|
130 |
path: '/home',
|
131 |
layout: false,
|
132 |
-
component: '@/
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
},
|
134 |
{
|
135 |
path: '/datasets',
|
|
|
129 |
{
|
130 |
path: '/home',
|
131 |
layout: false,
|
132 |
+
component: '@/layouts/next',
|
133 |
+
routes: [
|
134 |
+
{
|
135 |
+
path: '/home',
|
136 |
+
component: '@/pages/home',
|
137 |
+
},
|
138 |
+
],
|
139 |
},
|
140 |
{
|
141 |
path: '/datasets',
|
web/tailwind.config.js
CHANGED
@@ -23,17 +23,20 @@ module.exports = {
|
|
23 |
input: 'hsl(var(--input))',
|
24 |
ring: 'hsl(var(--ring))',
|
25 |
background: 'var(--background)',
|
26 |
-
foreground: '
|
27 |
buttonBlueText: 'var(--button-blue-text)',
|
28 |
|
29 |
'colors-outline-sentiment-primary':
|
30 |
'var(--colors-outline-sentiment-primary)',
|
31 |
'colors-outline-neutral-strong': 'var(--colors-outline-neutral-strong)',
|
|
|
|
|
32 |
|
33 |
'colors-text-core-standard': 'var(--colors-text-core-standard)',
|
34 |
'colors-text-neutral-strong': 'var(--colors-text-neutral-strong)',
|
35 |
'colors-text-neutral-standard': 'var(--colors-text-neutral-standard)',
|
36 |
'colors-text-functional-danger': 'var(--colors-text-functional-danger)',
|
|
|
37 |
|
38 |
primary: {
|
39 |
DEFAULT: 'hsl(var(--primary))',
|
@@ -80,6 +83,11 @@ module.exports = {
|
|
80 |
foreground: 'var(--background-core-weak-foreground)',
|
81 |
},
|
82 |
|
|
|
|
|
|
|
|
|
|
|
83 |
'color-background-brand-default': {
|
84 |
DEFAULT: 'var(--color-background-brand-default)',
|
85 |
foreground: 'var(--background-inverse-standard-foreground)',
|
|
|
23 |
input: 'hsl(var(--input))',
|
24 |
ring: 'hsl(var(--ring))',
|
25 |
background: 'var(--background)',
|
26 |
+
foreground: 'var(--colors-text-neutral-strong)',
|
27 |
buttonBlueText: 'var(--button-blue-text)',
|
28 |
|
29 |
'colors-outline-sentiment-primary':
|
30 |
'var(--colors-outline-sentiment-primary)',
|
31 |
'colors-outline-neutral-strong': 'var(--colors-outline-neutral-strong)',
|
32 |
+
'colors-outline-neutral-standard':
|
33 |
+
'var(--colors-outline-neutral-standard)',
|
34 |
|
35 |
'colors-text-core-standard': 'var(--colors-text-core-standard)',
|
36 |
'colors-text-neutral-strong': 'var(--colors-text-neutral-strong)',
|
37 |
'colors-text-neutral-standard': 'var(--colors-text-neutral-standard)',
|
38 |
'colors-text-functional-danger': 'var(--colors-text-functional-danger)',
|
39 |
+
'colors-text-inverse-strong': 'var(--colors-text-inverse-strong)',
|
40 |
|
41 |
primary: {
|
42 |
DEFAULT: 'hsl(var(--primary))',
|
|
|
83 |
foreground: 'var(--background-core-weak-foreground)',
|
84 |
},
|
85 |
|
86 |
+
'colors-background-inverse-standard': {
|
87 |
+
DEFAULT: 'var(--colors-background-inverse-standard)',
|
88 |
+
foreground: 'var(--colors-background-inverse-standard-foreground)',
|
89 |
+
},
|
90 |
+
|
91 |
'color-background-brand-default': {
|
92 |
DEFAULT: 'var(--color-background-brand-default)',
|
93 |
foreground: 'var(--background-inverse-standard-foreground)',
|
web/tailwind.css
CHANGED
@@ -35,18 +35,23 @@
|
|
35 |
|
36 |
--radius: 0.5rem;
|
37 |
|
38 |
-
--background-inverse-standard: rgba(
|
39 |
--background-inverse-standard-foreground: rgb(92, 81, 81);
|
|
|
|
|
|
|
40 |
|
41 |
--button-blue-text: rgb(22, 119, 255);
|
42 |
|
43 |
--colors-outline-sentiment-primary: rgba(127, 105, 255, 1);
|
44 |
--colors-outline-neutral-strong: rgba(112, 107, 107, 0.15);
|
|
|
45 |
|
46 |
--colors-text-core-standard: rgba(127, 105, 255, 1);
|
47 |
-
--colors-text-neutral-strong:
|
48 |
-
--colors-text-neutral-standard: rgba(
|
49 |
--colors-text-functional-danger: rgba(255, 81, 81, 1);
|
|
|
50 |
}
|
51 |
|
52 |
.dark {
|
@@ -111,7 +116,7 @@
|
|
111 |
0.5
|
112 |
);
|
113 |
--colors-background-inverse-standard: rgba(230, 227, 246, 0.15);
|
114 |
-
--colors-background-inverse-strong: rgba(255, 255, 255, 0.
|
115 |
--colors-background-inverse-weak: rgba(184, 181, 203, 0.15);
|
116 |
--colors-background-neutral-standard: rgba(11, 10, 18, 1);
|
117 |
--colors-background-neutral-strong: rgba(29, 26, 44, 1);
|
@@ -119,11 +124,13 @@
|
|
119 |
|
120 |
--colors-outline-sentiment-primary: rgba(146, 118, 255, 1);
|
121 |
--colors-outline-neutral-strong: rgba(255, 255, 255, 0.15);
|
|
|
122 |
|
123 |
--colors-text-core-standard: rgba(137, 126, 255, 1);
|
124 |
--colors-text-neutral-strong: rgba(255, 255, 255, 1);
|
125 |
--colors-text-neutral-standard: rgba(230, 227, 246, 1);
|
126 |
--colors-text-functional-danger: rgba(255, 81, 81, 1);
|
|
|
127 |
}
|
128 |
}
|
129 |
|
|
|
35 |
|
36 |
--radius: 0.5rem;
|
37 |
|
38 |
+
--background-inverse-standard: rgba(230, 227, 246, 0.15);
|
39 |
--background-inverse-standard-foreground: rgb(92, 81, 81);
|
40 |
+
--colors-background-inverse-standard: rgba(29, 26, 44, 0.1);
|
41 |
+
--colors-background-inverse-strong: rgba(11, 10, 18, 0.8);
|
42 |
+
--colors-background-inverse-weak: rgba(17, 16, 23, 0.1);
|
43 |
|
44 |
--button-blue-text: rgb(22, 119, 255);
|
45 |
|
46 |
--colors-outline-sentiment-primary: rgba(127, 105, 255, 1);
|
47 |
--colors-outline-neutral-strong: rgba(112, 107, 107, 0.15);
|
48 |
+
--colors-outline-neutral-standard: rgba(53, 51, 65, 0.1);
|
49 |
|
50 |
--colors-text-core-standard: rgba(127, 105, 255, 1);
|
51 |
+
--colors-text-neutral-strong: rgba(17, 16, 23, 1);
|
52 |
+
--colors-text-neutral-standard: rgba(53, 51, 65, 1);
|
53 |
--colors-text-functional-danger: rgba(255, 81, 81, 1);
|
54 |
+
--colors-text-inverse-strong: rgba(255, 255, 255, 1);
|
55 |
}
|
56 |
|
57 |
.dark {
|
|
|
116 |
0.5
|
117 |
);
|
118 |
--colors-background-inverse-standard: rgba(230, 227, 246, 0.15);
|
119 |
+
--colors-background-inverse-strong: rgba(255, 255, 255, 0.8);
|
120 |
--colors-background-inverse-weak: rgba(184, 181, 203, 0.15);
|
121 |
--colors-background-neutral-standard: rgba(11, 10, 18, 1);
|
122 |
--colors-background-neutral-strong: rgba(29, 26, 44, 1);
|
|
|
124 |
|
125 |
--colors-outline-sentiment-primary: rgba(146, 118, 255, 1);
|
126 |
--colors-outline-neutral-strong: rgba(255, 255, 255, 0.15);
|
127 |
+
--colors-outline-neutral-standard: rgba(230, 227, 246, 0.1);
|
128 |
|
129 |
--colors-text-core-standard: rgba(137, 126, 255, 1);
|
130 |
--colors-text-neutral-strong: rgba(255, 255, 255, 1);
|
131 |
--colors-text-neutral-standard: rgba(230, 227, 246, 1);
|
132 |
--colors-text-functional-danger: rgba(255, 81, 81, 1);
|
133 |
+
--colors-text-inverse-strong: rgba(17, 16, 23, 1);
|
134 |
}
|
135 |
}
|
136 |
|