UNPKG

@mitcsutt/kiln-forms

Version:

Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui

33 lines (32 loc) • 1.2 kB
import { type AmountFieldProps as UiAmountFieldProps } from '@mitcsutt/kiln-ui'; import type { ControlledKeys } from '../internal/controlledKeys.js'; import { type CommonFieldProps } from '../../../hooks/useFieldBinding.js'; export interface FormAmountFieldProps extends Omit<UiAmountFieldProps, ControlledKeys>, CommonFieldProps<number | null> { } /** * A money field bound to a `number` path. Clearing it writes `null`. * * @remarks * It renders kiln-ui's {@link AmountField | AmountField}. * * @example In a schema * ```json * { * "kind": "amount", * "name": "topUp", * "label": "Top-up", * "currency": "GBP", * "locale": "en-GB" * } * ``` * * @value `number | null` * @empty `null` * * @privateRemarks * A money field bound to a `number` path (§7.2 `amount`) — the path may additionally be * `null`/`undefined`: clearing the input always emits `null`. `unit: 'minor'` stores integer * minor units (recommended for money); view mode always renders a formatted major amount with * `Amount`. */ export declare const FormAmountField: import("../../../kit/contracts.js").FieldDef<import("../../../kit/contracts.js").ExactContract<number>, FormAmountFieldProps>;