text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var _simpleAssign = require('simple-assign');
  
  var _simpleAssign2 = _interopRequireDefault(_simpleAssign);
  
  var _react = require('react');
  
  var _react2 = _interopRequireDefault(_react);
  
  var _propTypes = require('prop-types');
  
  var _propTypes2 = _interopRequireDefault(_propTypes);
  
  var _transitions = require('../styles/transitions');
  
  var _transitions2 = _interopRequireDefault(_transitions);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  var propTypes = {
    /**
     * True if the parent `TextField` is disabled.
     */
    disabled: _propTypes2.default.bool,
    /**
     * Override the inline-styles of the underline when parent `TextField` is disabled.
     */
    disabledStyle: _propTypes2.default.object,
    /**
     * True if the parent `TextField` has an error.
     */
    error: _propTypes2.default.bool,
    /**
     * Override the inline-styles of the underline when parent `TextField` has an error.
     */
    errorStyle: _propTypes2.default.object,
    /**
     * True if the parent `TextField` is focused.
     */
    focus: _propTypes2.default.bool,
    /**
     * Override the inline-styles of the underline when parent `TextField` is focused.
     */
    focusStyle: _propTypes2.default.object,
    /**
     * @ignore
     * The material-ui theme applied to this component.
     */
    muiTheme: _propTypes2.default.object.isRequired,
    /**
     * Override the inline-styles of the root element.
     */
    style: _propTypes2.default.object
  };
  
  var defaultProps = {
    disabled: false,
    disabledStyle: {},
    error: false,
    errorStyle: {},
    focus: false,
    focusStyle: {},
    style: {}
  };
  
  var TextFieldUnderline = function TextFieldUnderline(props) {
    var disabled = props.disabled,
        disabledStyle = props.disabledStyle,
        error = props.error,
        errorStyle = props.errorStyle,
        focus = props.focus,
        focusStyle = props.focusStyle,
        muiTheme = props.muiTheme,
        style = props.style;
    var errorStyleColor = errorStyle.color;
    var prepareStyles = muiTheme.prepareStyles,
        _muiTheme$textField = muiTheme.textField,
        borderColor = _muiTheme$textField.borderColor,
        disabledTextColor = _muiTheme$textField.disabledTextColor,
        errorColor = _muiTheme$textField.errorColor,
        focusColor = _muiTheme$textField.focusColor;
  
  
    var styles = {
      root: {
        borderTop: 'none',
        borderLeft: 'none',
        borderRight: 'none',
        borderBottomStyle: 'solid',
        borderBottomWidth: 1,
        borderColor: borderColor,
        bottom: 8,
        boxSizing: 'content-box',
        margin: 0,
        position: 'absolute',
        width: '100%'
      },
      disabled: {
        borderBottomStyle: 'dotted',
        borderBottomWidth: 2,
        borderColor: disabledTextColor
      },
      focus: {
        borderBottomStyle: 'solid',
        borderBottomWidth: 2,
        borderColor: focusColor,
        transform: 'scaleX(0)',
        transition: _transitions2.default.easeOut()
      },
      error: {
        borderColor: errorStyleColor ? errorStyleColor : errorColor,
        transform: 'scaleX(1)'
      }
    };
  
    var underline = (0, _simpleAssign2.default)({}, styles.root, style);
    var focusedUnderline = (0, _simpleAssign2.default)({}, underline, styles.focus, focusStyle);
  
    if (disabled) underline = (0, _simpleAssign2.default)({}, underline, styles.disabled, disabledStyle);
    if (focus) focusedUnderline = (0, _simpleAssign2.default)({}, focusedUnderline, { transform: 'scaleX(1)' });
    if (error) focusedUnderline = (0, _simpleAssign2.default)({}, focusedUnderline, styles.error);
  
    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement('hr', { 'aria-hidden': 'true', style: prepareStyles(underline) }),
      _react2.default.createElement('hr', { 'aria-hidden': 'true', style: prepareStyles(focusedUnderline) })
    );
  };
  
  process.env.NODE_ENV !== "production" ? TextFieldUnderline.propTypes = propTypes : void 0;
  TextFieldUnderline.defaultProps = defaultProps;
  
  exports.default = TextFieldUnderline;