UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

44 lines (43 loc) 1.99 kB
import type { ReactElement } from "react"; import type { ChildProps } from "../util/props.js"; export declare const RADIO_CLASS: any; export declare const CHECKBOX_CLASS: any; export declare const INPUT_CLASS: any; export declare const PLACEHOLDER_CLASS: any; export declare const EMPTY_OPTION_CLASS: any; export declare const VALUE_OPTION_CLASS: any; export declare const TEXT_INPUT_CLASS: string; export declare const MULTILINE_TEXT_INPUT_CLASS: string; export declare const WRAPPER_INPUT_CLASS: string; export declare const SELECT_INPUT_CLASS: string; export declare const BUTTON_INPUT_CLASS: string; export declare const LABEL_INPUT_CLASS: string; /** Props all inputs allow. */ export interface InputProps { /** The `name=""` prop of the input. */ name: string; /** Friendly title for the input. */ title?: string | undefined; /** Placeholder for the input. Defaults to `title`. Set to `""` to show no placeholder. */ placeholder?: string | undefined; /** Whether the input is required. */ required?: boolean | undefined; /** Whether the input is disabled. */ disabled?: boolean | undefined; /** Any error message for the input. */ message?: string | undefined; } /** "Value inputs" are inputs that generate a value, like `<input>` or `<textarea>` */ export interface ValueInputProps<O, I = never> extends InputProps { /** The current value of the input. */ value?: O | I | undefined; /** Called when the value for the input changes, so you can make changes based on the new value (or `undefined` to set back to default). */ onValue(value: O | undefined): void; } /** Input that is loading. */ export declare const LOADING_INPUT: import("react/jsx-runtime").JSX.Element; /** * Wraps an input with support for absolutely-positioned `data-slot` icon elements on either side. * - This is so you can put an icon before or after an input. */ export declare function InputWrapper({ children }: ChildProps): ReactElement;