import React, { forwardRef } from "react";
import cls from "classnames";
import { StyledInput } from "./Input.styles";
export const Input = /*#__PURE__*/ forwardRef(({ value, readOnly, disabled, placeholder, contentLeft, contentRight, textBefore, textAfter, required, requiredPlacement, hasRequiredIndicator, label, labelPlacement, keepPlaceholder, errorClass, successClass, appearance, hasClearDivider, onChangeValue, onSearch, onFocus, onBlur, onKeyDown, ...rest }, ref)=>{
    const handleSearch = (searchValue, event)=>{
        if (onSearch) {
            onSearch(event, searchValue);
        }
    };
    return /*#__PURE__*/ React.createElement(StyledInput, {
        ref: ref,
        className: cls(errorClass, successClass),
        value: value,
        readOnly: readOnly,
        disabled: disabled,
        appearance: appearance,
        hasDivider: hasClearDivider,
        placeholder: placeholder,
        contentLeft: contentLeft,
        contentRight: contentRight,
        textBefore: textBefore,
        textAfter: textAfter,
        onChange: onChangeValue,
        onSearch: handleSearch,
        onFocus: onFocus,
        onBlur: onBlur,
        onKeyDown: onKeyDown,
        required: required,
        requiredPlacement: requiredPlacement,
        hasRequiredIndicator: hasRequiredIndicator,
        label: label,
        labelPlacement: labelPlacement,
        keepPlaceholder: keepPlaceholder,
        ...rest
    });
});
