UNPKG

@funkit/connect

Version:

Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.

39 lines (38 loc) 1.86 kB
import React, { type ChangeEvent, type HTMLInputTypeAttribute, type ReactNode } from 'react'; import { type BoxProps } from '../Box/Box'; export interface FunInputProps<T = HTMLInputElement | HTMLTextAreaElement> { prefix?: ReactNode; suffix?: ReactNode; prefixIcon?: 'SearchIcon' | '$'; placeholder?: string; value: string | number | readonly string[] | undefined; label?: string; onChange: (value: React.ChangeEvent<T>) => void; onKeyDown?: (e: React.KeyboardEvent<T>) => void; onKeySubmit?: () => void; onPaste?: (e: React.ClipboardEvent<T>) => void; onMouseDown?: (e: React.MouseEvent<T>) => void; onFocus?: () => void; onBlur?: () => void; inputStyle?: React.CSSProperties; inputProps?: React.HTMLProps<T> & { type?: HTMLInputTypeAttribute; }; error?: string | boolean; alwaysFocused?: boolean; /** Color meant for prefix & suffix elements. Defaults to secondaryText. */ adornmentColor?: BoxProps['color']; textWeight?: BoxProps['fontWeight']; ignoreFontSize?: boolean; overrideBorderWidth?: BoxProps['borderWidth']; overrideBackground?: BoxProps['background']; borderRadius?: BoxProps['borderRadius']; isLoading?: boolean; /** Allow multiline input. Defaults to false. This option replaces the internal `input` element with a `textarea` element. */ allowMultiline?: T extends HTMLInputElement ? false : true; /** Remove default transitions from the input wrapper and base styles. Defaults to false. */ ignoreBaseTransitions?: boolean; testId?: string; } export type FunInputChangeEvent = ChangeEvent<HTMLInputElement | HTMLTextAreaElement>; export declare const FunInput: React.ForwardRefExoticComponent<FunInputProps<HTMLTextAreaElement | HTMLInputElement> & React.RefAttributes<HTMLTextAreaElement | HTMLInputElement>>;