"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.LabelEndEnhancer = exports.LabelContainer = exports.Label = exports.ControlContainer = exports.Caption = void 0;

var _styles = require("../styles");

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var Label = (0, _styles.styled)('label', function (props) {
  var $disabled = props.$disabled,
      _props$$theme = props.$theme,
      colors = _props$$theme.colors,
      typography = _props$$theme.typography;
  return _objectSpread(_objectSpread({}, typography.font250), {}, {
    width: '100%',
    color: $disabled ? colors.contentSecondary : colors.contentPrimary,
    display: 'block',
    paddingTop: 0,
    paddingRight: 0,
    paddingBottom: 0,
    paddingLeft: 0
  });
});
exports.Label = Label;
Label.displayName = "Label";
Label.displayName = 'Label';
var LabelContainer = (0, _styles.styled)('span', function (_ref) {
  var sizing = _ref.$theme.sizing;
  return {
    display: 'flex',
    width: '100%',
    marginTop: sizing.scale300,
    marginRight: 0,
    marginBottom: sizing.scale300,
    marginLeft: 0
  };
});
exports.LabelContainer = LabelContainer;
LabelContainer.displayName = "LabelContainer";
LabelContainer.displayName = 'LabelContainer';
var LabelEndEnhancer = (0, _styles.styled)('span', function (_ref2) {
  var $disabled = _ref2.$disabled,
      $counterError = _ref2.$counterError,
      _ref2$$theme = _ref2.$theme,
      colors = _ref2$$theme.colors,
      typography = _ref2$$theme.typography;
  return _objectSpread(_objectSpread({}, typography.font100), {}, {
    flex: 0,
    width: '100%',
    color: $counterError ? colors.contentNegative : $disabled ? colors.contentStateDisabled : colors.contentPrimary
  });
});
exports.LabelEndEnhancer = LabelEndEnhancer;
LabelEndEnhancer.displayName = "LabelEndEnhancer";
LabelEndEnhancer.displayName = 'LabelEndEnhancer';
var Caption = (0, _styles.styled)('div', function (props) {
  var $error = props.$error,
      $positive = props.$positive,
      _props$$theme2 = props.$theme,
      colors = _props$$theme2.colors,
      sizing = _props$$theme2.sizing,
      typography = _props$$theme2.typography;
  var fontColor = colors.contentTertiary;

  if ($error) {
    fontColor = colors.contentNegative;
  } else if ($positive) {
    fontColor = colors.contentPositive;
  }

  return _objectSpread(_objectSpread({}, typography.font100), {}, {
    color: fontColor,
    paddingTop: 0,
    paddingRight: 0,
    paddingBottom: 0,
    paddingLeft: 0,
    marginTop: sizing.scale300,
    marginRight: 0,
    marginBottom: sizing.scale300,
    marginLeft: 0
  });
});
exports.Caption = Caption;
Caption.displayName = "Caption";
Caption.displayName = 'Caption';
var ControlContainer = (0, _styles.styled)('div', function (props) {
  var sizing = props.$theme.sizing;
  return {
    width: '100%',
    marginBottom: sizing.scale600
  };
});
exports.ControlContainer = ControlContainer;
ControlContainer.displayName = "ControlContainer";
ControlContainer.displayName = 'ControlContainer';