UNPKG

@eccenca/gui-elements

Version:

GUI elements based on other libraries, usable in React application, written in Typescript.

31 lines (30 loc) 1.37 kB
import React from "react"; import { HTMLInputProps, InputGroupProps as BlueprintInputGroupProps, MaybeElement } from "@blueprintjs/core"; import { IntentTypes } from "../../common/Intent"; import { ValidIconName } from "../Icon/canonicalIconNames"; import { InvisibleCharacterWarningProps } from "./useTextValidation"; export interface TextFieldProps extends Partial<Omit<BlueprintInputGroupProps, "intent" | "leftIcon" | "leftElement"> & HTMLInputProps> { /** * Intent state of the text field. */ intent?: IntentTypes | "edited" | "removed"; /** * The input element uses the full horizontal width of the parent container. */ fullWidth?: boolean; /** * Left aligned icon, can be a canonical icon name or an `Icon` element. */ leftIcon?: ValidIconName | MaybeElement; /** * If set, allows to be informed of invisible, hard to spot characters in the string value. */ invisibleCharacterWarning?: InvisibleCharacterWarningProps; /** If true pressing the Escape key will blur/de-focus the input field. Default: false */ escapeToBlur?: boolean; } /** * Text input field. */ export declare const TextField: ({ className, fullWidth, leftIcon, invisibleCharacterWarning, escapeToBlur, intent, ...otherBlueprintInputGroupProps }: TextFieldProps) => React.JSX.Element; export default TextField;