// we need some empty interfaces to show up in docs
// HACKHACK: these components should go in separate files
// tslint:disable max-classes-per-file no-empty-interface
import classNames from "classnames";
import * as React from "react";
import { Alignment } from "../../common/alignment";
import * as Classes from "../../common/classes";
import { DISPLAYNAME_PREFIX, HTMLInputProps, IProps } from "../../common/props";
import { safeInvoke } from "../../common/utils";
export interface IControlProps extends IProps, HTMLInputProps {
// NOTE: HTML props are duplicated here to provide control-specific documentation
/**
* Alignment of the indicator within container.
* @default Alignment.LEFT
*/
alignIndicator?: Alignment;
/** Whether the control is checked. */
checked?: boolean;
/** JSX label for the control. */
children?: React.ReactNode;
/** Whether the control is initially checked (uncontrolled mode). */
defaultChecked?: boolean;
/** Whether the control is non-interactive. */
disabled?: boolean;
/** Ref handler that receives HTML `` element backing this component. */
inputRef?: (ref: HTMLInputElement | null) => any;
/** Whether the control should appear as an inline element. */
inline?: boolean;
/**
* Text label for the control.
*
* Use `children` or `labelElement` to supply JSX content. This prop actually supports JSX elements,
* but TypeScript will throw an error because `HTMLAttributes` only allows strings.
*/
label?: string;
/**
* JSX Element label for the control.
*
* This prop is a workaround for TypeScript consumers as the type definition for `label` only
* accepts strings. JavaScript consumers can provide a JSX element directly to `label`.
*/
labelElement?: React.ReactNode;
/** Whether this control should use large styles. */
large?: boolean;
/** Event handler invoked when input value is changed. */
onChange?: React.FormEventHandler;
/**
* Name of the HTML tag that wraps the checkbox.
*
* By default a `