mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-29 11:01:29 +02:00
- **Wails v3 application** (`client/ui`) with a React + TypeScript + Tailwind frontend replacing the Fyne UI: main connection view, exit-node switcher, networks/peers browser with detail panels, profile management, settings (general, network, SSH, security, troubleshooting, appearance), debug-bundle creation, and a first-run welcome flow. - **Internationalization**: go-i18n bundle with 9 locales (en, de, es, fr, hu, it, pt, ru, zh-CN) shared between the tray and the frontend. - **New system tray** implementation with per-platform theme-aware icons, including a native XEmbed host for Linux (`xembed_tray_linux.c`) and a Linux theme watcher. - **Session handling**: auth session watcher (`client/internal/auth/sessionwatch`), pending login flow, session-expiration dialog and tray notifications, and `netbird login` improvements. - **Daemon API extensions** (`daemon.proto`): status stream subscription, event stream, networks/exit-node selection endpoints, and richer full status — with probe throttling on the daemon side to protect against UI-driven request storms. - **UI preferences store** persisted per profile, autostart management via the daemon (single source of truth in HKCU on Windows). - **Build system**: Taskfile-based builds per platform (macOS, Linux, Windows), Docker cross-compilation images, MSIX/NSIS/nfpm/AppImage packaging, and a new `frontend-ui` CI workflow. Co-authored-by: Zoltan Papp <zoltan.pmail@gmail.com> Co-authored-by: Eduard Gert <kontakt@eduardgert.de> Co-authored-by: braginini <bangvalo@gmail.com> Co-authored-by: Pascal Fischer <32096965+pascal-fischer@users.noreply.github.com> Co-authored-by: riccardom <riccardomanfrin@gmail.com>
99 lines
3.1 KiB
TypeScript
99 lines
3.1 KiB
TypeScript
import { type ComponentType, type ReactNode, forwardRef } from "react";
|
|
import * as Tabs from "@radix-ui/react-tabs";
|
|
import { type LucideProps } from "lucide-react";
|
|
import { cn } from "@/lib/cn";
|
|
import { useFocusVisible } from "@/hooks/useFocusVisible";
|
|
|
|
const Root = forwardRef<HTMLDivElement, Omit<Tabs.TabsProps, "orientation">>(
|
|
function VerticalTabsRoot({ className, ...props }, ref) {
|
|
return (
|
|
<Tabs.Root
|
|
ref={ref}
|
|
orientation={"vertical"}
|
|
className={cn("flex min-h-0 flex-1", className)}
|
|
{...props}
|
|
/>
|
|
);
|
|
},
|
|
);
|
|
|
|
const List = forwardRef<HTMLDivElement, Tabs.TabsListProps>(function VerticalTabsList(
|
|
{ className, ...props },
|
|
ref,
|
|
) {
|
|
return (
|
|
<Tabs.List
|
|
ref={ref}
|
|
className={cn("flex w-full flex-col gap-1 p-5 pr-0", className)}
|
|
{...props}
|
|
/>
|
|
);
|
|
});
|
|
|
|
type TriggerProps = Tabs.TabsTriggerProps & {
|
|
icon: ComponentType<LucideProps>;
|
|
title: string;
|
|
iconSize?: number;
|
|
adornment?: ReactNode;
|
|
};
|
|
|
|
const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function VerticalTabsTrigger(
|
|
{ icon: Icon, title, iconSize = 16, adornment, className, ...props },
|
|
ref,
|
|
) {
|
|
const isFocusVisible = useFocusVisible();
|
|
return (
|
|
<Tabs.Trigger
|
|
ref={ref}
|
|
className={cn(
|
|
"group flex w-full cursor-default items-center gap-3 rounded-lg px-2 py-2.5 text-left outline-none",
|
|
"transition-colors duration-150",
|
|
"data-[state=active]:bg-nb-gray-930",
|
|
"data-[state=inactive]:hover:bg-nb-gray-935",
|
|
isFocusVisible &&
|
|
"focus-visible:ring-2 focus-visible:ring-white/60 focus-visible:ring-offset-2 focus-visible:ring-offset-nb-gray-940",
|
|
className,
|
|
)}
|
|
{...props}
|
|
>
|
|
<Icon
|
|
size={iconSize}
|
|
aria-hidden={"true"}
|
|
className={cn(
|
|
"ml-2 shrink-0 transition-colors duration-150",
|
|
"text-nb-gray-400 group-data-[state=active]:text-nb-gray-100",
|
|
)}
|
|
/>
|
|
<span
|
|
className={cn(
|
|
"min-w-0 truncate text-sm font-medium transition-colors duration-150",
|
|
"text-nb-gray-400 group-data-[state=active]:text-nb-gray-100",
|
|
)}
|
|
>
|
|
{title}
|
|
</span>
|
|
{adornment && (
|
|
<div aria-hidden={"true"} className={"ml-auto mr-2 shrink-0"}>
|
|
{adornment}
|
|
</div>
|
|
)}
|
|
</Tabs.Trigger>
|
|
);
|
|
});
|
|
|
|
const Content = forwardRef<HTMLDivElement, Tabs.TabsContentProps>(function VerticalTabsContent(
|
|
{ className, ...props },
|
|
ref,
|
|
) {
|
|
return (
|
|
<Tabs.Content
|
|
ref={ref}
|
|
tabIndex={-1}
|
|
className={cn("outline-none", className)}
|
|
{...props}
|
|
/>
|
|
);
|
|
});
|
|
|
|
export const VerticalTabs = Object.assign(Root, { List, Trigger, Content });
|