import { InputBaseComponentProps } from '@material-ui/core'; import React, { ElementType, ComponentType } from 'react'; import { FieldProps as FinalFieldProps, FieldRenderProps } from 'react-final-form'; export interface MuiFieldComponentProps { error?: boolean; helperText?: React.ReactNode; inputProps?: InputBaseComponentProps; onChange: React.ChangeEventHandler; ComponentProps?: any; } /** * Props for Fluent-style components (error string contains the message) */ export interface FluentFieldComponentProps { error?: string; hint?: string; onChange?: (event: { target: { value: unknown; }; }) => void; } export type MuiFieldComponent = ElementType; export type FieldProps, T extends HTMLElement = HTMLElement> = { component: ElementType; // @fixme Some of the onChange handlers pass value instead valueForChange?: (event: React.ChangeEvent) => FieldValue; pattern?: string; /** * Helper text shown below the input when there's no error. * Passed as helperText for MUI components, or automatically converted for Fluent components. */ helperText?: React.ReactNode; } & Pick, 'afterSubmit' | 'allowNull' | 'beforeSubmit' | 'defaultValue' | 'format' | 'formatOnBlur' | 'initialValue' | 'isEqual' | 'name' | 'parse' | 'subscription' | 'type' | 'validate' | 'validateFields' | 'value' | 'required'> & Omit; type FieldComponent = FieldRenderProps, T extends HTMLElement = HTMLElement> = ComponentType>; /** * Final Form Field wrapper that supports both Material UI and Fluent UI components. * * UDP Fluent components automatically detect and convert error props, * so you can use the same Field component for both MUI and Fluent components. * * @example * // MUI component * * * @example * // UDP Fluent component (auto-detects error style) * */ export declare const Field: FieldComponent; export {}; //# sourceMappingURL=Field.d.ts.map