nextuiq
Version:
NextUIQ is a modern, lightweight, and developer-friendly UI component library for React and Next.js. Built with TypeScript and Tailwind CSS, it offers customizable, accessible, and performance-optimized components with built-in dark mode, theme customizat
72 lines (69 loc) • 2.32 kB
JavaScript
import { j as jsxRuntimeExports } from './index46.mjs';
import React__default from 'react';
import { cn } from './index38.mjs';
import { cva } from 'class-variance-authority';
const linkVariants = cva(
"inline-flex items-center transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[oklch(var(--theme-ring))] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
{
variants: {
variant: {
default: "text-[oklch(var(--theme-primary))] hover:text-[oklch(var(--theme-primary)/0.8)]",
ghost: "text-[oklch(var(--theme-muted-foreground))] hover:text-[oklch(var(--theme-foreground))]",
destructive: "text-[oklch(var(--theme-destructive))] hover:text-[oklch(var(--theme-destructive)/0.8)]"
},
size: {
default: "text-base",
sm: "text-sm",
lg: "text-lg"
}
},
defaultVariants: {
variant: "default",
size: "default"
}
}
);
const LinkComponent = React__default.forwardRef(
({ className, variant, size, href, external, children, ...props }, ref) => {
const externalProps = external ? {
target: "_blank",
rel: "noopener noreferrer",
"aria-label": `${props["aria-label"] || children} (opens in new tab)`
} : {};
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
"a",
{
ref,
href,
className: cn(linkVariants({ variant, size, className })),
...externalProps,
...props,
children: [
children,
external && /* @__PURE__ */ jsxRuntimeExports.jsx(
"svg",
{
className: "ml-1 h-4 w-4",
xmlns: "http://www.w3.org/2000/svg",
fill: "none",
viewBox: "0 0 24 24",
stroke: "currentColor",
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
"path",
{
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 2,
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
}
)
}
)
]
}
);
}
);
LinkComponent.displayName = "Link";
const Link = LinkComponent;
export { Link };