Skip to content

Commit ecc2b18

Browse files
committed
Update Link Component
1 parent 73359f9 commit ecc2b18

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/components/shared/ReactFlow/FlowCanvas/TaskNode/TaskOverview/IOSection/IOCell/IOCellHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ const IOCellHeader = ({
9797
artifactData.is_dir || false,
9898
)}
9999
external
100-
iconClassName="h-2.5 w-2.5"
101-
className="font-mono break-all text-[10px] text-blue-600 hover:text-blue-800 hover:underline flex gap-1"
100+
size="sm"
101+
variant="classic"
102102
>
103103
Link
104104
</Link>

src/components/ui/link.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
11
import { cva } from "class-variance-authority";
2-
import { DownloadIcon, ExternalLink } from "lucide-react";
32
import { type AnchorHTMLAttributes } from "react";
43

54
import { cn } from "@/lib/utils";
65

6+
import { Icon } from "./icon";
7+
import { InlineStack } from "./layout";
8+
79
const linkVariants = cva("items-center inline-flex cursor-pointer", {
810
variants: {
911
variant: {
1012
default: "text-primary",
1113
link: "text-primary hover:underline",
1214
disabled: "text-muted-foreground cursor-not-allowed pointer-events-none",
15+
classic: "text-sky-500 hover:text-sky-600 hover:underline",
1316
},
1417
size: {
15-
default: "",
18+
xs: "text-xs",
1619
sm: "text-sm",
20+
md: "text-md",
1721
lg: "text-lg",
1822
},
1923
},
2024
defaultVariants: {
2125
variant: "default",
22-
size: "default",
26+
size: "md",
2327
},
2428
});
2529

2630
interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
2731
external?: boolean;
2832
download?: boolean;
29-
iconClassName?: string;
30-
variant?: "default" | "link" | "disabled";
31-
size?: "default" | "sm" | "lg";
33+
variant?: "default" | "link" | "disabled" | "classic";
34+
size?: "xs" | "sm" | "md" | "lg";
3235
}
3336

3437
function Link({
3538
external,
3639
children,
3740
className,
3841
download,
39-
iconClassName,
4042
variant,
4143
size,
4244
...props
@@ -51,9 +53,11 @@ function Link({
5153
{...props}
5254
className={cn(linkVariants({ variant, size }), className)}
5355
>
54-
{children}
55-
{external && <ExternalLink className={cn("h-4", iconClassName)} />}
56-
{download && <DownloadIcon className={cn("h-4", iconClassName)} />}
56+
<InlineStack gap="1" blockAlign="center">
57+
{children}
58+
{external && <Icon name="ExternalLink" size={size} />}
59+
{download && <Icon name="Download" size={size} />}
60+
</InlineStack>
5761
</a>
5862
);
5963
}

0 commit comments

Comments
 (0)