UNPKG

zarm

Version:

基于 React 的移动端UI库

31 lines (30 loc) 1.53 kB
import * as React from 'react'; import type { HTMLProps } from '../utils/utilityTypes'; import type { BaseInputTextareaProps, BaseInputTextProps } from './interface'; export interface InputCssVars { '--height'?: React.CSSProperties['height']; '--line-height': React.CSSProperties['lineHeight']; '--font-size'?: React.CSSProperties['fontSize']; '--color'?: React.CSSProperties['color']; '--background'?: React.CSSProperties['background']; '--label-font-size'?: React.CSSProperties['fontSize']; '--placeholder-color'?: React.CSSProperties['color']; '--disabled-color'?: React.CSSProperties['color']; '--clear-icon-size'?: React.CSSProperties['width']; '--clear-icon-color'?: React.CSSProperties['color']; '--textarea-length-font-size'?: React.CSSProperties['fontSize']; '--textarea-length-color'?: React.CSSProperties['color']; } export declare type InputTextProps = BaseInputTextProps & HTMLProps<InputCssVars> & React.InputHTMLAttributes<HTMLInputElement>; export declare type InputTextareaProps = BaseInputTextareaProps & React.TextareaHTMLAttributes<HTMLTextAreaElement> & HTMLProps<InputCssVars>; export declare type InputProps = { type?: string; } & (InputTextProps | InputTextareaProps); export interface InputRef { focus: () => void; blur: () => void; clear: () => void; nativeElement: HTMLInputElement | HTMLTextAreaElement | null; } declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<unknown>>; export default Input;