import React from 'react'; import classnames from 'classnames'; import { AlignItems, BackgroundColor, BorderRadius, Display, IconColor, JustifyContent, } from '../../../helpers/constants/design-system'; import { Box, Icon } from '..'; import { IconSize } from '../icon'; import { BoxProps, PolymorphicRef } from '../box'; import { ButtonIconSize, ButtonIconProps, ButtonIconComponent, } from './button-icon.types'; const buttonIconSizeToIconSize: Record = { [ButtonIconSize.Sm]: IconSize.Sm, [ButtonIconSize.Md]: IconSize.Md, [ButtonIconSize.Lg]: IconSize.Lg, }; export const ButtonIcon: ButtonIconComponent = React.forwardRef( ( { ariaLabel, as, className = '', color = IconColor.iconDefault, href, size = ButtonIconSize.Lg, iconName, disabled, iconProps, ...props }: ButtonIconProps, ref?: PolymorphicRef, ) => { const tag = href ? 'a' : as || 'button'; const isDisabled = disabled && tag === 'button'; return ( )} > ); }, );