import styled from "styled-components";
import { applyEllipsis } from "../../mixins";
import { tooltipConfig } from "../Tooltip";
import { component, mergeConfig } from "../../engines";
import { classes, tokens } from "./TextArea.tokens";
var mergedConfig = mergeConfig(tooltipConfig);
var Tooltip = component(mergedConfig);
export var Hint = styled(Tooltip).withConfig({
    displayName: "TextArea.styles__Hint",
    componentId: "sc-8fa014a4-0"
})([
    ""
]);
export var OuterLabelWrapper = styled.div.withConfig({
    displayName: "TextArea.styles__OuterLabelWrapper",
    componentId: "sc-8fa014a4-1"
})([
    "display:flex;align-items:center;max-width:",
    ";margin-bottom:",
    ";"
], function(param) {
    var width = param.width;
    return width;
}, function(param) {
    var isInnerLabel = param.isInnerLabel;
    return isInnerLabel ? "var(".concat(tokens.titleCaptionInnerLabelOffset, ")") : "var(".concat(tokens.labelMarginBottom, ")");
});
export var StyledLabel = styled.div.withConfig({
    displayName: "TextArea.styles__StyledLabel",
    componentId: "sc-8fa014a4-2"
})([
    "position:relative;display:inline-flex;color:var(",
    ",var(",
    "));font-family:var(",
    ",var(",
    "));font-size:var(",
    ",var(",
    "));font-style:var(",
    ",var(",
    "));font-weight:var(",
    ",var(",
    "));letter-spacing:var(",
    ",var(",
    "));line-height:var(",
    ",var(",
    "));"
], tokens.labelOuterColor, tokens.inputColor, tokens.labelOuterFontFamily, tokens.inputFontFamily, tokens.labelOuterFontSize, tokens.inputFontSize, tokens.labelOuterFontStyle, tokens.inputFontStyle, tokens.labelOuterFontWeight, tokens.inputFontWeight, tokens.labelOuterLetterSpacing, tokens.inputLetterSpacing, tokens.labelOuterLineHeight, tokens.inputLineHeight);
export var TitleCaption = styled.div.withConfig({
    displayName: "TextArea.styles__TitleCaption",
    componentId: "sc-8fa014a4-3"
})([
    "display:inline-block;margin-left:auto;font-family:var(",
    ");font-size:var(",
    ");font-style:var(",
    ");font-weight:var(",
    ");letter-spacing:var(",
    ");line-height:var(",
    ");"
], tokens.titleCaptionFontFamily, tokens.titleCaptionFontSize, tokens.titleCaptionFontStyle, tokens.titleCaptionFontWeight, tokens.titleCaptionLetterSpacing, tokens.titleCaptionLineHeight);
export var StyledIndicatorWrapper = styled.div.withConfig({
    displayName: "TextArea.styles__StyledIndicatorWrapper",
    componentId: "sc-8fa014a4-4"
})([
    "position:relative;display:inline-flex;align-items:center;"
]);
export var StyledOptionalText = styled.span.withConfig({
    displayName: "TextArea.styles__StyledOptionalText",
    componentId: "sc-8fa014a4-5"
})([
    "color:var(",
    ");font-family:",
    ";font-size:",
    ";font-style:",
    ";font-weight:",
    ";letter-spacing:",
    ";line-height:",
    ";"
], tokens.optionalColor, function(param) {
    var inheritFont = param.inheritFont;
    return inheritFont ? 'inherit' : "var(".concat(tokens.labelOuterFontFamily, ", var(").concat(tokens.inputFontFamily, "))");
}, function(param) {
    var inheritFont = param.inheritFont;
    return inheritFont ? 'inherit' : "var(".concat(tokens.labelOuterFontSize, ", var(").concat(tokens.inputFontSize, "))");
}, function(param) {
    var inheritFont = param.inheritFont;
    return inheritFont ? 'inherit' : "var(".concat(tokens.labelOuterFontStyle, ", var(").concat(tokens.inputFontStyle, "))");
}, function(param) {
    var inheritFont = param.inheritFont;
    return inheritFont ? 'inherit' : "var(".concat(tokens.labelOuterFontWeight, ", var(").concat(tokens.inputFontWeight, "))");
}, function(param) {
    var inheritFont = param.inheritFont;
    return inheritFont ? 'inherit' : "var(".concat(tokens.labelOuterLetterSpacing, ", var(").concat(tokens.inputLetterSpacing, "))");
}, function(param) {
    var inheritFont = param.inheritFont;
    return inheritFont ? 'inherit' : "var(".concat(tokens.labelOuterLineHeight, ", var(").concat(tokens.inputLineHeight, "))");
});
export var StyledHintWrapper = styled.div.withConfig({
    displayName: "TextArea.styles__StyledHintWrapper",
    componentId: "sc-8fa014a4-6"
})([
    "display:inline-flex;line-height:0;margin:var(",
    ");&.",
    "{position:absolute;margin:0;inset:var(",
    ");}"
], tokens.hintMargin, classes.innerLabelPlacement, tokens.hintInnerLabelPlacementOffset);
export var HintTargetWrapper = styled.div.withConfig({
    displayName: "TextArea.styles__HintTargetWrapper",
    componentId: "sc-8fa014a4-7"
})([
    "color:var(",
    ");width:var(",
    ");height:var(",
    ");display:flex;justify-content:center;align-items:center;"
], tokens.hintIconColor, tokens.hintTargetSize, tokens.hintTargetSize);
export var HintIconWrapper = styled.div.withConfig({
    displayName: "TextArea.styles__HintIconWrapper",
    componentId: "sc-8fa014a4-8"
})([
    ""
]);
export var StyledTextAreaWrapper = styled.div.withConfig({
    displayName: "TextArea.styles__StyledTextAreaWrapper",
    componentId: "sc-8fa014a4-9"
})([
    "display:flex;flex-direction:column;background-color:var(",
    ");padding-top:",
    ";padding-bottom:",
    ";border-radius:",
    ";&:after{content:'';position:absolute;z-index:-2;inset:0;}"
], tokens.inputBackgroundColor, function(param) {
    var hasHeader = param.hasHeader;
    return hasHeader ? 'unset' : "var(".concat(tokens.inputPaddingTop, ")");
}, function(param) {
    var hasHelper = param.hasHelper;
    return hasHelper ? "var(".concat(tokens.inputPaddingBottomWithHelpers, ")") : "var(".concat(tokens.inputPaddingBottom, ")");
}, function(param) {
    var hasHelper = param.hasHelper;
    return hasHelper ? "var(".concat(tokens.borderRadiusWithHelpers, ")") : "var(".concat(tokens.borderRadius, ")");
});
export var StyledContentWrapper = styled.div.withConfig({
    displayName: "TextArea.styles__StyledContentWrapper",
    componentId: "sc-8fa014a4-10"
})([
    "position:relative;width:100%;height:0;padding-top:",
    ";"
], function(param) {
    var hasHeader = param.hasHeader;
    return hasHeader ? "var(".concat(tokens.inputPaddingTop, ")") : 'unset';
});
export var StyledContent = styled.div.withConfig({
    displayName: "TextArea.styles__StyledContent",
    componentId: "sc-8fa014a4-11"
})([
    "position:absolute;display:flex;align-items:center;z-index:1;color:var(",
    ");top:",
    ";right:var(",
    ");height:var(",
    ");&:hover{color:var(",
    ");}&:active{color:var(",
    ");}"
], tokens.rightContentColor, function(param) {
    var hasHeader = param.hasHeader;
    return hasHeader ? "var(".concat(tokens.inputPaddingTop, ")") : "var(".concat(tokens.rightContentTop, ")");
}, tokens.rightContentRight, tokens.rightContentHeight, tokens.rightContentColorHover, tokens.rightContentColorActive);
export var StyledHeaderSlot = styled.div.withConfig({
    displayName: "TextArea.styles__StyledHeaderSlot",
    componentId: "sc-8fa014a4-12"
})([
    "display:flex;flex-direction:column;"
]);
export var DividerWrapper = styled.div.withConfig({
    displayName: "TextArea.styles__DividerWrapper",
    componentId: "sc-8fa014a4-13"
})([
    "background:var(",
    ");"
], tokens.backgroundColor);
export var Divider = styled.div.withConfig({
    displayName: "TextArea.styles__Divider",
    componentId: "sc-8fa014a4-14"
})([
    "height:0.0625rem;background:var(",
    ");"
], tokens.dividerColor);
export var StyledContainer = styled.div.withConfig({
    displayName: "TextArea.styles__StyledContainer",
    componentId: "sc-8fa014a4-15"
})([
    "display:inline-flex;flex-direction:column;width:",
    ";position:relative;"
], function(param) {
    var width = param.width;
    return width;
});
export var StyledTextArea = styled.textarea.withConfig({
    displayName: "TextArea.styles__StyledTextArea",
    componentId: "sc-8fa014a4-16"
})([
    "display:block;box-sizing:border-box;outline:none;border:none;-webkit-appearance:none;background-color:transparent;color:var(",
    ");caret-color:var(",
    ");resize:",
    ";--plasma_private-textarea-height:",
    ";--plasma_private-textarea-width:",
    ";--plasma_private-textarea-computed-height:",
    ";--plasma_private-textarea-computed-width:",
    ";height:var(--plasma_private-textarea-computed-height);width:var(--plasma_private-textarea-computed-width);min-width:",
    ";max-width:",
    ";min-height:var(",
    ");padding-right:",
    ";padding-left:var(",
    ",0);padding-top:0;padding-bottom:0;--plasma_private-textarea-helpers-computed-height:calc( var(",
    ",0) + var(",
    ",0) + var(",
    ") );--plasma_private-textarea-input-with-helpers-height:calc( var(--plasma_private-textarea-height) - var(--plasma_private-textarea-helpers-computed-height) + var(",
    ") );--plasma_private-textarea-input-without-helpers-height:calc( var(--plasma_private-textarea-computed-height) - var(",
    ") );--plasma_private-textarea-input-actual-height:",
    ";height:var(--plasma_private-textarea-input-actual-height);font-family:var(",
    ");font-size:var(",
    ");font-style:var(",
    ");font-weight:var(",
    ");letter-spacing:var(",
    ");line-height:var(",
    ");&::placeholder{opacity:0;}&:read-only{cursor:default;}&:focus:not(:disabled){color:var(",
    ");}&::-webkit-scrollbar{width:var(",
    ");}&::-webkit-scrollbar-thumb{background-color:var(",
    ");background-clip:content-box;border:var(",
    ") solid transparent;border-radius:1rem;}&::-webkit-scrollbar-track{background-color:var(",
    ");background-clip:content-box;border:var(",
    ") solid transparent;border-radius:1rem;}"
], tokens.inputColor, tokens.inputCaretColor, function(param) {
    var resize = param.resize;
    return resize || 'none';
}, function(param) {
    var height = param.height;
    return !Number.isNaN(Number(height)) ? "calc(".concat(height, "rem - 0.875rem)") : height || "var(".concat(tokens.inputHeight, ")");
}, function(param) {
    var width = param.width;
    return !Number.isNaN(Number(width)) ? "".concat(width, "rem") : width || "var(".concat(tokens.inputWidth, ")");
}, function(param) {
    var rows = param.rows;
    return rows ? 'unset' : 'var(--plasma_private-textarea-height)';
}, function(param) {
    var cols = param.cols;
    return cols ? 'unset' : 'var(--plasma_private-textarea-width)';
}, function(param) {
    var applyCustomWidth = param.applyCustomWidth;
    return applyCustomWidth ? 'var(--plasma_private-textarea-width)' : 'auto';
}, function(param) {
    var applyCustomWidth = param.applyCustomWidth;
    return applyCustomWidth ? 'var(--plasma_private-textarea-width)' : 'auto';
}, tokens.inputMinHeight, function(param) {
    var hasContentRight = param.hasContentRight;
    return hasContentRight ? "var(".concat(tokens.inputPaddingRightWithRightContent, ", 0)") : "var(".concat(tokens.inputPaddingRight, ", 0)");
}, tokens.inputPaddingLeft, tokens.helpersPaddingTop, tokens.helpersPaddingBottom, tokens.helpersLineHeight, tokens.helpersOffset, tokens.inputPaddingBottom, function(param) {
    var hasHelper = param.hasHelper, rows = param.rows;
    return hasHelper && !rows ? 'var(--plasma_private-textarea-input-with-helpers-height)' : 'var(--plasma_private-textarea-input-without-helpers-height)';
}, tokens.inputFontFamily, tokens.inputFontSize, tokens.inputFontStyle, tokens.inputFontWeight, tokens.inputLetterSpacing, tokens.inputLineHeight, tokens.inputColorFocus, tokens.scrollbarWidth, tokens.scrollbarThumbBackgroundColor, tokens.scrollbarBorderWidth, tokens.scrollbarTrackBackgroundColor, tokens.scrollbarBorderWidth);
export var StyledHiddenTextArea = styled.textarea.withConfig({
    displayName: "TextArea.styles__StyledHiddenTextArea",
    componentId: "sc-8fa014a4-17"
})([
    "max-height:none !important;min-height:var(",
    ") !important;visibility:hidden !important;overflow:hidden !important;position:absolute !important;z-index:-1000 !important;top:0 !important;left:0 !important;right:",
    ";border-width:0;padding-right:",
    ";padding-left:var(",
    ",0);padding-top:0;padding-bottom:0;box-sizing:border-box;text-indent:0;text-rendering:auto;text-transform:none;tab-size:8;font-family:var(",
    ");font-size:var(",
    ");font-style:var(",
    ");font-weight:var(",
    ");letter-spacing:var(",
    ");line-height:var(",
    ");"
], tokens.inputMinHeight, function(param) {
    var cols = param.cols;
    return cols ? 'unset' : '0.0625rem !important';
}, function(param) {
    var hasContentRight = param.hasContentRight;
    return hasContentRight ? "var(".concat(tokens.inputPaddingRightWithRightContent, ", 0)") : "var(".concat(tokens.inputPaddingRight, ", 0)");
}, tokens.inputPaddingLeft, tokens.inputFontFamily, tokens.inputFontSize, tokens.inputFontStyle, tokens.inputFontWeight, tokens.inputLetterSpacing, tokens.inputLineHeight);
export var StyledHelpers = styled.div.withConfig({
    displayName: "TextArea.styles__StyledHelpers",
    componentId: "sc-8fa014a4-18"
})([
    "box-sizing:border-box;display:flex;justify-content:space-between;transition:background-color 0.1s ease-in-out;background-color:var(",
    ");padding-top:var(",
    ");padding-right:var(",
    ");padding-bottom:var(",
    ");padding-left:var(",
    ");border-bottom-left-radius:var(",
    ");border-bottom-right-radius:var(",
    ");"
], tokens.helpersBackgroundColor, tokens.helpersPaddingTop, tokens.helpersPaddingRight, tokens.helpersPaddingBottom, tokens.helpersPaddingLeft, tokens.borderRadius, tokens.borderRadius);
export var StyledOutsideHelpersWrapper = styled.div.withConfig({
    displayName: "TextArea.styles__StyledOutsideHelpersWrapper",
    componentId: "sc-8fa014a4-19"
})([
    "box-sizing:border-box;display:flex;justify-content:space-between;padding-top:var(",
    ");"
], tokens.clearHelpersPaddingTop);
export var StyledLeftHelper = styled.span.withConfig({
    displayName: "TextArea.styles__StyledLeftHelper",
    componentId: "sc-8fa014a4-20"
})([
    "",
    ";display:block;font-family:var(",
    ");font-size:var(",
    ");font-style:var(",
    ");font-weight:var(",
    ");letter-spacing:var(",
    ");line-height:var(",
    ");color:var(",
    ");&.",
    "{color:var(",
    ",var(",
    "));}"
], applyEllipsis(), tokens.helpersFontFamily, tokens.helpersFontSize, tokens.helpersFontStyle, tokens.helpersFontWeight, tokens.helpersLetterSpacing, tokens.helpersLineHeight, tokens.leftHelperColor, classes.leftHelperFocus, tokens.leftHelperColorFocus, tokens.leftHelperColor);
export var StyledRightHelper = styled(StyledLeftHelper).withConfig({
    displayName: "TextArea.styles__StyledRightHelper",
    componentId: "sc-8fa014a4-21"
})([
    "color:var(",
    ");margin-left:auto;"
], tokens.rightHelperColor);
export var StyledPlaceholder = styled.label.withConfig({
    displayName: "TextArea.styles__StyledPlaceholder",
    componentId: "sc-8fa014a4-22"
})([
    "box-sizing:border-box;position:absolute;pointer-events:none;display:inline-flex;align-items:center;transition:all 0.1s ease-in-out;transform-origin:top left;color:var(",
    ");width:100%;height:auto;top:var(",
    ");padding-left:var(",
    ");padding-right:",
    ";font-family:var(",
    ");font-size:var(",
    ");font-style:var(",
    ");font-weight:var(",
    ");letter-spacing:var(",
    ");line-height:var(",
    ");"
], tokens.placeholderColor, tokens.inputPaddingTop, tokens.inputPaddingLeft, function(param) {
    var hasContentRight = param.hasContentRight;
    return hasContentRight ? "var(".concat(tokens.inputPaddingRightWithRightContent, ")") : "var(".concat(tokens.inputPaddingRight, ")");
}, tokens.inputFontFamily, tokens.inputFontSize, tokens.inputFontStyle, tokens.inputFontWeight, tokens.inputLetterSpacing, tokens.inputLineHeight);
export var StyledIndicator = styled.div.withConfig({
    displayName: "TextArea.styles__StyledIndicator",
    componentId: "sc-8fa014a4-23"
})([
    "position:absolute;border-radius:50%;background-color:var(",
    ");&.",
    "{width:var(",
    ");height:var(",
    ");inset:var(",
    ");&.",
    "{inset:var(",
    ");&.",
    "{right:calc( -1 * var(",
    ") + var(",
    ",0px) );}}}&.",
    "{width:var(",
    ");height:var(",
    ");inset:var(",
    ");&.",
    "{inset:var(",
    ");}}"
], tokens.indicatorColor, classes.outerLabelPlacement, tokens.indicatorSizeOuter, tokens.indicatorSizeOuter, tokens.indicatorLabelPlacementOuter, classes.requiredAlignRight, tokens.indicatorLabelPlacementOuterRight, classes.hasHint, tokens.indicatorSizeOuter, tokens.indicatorLabelPlacementHintOuterRight, classes.innerLabelPlacement, tokens.indicatorSizeInner, tokens.indicatorSizeInner, tokens.indicatorLabelPlacementInner, classes.requiredAlignRight, tokens.indicatorLabelPlacementInnerRight);
