Skip to content

Commit 01d5080

Browse files
committed
new devtools ui
1 parent e1f9d4d commit 01d5080

File tree

21 files changed

+1440
-56
lines changed

21 files changed

+1440
-56
lines changed

packages/devtools/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"@radix-ui/react-icons": "^1.3.0",
6666
"@radix-ui/react-label": "^2.1.2",
6767
"@radix-ui/react-popover": "^1.0.7",
68+
"@radix-ui/react-progress": "^1.1.2",
6869
"@radix-ui/react-select": "^2.1.6",
6970
"@radix-ui/react-separator": "^1.1.2",
7071
"@radix-ui/react-slot": "^1.1.2",

packages/devtools/src/frontend/components/content/content.tsx

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Card } from "frontend/components/ui/card";
2+
import { cn } from "frontend/lib/utils";
3+
4+
export const Content = ({ children, className }: { children: React.ReactNode; className?: string }) => {
5+
return (
6+
<Card className={cn("h-full max-h-[calc(100vh-60px)] w-full p-0 gap-0 bg-sidebar overflow-auto", className)}>
7+
{children}
8+
</Card>
9+
);
10+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const EmptyBox = ({ title }: { title: string }) => {
2+
return (
3+
<div className="w-full h-full flex items-center justify-center p-4 bg-gray-50/20 dark:bg-gray-900/40 border-2 border-dashed border-gray-300 dark:border-gray-700 rounded-md text-gray-500 dark:text-gray-500 text-center">
4+
{title}
5+
</div>
6+
);
7+
};

packages/devtools/src/frontend/components/ui/empty-state.tsx

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,43 @@ export const EmptyState = ({
55
description,
66
icon: Icon = AppWindowMac,
77
children,
8+
size = "md",
89
}: {
910
title: string;
10-
description: string;
11+
description?: string;
1112
icon?: React.ElementType;
1213
children?: React.ReactNode;
14+
size?: "sm" | "md" | "lg";
1315
}) => {
16+
// Size variant classes
17+
const sizeClasses = {
18+
sm: {
19+
container: "w-12 h-12",
20+
icon: "w-6 h-6",
21+
title: "text-xl",
22+
},
23+
md: {
24+
container: "w-16 h-16",
25+
icon: "w-8 h-8",
26+
title: "text-2xl",
27+
},
28+
lg: {
29+
container: "w-20 h-20",
30+
icon: "w-10 h-10",
31+
title: "text-3xl",
32+
},
33+
};
34+
1435
return (
1536
<div className="flex flex-col items-center justify-center h-full p-8 text-center">
16-
<div className="flex items-center justify-center w-16 h-16 mb-4 rounded-full bg-gray-100 dark:bg-gray-800">
17-
<Icon className="w-8 h-8 text-gray-500 dark:text-gray-400" />
37+
<div
38+
className={`flex items-center justify-center mb-4 rounded-full bg-gray-100 dark:bg-gray-800 ${sizeClasses[size].container}`}
39+
>
40+
<Icon className={`text-gray-500 dark:text-gray-400 ${sizeClasses[size].icon}`} />
1841
</div>
19-
<h2 className="text-2xl font-bold text-gray-900 dark:text-gray-100/70 mb-2">{title}</h2>
20-
<p className="text-gray-500 dark:text-gray-400/80 max-w-md">{description}</p>
42+
43+
<h2 className={`font-bold text-gray-900 dark:text-gray-100/70 mb-2 ${sizeClasses[size].title}`}>{title}</h2>
44+
{description && <p className="text-gray-500 dark:text-gray-400/80 max-w-md">{description}</p>}
2145
{children}
2246
</div>
2347
);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"use client"
2+
3+
import * as React from "react"
4+
import * as ProgressPrimitive from "@radix-ui/react-progress"
5+
6+
import { cn } from "frontend/lib/utils"
7+
8+
function Progress({
9+
className,
10+
value,
11+
...props
12+
}: React.ComponentProps<typeof ProgressPrimitive.Root>) {
13+
return (
14+
<ProgressPrimitive.Root
15+
data-slot="progress"
16+
className={cn(
17+
"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
18+
className
19+
)}
20+
{...props}
21+
>
22+
<ProgressPrimitive.Indicator
23+
data-slot="progress-indicator"
24+
className="bg-primary h-full w-full flex-1 transition-all"
25+
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
26+
/>
27+
</ProgressPrimitive.Root>
28+
)
29+
}
30+
31+
export { Progress }

packages/devtools/src/frontend/context/projects/bridge/bridge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useDidMount } from "@reins/hooks";
44
import { Socket } from "@hyper-fetch/sockets";
55

66
import { BaseMessage, MessageType } from "types/messages.types";
7-
import { SocketTopics } from "frontend/lib/socket/topics";
7+
import { SocketTopics } from "frontend/constants/topics";
88
import { ConnectionName } from "frontend/constants/connection.name";
99
import { Connection, useConnections } from "../connection/connection";
1010
import { useProjects } from "frontend/store/projects.store";

packages/devtools/src/frontend/lib/socket/socket.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { Outlet } from "@reins/router";
22

3-
import { Card } from "frontend/components/ui/card";
43
import { DashboardSidebar } from "./sidebar/sidebar";
4+
import { Content } from "frontend/components/ui/content";
55

66
export const DashboardLayout = () => {
77
return (
88
<div className="h-full w-full py-2 px-1">
9-
<Card className="grid grid-cols-[250px_1fr] h-full w-full p-0 gap-0 bg-sidebar">
9+
<Content className="grid grid-cols-[250px_1fr] h-full w-full p-0 gap-0 bg-sidebar">
1010
<DashboardSidebar />
1111
<div className="border-l-2 p-4">
1212
<Outlet />
1313
</div>
14-
</Card>
14+
</Content>
1515
</div>
1616
);
1717
};

0 commit comments

Comments
 (0)