@react-md/form
Version:
This package is for creating all the different form input types.
49 lines (48 loc) • 1.96 kB
TypeScript
import type { HTMLAttributes } from "react";
import type { PropsWithRef } from "@react-md/utils";
import type { FormMessageProps } from "./FormMessage";
declare type DivAttributes = HTMLAttributes<HTMLDivElement>;
declare type MessageProps = PropsWithRef<FormMessageProps, HTMLDivElement>;
declare type MessageContainerProps = PropsWithRef<DivAttributes, HTMLDivElement>;
/**
* This is a utility type that allows for a component to "extend" the
* `FieldMessageContainer` component. This should really be used internally with
* any `TextField` or `TextArea` related components.
*
* @remarks \@since 2.5.0
*/
export declare type FieldMessageContainerExtension<P> = P & {
/**
* If the extension doesn't actually want to render the `FormMessage`
* component, these props are optional. It kind of eliminates the whole
* purpose of this component though.
*/
messageProps?: MessageProps;
/**
* Any props (and an optional ref) to provide to the `<div>` surrounding the
* children and `FormMessage` component.
*
* Note: This will not be used if the `messageProps` are not provided since
* only the `children` will be returned without the container.
*/
messageContainerProps?: MessageContainerProps;
};
/**
* @remarks \@since 2.5.0
*/
export interface FormMessageContainerProps extends DivAttributes {
/**
* If the extension doesn't actually want to render the `FormMessage`
* component, these props are optional. It kind of eliminates the whole
* purpose of this component though.
*/
messageProps?: MessageProps;
}
/**
* A wrapper component that can be used to display a `TextField` related
* component or `TextArea` along with the `FormMessage` component.
*
* @remarks \@since 2.5.0
*/
export declare const FormMessageContainer: import("react").ForwardRefExoticComponent<FormMessageContainerProps & import("react").RefAttributes<HTMLDivElement>>;
export {};