import clsx from 'clsx'; import { Label } from '../Input/Label'; import { type Colors, type Editor, type ErrorProcessing, type Input } from '../props'; import { ErrorField } from './ErrorField'; interface TextInputProps extends Editor, ErrorProcessing, Colors, Input { /** Indicates that padding should be minimal. */ dense?: boolean; /** Capture enter key. */ allowEnter?: boolean; } function preventEnterCapture(event: React.KeyboardEvent) { if (event.key === 'Enter') { event.preventDefault(); } } /** * Displays a customizable input with a label. */ export function TextInput({ id, label, dense, noBorder, noOutline, allowEnter, disabled, className, colors = 'clr-input', onKeyDown, error, ...restProps }: TextInputProps) { return (
); }