"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const native_1 = tslib_1.__importDefault(require("styled-components/native"));
const theme_toolkit_1 = require("@platformbuilders/theme-toolkit");
const index_1 = tslib_1.__importDefault(require("./index"));
const success = (0, theme_toolkit_1.getTheme)('success.main');
const dangerMain = (0, theme_toolkit_1.getTheme)('danger.main');
const getColorByStatus = (props) => {
    const configByStatus = {
        default: {
            borderedColor: (0, theme_toolkit_1.getTheme)('text.light')(props),
            iconColor: (0, theme_toolkit_1.getTheme)('text.light')(props),
        },
        success: {
            borderedColor: success(props),
            iconColor: success(props),
        },
        error: {
            borderedColor: dangerMain(props),
            iconColor: dangerMain(props),
        },
        select: {
            borderedColor: (0, theme_toolkit_1.getTheme)('primary.main')(props),
            iconColor: (0, theme_toolkit_1.getTheme)('primary.main')(props),
        },
        focus: {
            borderedColor: (0, theme_toolkit_1.getTheme)('info.main')(props),
            iconColor: (0, theme_toolkit_1.getTheme)('info.main')(props),
        },
    };
    return configByStatus[props?.status || 'default'];
};
const getTextMain = (0, theme_toolkit_1.getTheme)('text.main');
const getBorderWidth = (0, theme_toolkit_1.getTheme)('borderWidth.xs');
const getFontSizeXs = (0, theme_toolkit_1.getTheme)('fontSizes.xs');
const getFontSizeLG = (0, theme_toolkit_1.getTheme)('fontSizes.lg');
const TextInputFloating = (0, native_1.default)(index_1.default).attrs((props) => {
    const fontSizeLg = getFontSizeLG(props);
    const fontSizeXs = getFontSizeXs(props);
    return {
        borderedHeight: 65,
        suppressAnimation: false,
        borderedRadius: 8,
        borderedWidth: getBorderWidth(props),
        borderedColor: getColorByStatus(props)?.borderedColor,
        iconColor: getColorByStatus(props)?.iconColor,
        withBottomline: false,
        fixedLabelVariant: 'animated',
        textStyle: {
            fontSize: fontSizeLg,
            color: getTextMain(props),
            paddingBottom: 5,
        },
        labelStyle: {
            lineHeight: 24,
            color: getTextMain(props),
        },
        iconSize: 18,
        animationValues: {
            upper: {
                top: 2,
                fontSize: fontSizeXs,
                opacity: 0.4,
            },
            lower: {
                top: 14,
                fontSize: fontSizeLg,
                opacity: 0.5,
            },
        },
    };
}) ``;
exports.default = TextInputFloating;
//# sourceMappingURL=Floating.style.js.map