import { AnchorHTMLAttributes, ButtonHTMLAttributes, forwardRef, HTMLAttributes } from 'react'; import { PrimitiveAnchor, PrimitiveButton } from '../primitives'; import Circle from '../common/circle'; import { clsx } from 'clsx'; export type Props = { /** @default 48 */ size?: 16 | 24 | 32 | 40 | 48 | 56 | 72; /** @default 'primary' */ priority?: 'primary' | 'secondary' | 'tertiary' | 'minimal'; /** @default 'default' */ type?: 'default' | 'negative'; 'data-testid'?: string; } & Pick, 'href' | 'target' | 'onClick'> & Pick, 'onClick' | 'disabled'> & Pick< HTMLAttributes, 'id' | 'className' | 'role' | 'children' | 'aria-label' | 'tabIndex' >; const IconButton = forwardRef(function IconButton( { size = 48, href = '#', children, className, priority = 'primary', type = 'default', ...props }: Props, ref, ) { const isLink = href !== '#'; return ( // @ts-expect-error it's either link or `button` element so it has `onClick` / `href` {children} ); }); export default IconButton;