import * as React from 'react'; export type CheckboxValue = string | number; export type CheckboxSize = "small" | "medium" | "large"; export type CheckboxVariant = "simple" | "toggle"; export type CheckboxLabelPlacement = "top" | "start" | "end"; export interface CheckboxProps { label: React.ReactNode; id?: string; value?: CheckboxValue; /** * object with shape: `{ * text: PropTypes.string, * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']) * }` */ messages?: any[]; /** * whether to set the input to checked or not on initial render */ defaultChecked?: boolean; /** * whether the input is checked or not (must be accompanied by an `onChange` prop) */ checked?: any; /** * when used with the `checked` prop, the component will not control its own state */ onChange?: (...args: any[])=>any; onKeyDown?: (...args: any[])=>any; onFocus?: (...args: any[])=>any; onBlur?: (...args: any[])=>any; onMouseOver?: (...args: any[])=>any; onMouseOut?: (...args: any[])=>any; /** * Whether or not to disable the checkbox */ disabled?: boolean; /** * Works just like disabled but keeps the same styles as if it were active */ readOnly?: boolean; /** * Visual state showing that child checkboxes are a combination of checked and unchecked */ indeterminate?: boolean; size?: CheckboxSize; variant?: CheckboxVariant; inline?: boolean; labelPlacement?: CheckboxLabelPlacement; } export class Checkbox extends React.Component { render(): JSX.Element; } export type CheckboxGroupSize = "small" | "medium" | "large"; export type CheckboxGroupLayout = "stacked" | "columns" | "inline"; export interface CheckboxGroupProps { name: string; description: React.ReactNode; /** * value to set on initial render */ defaultValue?: any[]; /** * the selected values (must be accompanied by an `onChange` prop) */ value?: any; /** * when used with the `value` prop, the component will not control its own state */ onChange?: (...args: any[])=>any; disabled?: boolean; readOnly?: boolean; /** * object with shape: `{ * text: PropTypes.string, * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']) * }` */ messages?: any[]; /** * children of type `Checkbox` */ children?: any; size?: CheckboxGroupSize; layout?: CheckboxGroupLayout; } export class CheckboxGroup extends React.Component { render(): JSX.Element; } export type DateInputInvalidDateMessage = string | ((...args: any[])=>any); export type DateInputDisabledDateMessage = string | ((...args: any[])=>any); export type DateInputSize = "small" | "medium" | "large"; export type DateInputLayout = "stacked" | "inline"; export type DateInputDisabledDays = any[] | ((...args: any[])=>any); export interface DateInputProps { /** * The label to put on the previous month button of the calendar. */ previousLabel: string; /** * The label to put on the next month button of the calendar. */ nextLabel: string; /** * The message that's used when the data is invalid. */ invalidDateMessage: DateInputInvalidDateMessage; /** * The message that's used when a date is disabled */ disabledDateMessage?: DateInputDisabledDateMessage; /** * Where the calendar popover should be placed. */ placement?: any; /** * This display to show in the input when a date is selected. * Valid formats are compatible with * [moment.js formats](https://momentjs.com/docs/#/displaying/format/), * including localized formats. */ format?: string; messages?: any[]; /** * A standard language id */ locale?: string; /** * A timezone identifier in the format: Area/Location */ timezone?: string; /** * An ISO 8601 formatted string. The initial date value to display on render. * It should only be used when using this component as an uncontrolled input. */ defaultDateValue?: any; /** * Called when the date value of the input has changed. * The parameters are the triggering event, new date value in ISO 8601 format, * the raw user input, if the conversion from raw to a date was successful, and * if the selected date is disabled. */ onDateChange?: (...args: any[])=>any; /** * the selected value (must be accompanied by an `onDateChange` prop) */ dateValue?: any; /** * Whether to display validation feedback while typing. */ validationFeedback?: boolean; datePickerRef?: (...args: any[])=>any; inputRef?: (...args: any[])=>any; /** * An ISO 8601 formatted string. Defaults to the current date. */ todayValue?: any; size?: DateInputSize; layout?: DateInputLayout; width?: string; inline?: boolean; /** * Html placeholder text to display when the input has no value. This should be hint text, not a label * replacement. */ placeholder?: string; /** * Whether or not to disable the input */ disabled?: boolean; /** * Works just like disabled but keeps the same styles as if it were active */ readOnly?: boolean; required?: boolean; /** * An array of weekdays that should be unselectable. Each day should be an integer * corresponding to the day of the week, where 0 = Sunday, 1 = Monday, 2 = Tuesday, * 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday. */ disabledDaysOfWeek?: any[]; /** * An array of Date objects that should be unselectable or a callback function * that gets passed a date and should return a boolean indicating where it is * unselectable. */ disabledDays?: DateInputDisabledDays; } export class DateInput extends React.Component { render(): JSX.Element; } export type DateTimeInputTimeStep = 5 | 10 | 15 | 20 | 30 | 60; export type DateTimeInputInvalidDateTimeMessage = string | ((...args: any[])=>any); export type DateTimeInputLayout = "stacked" | "columns" | "inline"; export interface DateTimeInputProps { /** * The label over the composite `DateTimeInput` component */ description: React.ReactNode; /** * The label over the Date Input */ dateLabel: string; /** * The label to put on the previous month button of the calendar. */ datePreviousLabel: string; /** * The label to put on the next month button of the calendar. */ dateNextLabel: string; /** * HTML placeholder text to display when the date input has no value. * This should be hint text, not a label replacement. */ datePlaceholder?: string; /** * The format of the date shown in the `DateInput` when a date is selected. * Valid formats are compatible with * [moment.js formats](https://momentjs.com/docs/#/displaying/format/), * including localized formats. * If omitted, deferrs to the underlying `DateInput`'s default. */ dateFormat?: string; /** * The label over the time input */ timeLabel: string; /** * The number of minutes to increment by when generating the allowable time options. */ timeStep?: DateTimeInputTimeStep; /** * The format of the time shown in the `TimeInput` when a time is selected. * Valid formats are compatible with * [moment.js formats](https://momentjs.com/docs/#/displaying/format/), * including localized formats. * If omitted, deferrs to the underlying `TimeInput`'s default. */ timeFormat?: string; /** * A standard language identifier. * See [moment.js i18n](https://momentjs.com/docs/#/i18n/) for more details. * This property can also be set via a context property and if both are set then the component property takes * precedence over the context property. * The web browser's locale will be used if no value is set via a component property or a context * property. */ locale?: string; /** * A timezone identifier in the format: Area/Location * See [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for the list * of possible options. * This property can also be set via a context property and if both are set then the component property takes * precedence over the context property. * The web browser's timezone will be used if no value is set via a component property or a context * property. */ timezone?: string; /** * The message shown to the user when the data is invalid. * If a string, shown to the user anytime the input is invalid. * If a function, receives 2 parameters: * *rawDateValue*: the string entered as a date by the user, * *rawTimeValue*: the string entered as a time by the user. * Currently, times must be selected from a list, it can never be incorrect, * Though `invalidDateTimeMessage` will be called if the user selects a time without * setting the date. * Either parameter is undefined if the user has not entered anything, * which you can use to test for no input if the `DateTimeInput` is required. */ invalidDateTimeMessage: DateTimeInputInvalidDateTimeMessage; /** * Messages my parent would like displayed * object with shape: `{ * text: PropTypes.string, * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']) * } */ messages?: any[]; /** * This format of the composite date-time when displayed in messages. * Valid formats are compatible with * [moment.js formats](https://momentjs.com/docs/#/displaying/format/), * including localized formats. */ messageFormat?: string; /** * Vertically stacked, horizontally arranged in 2 columns, or inline. * See [FormFieldGroup](#FormFieldGroup) for details. */ layout?: DateTimeInputLayout; /** * An ISO 8601 formatted date string representing the current date-time * (must be accompanied by an onChange prop). */ value?: any; /** * An ISO 8601 formatted date string to use if `value` isn't provided. */ defaultValue?: any; required?: boolean; /** * Whether or not to disable the inputs */ disabled?: boolean; /** * Works just like disabled but keeps the same styles as if it were active */ readOnly?: boolean; /** * Called when the date-time value has changed. * The passed in parameters are * *event*: the triggering event (which may be from the underlying * `DateInput` or `TimeInput`), *isoValue*: the new date value in ISO 8601 format. */ onChange?: (...args: any[])=>any; /** * The element where the date is entered. */ dateInputRef?: (...args: any[])=>any; /** * The element where the time is entered. */ timeInputRef?: (...args: any[])=>any; /** * onBlur event handler for when focus leaves DateTimeInput. * Does not fire when focus moves between DateInput and TimeInput within the component */ onBlur?: (...args: any[])=>any; } export class DateTimeInput extends React.Component { render(): JSX.Element; } export type FileDropLabel = ((...args: any[])=>any) | React.ReactNode; export type FileDropAccept = string | string[]; export type FileDropInteraction = "enabled" | "disabled" | "readonly"; export interface FileDropProps { /** * the id of the input (to link it to its label for a11y) */ id?: string; /** * the content of FileDrop, can be a component or an react node. * If given a component, it will receive isDragAccepted and isDragRejected as props */ label: FileDropLabel; /** * the mime media type/s or file extension/s allowed to be dropped inside */ accept?: FileDropAccept; /** * object with shape: `{ * text: PropTypes.string, * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']) * }` */ messages?: any[]; /** * callback called when clicking on drop area to select files to upload */ onClick?: (...args: any[])=>any; /** * callback called when dropping files or when the file dialog window exits successfully */ onDrop?: (...args: any[])=>any; /** * callback called when dropping allowed files */ onDropAccepted?: (...args: any[])=>any; /** * callback called when dropping rejected files */ onDropRejected?: (...args: any[])=>any; /** * callback called when dragging files * and passing through FileDrop's content for the first time */ onDragEnter?: (...args: any[])=>any; /** * callback called when dragging files and passing through FileDrop's content */ onDragOver?: (...args: any[])=>any; /** * callback called when dragging files and leaving FileDrop's content */ onDragLeave?: (...args: any[])=>any; /** * flag to use window.URL.createObjectURL for each dropped file and passing it through file.preview */ enablePreview?: boolean; /** * flag to allow selection multiple files to drop at once */ allowMultiple?: boolean; /** * the maximum file size allowed */ maxSize?: number; /** * the minimum file size allowed */ minSize?: number; /** * Whether or not to allow the file browser to upload the same file more than once. */ allowRepeatFileSelection?: boolean; disabled?: boolean; readOnly?: boolean; interaction?: FileDropInteraction; } export class FileDrop extends React.Component { render(): JSX.Element; } export type RadioInputValue = string | number; export type RadioInputVariant = "simple" | "toggle"; export type RadioInputSize = "small" | "medium" | "large"; export type RadioInputContext = "success" | "warning" | "danger" | "off"; export interface RadioInputProps { label: React.ReactNode; value?: RadioInputValue; id?: string; name?: string; checked?: boolean; /** * Whether or not to disable the input */ disabled?: boolean; /** * Works just like disabled but keeps the same styles as if it were active */ readOnly?: boolean; variant?: RadioInputVariant; size?: RadioInputSize; context?: RadioInputContext; inline?: boolean; onClick?: (...args: any[])=>any; onChange?: (...args: any[])=>any; } export class RadioInput extends React.Component { render(): JSX.Element; } export type RadioInputGroupDefaultValue = string | number; export type RadioInputGroupVariant = "simple" | "toggle"; export type RadioInputGroupSize = "small" | "medium" | "large"; export type RadioInputGroupLayout = "stacked" | "columns" | "inline"; export interface RadioInputGroupProps { name: string; description: React.ReactNode; /** * value to set on initial render */ defaultValue?: RadioInputGroupDefaultValue; /** * the selected value (must be accompanied by an `onChange` prop) */ value?: any; /** * when used with the `value` prop, the component will not control its own state */ onChange?: (...args: any[])=>any; disabled?: boolean; /** * works just like disabled but keeps the same styles as if it were active */ readOnly?: boolean; /** * object with shape: `{ * text: PropTypes.string, * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']) * }` */ messages?: any[]; /** * any children (ones that aren't `RadioInput` are passed through) */ children?: React.ReactNode; variant?: RadioInputGroupVariant; size?: RadioInputGroupSize; layout?: RadioInputGroupLayout; } export class RadioInputGroup extends React.Component { render(): JSX.Element; } export type RangeInputSize = "small" | "medium" | "large"; export type RangeInputLayout = "stacked" | "inline"; export interface RangeInputProps { min: number; max: number; /** * value to set on initial render */ defaultValue?: number; /** * the selected value (must be accompanied by an `onChange` prop) */ value?: any; /** * when used with the `value` prop, the component will not control its own state */ onChange?: (...args: any[])=>any; messages?: any[]; size?: RangeInputSize; layout?: RangeInputLayout; id?: string; label: React.ReactNode; /** * whether to display the current value */ displayValue?: boolean; step?: number; /** * A function to format the displayed value */ formatValue?: (...args: any[])=>any; inline?: boolean; disabled?: boolean; readOnly?: boolean; } export class RangeInput extends React.Component { render(): JSX.Element; } export type SelectDefaultOption = string | { label: string; value: string; id?: string | number; children?: React.ReactNode; disabled?: boolean; icon?: (...args: any[])=>any; groupLabel?: boolean; } | (string | { label: string; value: string; id?: string | number; children?: React.ReactNode; disabled?: boolean; icon?: (...args: any[])=>any; groupLabel?: boolean; })[]; export type SelectSize = "small" | "medium" | "large"; export type SelectLayout = "stacked" | "inline"; export type SelectVisibleOptionsCount = string | number; export interface SelectProps { /** * Determines wether Select allows multiple values */ multiple?: boolean; /** * Determines whether the user can type in the input */ editable?: boolean; /** * Each children must be an option element. */ children?: any; /** * a function that provides a reference to the internal input element */ inputRef?: (...args: any[])=>any; value?: string; /** * the selected value (must be accompanied by an `onChange` prop) */ selectedOption?: any; /** * value to set on initial render, meant for an uncontrolled component */ defaultOption?: SelectDefaultOption; /** * for not multiple Select, allows the user to empty selection */ allowEmpty?: boolean; /** * SelectSingle only (Mutually exclusive with multiple=true) * If true, the user can freely enter a value not available in the options list. * Implies editable is true. */ allowCustom?: boolean; id?: string; /** * The placement of the content in relation to the trigger, passed down to Position */ placement?: any; messages?: any[]; size?: SelectSize; layout?: SelectLayout; /** * Options dropdown can be wider than input if optionsMaxWidth is provided */ optionsMaxWidth?: string; /** * Give the Spinner a title to be read by screenreaders. Disables menu * interaction and renders a Spinner in its place. */ loadingText?: string; /** * The menu content to render when no options are present or are filtered away */ emptyOption?: React.ReactNode; /** * The amount of options that are visible without scrolling */ visibleOptionsCount?: SelectVisibleOptionsCount; /** * Custom text to be read by the screenreader when Select is focused */ assistiveText?: string; /** * Additional text to provide screenreader feedback upon user action */ announcement?: string; /** * The filter function applied to the options when writing on the input */ filter?: (...args: any[])=>any; /** * The format function called for each Tag to render its contents */ formatSelectedOption?: (...args: any[])=>any; /** * Whether or not to disable the input */ disabled?: boolean; /** * Works just like disabled but keeps the same styles as if it were active */ readOnly?: boolean; /** * Callback fired when `` content has been rendered */ onPositioned?: (...args: any[])=>any; /** * Callback fired when the menu is opened */ onOpen?: (...args: any[])=>any; /** * Callback fired when the menu is closed */ onClose?: (...args: any[])=>any; /** * Callback fired when one of the menu options gets selected. Second parameter is the selected option. */ onChange?: (...args: any[])=>any; /** * Callback fired when on the onChange of the internal input. */ onInputChange?: (...args: any[])=>any; /** * Callback fired when the options displayed in the menu change */ onOptionsChange?: (...args: any[])=>any; /** * Callback fired when on the onBlur of the internal input */ onBlur?: (...args: any[])=>any; /** * Callback fired when on the onClick of the internal input */ onClick?: (...args: any[])=>any; /** * should the menu be closed when a selection happens */ closeOnSelect?: boolean; /** * The parent in which to constrain the menu. * One of: 'window', 'scroll-parent', 'parent', 'none', an element, * or a function returning an element */ constrain?: any; } export class Select extends React.Component { render(): JSX.Element; } export type TextAreaSize = "small" | "medium" | "large"; export type TextAreaLayout = "stacked" | "inline"; export type TextAreaResize = "none" | "both" | "horizontal" | "vertical"; export type TextAreaMaxHeight = number | string; export interface TextAreaProps { label: React.ReactNode; id?: string; /** * sets the font-size for the textarea */ size?: TextAreaSize; layout?: TextAreaLayout; /** * the textarea will expand vertically to fit the height of the content, * unless its content exceeds `maxHeight` */ autoGrow?: boolean; /** * is the textarea resizable (in supported browsers) */ resize?: TextAreaResize; /** * a fixed width for the textarea */ width?: string; /** * a initial height for the textarea (if autoGrow is true it will grow vertically) */ height?: string; /** * when autoGrow is true, the textarea will never grow beyond this value */ maxHeight?: TextAreaMaxHeight; /** * object with shape: `{ * text: PropTypes.string, * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']) * }` */ messages?: any[]; inline?: boolean; /** * Html placeholder text to display when the input has no value. This should be hint text, not a label * replacement. */ placeholder?: string; /** * Whether or not to disable the textarea */ disabled?: boolean; /** * Works just like disabled but keeps the same styles as if it were active */ readOnly?: boolean; required?: boolean; /** * a function that provides a reference to the actual textarea element */ textareaRef?: (...args: any[])=>any; /** * value to set on initial render */ defaultValue?: string; /** * the selected value (must be accompanied by an `onChange` prop) */ value?: any; /** * when used with the `value` prop, the component will not control its own state */ onChange?: (...args: any[])=>any; } export class TextArea extends React.Component { render(): JSX.Element; } export type TextInputType = "text" | "email" | "url" | "tel" | "search" | "password"; export type TextInputSize = "small" | "medium" | "large"; export type TextInputLayout = "stacked" | "inline"; export type TextInputTextAlign = "start" | "center"; export interface TextInputProps { type?: TextInputType; label: React.ReactNode; id?: string; /** * object with shape: `{ * text: PropTypes.string, * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']) * }` */ messages?: any[]; size?: TextInputSize; layout?: TextInputLayout; textAlign?: TextInputTextAlign; width?: string; inline?: boolean; /** * Html placeholder text to display when the input has no value. This should be hint text, not a label * replacement. */ placeholder?: string; /** * Whether or not to disable the input */ disabled?: boolean; /** * Works just like disabled but keeps the same styles as if it were active */ readOnly?: boolean; required?: boolean; /** * a function that provides a reference to the actual input element */ inputRef?: (...args: any[])=>any; /** * value to set on initial render */ defaultValue?: string; /** * the selected value (must be accompanied by an `onChange` prop) */ value?: any; /** * An icon to display within the input */ icon?: (...args: any[])=>any; } export class TextInput extends React.Component { render(): JSX.Element; } export type TimeInputStep = 5 | 10 | 15 | 20 | 30 | 60; export interface TimeInputProps { /** * Whether to default to the first option when `defaultValue` hasn't been specified. */ defaultToFirstOption?: boolean; /** * An ISO 8601 formatted date string to use if `value` isn't provided. */ defaultValue?: any; /** * The format to use when displaying the possible and currently selected options. * See [moment.js formats](https://momentjs.com/docs/#/displaying/format/) for the list of available formats. */ format?: string; /** * The label associated with the underlying [TextInput](#TextInput). */ label: React.ReactNode; /** * A standard language identifier. * See [moment.js i18n](https://momentjs.com/docs/#/i18n/) for more details. * This property can also be set via a context property and if both are set then the component property takes * precedence over the context property. * The web browser's locale will be used if no value is set via a component property or a context * property. */ locale?: string; /** * Callback fired when one of the menu options gets selected */ onChange?: (...args: any[])=>any; /** * The number of minutes to increment by when generating the allowable options. */ step?: TimeInputStep; /** * A timezone identifier in the format: Area/Location * See [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for the list * of possible options. * This property can also be set via a context property and if both are set then the component property takes * precedence over the context property. * The web browser's timezone will be used if no value is set via a component property or a context * property. */ timezone?: string; /** * An ISO 8601 formatted date string representing the current selected value * (must be accompanied by an onChange prop). */ value?: any; /** * Whether or not to disable the select */ disabled?: boolean; /** * Works just like disabled but keeps the same styles as if it were active */ readOnly?: boolean; } export class TimeInput extends React.Component { render(): JSX.Element; }