UNPKG

@octopusdeploy/design-system-components

Version:
75 lines (74 loc) 1.94 kB
import * as React from "react"; import type { IconOnlyButtonProps } from "../../Button"; interface InputProps<T> { /** * The ID of the input */ id: string; /** * The input type (text, email, password, etc.) */ type: "text" | "email" | "password" | "tel" | "url" | "search" | "number" | "time"; /** * The value of the input */ value?: T; /** * The placeholder text to display when input is empty */ placeholder?: string; /** * Whether the field is disabled */ disabled?: boolean; /** * Whether the field is required */ required?: boolean; /** * Whether to autofocus the input */ autoFocus?: boolean; /** * Whether the input is readonly */ readOnly?: boolean; /** * The name attribute for the input */ name?: string; /** * The prefix to display before the input - can be a string or a icon it cannot be interactive */ prefix?: string | React.ReactElement; /** * The suffix to display after the input - can be a string or a button with ghost importance and medium size only */ suffix?: string | React.ReactElement<IconOnlyButtonProps>; /** * The minimum value allowed for number inputs */ min?: number; /** * The maximum value allowed for number inputs */ max?: number; /** * The step value for number inputs */ step?: number | "any"; /** * The action to perform when the form control field is changed. */ onChange: (newValue: T) => void; /** * The ID of the element describing the input */ "aria-describedby"?: string; /** * Whether the field has an invalid value */ "aria-invalid"?: boolean; } export declare function Input<T extends string | number | undefined>(props: InputProps<T>): import("react/jsx-runtime").JSX.Element; export {};