/**
 * shadcn's import path for the button.
 *
 * There is only one Button in PIG now — see the note in `./index`. This module
 * exists so the shadcn compositions written against `@/components/ui/button`
 * keep working unchanged, and it supplies the one thing they genuinely need
 * that the PIG default does not: a bare `<Button>` here means a solid brand
 * fill (shadcn's `default`), whereas a bare `<Button>` from `./index` means the
 * quiet secondary. Changing either default silently restyles the other's call
 * sites, which is why the shim is a default rather than a second component.
 *
 * `[&_svg]:size-4` likewise preserves shadcn's icon sizing for these call
 * sites without imposing it on every PIG button in the app.
 */
import { forwardRef } from 'react';

import { Button as BaseButton, buttonVariants, cn, type ButtonProps } from './index';

const Button = forwardRef<HTMLButtonElement, ButtonProps>(
  ({ variant = 'default', size = 'default', className, ...props }, ref) => (
    <BaseButton
      ref={ref}
      variant={variant}
      size={size}
      className={cn('[&_svg]:size-4', className)}
      {...props}
    />
  ),
);
Button.displayName = 'Button';

export { Button, buttonVariants, type ButtonProps };
