import styled from "@emotion/styled";
import { classes, tokens, constants } from "../../Dropdown.tokens";
import { addFocus, applyEllipsis } from "../../../../mixins";
import { cellConfig, cellTokens } from "../../../Cell";
import { component, mergeConfig } from "../../../../engines";
import { IconDisclosureRight } from "../../../_Icon";
var mergedCellConfig = mergeConfig(cellConfig);
var Cell = component(mergedCellConfig);
export var CellWrapper = /*#__PURE__*/ styled("div", {
    target: "e1l9fhj10",
    label: "CellWrapper"
})(cellTokens.cellTitleColor, ":var(", constants.cellTitleColor, ");", cellTokens.cellBackgroundColor, ":var(", constants.cellBackgroundColor, ");", cellTokens.cellPadding, ":var(", tokens.cellPadding, ");", cellTokens.cellPaddingLeftContent, ":var(", tokens.cellPaddingLeftContent, ");", cellTokens.cellPaddingContent, ":var(", tokens.cellPaddingContent, ");", cellTokens.cellPaddingRightContent, ":var(", tokens.cellPaddingRightContent, ");", cellTokens.cellTextboxGap, ":var(", tokens.cellTextboxGap, ");", cellTokens.cellGap, ":var(", tokens.cellGap, ");", cellTokens.cellTitleFontFamily, ":var(", tokens.cellTitleFontFamily, ");", cellTokens.cellTitleFontSize, ":var(", tokens.cellTitleFontSize, ");", cellTokens.cellTitleFontStyle, ":var(", tokens.cellTitleFontStyle, ");", cellTokens.cellTitleFontWeight, ":var(", tokens.cellTitleFontWeight, ");", cellTokens.cellTitleLetterSpacing, ":var(", tokens.cellTitleLetterSpacing, ");", cellTokens.cellTitleLineHeight, ":var(", tokens.cellTitleLineHeight, ");width:100%;");
export var StyledCell = /*#__PURE__*/ styled(Cell, {
    target: "e1l9fhj11",
    label: "StyledCell"
})();
export var DisclosureIconWrapper = /*#__PURE__*/ styled("div", {
    target: "e1l9fhj12",
    label: "DisclosureIconWrapper"
})("line-height:0;color:var(", tokens.disclosureIconColor, ",var(", constants.disclosureIconColor, "));");
// TODO: Удалить после поддержки JS переменных в конфиге компонент
export var sizeMap = {
    xs: '1rem',
    s: '1.5rem',
    m: '2rem'
};
export var StyledIconDisclosureRight = /*#__PURE__*/ styled(IconDisclosureRight, {
    target: "e1l9fhj13",
    label: "StyledIconDisclosureRight"
})("width:", function(param) {
    var _param_size = param.size, size = _param_size === void 0 ? 'xs' : _param_size;
    return "var(".concat(tokens.itemDisclosureIconSize, ", ").concat(sizeMap[size], ")");
}, ";height:", function(param) {
    var _param_size = param.size, size = _param_size === void 0 ? 'xs' : _param_size;
    return "var(".concat(tokens.itemDisclosureIconSize, ", ").concat(sizeMap[size], ")");
}, ";");
export var Divider = /*#__PURE__*/ styled("div", {
    target: "e1l9fhj14",
    label: "Divider"
})("height:1px;margin-top:", function(param) {
    var variant = param.variant;
    return "var(".concat(variant === 'tight' ? tokens.dividerMarginTopTight : tokens.dividerMarginTop, ")");
}, ";margin-right:var(", tokens.dividerMarginRight, ");margin-bottom:", function(param) {
    var variant = param.variant;
    return "var(".concat(variant === 'tight' ? tokens.dividerMarginBottomTight : tokens.dividerMarginBottom, ")");
}, ";margin-left:var(", tokens.dividerMarginLeft, ");background:var(", tokens.dividerColor, ");");
export var Wrapper = /*#__PURE__*/ styled("li", {
    target: "e1l9fhj15",
    label: "Wrapper"
})("display:flex;align-items:center;gap:", function(param) {
    var variant = param.variant;
    return "var(".concat(variant === 'tight' ? tokens.itemGapTight : tokens.itemGap, ")");
}, ";min-height:var(", tokens.itemHeight, ");margin:var(", tokens.itemMargin, ",0);box-sizing:content-box;padding:", function(param) {
    var variant = param.variant;
    return "var(".concat(variant === 'tight' ? tokens.itemPaddingTight : tokens.itemPadding, ")");
}, ";font-family:var(", tokens.itemFontFamily, ");font-size:var(", tokens.itemFontSize, ");font-style:var(", tokens.itemFontStyle, ");font-weight:var(", tokens.itemFontWeightBold, ");letter-spacing:var(", tokens.itemFontLetterSpacing, ");line-height:var(", tokens.itemFontLineHeight, ");background-color:var(", constants.itemBackground, ");border-radius:var(\n        ", tokens.itemBorderRadius, ",calc(var(", tokens.borderRadius, ") - 0.125rem - var(", tokens.borderWidth, ",0rem))\n    );user-select:none;background-clip:padding-box;&:hover:not(.", classes.dropdownItemIsDisabled, "){cursor:pointer;background-color:var(", tokens.itemBackgroundHover, ");}&.", classes.dropdownItemIsActive, "{background-color:var(", tokens.itemBackgroundHover, ");}&.", classes.dropdownItemIsDisabled, "{opacity:", constants.opacity, ";cursor:not-allowed;}:focus{outline:none;}", addFocus({
    outlineSize: '0',
    outlineOffset: '0',
    outlineColor: "var(".concat(constants.focusColor, ")"),
    outlineRadius: "calc(var(".concat(tokens.borderRadius, ") - 0.125rem - var(").concat(tokens.borderWidth, ", 0rem))"),
    hasTransition: false,
    customFocusRules: "\n            &.".concat(classes.dropdownItemIsFocused, ":before {\n                outline: none;\n                box-shadow: inset 0 0 0 0.0625rem var(").concat(constants.focusColor, ");\n            }\n        ")
}), ";");
export var RenderItemWrapper = /*#__PURE__*/ styled("div", {
    target: "e1l9fhj16",
    label: "RenderItemWrapper"
})(applyEllipsis(), ";flex:1;");
