Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/(dashboard)/peers/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function PeersBlockedView() {
<div className={"px-3 pt-1 pb-8 max-w-3xl w-full"}>
<div
className={
"rounded-md border border-nb-gray-900/70 grid w-full bg-nb-gray-930/40 stepper-bg-variant"
"rounded-md border border-nb-gray-900/70 grid w-full bg-nb-gray-930/40"
}
>
<SetupModalContent header={false} footer={false} />
Expand Down
43 changes: 41 additions & 2 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ p {
}

.stepper-bg-variant .step-circle {
@apply !border-[#1d2024];
@apply !border-nb-gray-940;
}

.webkit-scroll{
Expand Down Expand Up @@ -117,4 +117,43 @@ p {
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
}


.animate-slow-ping {
animation: ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite
}

@keyframes ping {
75%, 100% {
transform: scale(2);
opacity: 0;
}
}

.animate-slow-pulse {
animation: pulse 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite
}


@keyframes pulse {
60% {
opacity: 0.5;
}
}

@keyframes bg-scroll {
0% {
background-position: 0% 100%;
}
100% {
background-position: 0% 0%;
}
}

.animate-bg-scroll {
animation: bg-scroll 4s linear infinite;
}
.animate-bg-scroll-faster {
animation: bg-scroll 1.8s linear infinite;
}
12 changes: 12 additions & 0 deletions src/assets/nameservers/dns0-zero.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/nameservers/dns0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export default function Badge({
<div
className={cn(
"relative z-10 cursor-inherit whitespace-nowrap rounded-md text-[12px] py-1.5 px-3 font-normal flex gap-1.5 items-center justify-center transition-all",
className,
variants({ variant, hover: useHover ? variant : "none" }),
disabled && "cursor-not-allowed opacity-50 select-none",
className,
)}
{...props}
>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { cva, VariantProps } from "class-variance-authority";
import classNames from "classnames";
import React, { forwardRef } from "react";

type ButtonVariants = VariantProps<typeof buttonVariants>;
export type ButtonVariants = VariantProps<typeof buttonVariants>;

export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
Expand All @@ -28,7 +28,7 @@ export const buttonVariants = cva(
"dark:focus:ring-zinc-800/50 dark:bg-nb-gray dark:text-gray-400 dark:border-gray-700/30 dark:hover:text-white dark:hover:bg-zinc-800/50",
],
primary: [
"dark:focus:ring-netbird-600/50 dark:ring-offset-neutral-950/50 enabled:dark:bg-netbird disabled:dark:bg-nb-gray-920 dark:text-gray-100 enabled:dark:hover:text-white enabled:dark:hover:bg-netbird-500/80",
"dark:focus:ring-netbird-600/50 dark:ring-offset-neutral-950/50 enabled:dark:bg-netbird disabled:dark:bg-nb-gray-910 dark:text-gray-100 enabled:dark:hover:text-white enabled:dark:hover:bg-netbird-500/80",
"enabled:bg-netbird enabled:text-white enabled:focus:ring-netbird-400/50 enabled:hover:bg-netbird-500",
],
secondary: [
Expand All @@ -49,7 +49,7 @@ export const buttonVariants = cva(
dropdown: [
"bg-white hover:text-black focus:ring-zinc-200/50 hover:bg-gray-100 border-neutral-200 text-gray-900",
"dark:ring-offset-neutral-950/50 dark:focus:ring-neutral-500/20 ",
"dark:bg-nb-gray-900/40 dark:text-gray-400 dark:border-nb-gray-800 dark:hover:bg-nb-gray-900/50",
"dark:bg-nb-gray-900/40 dark:text-gray-400 dark:border-nb-gray-900 dark:hover:bg-nb-gray-900/50",
],
dotted: [
"bg-white hover:text-black focus:ring-zinc-200/50 hover:bg-gray-100 border-gray-200 text-gray-900 border-dashed",
Expand Down
9 changes: 7 additions & 2 deletions src/components/DatePickerWithRange.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ const defaultRanges = {
from: dayjs().subtract(2, "day").startOf("day").toDate(),
to: dayjs().endOf("day").toDate(),
},
last7Days: {
from: dayjs().subtract(7, "day").startOf("day").toDate(),
to: dayjs().endOf("day").toDate(),
},
lastMonth: {
from: dayjs().subtract(1, "month").startOf("day").toDate(),
to: dayjs().endOf("day").toDate(),
Expand Down Expand Up @@ -64,6 +68,7 @@ export function DatePickerWithRange({
yesterday: isEqualDateRange(value, defaultRanges.yesterday),
last14Days: isEqualDateRange(value, defaultRanges.last14Days),
last2Days: isEqualDateRange(value, defaultRanges.last2Days),
last7Days: isEqualDateRange(value, defaultRanges.last7Days),
lastMonth: isEqualDateRange(value, defaultRanges.lastMonth),
allTime: isEqualDateRange(value, defaultRanges.allTime),
};
Expand All @@ -76,6 +81,7 @@ export function DatePickerWithRange({
if (isActive.lastMonth) return "Last Month";
if (isActive.last14Days) return "Last 14 Days";
if (isActive.last2Days) return "Last 2 Days";
if (isActive.last7Days) return "Last 7 Days";
if (isActive.yesterday) return "Yesterday";
if (isActive.today) return "Today";

Expand All @@ -88,12 +94,11 @@ export function DatePickerWithRange({
const [calendarOpen, setCalendarOpen] = useState(false);

const updateRangeAndClose = (range: DateRange) => {
setCalendarOpen(false);
onChange?.(range);
};

const debouncedOnChange = useMemo(() => {
return onChange ? debounce(onChange, 300) : undefined;
return onChange ? debounce(onChange, 500) : undefined;
}, [onChange]);

const handleOnSelect = (range?: DateRange) => {
Expand Down
9 changes: 7 additions & 2 deletions src/components/FullTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
TooltipContent,
TooltipProvider,
TooltipTrigger,
TooltipVariants,
} from "@components/Tooltip";
import { TooltipProps } from "@radix-ui/react-tooltip";
import { cn } from "@utils/helpers";
Expand All @@ -24,7 +25,9 @@ type Props = {
customOnOpenChange?: React.Dispatch<React.SetStateAction<boolean>>;
delayDuration?: number;
skipDelayDuration?: number;
} & TooltipProps;
} & TooltipProps &
TooltipVariants;

export default function FullTooltip({
children,
content,
Expand All @@ -41,6 +44,7 @@ export default function FullTooltip({
customOnOpenChange,
delayDuration = 1,
skipDelayDuration = 300,
variant = "default",
}: Props) {
const [open, setOpen] = useState(!!keepOpen);

Expand All @@ -66,7 +70,7 @@ export default function FullTooltip({
<div
className={cn(
isAction ? "cursor-pointer" : "cursor-default",
"inline-flex items-center gap-2 dark:text-neutral-300 text-neutral-500 hover:text-neutral-100 transition-all hover:bg-nb-gray-800/60 py-2 px-3 rounded-md",
"inline-flex items-center gap-2 dark:text-neutral-300 text-neutral-500 hover:text-neutral-100 transition-all hover:bg-nb-gray-800/60 py-2 px-3 rounded-md",
className,
)}
>
Expand All @@ -82,6 +86,7 @@ export default function FullTooltip({
alignOffset={20}
forceMount={true}
className={contentClassName}
variant={variant}
align={align}
side={side}
>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Kbd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const variants = cva("", {
variants: {
variant: {
default: ["bg-nb-gray-800 border-nb-gray-700 text-nb-gray-300 "],
darker: ["bg-nb-gray-930 border-nb-gray-900 text-nb-gray-250 "],
netbird: ["bg-netbird-100 text-netbird border-netbird "],
},
size: {
Expand All @@ -30,7 +31,7 @@ export default function Kbd({
size = "default",
disabled = false,
className,
}: Props) {
}: Readonly<Props>) {
return (
<div
className={cn(
Expand Down
42 changes: 42 additions & 0 deletions src/components/NetBirdLogo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { cn } from "@utils/helpers";
import Image from "next/image";
import * as React from "react";
import NetBirdLogoMark from "@/assets/netbird.svg";
import NetBirdLogoFull from "@/assets/netbird-full.svg";

type Props = {
size?: "default" | "large";
mobile?: boolean;
};

const sizes = {
default: {
desktop: 22,
mobile: 30,
},
large: {
desktop: 24,
mobile: 40,
},
};

export const NetBirdLogo = ({ size = "default", mobile = true }: Props) => {
return (
<>
<Image
src={NetBirdLogoFull}
height={sizes[size].desktop}
alt={"NetBird Logo"}
className={cn(mobile && "hidden md:block")}
/>
{mobile && (
<Image
src={NetBirdLogoMark}
width={sizes[size].mobile}
alt={"NetBird Logo"}
className={cn(mobile && "md:hidden ml-4")}
/>
)}
</>
);
};
1 change: 1 addition & 0 deletions src/components/PeerSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export function PeerSelector({
{filteredItems.length > 0 && (
<VirtualScrollAreaList
items={filteredItems}
estimatedItemHeight={37}
onSelect={(item) => {
const isSupported = isRoutingPeerSupported(
item.version,
Expand Down
67 changes: 67 additions & 0 deletions src/components/RadioCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import * as RadioGroup from "@radix-ui/react-radio-group";
import { ReactNode } from "react"; // or replace with clsx or similar
import { cn } from "@/utils/helpers";

type Props = {
value: string;
title: ReactNode;
description: ReactNode;
icon?: ReactNode;
className?: string;
};

export const RadioCard = ({
value,
title,
description,
className,
icon,
}: Props) => {
return (
<RadioGroup.Item
value={value}
className={cn(
"peer relative block cursor-pointer rounded-lg border border-nb-gray-900 bg-nb-gray-930/60 px-5 py-3 transition-all focus:outline-none",
"data-[state=checked]:border-nb-gray-400 data-[state=checked]:bg-nb-gray-920",
"outline-none focus:ring-0 focus:bg-nb-gray-930 focus:border-nb-gray-920",
"hover:bg-nb-gray-930",
className,
)}
>
<div className="text-nb-gray-100 font-normal text-sm text-left gap-2 flex items-center">
{icon}
{title}
</div>
<div className="text-nb-gray-300 text-[0.8rem] text-left">
{description}
</div>
</RadioGroup.Item>
);
};

type RadioCardGroupProps = {
value: string;
onValueChange: (val: string) => void;
children: React.ReactNode;
className?: string;
"aria-label"?: string;
};

export const RadioCardGroup = ({
value,
onValueChange,
children,
className,
"aria-label": ariaLabel = "Options",
}: RadioCardGroupProps) => {
return (
<RadioGroup.Root
className={cn("flex flex-col gap-2", className)}
value={value}
onValueChange={onValueChange}
aria-label={ariaLabel}
>
{children}
</RadioGroup.Root>
);
};
Loading