surf-design-system
Version:
Surf Design System
46 lines (45 loc) • 1.63 kB
TypeScript
import React from 'react';
import type { sizeSDS, validationSDS, UseFormRegisterReturn } from '../types/common';
export interface TextinputStatusProps {
validation?: validationSDS;
size?: sizeSDS;
iconPosition?: 'left' | 'right';
textAlign?: 'left' | 'right';
}
export interface TextinputProps extends TextinputStatusProps {
id?: string;
label?: React.ReactNode;
name?: string;
placeholder?: string;
value?: string;
valueType?: 'text' | 'password' | 'number' | 'color';
valueCount?: boolean;
helpText?: React.ReactNode;
width?: string;
autoComplete?: string;
showIcon?: boolean;
disabled?: boolean;
readOnly?: boolean;
autoFocus?: boolean;
maxLength?: number;
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
onKeyUp?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
icon?: React.ReactNode;
max?: number;
min?: number;
step?: number;
helpTextWordBreak?: string;
helpTextWhiteSpace?: string;
ariaAutocomplete?: 'none' | 'inline' | 'list' | 'both';
role?: React.AriaRole;
isReadOnlyAttribute?: boolean;
onClick?: React.MouseEventHandler<HTMLInputElement>;
hideIconWhenFocus?: boolean;
tabIndex?: number;
register?: UseFormRegisterReturn;
title?: string;
}
declare const Textinput: React.ForwardRefExoticComponent<TextinputProps & React.RefAttributes<HTMLInputElement | null>>;
export default Textinput;