import type { InputHTMLAttributes, PropsWithChildren, ReactNode, RefObject, MouseEvent, HTMLAttributes } from "react";
import type { ClassName, TComponentIcon } from "@helpers/types";
export type suffixVariants = "dropdown";
export type prefixVariants = "text" | "dropdown" | "icon";
export interface DropdownButtonProps {
text: string;
disabled?: boolean;
onDropdownButtonClick?: (e: MouseEvent) => void;
}
export interface TextProps {
text?: ReactNode;
type: "label" | "supportingText" | "errorMessage" | "disabled";
id?: string;
}
export interface SuffixIconProps extends Pick, "aria-label"> {
suffixIcon?: TComponentIcon;
withPrefix?: boolean;
isError?: boolean;
onIconClick?: () => void;
}
export interface PrefixProps extends ClassName, Pick {
prefixText?: string;
disabled?: boolean;
prefixIcon?: TComponentIcon;
isError?: boolean;
prefixVariant?: prefixVariants;
}
export interface SuffixProps extends ClassName, Pick {
suffixText: string;
disabled?: boolean;
isError?: boolean;
suffixVariant?: suffixVariants;
}
export interface BaseInputProps extends InputHTMLAttributes, PropsWithChildren, Omit {
placeholder?: string;
isError?: boolean;
disabled?: boolean;
required?: boolean;
suffixVariant?: suffixVariants;
prefixVariant?: prefixVariants;
ariaLabel?: string;
inputRef?: RefObject;
iconAriaLabel?: string;
}
export interface InputProps extends Omit, PrefixProps {
label?: string;
supportingText?: string;
prefixOrSuffixText?: string;
errorMessage?: ReactNode;
prefixIcon?: TComponentIcon;
ariaLive?: "polite" | "assertive" | "off";
iconAriaLabel?: string;
id: string;
}
export declare enum EInputVariants {
PREFIX_AND_SUFFIX = "withPrefixAndSuffix",
SUFFIX = "withSuffix",
PREFIX = "withPrefix",
DEFAULT = "default"
}