import { __makeTemplateObject } from "tslib";
import styled, { css } from "styled-components";
import { getTheme } from "../utils/theme/getTheme";
import P2 from "../typography/P2";
import { LIGHT_THEME } from "../Pallette/themes";
import { Margin } from "../Pallette/style-utils";
import { defaultThemeBreadcrumbs } from "./theme";
var COMPONENT_NAME = "breadcrumbs";
export var BreadcrumbsWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  width: 100%;\n  height: 32px;\n  gap: 8px;\n\n  & > div:last-child {\n    min-width: 0;\n    width: ", ";\n  }\n\n  ", "\n"], ["\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  width: 100%;\n  height: 32px;\n  gap: 8px;\n\n  & > div:last-child {\n    min-width: 0;\n    width: ", ";\n  }\n\n  ", "\n"])), function (_a) {
    var widthLastNodeElement = _a.widthLastNodeElement;
    return typeof widthLastNodeElement === "string"
        ? widthLastNodeElement
        : widthLastNodeElement + "px";
}, function (_a) {
    var isLastChildEllipsis = _a.isLastChildEllipsis;
    return isLastChildEllipsis
        ? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n          & > div:last-child span {\n            overflow: hidden;\n            text-overflow: ellipsis;\n            white-space: nowrap;\n          }\n        "], ["\n          & > div:last-child span {\n            overflow: hidden;\n            text-overflow: ellipsis;\n            white-space: nowrap;\n          }\n        "]))) : null;
});
export var ItemWrapper = styled.div.attrs(function (props) { return ({
    theme: getTheme({
        componentName: COMPONENT_NAME,
        theme: props.theme,
        defaultTheme: defaultThemeBreadcrumbs
    })
}); })(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  height: 32px;\n  cursor: pointer;\n\n  ", ";\n"], ["\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  height: 32px;\n  cursor: pointer;\n\n  ", ";\n"])), function (_a) {
    var viewType = _a.viewType, theme = _a.theme, isDisabled = _a.isDisabled;
    if (isDisabled) {
        return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n        color: ", ";\n        cursor: not-allowed;\n      "], ["\n        color: ", ";\n        cursor: not-allowed;\n      "])), theme.components.breadcrumbs.colorDisabled);
    }
    else if (viewType === "current") {
        return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n        color: ", ";\n        cursor: default;\n      "], ["\n        color: ", ";\n        cursor: default;\n      "])), theme.components.breadcrumbs.colorActive);
    }
    else {
        return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n        color: ", ";\n        &:hover {\n          color: ", ";\n        }\n      "], ["\n        color: ", ";\n        &:hover {\n          color: ", ";\n        }\n      "])), theme.components.breadcrumbs.colorDefault, theme.components.breadcrumbs.colorHover);
    }
});
ItemWrapper.defaultProps = {
    theme: LIGHT_THEME
};
export var IconWrapper = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  width: 24px;\n  height: 24px;\n  min-width: 24px;\n  min-height: 24px;\n  margin: 0 4px;\n\n  & > span {\n    color: unset;\n  }\n"], ["\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  width: 24px;\n  height: 24px;\n  min-width: 24px;\n  min-height: 24px;\n  margin: 0 4px;\n\n  & > span {\n    color: unset;\n  }\n"])));
export var Text = styled(P2)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n  ", "\n  white-space: nowrap;\n"], ["\n  ", "\n  white-space: nowrap;\n"])), Margin.allSide(0, 1));
export var Divider = styled(P2).attrs(function (props) { return ({
    theme: getTheme({
        componentName: COMPONENT_NAME,
        theme: props.theme,
        defaultTheme: defaultThemeBreadcrumbs
    })
}); })(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n  ", "\n  color: ", ";\n  width: 8px;\n  min-width: 8px;\n"], ["\n  ", "\n  color: ", ";\n  width: 8px;\n  min-width: 8px;\n"])), Margin.allSide(0, 2), function (_a) {
    var theme = _a.theme;
    return theme.components.breadcrumbs.dividerColor;
});
Divider.defaultProps = {
    theme: LIGHT_THEME
};
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
