@kiwicom/orbit-components
Version:
Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.
70 lines (61 loc) • 2.5 kB
Flow
// @flow
/*
DOCUMENTATION: https://orbit.kiwi/components/inputfield/
*/
import * as React from "react";
import type { StyledComponent } from "styled-components";
import type { Globals, Translation, DataAttrs } from "../common/common.js.flow";
import type { spaceAfter } from "../common/getSpacingToken/index.js.flow";
type InputMode = "numeric" | "tel" | "decimal" | "email" | "url" | "search" | "text" | "none";
type AriaAutoComplete = "inline" | "list" | "both" | "none";
export type Props = {|
...Globals,
...spaceAfter,
...DataAttrs,
+type?: "text" | "number" | "email" | "password" | "passportid",
+inputMode?: InputMode,
+name?: string,
+label?: Translation,
+inlineLabel?: boolean,
+value?: (() => string | number) | string | number,
+defaultValue?: (() => string | number) | string | number,
+placeholder?: string | (() => string),
+prefix?: React.Node,
+suffix?: React.Node,
+list?: string,
+help?: React.Node,
+error?: React.Node,
+tags?: React.Node,
+disabled?: boolean,
+maxValue?: number,
+minValue?: number,
+width?: string,
+maxLength?: number,
+minLength?: number,
required?: boolean,
tabIndex?: string | number,
+readOnly?: boolean,
+autoComplete?: string,
+autoFocus?: boolean,
+helpClosable?: boolean,
+id?: string,
+insideInputGroup?: boolean,
+ariaAutocomplete?: AriaAutoComplete,
+ariaHasPopup?: boolean,
+ariaExpanded?: boolean,
+ariaControls?: string,
+ariaActiveDescendant?: string,
+onChange?: (ev: SyntheticInputEvent<HTMLInputElement>) => void | Promise<any>,
+onFocus?: (ev: SyntheticInputEvent<HTMLInputElement>) => void | Promise<any>,
+onBlur?: (ev: SyntheticInputEvent<HTMLInputElement>) => void | Promise<any>,
+onSelect?: (ev: SyntheticInputEvent<HTMLInputElement>) => void | Promise<any>,
+onMouseUp?: (ev: SyntheticEvent<HTMLInputElement>) => void | Promise<any>,
+onMouseDown?: (ev: SyntheticEvent<HTMLInputElement>) => void | Promise<any>,
+onKeyDown?: (ev: SyntheticKeyboardEvent<HTMLInputElement>) => void | Promise<any>,
+onKeyUp?: (ev: SyntheticKeyboardEvent<HTMLInputElement>) => void | Promise<any>,
|};
declare export var FakeInput: StyledComponent<any, any, HTMLElement>;
declare export var Input: StyledComponent<any, any, HTMLElement>;
declare export var Prefix: StyledComponent<any, any, HTMLElement>;
declare export var InputContainer: StyledComponent<any, any, HTMLElement>;
declare export default React.AbstractComponent<Props, HTMLInputElement>;