@mitcsutt/kiln-forms
Version:
Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui
35 lines (34 loc) • 1.16 kB
TypeScript
import { type OneTimeCodeFieldProps as UiOneTimeCodeFieldProps } from '@mitcsutt/kiln-ui';
import type { ControlledKeys } from '../internal/controlledKeys.js';
import { type CommonFieldProps } from '../../../hooks/useFieldBinding.js';
export interface FormOneTimeCodeFieldProps extends Omit<UiOneTimeCodeFieldProps, ControlledKeys>, CommonFieldProps<string> {
/**
* Once every cell is filled (`onComplete`), also submit the form.
*
* @privateRemarks Design reference §7.3.
*/
submitOnComplete?: boolean;
}
/**
* A one-time code as a row of cells, bound to a `string` path.
*
* @remarks
* It renders kiln-ui's {@link OneTimeCodeField | OneTimeCodeField}.
*
* @example In a schema
* ```json
* {
* "kind": "oneTimeCode",
* "name": "code",
* "label": "Verification code",
* "length": 6
* }
* ```
*
* @value `string`
* @empty `''`
*
* @privateRemarks
* A one-time code bound to a `string` path (§7.2 `oneTimeCode`). Empty is `''`.
*/
export declare const FormOneTimeCodeField: import("../../../kit/contracts.js").FieldDef<import("../../../kit/contracts.js").ExactContract<string>, FormOneTimeCodeFieldProps>;