import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { SoftFormControlLayout, } from '../form_control_layout';
import { SoftValidatableControl, } from '../validatable_control';
export const SoftFieldPassword = ({ className, id, name, placeholder, value, isInvalid, fullWidth, isLoading, compressed, inputRef, ...rest }) => {
    const classes = classNames('softFieldPassword', {
        'softFieldPassword--fullWidth': fullWidth,
        'softFieldPassword--compressed': compressed,
        'softFieldPassword-isLoading': isLoading,
    }, className);
    return (React.createElement(SoftFormControlLayout, { icon: "lock", fullWidth: fullWidth, isLoading: isLoading, compressed: compressed },
        React.createElement(SoftValidatableControl, { isInvalid: isInvalid },
            React.createElement("input", Object.assign({ type: "password", id: id, name: name, placeholder: placeholder, className: classes, value: value, ref: inputRef }, rest)))));
};
// @ts-ignore
SoftFieldPassword.propTypes = {
    name: PropTypes.string,
    id: PropTypes.string,
    placeholder: PropTypes.string,
    value: PropTypes.string,
    isInvalid: PropTypes.bool,
    fullWidth: PropTypes.bool,
    inputRef: PropTypes.func,
    isLoading: PropTypes.bool,
    /**
     * when `true` creates a shorter height input
     */
    compressed: PropTypes.bool,
};
// @ts-ignore
SoftFieldPassword.defaultProps = {
    value: undefined,
    fullWidth: false,
    isLoading: false,
    compressed: false,
};
//# sourceMappingURL=SoftFieldPassword.js.map