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" /** * LLMagnet button system — brand variants: * - default: solid plum (#1B0C27) primary actions * - gradient: purple→pink hero CTAs (reserved — available in code, not used in UI) * - secondary / outline / ghost / muted: neutral actions * - success / destructive: semantic states */ const buttonVariants = cva( // `no-underline hover:no-underline` + per-variant `hover:text-*` keep these immune to // WordPress admin's `#wpbody-content a:hover` rule (which otherwise turns anchor-based // buttons blue and underlined on hover). Class+pseudo specificity beats WP's id+element. "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg border-none text-sm font-medium no-underline transition-colors hover:no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#9333ea] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", { variants: { variant: { default: "bg-[#1B0C27] text-white hover:bg-[#2D1245] hover:text-white", gradient: "border-none bg-gradient-to-r from-[#9333ea] to-[#db2777] text-white shadow-sm hover:from-[#7e22ce] hover:to-[#be185d] hover:text-white", secondary: "bg-gray-100 text-gray-700 hover:bg-gray-200 hover:text-gray-700", outline: "border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 hover:text-gray-700", ghost: "text-gray-500 hover:bg-gray-100 hover:text-gray-700", muted: "bg-gray-200 text-gray-500 hover:bg-gray-300 hover:text-gray-500 disabled:hover:bg-gray-200", destructive: "border border-red-200 bg-white text-red-700 hover:bg-red-50 hover:text-red-700", "destructive-solid": "bg-red-600 text-white hover:bg-red-700 hover:text-white", success: "bg-green-600 text-white hover:bg-green-700 hover:text-white", link: "text-[#9333ea] underline-offset-4 hover:underline hover:text-[#9333ea]", }, size: { xs: "h-7 px-2.5 text-xs", sm: "h-9 px-3", default: "h-10 px-4 py-2", lg: "h-11 px-6", icon: "h-10 w-10 p-0", "icon-sm": "h-9 w-9 p-0", }, }, defaultVariants: { variant: "default", size: "default", }, } ) export interface ButtonProps extends React.ButtonHTMLAttributes, VariantProps { asChild?: boolean } const Button = React.forwardRef( ({ className, variant, size, asChild = false, ...props }, ref) => { const Comp = asChild ? Slot : "button" return ( ) } ) Button.displayName = "Button" export { Button, buttonVariants }