UNPKG

@primer/react-brand

Version:

Primer Brand is a GitHub's design system for creating React-based marketing websites and digital experiences.

54 lines (53 loc) 1.6 kB
import React from 'react'; import type { BaseProps } from '../../component-helpers'; import type { FormInputSizes, FormValidationStatus } from '../form-types'; import { Icon } from '@primer/octicons-react'; type VisualType = React.ReactElement | React.ReactNode | Icon; export type TextInputProps = { /** * Applies full width styling. */ fullWidth?: boolean; /** * Removes border */ invisible?: boolean; /** * Applies non-interactive text to start of input. */ leadingText?: string; /** * Applies non-interactive iconography to start of input. */ leadingVisual?: VisualType; /** * Applies monospace styling. */ monospace?: boolean; /** * Applies alternative sizing to the input */ size?: FormInputSizes; /** * Applies non-interactive text to end of input. */ trailingText?: string; /** * Applies non-interactive iconography to end of input. */ trailingVisual?: VisualType; /** * Constrains the input type to single line inputs. */ type?: 'text' | 'number' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'time' | 'datetime-local'; /** * Applies a required attribute to the input */ required?: boolean; /** * */ validationStatus?: FormValidationStatus; } & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> & BaseProps<HTMLInputElement>; export declare const TextInput: React.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & React.RefAttributes<unknown>>; export {};