import type { InputHTMLAttributes, ReactNode, Ref, TextareaHTMLAttributes } from 'react';
import { type FieldControlProps } from './Field.js';
import { type FieldBoxSize } from './fieldBox.js';
interface FramedProps {
/** Without a label the box stands alone: name it with `aria-label`, or place it in a Field. */
label?: ReactNode;
/** Beside the label and outside it, so it stays out of the field's name. */
hint?: ReactNode;
/** More about the field, behind a ? beside the label; see Field's `help`. */
help?: string | undefined;
/** Help under the field. */
description?: ReactNode;
error?: ReactNode;
mono?: boolean;
/** `sm` for dense places such as toolbars and table cells, `lg` for a form that stands alone,
* such as sign-in. With a label, the label matches. */
size?: FieldBoxSize | undefined;
}
export interface InputProps extends Omit, 'size'>, FramedProps {
ref?: Ref | undefined;
}
export interface TextareaProps extends TextareaHTMLAttributes, FramedProps {
ref?: Ref | undefined;
/** Grows with its text instead of scrolling, from `rows` lines up to `maxRows`, past which
* it scrolls. */
autosize?: boolean | {
maxRows?: number | undefined;
} | undefined;
/** Draws no box of its own, for a textarea in a frame that draws one, such as a comment
* composer with its buttons: frame it with `fieldBox({ multiline: true, within: true })`.
* It has no padding either, so the frame's own lines up with what is around it. */
bare?: boolean | undefined;
/** Hides what is typed, as a password field does, with a button that shows it: for a
* private key or a certificate. It is monospace, unchecked for spelling and left alone by
* password managers and autofill. */
secret?: boolean | undefined;
}
/** The Field around a control when it has a label; the control alone when it doesn't. */
export declare function framed({ label, hint, help, actions, description, error, size, }: Omit & {
actions?: ReactNode;
}, { id, required, disabled, }: {
id?: string | undefined;
required?: boolean | undefined;
disabled?: boolean | undefined;
}, control: (props: Partial) => ReactNode): string | number | bigint | boolean | import("react").JSX.Element | Iterable | Promise | import("react").ReactElement> | import("react").ReactPortal | null | undefined> | null | undefined;
/** A single-line text field. `type="password"` adds a button that shows what was typed. Placed in
* a Field, it takes the Field's label, description and invalid state. */
export declare function Input({ label, hint, help, description, error, className, mono, size, type, ref, ...props }: InputProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable | Promise | import("react").ReactElement> | import("react").ReactPortal | null | undefined> | null | undefined;
/** Sets a textarea's height to its text's while the browser can't, from its value. */
export declare function useAutosize(enabled: boolean, value: unknown): {
element: import("react").RefObject;
resize: (() => void) | undefined;
};
/** A multi-line text field that grows by hand, or with its text with `autosize`. Placed in a
* Field, it takes the Field's label, description and invalid state. */
export declare function Textarea({ label, hint, help, description, error, className, mono, size, ref, autosize, bare, secret, style, ...props }: TextareaProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable | Promise | import("react").ReactElement> | import("react").ReactPortal | null | undefined> | null | undefined;
export interface TitleInputProps extends Omit, 'value' | 'defaultValue' | 'onChange' | 'rows' | 'aria-label'> {
/** The saved title. Changes from outside show while the title isn't being edited. */
value: string;
/** Called with the trimmed title when an edit ends with a change: on Enter or on leaving
* the field. An empty title isn't committed; the saved one comes back. */
onCommit: (value: string) => void;
'aria-label': string;
/** Focuses the title and selects its text as it appears, such as for a thing just made. */
autoSelect?: boolean | undefined;
/** `xl` for a page's own title, `lg` for one in a panel or drawer. */
size?: 'lg' | 'xl' | undefined;
ref?: Ref | undefined;
}
/** A title edited where it reads: one line that wraps and grows, with no box until the
* pointer or focus is on it. Enter saves, Escape puts the saved title back, and leaving the
* field saves. */
export declare function TitleInput({ value, onCommit, autoSelect, size, readOnly, className, onBlur, onFocus, onKeyDown, ref, ...props }: TitleInputProps): import("react").JSX.Element;
export {};