import { __makeTemplateObject } from "tslib";
import styled, { css } from "styled-components";
import { getTheme } from "../utils/theme/getTheme";
import { LIGHT_THEME } from "../Pallette/themes";
import P1 from "../typography/P1";
import { Shape } from "../Pallette/Shape";
import { defaultThemeLabel } from "./themes";
import { getComputedLabelColor } from "./helpers";
var COMPONENT_NAME = "label";
export var LabelStyled = styled(P1).attrs(function (props) { return ({
    theme: getTheme({
        theme: props.theme,
        defaultTheme: defaultThemeLabel,
        componentName: COMPONENT_NAME
    })
}); })(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n  color: ", ";\n  ", ";\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  border-radius: ", ";\n  padding: 4px;\n  ", "\n\n  & > .required-container {\n    color: ", ";\n  }\n\n  .label-icon {\n    color: unset;\n  }\n"], ["\n  color: ", ";\n  ", ";\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  border-radius: ", ";\n  padding: 4px;\n  ", "\n\n  & > .required-container {\n    color: ", ";\n  }\n\n  .label-icon {\n    color: unset;\n  }\n"])), function (_a) {
    var status = _a.status, theme = _a.theme, isDisabled = _a.isDisabled;
    return getComputedLabelColor(status, theme, isDisabled);
}, function (_a) {
    var theme = _a.theme, status = _a.status, isDisabled = _a.isDisabled;
    return (isDisabled || status === "filled") && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n      background: ", ";\n    "], ["\n      background: ", ";\n    "])), theme.components[COMPONENT_NAME]
        .backgroundDisabledOrFilled);
}, Shape.borderRadiusSmall, function (_a) {
    var size = _a.size;
    if (size === "s") {
        return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n        font-size: 12px;\n      "], ["\n        font-size: 12px;\n      "])));
    }
    else {
        return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n        font-size: 14px;\n      "], ["\n        font-size: 14px;\n      "])));
    }
}, function (_a) {
    var theme = _a.theme, isDisabled = _a.isDisabled;
    return isDisabled
        ? theme.components[COMPONENT_NAME].colorDisabled
        : theme.components[COMPONENT_NAME].colorError;
});
LabelStyled.defaultProps = {
    theme: LIGHT_THEME
};
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
