import { Error, Help } from '@procore/core-icons/dist';
import { Form as FormikForm } from 'formik';
import styled, { css } from 'styled-components';
import { checkboxSize } from '../Checkbox/Checkbox.styles';
import { StyledFieldHeader } from '../Field/Field.styles';
import { Required } from '../Required/Required';
import { Label } from '../Semantic/Semantic';
import { Typography } from '../Typography';
import { getTypographyIntent } from '../Typography/Typography.styles';
import { colors } from '../_styles/colors';
import { getGapOutlineFocus } from '../_styles/mixins';
import { spacing } from '../_styles/spacing';
var columnGutter = '24px';
var defaultLineHeight = '20px';
var textEditorOutputListPadding = '10px 0 10px 40px';
var traditionalBorder = 'rgb(216, 216, 216)';
var traditionalBgGray = 'rgb(242, 242, 242)';
var traditionalPadding = '10px';
var traditionalFontSize = '13px';
var traditionalLineHeight = '20px';
function getGridColumns(colStart, colEnd, colIeSpan) {
  return css(["-ms-grid-column:", ";grid-column-start:", ";grid-column-end:", ";-ms-grid-column-span:", ";"], colStart, colStart, colEnd, colIeSpan);
}
function applyStylesOnlyToIE11(styles) {
  return css(["@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){", "}"], styles);
}
export var StyledFormFieldMain = /*#__PURE__*/styled.div.withConfig({
  displayName: "StyledFormFieldMain",
  componentId: "core-11_26_1__sc-ncj3pf-0"
})(["-ms-grid-row:2;grid-row:2;", " ", " ", ""], function (_ref) {
  var $colStart = _ref.$colStart,
    $colEnd = _ref.$colEnd,
    $colIeSpan = _ref.$colIeSpan;
  return getGridColumns($colStart, $colEnd, $colIeSpan);
}, function (_ref2) {
  var $read = _ref2.$read;
  return $read && css(["word-wrap:break-word;color:", ";", ";"], colors.gray15, getTypographyIntent('body'));
}, applyStylesOnlyToIE11("\n      padding-left: ".concat(columnGutter, ";\n\n      &:nth-child(2) {\n        padding-left: 0;\n      }\n  ")));
export var StyledLabel = /*#__PURE__*/styled(Label).withConfig({
  displayName: "StyledLabel",
  componentId: "core-11_26_1__sc-ncj3pf-1"
})(["word-wrap:break-word;word-break:break-word;"]);
export var StyledDescription = /*#__PURE__*/styled.div.withConfig({
  displayName: "StyledDescription",
  componentId: "core-11_26_1__sc-ncj3pf-2"
})(["", " color:", ";word-wrap:break-word;word-break:break-word;"], getTypographyIntent('body'), colors.gray45);
export var StyledCheckboxInlineDescription = /*#__PURE__*/styled(StyledDescription).withConfig({
  displayName: "StyledCheckboxInlineDescription",
  componentId: "core-11_26_1__sc-ncj3pf-3"
})(["margin-top:", "px;", ""], spacing.xs, function (_ref3) {
  var $read = _ref3.$read;
  if (!$read) {
    return css(["padding-left:", "px;"], checkboxSize + spacing.md);
  }
});
export var StyledFormFieldHeader = /*#__PURE__*/styled(StyledFieldHeader).withConfig({
  displayName: "StyledFormFieldHeader",
  componentId: "core-11_26_1__sc-ncj3pf-4"
})(["-ms-grid-row:1;grid-row:1;align-self:end;margin-bottom:", "px;", " ", " * + ", "{margin-top:", "px;}"], spacing.xs, function (_ref4) {
  var $colStart = _ref4.$colStart,
    $colEnd = _ref4.$colEnd,
    $colIeSpan = _ref4.$colIeSpan;
  return getGridColumns($colStart, $colEnd, $colIeSpan);
}, applyStylesOnlyToIE11("\n    padding-left: ".concat(columnGutter, ";\n\n    &:first-child {\n      padding-left: 0;\n    }\n\n    ").concat(StyledFormFieldMain, " {\n      padding-left: ").concat(columnGutter, ";\n\n      &:nth-child(2) {\n        padding-left: 0;\n      }\n    }\n  ")), StyledDescription, spacing.xs);
export var StyledFormFieldRequiredMark = /*#__PURE__*/styled(Required).withConfig({
  displayName: "StyledFormFieldRequiredMark",
  componentId: "core-11_26_1__sc-ncj3pf-5"
})(["padding-left:", "px;vertical-align:top;"], spacing.xs);
export var dataQaFieldTooltipIcon = 'form-field-tooltip-icon';
export var StyledFormFieldTooltipIcon = /*#__PURE__*/styled(Help).attrs(function () {
  return {
    'data-qa': dataQaFieldTooltipIcon
  };
}).withConfig({
  displayName: "StyledFormFieldTooltipIcon",
  componentId: "core-11_26_1__sc-ncj3pf-6"
})(["margin-left:", "px;color:", ";vertical-align:middle;&:focus-visible{border-radius:50%;", " outline-offset:0;}"], spacing.sm, colors.gray45, getGapOutlineFocus);
export var StyledFormFieldErrorIcon = /*#__PURE__*/styled(Error).withConfig({
  displayName: "StyledFormFieldErrorIcon",
  componentId: "core-11_26_1__sc-ncj3pf-7"
})(["vertical-align:sub;"]);
export var StyledFormFieldBanner = /*#__PURE__*/styled.div.withConfig({
  displayName: "StyledFormFieldBanner",
  componentId: "core-11_26_1__sc-ncj3pf-8"
})(["display:flex;align-items:flex-start;min-height:22px;margin-top:", "px;margin-bottom:2px;word-break:break-word;word-wrap:break-word;color:", ";", ""], spacing.xs, colors.red50, getTypographyIntent('body'));
export var StyledTraditionalFormColumn = /*#__PURE__*/styled.div.withConfig({
  displayName: "StyledTraditionalFormColumn",
  componentId: "core-11_26_1__sc-ncj3pf-9"
})(["padding:", ";align-self:center;height:100%;&:nth-child(1){-ms-grid-column:1;}&:nth-child(2){-ms-grid-column:2;}&:nth-child(3){-ms-grid-column:3;}&:nth-child(4){-ms-grid-column:4;}", " ", ""], traditionalPadding, function (_ref5) {
  var _ref5$$fullWidth = _ref5.$fullWidth,
    $fullWidth = _ref5$$fullWidth === void 0 ? false : _ref5$$fullWidth;
  return $fullWidth && css(["grid-column:2 / 5;-ms-grid-column-span:3;"]);
}, function (_ref6) {
  var _ref6$$output = _ref6.$output,
    $output = _ref6$$output === void 0 ? false : _ref6$$output;
  return $output && css(["font-weight:bold;font-size:", ";line-height:", ";word-wrap:break-word;"], traditionalFontSize, traditionalLineHeight);
});
export var StyledTraditionalFormLabel = /*#__PURE__*/styled(Typography).withConfig({
  displayName: "StyledTraditionalFormLabel",
  componentId: "core-11_26_1__sc-ncj3pf-10"
})(["display:inline-block;word-break:break-word;word-wrap:break-word;", ""], function (_ref7) {
  var $view = _ref7.$view;
  return ['create', 'update'].includes($view) && css(["padding-top:", "px;"], spacing.sm);
});
export var StyledFormOutputTextArea = /*#__PURE__*/styled.span.withConfig({
  displayName: "StyledFormOutputTextArea",
  componentId: "core-11_26_1__sc-ncj3pf-11"
})(["white-space:pre-wrap;"]);
export var StyledFormOutputFiledset = /*#__PURE__*/styled.fieldset.withConfig({
  displayName: "StyledFormOutputFiledset",
  componentId: "core-11_26_1__sc-ncj3pf-12"
})(["border:none;padding:0;margin-top:", "px;"], spacing.xs);
export var StyledFormRow = /*#__PURE__*/styled.div.withConfig({
  displayName: "StyledFormRow",
  componentId: "core-11_26_1__sc-ncj3pf-13"
})(["", ""], function (_ref8) {
  var _ref8$$traditional = _ref8.$traditional,
    $traditional = _ref8$$traditional === void 0 ? false : _ref8$$traditional,
    _ref8$$read = _ref8.$read,
    $read = _ref8$$read === void 0 ? false : _ref8$$read;
  return $traditional ? css(["display:-ms-grid;display:grid;-ms-grid-columns:20% 30% 20% 30%;grid-template-columns:20% 30% 20% 30%;-ms-grid-rows:auto;grid-template-rows:auto;border-top:1px solid ", ";background-color:", ";&:last-of-type{border-bottom:1px solid ", ";}", ""], traditionalBorder, colors.white, traditionalBorder, $read && "\n            &:nth-child(2n + 1) {\n              background-color: ".concat(traditionalBgGray, ";\n            }\n            \n            & > ").concat(StyledTraditionalFormColumn, ":nth-child(2) {\n              border-right: 1px solid ").concat(traditionalBorder, ";\n      \n              &:last-child {\n                border-right: none;\n              }\n            }\n          ")) : css(["display:-ms-grid;display:grid;-ms-grid-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);grid-template-columns:repeat(12,minmax(0,1fr));-ms-grid-rows:minmax(", ",max-content) minmax(", ",max-content);grid-template-rows:minmax(", ",auto) minmax( ", ",auto );justify-content:space-between;grid-column-gap:", ";"], defaultLineHeight, defaultLineHeight, defaultLineHeight, defaultLineHeight, columnGutter);
});
var formWrapper = /*#__PURE__*/css(["display:inherit;flex-direction:inherit;height:inherit;max-height:inherit;"]);
export var StyledFormikForm = /*#__PURE__*/styled(FormikForm).withConfig({
  displayName: "StyledFormikForm",
  componentId: "core-11_26_1__sc-ncj3pf-14"
})(["", ""], formWrapper);
export var StyledForm = /*#__PURE__*/styled.div.withConfig({
  displayName: "StyledForm",
  componentId: "core-11_26_1__sc-ncj3pf-15"
})(["", ""], formWrapper);
//# sourceMappingURL=Form.styles.js.map