import { __makeTemplateObject } from "tslib";
import styled, { css } from "styled-components";
import { getTheme } from "../utils/theme/getTheme";
import { LIGHT_THEME } from "../Pallette/themes";
import { defaultThemeTag } from "./theme";
var Padding = {
    s: "padding: 0 6px 0 8px;",
    m: "padding: 0 10px 0 12px;",
    xs: "padding: 0 6px 0 8px;"
};
var PaddingAvatar = {
    s: "padding: 0 4px 0 4px;",
    m: " padding: 0 14px 0 8px;",
    xs: "padding: 0 2px 0 0;"
};
var COMPONENT_NAME = "tag";
export var TagWrapper = styled.button.attrs(function (props) { return ({
    theme: getTheme({
        theme: props.theme,
        defaultTheme: defaultThemeTag,
        componentName: COMPONENT_NAME
    })
}); })(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  box-sizing: border-box;\n  white-space: nowrap;\n  ", ";\n  border: 0;\n  font-feature-settings: \"pnum\" on, \"lnum\" on;\n  transition: all 0.2s linear;\n  border-radius: 16px;\n  cursor: pointer;\n\n  .tag__avatar {\n    margin-right: 4px;\n  }\n\n  ", "\n\n  ", "\n"], ["\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  box-sizing: border-box;\n  white-space: nowrap;\n  ", ";\n  border: 0;\n  font-feature-settings: \"pnum\" on, \"lnum\" on;\n  transition: all 0.2s linear;\n  border-radius: 16px;\n  cursor: pointer;\n\n  .tag__avatar {\n    margin-right: 4px;\n  }\n\n  ", "\n\n  ", "\n"])), function (_a) {
    var avatarProps = _a.avatarProps, size = _a.size;
    if (avatarProps) {
        return PaddingAvatar[size];
    }
    else {
        return Padding[size];
    }
}, function (_a) {
    var size = _a.size;
    switch (size) {
        case "xs":
            return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n          height: 20px;\n        "], ["\n          height: 20px;\n        "])));
        case "s":
            return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n          height: 24px;\n        "], ["\n          height: 24px;\n        "])));
        default:
            return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n          height: 32px;\n        "], ["\n          height: 32px;\n        "])));
    }
}, function (_a) {
    var isPressed = _a.isPressed, isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly, theme = _a.theme;
    if (isDisabled) {
        return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n        cursor: not-allowed;\n      "], ["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n        cursor: not-allowed;\n      "])), theme.components[COMPONENT_NAME].backgroundDisabled, theme.components[COMPONENT_NAME].colorDisabled, theme.components[COMPONENT_NAME].colorDisabled);
    }
    else if (isReadOnly) {
        return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n        cursor: not-allowed;\n      "], ["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n        cursor: not-allowed;\n      "])), theme.components[COMPONENT_NAME].backgroundReadOnly, theme.components[COMPONENT_NAME].colorReadOnly, theme.components[COMPONENT_NAME].colorDisabled);
    }
    else if (isPressed) {
        return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n      "], ["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n      "])), theme.components[COMPONENT_NAME].backgroundPressed, theme.components[COMPONENT_NAME].colorPressed, theme.components[COMPONENT_NAME].colorPressed);
    }
    else {
        return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n\n        &:hover {\n          background: ", ";\n          color: ", ";\n          svg {\n            color: ", ";\n          }\n        }\n      "], ["\n        background: ", ";\n        color: ", ";\n        svg {\n          color: ", ";\n        }\n\n        &:hover {\n          background: ", ";\n          color: ", ";\n          svg {\n            color: ", ";\n          }\n        }\n      "])), theme.components[COMPONENT_NAME].backgroundDefault, theme.components[COMPONENT_NAME].colorDefault, theme.components[COMPONENT_NAME].colorDefault, theme.components[COMPONENT_NAME].backgroundHover, theme.components[COMPONENT_NAME].colorHover, theme.components[COMPONENT_NAME].colorHover);
    }
});
TagWrapper.defaultProps = {
    theme: LIGHT_THEME
};
export var LeadIconWrapper = styled.span(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n  margin-right: 8px;\n  width: 16px;\n  height: 16px;\n"], ["\n  margin-right: 8px;\n  width: 16px;\n  height: 16px;\n"])));
export var CloseIconWrapper = styled.span(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n  width: 12px;\n  height: 12px;\n  svg {\n    width: 12px;\n    height: 12px;\n  }\n  ", "\n"], ["\n  width: 12px;\n  height: 12px;\n  svg {\n    width: 12px;\n    height: 12px;\n  }\n  ", "\n"])), function (_a) {
    var size = _a.size;
    switch (size) {
        case "xs":
        case "s":
            return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n          margin-left: 6px;\n        "], ["\n          margin-left: 6px;\n        "])));
        default:
            return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n          margin-left: 14px;\n        "], ["\n          margin-left: 14px;\n        "])));
    }
});
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
