import { getColorAlias, getDarkenColor, transparentizeAliasColor } from '../../utils/index.js';

const getIconButtonBackgroundColor = (variant) => {
    switch (variant) {
        case 'primary':
            return getColorAlias('interactiveBrand');
        case 'secondary':
            return getColorAlias('interactiveSecondary');
        case 'outline':
        case 'ghost':
        case 'ghost-inverse':
        case 'ghost-tertiary':
            return 'transparent';
        case 'inverse':
            return getColorAlias('contentInverse');
        default:
            console.warn('Error, incorrect props. Pass the correct set of props to the getIconButtonBackgroundColor function.');
    }
};
const getDisabledBackgroundColor = (variant) => {
    switch (variant) {
        case 'primary':
        case 'secondary':
        case 'outline':
            return getColorAlias('disabled01');
        case 'inverse':
            return getColorAlias('disabled01');
        case 'ghost':
        case 'ghost-tertiary':
        case 'ghost-inverse':
            return 'transparent';
        default:
            console.warn('Error, incorrect props. Pass the correct set of props to the getDisabledBackgroundColor function.');
    }
};
const getIconButtonSvgColor = (variant, disabled) => {
    if (disabled)
        return '#8c999b';
    switch (variant) {
        case 'primary':
        case 'ghost-inverse':
            return getColorAlias('contentInverse');
        case 'secondary':
        case 'ghost-tertiary':
            return getColorAlias('contentSubdued');
        case 'outline':
        case 'ghost':
        case 'inverse':
            return getColorAlias('interactiveBrand');
        default:
            console.warn('Error, incorrect props. Pass the correct set of props to the getIconButtonSvgColor function.');
    }
};
const getIconButtonBackgroundColorLoading = (variant, isDark) => {
    switch (variant) {
        case 'primary':
            return getDarkenColor('active01', 'contentBrand');
        case 'secondary':
            return isDark
                ? transparentizeAliasColor('active01', 'contentLight')
                : getDarkenColor('active01', 'containerDefault');
        case 'outline':
            return isDark
                ? getDarkenColor('active01', 'interactiveLight')
                : getDarkenColor('active01', 'containerDefault');
        case 'ghost':
        case 'ghost-tertiary':
            return isDark
                ? transparentizeAliasColor('active01', 'contentLight')
                : getDarkenColor('active01', 'containerDefault');
        case 'inverse':
            return isDark
                ? getDarkenColor('active01', 'backgroundDark')
                : getDarkenColor('active01', 'contentLight');
        case 'ghost-inverse':
            return isDark
                ? 'transparent'
                : getDarkenColor('active01', 'backgroundDark');
        default:
            console.warn('Error, incorrect props. Pass the correct set of props to the getIconButtonBackgroundColorLoading function.');
    }
};
const getHoverIconButtonBackground = (variant, isDark) => {
    switch (variant) {
        case 'primary':
            return getDarkenColor('hover01', 'contentBrand');
        case 'secondary':
            return isDark
                ? transparentizeAliasColor('hover01', 'contentLight')
                : getDarkenColor('hover02', 'containerDefault');
        case 'outline':
            return isDark
                ? transparentizeAliasColor('hover01', 'contentLight')
                : getDarkenColor('hover01', 'containerDefault');
        case 'ghost':
        case 'ghost-tertiary':
            return isDark
                ? transparentizeAliasColor('hover01', 'contentSubdued')
                : getDarkenColor('hover01', 'containerDefault');
        case 'inverse':
            return isDark
                ? getDarkenColor('hover01', 'contentSubdued')
                : getDarkenColor('hover01', 'contentLight');
        case 'ghost-inverse':
            return isDark
                ? transparentizeAliasColor('hover01', 'containerDefault')
                : getDarkenColor('hover01', 'contentSubdued');
        default:
            console.warn('Error, incorrect props. Pass the correct set of props to the getHoverIconButtonBackground function.');
    }
};
const getActiveIconButtonBackground = (variant, isDark) => {
    switch (variant) {
        case 'primary':
            return getDarkenColor('active01', 'contentBrand');
        case 'secondary':
            return isDark
                ? transparentizeAliasColor('active01', 'contentLight')
                : getDarkenColor('active01', 'containerDefault');
        case 'outline':
            return isDark
                ? transparentizeAliasColor('active01', 'contentLight')
                : getDarkenColor('active01', 'containerDefault');
        case 'ghost':
        case 'ghost-tertiary':
            return isDark
                ? transparentizeAliasColor('active01', 'contentSubdued')
                : getDarkenColor('active01', 'containerDefault');
        case 'inverse':
            return isDark
                ? getDarkenColor('active01', 'contentSubdued')
                : getDarkenColor('active01', 'contentLight');
        case 'ghost-inverse':
            return isDark
                ? getDarkenColor('active01', 'contentSubdued')
                : getDarkenColor('active01', 'contentLight');
        default:
            console.warn('Error, incorrect props. Pass the correct set of props to the getHoverIconButtonBackground function.');
    }
};
const getBorderColor = (variant, hasFocus) => {
    if (!hasFocus) {
        if (variant === 'outline') {
            return getColorAlias('borderDefault');
        }
        else {
            return 'transparent';
        }
    }
    else {
        return getColorAlias('focusOuter');
    }
};
const getSpinnerType = (variant) => {
    switch (variant) {
        case 'primary':
        case 'ghost-inverse':
            return 'inverse';
        case 'secondary':
        case 'ghost-tertiary':
            return 'secondary';
        case 'outline':
        case 'ghost':
        case 'inverse':
            return 'brand';
        default:
            console.warn('Error, incorrect props. Pass the correct set of props to the getSpinnerType function.');
    }
};
const getSpinnerSize = (size) => {
    switch (size) {
        case 'x-small':
            return 'XS';
        case 'small':
            return 'S';
        case 'medium':
            return 'M';
        case 'large':
            return 'L';
        default:
            console.warn('Error, incorrect props. Pass the correct set of props to the getSpinnerSize function.');
    }
};
const getIconButtonSize = (size) => {
    switch (size) {
        case 'large':
            return '56px';
        case 'medium':
            return '48px';
        case 'small':
            return '40px';
        case 'x-small':
            return '32px';
        default:
            console.warn('Error, incorrect props. Pass the correct set of props to the getIconButtonSize function.');
    }
};
const getSVGSize = (size) => {
    return size === 'large'
        ? `
      height: 24.5px;
      width: 24.5px;
    `
        : `
      height: 21px;
      width: 21px;
    `;
};

export { getActiveIconButtonBackground, getBorderColor, getDisabledBackgroundColor, getHoverIconButtonBackground, getIconButtonBackgroundColor, getIconButtonBackgroundColorLoading, getIconButtonSize, getIconButtonSvgColor, getSVGSize, getSpinnerSize, getSpinnerType };
