import clsx from 'clsx'; import { Label } from '../Input/Label'; import { CProps } from '../props'; import { ErrorField } from './ErrorField'; interface TextInputProps extends CProps.Editor, CProps.ErrorProcessing, CProps.Colors, CProps.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 (
); }