mirror of
https://github.com/parsis-foundation/parsis.foundation.git
synced 2026-10-30 20:47:22 +00:00
- Transform from personal site to foundation/NGO site - Focus on education, research, AI, cryptography, open governance - Update all translations and navigation - Update package.json metadata
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
import * as React from 'react';
|
|
import { Slot } from '@radix-ui/react-slot';
|
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
const buttonVariants = cva(
|
|
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gold/60 disabled:pointer-events-none disabled:opacity-50',
|
|
{
|
|
variants: {
|
|
variant: {
|
|
default: 'bg-gold text-black hover:bg-gold-light',
|
|
outline: 'border border-gold text-gold hover:bg-gold hover:text-black',
|
|
ghost: 'text-muted-foreground hover:text-gold',
|
|
},
|
|
size: {
|
|
default: 'h-11 px-6',
|
|
sm: 'h-9 px-4',
|
|
lg: 'h-12 px-8 text-base',
|
|
},
|
|
},
|
|
defaultVariants: {
|
|
variant: 'default',
|
|
size: 'default',
|
|
},
|
|
}
|
|
);
|
|
|
|
export interface ButtonProps
|
|
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
VariantProps<typeof buttonVariants> {
|
|
asChild?: boolean;
|
|
}
|
|
|
|
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
const Comp = asChild ? Slot : 'button';
|
|
return (
|
|
<Comp
|
|
className={cn(buttonVariants({ variant, size, className }))}
|
|
ref={ref}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
);
|
|
Button.displayName = 'Button';
|
|
|
|
export { Button, buttonVariants };
|