'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var styled = require('styled-components');
var index = require('../../utils/index.js');

function formatCharCount(count) {
    if (count === undefined || count < 0)
        return null;
    if (count === 0)
        return '00';
    if (count < 10)
        return '0' + count;
    return count.toString();
}
function getCharacterCount(charCount, maxCharacters) {
    const maxChar = formatCharCount(maxCharacters);
    const maxCharFormatted = maxChar ? `/${maxChar}` : '';
    return `${formatCharCount(charCount)}${maxCharFormatted}`;
}
function getBorderColor(disabled, error) {
    if (!disabled && error)
        return index.getColorAlias('supportError');
    return index.getColorAlias('interactiveForm');
}
const getFieldPadding = (variant) => {
    switch (variant) {
        case 'small':
            return styled.css `
        padding: ${index.getSpacing('s02', 's04')};
      `;
        case 'medium':
            return styled.css `
        padding: ${index.getSpacing('s03', 's04')};
      `;
        case 'large':
            return styled.css `
        padding: ${index.getSpacing('s04')};
      `;
        default:
            return styled.css `
        padding: ${index.getSpacing('s03', 's04')};
      `;
    }
};
const getTextAreaPadding = (variant) => {
    switch (variant) {
        case 'small':
            return styled.css `
        padding: ${index.getSpacing('s02', 's04')};
        min-height: 64px;
      `;
        case 'medium':
            return styled.css `
        padding: ${index.getSpacing('s03', 's04')};
        min-height: 72px;
      `;
        case 'large':
            return styled.css `
        padding: ${index.getSpacing('s04')};
        min-height: 80px;
      `;
        default:
            return styled.css `
        padding: ${index.getSpacing('s03', 's04')};
        min-height: 72px;
      `;
    }
};
const getCheckRadioIconColor = (disabled) => {
    return disabled ? '8C999B' : 'ffffff';
};

exports.formatCharCount = formatCharCount;
exports.getBorderColor = getBorderColor;
exports.getCharacterCount = getCharacterCount;
exports.getCheckRadioIconColor = getCheckRadioIconColor;
exports.getFieldPadding = getFieldPadding;
exports.getTextAreaPadding = getTextAreaPadding;
