{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "mc-button",
  "title": "MicroClub Button",
  "description": "A button component for MicroClub UI",
  "dependencies": [
    "@base-ui/react",
    "lucide-react"
  ],
  "files": [
    {
      "path": "registry/ui/mc-button.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { Button as ButtonPrimitive } from '@base-ui/react/button';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { LinkIcon, Loader2 } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nconst buttonVariants = cva(\n  'group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',\n  {\n    variants: {\n      variant: {\n        primary:\n          'bg-primary text-primary-foreground hover:bg-secondary-foreground hover:text-secondary active:bg-secondary-foreground active:text-secondary active:ring-4 active:ring-secondary disabled:bg-muted disabled:text-muted-foreground',\n        secondary:\n          'bg-secondary text-secondary-foreground hover:bg-accent hover:text-accent-foreground active:bg-accent active:text-accent-foreground active:ring-4 active:ring-secondary disabled:bg-muted disabled:text-muted-foreground',\n        tertiary:\n          'bg-primary-foreground text-primary hover:text-accent-foreground active:text-accent-foreground active:ring-4 active:ring-secondary disabled:bg-muted disabled:text-muted-foreground',\n        link: 'bg-transparent p-0 text-foreground underline hover:text-accent-foreground active:text-accent-foreground disabled:text-muted-foreground',\n      },\n      size: {\n        sm: 'px-3.5 py-2 text-sm font-medium',\n        md: 'px-4 py-2.5 text-sm font-medium',\n        lg: 'px-[1.125rem] py-2.5 text-base font-medium',\n        xl: 'px-5 py-3 text-base font-medium',\n      },\n      icon: {\n        none: '',\n        leading: 'gap-2',\n        trailing: 'gap-2',\n        dot: 'gap-2',\n        only: '',\n      },\n      destructive: {\n        true: '',\n        false: '',\n      },\n    },\n    compoundVariants: [\n      {\n        variant: 'link',\n        className: 'px-0 py-0',\n      },\n      {\n        icon: 'only',\n        size: 'sm',\n        className: 'p-2',\n      },\n      {\n        icon: 'only',\n        size: 'md',\n        className: 'p-2.5',\n      },\n      {\n        icon: 'only',\n        size: 'lg',\n        className: 'p-3',\n      },\n      {\n        icon: 'only',\n        size: 'xl',\n        className: 'p-3.5',\n      },\n      // Destructive overrides\n      {\n        destructive: true,\n        variant: 'primary',\n        className:\n          'bg-destructive text-destructive-foreground hover:bg-destructive/90 active:bg-destructive/90 active:ring-4 active:ring-destructive/20',\n      },\n      {\n        destructive: true,\n        variant: 'secondary',\n        className:\n          'bg-destructive/10 text-destructive hover:bg-destructive/20 active:ring-4 active:ring-destructive/20',\n      },\n      {\n        destructive: true,\n        variant: 'tertiary',\n        className:\n          'text-destructive hover:bg-destructive/10 active:ring-4 active:ring-destructive/20',\n      },\n      {\n        destructive: true,\n        variant: 'link',\n        className: 'text-destructive hover:text-destructive/80 active:text-destructive/80',\n      },\n    ],\n    defaultVariants: {\n      variant: 'primary',\n      size: 'md',\n      icon: 'none',\n      destructive: false,\n    },\n  }\n);\n\nexport interface McButtonProps\n  extends Omit<ButtonPrimitive.Props, 'icon'>, Omit<VariantProps<typeof buttonVariants>, 'icon'> {\n  iconDefinition?: React.ReactNode;\n  icon?: 'none' | 'leading' | 'trailing' | 'dot' | 'only';\n  isLoading?: boolean;\n}\n\nfunction McButton({\n  className,\n  variant = 'primary',\n  size,\n  icon = 'none',\n  destructive,\n  iconDefinition,\n  isLoading,\n  children,\n  disabled,\n  ...props\n}: McButtonProps) {\n  const isLink = variant === 'link';\n  const effectiveIcon =\n    isLink && (icon === 'leading' || icon === 'trailing') && !iconDefinition ? (\n      <LinkIcon />\n    ) : (\n      iconDefinition\n    );\n\n  return (\n    <ButtonPrimitive\n      data-slot=\"button\"\n      disabled={disabled || isLoading}\n      className={cn(\n        buttonVariants({\n          variant,\n          size,\n          icon: icon === 'none' ? 'none' : icon,\n          destructive,\n          className,\n        }),\n        isLoading && 'gap-2'\n      )}\n      {...props}\n    >\n      {isLoading ? (\n        <Loader2 className=\"size-4 animate-spin shrink-0\" />\n      ) : (\n        <>\n          {icon === 'dot' && (\n            <span data-slot=\"dot\" className=\"size-2.5 shrink-0 rounded-full bg-current\" />\n          )}\n          {icon === 'leading' && effectiveIcon && (\n            <span data-slot=\"leading-icon\" className=\"size-4 shrink-0 [&_svg]:size-full\">\n              {effectiveIcon}\n            </span>\n          )}\n        </>\n      )}\n\n      {icon !== 'only' && children}\n      {icon === 'only' && !isLoading && effectiveIcon}\n\n      {icon === 'trailing' && !isLoading && effectiveIcon && (\n        <span data-slot=\"trailing-icon\" className=\"size-4 shrink-0 [&_svg]:size-full\">\n          {effectiveIcon}\n        </span>\n      )}\n    </ButtonPrimitive>\n  );\n}\n\nexport { McButton, buttonVariants };\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}