import * as react from 'react'; import { FormHTMLAttributes, ReactNode } from 'react'; import { F as FieldMode } from './inputs.types-CJbAS14j.cjs'; import { S as Size } from './types-8Sv0rCjw.cjs'; interface FormProviderProps { /** `"edit"` (default) or `"view"` — applied to every input below that doesn't override it. */ mode?: FieldMode; children?: ReactNode; } interface FormProps extends FormHTMLAttributes { /** `"edit"` (default) or `"view"` — applied to every input inside. */ mode?: FieldMode; } /** * Provide a form-wide {@link FieldMode} to every Fancy input below — flip a * whole form from editable to read-only display in one place. Pure context, no * DOM (use it to wrap a filter bar or any tree that isn't a `
`). */ declare function FormProvider({ mode, children }: FormProviderProps): react.JSX.Element; /** * A real `` that also broadcasts a form-wide {@link FieldMode} to the * inputs inside it (sugar over {@link FormProvider}). Per-input `mode` props * still override this. */ declare function Form({ mode, children, ...formProps }: FormProps): react.JSX.Element; interface DisplayValueProps { /** The formatted value to show. Empty / null / undefined renders `empty`. */ children?: ReactNode; size?: Size; /** Static adornment rendered before the value (mirrors an input's `leading`/`prefix`). */ leading?: ReactNode; /** Static adornment rendered after the value (mirrors an input's `trailing`/`suffix`). */ trailing?: ReactNode; /** Shown when the value is empty. Default `—`. */ empty?: ReactNode; /** When true the value is clickable to enter edit mode (inline click-to-edit). */ interactive?: boolean; /** Called when an interactive value is activated (click / Enter / Space). */ onActivate?: () => void; className?: string; } /** * The read-only counterpart to an ``. Renders a non-interactive value * with the same size rhythm as the editable control (reusing * {@link inputSizeClasses}) but without the border / background / focus ring. * * When `interactive` (inline click-to-edit), the value becomes a focusable, * hoverable target that calls `onActivate` on click / Enter / Space to swap in * the real control. Dropped into the SAME `Field` wrapper the editable control * uses, so label / description / error chrome stays byte-identical between the * display and the editor. * * Carries `data-react-fancy-display` / `data-mode="view"` stable handles for * agents and tests (Human+ contract). */ declare function DisplayValue({ children, size, leading, trailing, empty, interactive, onActivate, className, }: DisplayValueProps): react.JSX.Element; interface FieldModeContextValue { mode: FieldMode; } declare const FieldModeContext: react.Context; /** * Resolve the effective mode for an input. Precedence: an explicit prop wins, * then the nearest `` / `` context, then `"edit"`. * * Deliberately tolerant (returns `"edit"` outside any provider) — unlike a slot * guard — so every input works standalone with zero context and existing call * sites behave identically. */ declare function useFieldMode(explicit?: FieldMode): FieldMode; export { DisplayValue as D, FieldModeContext as F, type DisplayValueProps as a, type FieldModeContextValue as b, Form as c, type FormProps as d, FormProvider as e, type FormProviderProps as f, useFieldMode as u };