import React from "react";
import { motion } from "framer-motion";
import * as styles from "./styles";
export function Input({ name, label, type = "text", value = "", isDisabled, isLoading, maxLength = 255, prefixIcon: PrefixIcon, className, onChange, }) {
    const handleOnChange = (e) => {
        if (typeof onChange !== "undefined") {
            onChange(e);
        }
    };
    return (React.createElement("div", { className: `${styles.container} ${className || ""}` },
        React.createElement("input", { className: styles.field, type: type, id: name, name: name, placeholder: label, value: value, max: maxLength, disabled: isLoading || isDisabled, "data-is-loading": isLoading, "data-has-prefix-icon": !!PrefixIcon, onChange: handleOnChange, "data-1p-ignore": true }),
        React.createElement(motion.label, { htmlFor: name, className: styles.label }, label),
        typeof PrefixIcon !== "undefined" && (React.createElement(PrefixIcon, { className: styles.prefixIcon }))));
}
//# sourceMappingURL=index.js.map