import styled from "@emotion/styled";
import { addFocus, applyEllipsis } from "../../../../../../mixins";
import { component, mergeConfig } from "../../../../../../engines";
import { cellConfig, cellTokens } from "../../../../../Cell";
import { IconDisclosureRight } from "../../../../../_Icon";
import { classes, tokens, constants } from "../../../../Dropdown.tokens";
const mergedCellConfig = mergeConfig(cellConfig);
const Cell = component(mergedCellConfig);
export const CellWrapper = /*#__PURE__*/ styled("div", {
    target: "e1gc8byl0",
    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 const StyledCell = /*#__PURE__*/ styled(Cell, {
    target: "e1gc8byl1",
    label: "StyledCell"
})();
export const DisclosureIconWrapper = /*#__PURE__*/ styled("div", {
    target: "e1gc8byl2",
    label: "DisclosureIconWrapper"
})("line-height:0;color:var(", tokens.disclosureIconColor, ",var(", constants.disclosureIconColor, "));");
// TODO: Удалить после поддержки JS переменных в конфиге компонент
export const sizeMap = {
    xs: '1rem',
    s: '1.5rem',
    m: '2rem'
};
export const StyledIconDisclosureRight = /*#__PURE__*/ styled(IconDisclosureRight, {
    target: "e1gc8byl3",
    label: "StyledIconDisclosureRight"
})("width:", ({ size = 'xs' })=>`var(${tokens.itemDisclosureIconSize}, ${sizeMap[size]})`, ";height:", ({ size = 'xs' })=>`var(${tokens.itemDisclosureIconSize}, ${sizeMap[size]})`, ";");
export const Divider = /*#__PURE__*/ styled("div", {
    target: "e1gc8byl4",
    label: "Divider"
})("height:1px;margin-top:", ({ variant })=>`var(${variant === 'tight' ? tokens.dividerMarginTopTight : tokens.dividerMarginTop})`, ";margin-right:var(", tokens.dividerMarginRight, ");margin-bottom:", ({ variant })=>`var(${variant === 'tight' ? tokens.dividerMarginBottomTight : tokens.dividerMarginBottom})`, ";margin-left:var(", tokens.dividerMarginLeft, ");background:var(", tokens.dividerColor, ");");
export const Wrapper = /*#__PURE__*/ styled("li", {
    target: "e1gc8byl5",
    label: "Wrapper"
})("display:flex;align-items:center;gap:", ({ variant })=>`var(${variant === 'tight' ? tokens.itemGapTight : tokens.itemGap})`, ";min-height:var(", tokens.itemHeight, ");margin:var(", tokens.itemMargin, ",0);box-sizing:content-box;padding:", ({ variant })=>`var(${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(${constants.focusColor})`,
    outlineRadius: `calc(var(${tokens.borderRadius}) - 0.125rem - var(${tokens.borderWidth}, 0rem))`,
    hasTransition: false,
    customFocusRules: `
            &.${classes.dropdownItemIsFocused}:before {
                outline: none;
                box-shadow: inset 0 0 0 0.0625rem var(${constants.focusColor});
            }
        `
}), ";");
export const RenderItemWrapper = /*#__PURE__*/ styled("div", {
    target: "e1gc8byl6",
    label: "RenderItemWrapper"
})(applyEllipsis(), ";flex:1;");
