mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-06-19 08:15:28 -04:00
some more arguably unnecessary refactoring
This commit is contained in:
@@ -3,7 +3,7 @@ import { cva, type VariantProps } from "class-variance-authority";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { ComponentPropsWithoutRef } from "react";
|
||||
|
||||
export const buttonVariants = cva(
|
||||
const buttonVariants = cva(
|
||||
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
||||
{
|
||||
variants: {
|
||||
@@ -36,14 +36,14 @@ const Button = ({
|
||||
variant,
|
||||
size,
|
||||
asChild = false,
|
||||
...props
|
||||
...rest
|
||||
}: ComponentPropsWithoutRef<"button"> &
|
||||
VariantProps<typeof buttonVariants> & {
|
||||
asChild?: boolean;
|
||||
}) => {
|
||||
const Comp = asChild ? Slot : "button";
|
||||
|
||||
return <Comp data-slot="button" className={cn(buttonVariants({ variant, size, className }))} {...props} />;
|
||||
return <Comp data-slot="button" className={cn(buttonVariants({ variant, size, className }))} {...rest} />;
|
||||
};
|
||||
|
||||
export default Button;
|
||||
|
||||
Reference in New Issue
Block a user