{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "icon-button",
  "title": "Icon button",
  "description": "Square icon-only button with a required accessible label.",
  "dependencies": [
    "@radix-ui/react-slot",
    "lucide-react"
  ],
  "registryDependencies": [
    "@hjconsult/lib",
    "@hjconsult/motion",
    "@hjconsult/button"
  ],
  "files": [
    {
      "path": "src/components/icon-button/index.tsx",
      "content": "import { Slot } from '@radix-ui/react-slot'\nimport { LoaderCircle } from 'lucide-react'\nimport type { ComponentPropsWithoutRef, Ref } from 'react'\nimport { cn } from '../../lib'\nimport { Magnetic } from '../../motion/magnetic'\nimport { type ButtonVariant, buttonVariants } from '../button'\n\nexport type IconButtonSize = 'sm' | 'md' | 'lg'\n\nexport interface IconButtonProps extends ComponentPropsWithoutRef<'button'> {\n  /** Accessible name; the icon itself is decorative. */\n  label: string\n  variant?: Exclude<ButtonVariant, 'link'>\n  size?: IconButtonSize\n  asChild?: boolean\n  loading?: boolean\n  magnetic?: boolean\n  ref?: Ref<HTMLButtonElement>\n}\n\n/** Square button for a single icon. `label` becomes the `aria-label`. */\nexport function IconButton({\n  label,\n  variant = 'secondary',\n  size = 'md',\n  asChild = false,\n  loading = false,\n  magnetic = false,\n  disabled,\n  className,\n  children,\n  ref,\n  type,\n  ...props\n}: IconButtonProps) {\n  const Comp = (asChild ? Slot : 'button') as 'button'\n  const element = (\n    <Comp\n      ref={ref}\n      aria-label={label}\n      aria-busy={loading || undefined}\n      disabled={disabled || loading || undefined}\n      type={asChild ? undefined : (type ?? 'button')}\n      className={cn(buttonVariants({ variant, size: `icon-${size}` }), 'p-0', className)}\n      {...props}\n    >\n      {loading ? <LoaderCircle aria-hidden=\"true\" className=\"animate-spin\" /> : children}\n    </Comp>\n  )\n  return magnetic ? <Magnetic>{element}</Magnetic> : element\n}\n",
      "type": "registry:ui",
      "target": "hj/components/icon-button/index.tsx"
    }
  ],
  "cssVars": {},
  "type": "registry:ui"
}