- Removed excessive glows from button variants - default: removed base glow, reduced hover glow (30px→15px, opacity 0.5→0.3) - destructive: removed hover glow - outline: removed hover glow - Buttons now have minimal, subtle glows for better visual hierarchy - Action 9.3.1.4 complete
55 lines
2 KiB
TypeScript
55 lines
2 KiB
TypeScript
import * as React from 'react';
|
|
import { Slot } from '@radix-ui/react-slot';
|
|
import { type VariantProps, cva } from 'class-variance-authority';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
const buttonVariants = cva(
|
|
'inline-flex items-center justify-center whitespace-nowrap rounded-xl text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-kodo-cyan focus-visible:ring-offset-2 focus-visible:ring-offset-kodo-void disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] hover-lift',
|
|
{
|
|
variants: {
|
|
variant: {
|
|
default:
|
|
'bg-kodo-cyan text-kodo-void hover:bg-kodo-cyan-dim hover:shadow-[0_0_15px_rgba(102,252,241,0.3)] border border-transparent font-semibold tracking-tight',
|
|
destructive:
|
|
'bg-kodo-red/10 text-kodo-red hover:bg-kodo-red/20 border border-kodo-red/30 hover:border-kodo-red/50',
|
|
outline:
|
|
'border border-kodo-steel bg-transparent text-kodo-secondary hover:bg-white/5 hover:text-white hover:border-kodo-cyan/50',
|
|
secondary:
|
|
'bg-kodo-steel/30 text-white hover:bg-kodo-steel/50 border border-white/5 hover:border-white/10',
|
|
ghost: 'hover:bg-white/5 hover:text-white text-kodo-secondary',
|
|
},
|
|
size: {
|
|
default: 'h-10 px-4 py-2',
|
|
sm: 'h-8 rounded-lg px-3 text-xs',
|
|
lg: 'h-12 rounded-xl px-8 text-base',
|
|
icon: 'h-10 w-10',
|
|
},
|
|
},
|
|
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 };
|