import { AsElementProps, ElementProps } from "../../../types/shared.mjs"; import { PolymorphicComponentProps } from "../../../internal/factory/create-polymorphic-factory.mjs"; import { ErrorMessageProps } from "../../form-elements/error-message/ErrorMessage.mjs"; import { HintProps } from "../../form-elements/hint/Hint.mjs"; import { LabelProps } from "../label/Label.mjs"; import React, { ForwardedRef, ReactNode } from "react"; //#region src/components/core/form-group/FormGroup.d.ts type BaseFormElementProps = { name?: string; id?: string; label?: ReactNode; hint?: ReactNode | ReactNode[]; error?: string | Record; labelProps?: LabelProps; hintProps?: HintProps; errorProps?: ErrorMessageProps; formGroupProps?: React.HTMLAttributes & Record<`data-${string}`, unknown>; withErrorLine?: boolean; }; type FormGroupProps = BaseFormElementProps & { render: (props: BaseFormElementProps & { ref: ForwardedRef; withError: boolean; errorMap?: Record; className?: string; children?: ReactNode; id: string; }) => ReactNode; inputType: 'input' | 'radios' | 'select' | 'checkboxes' | 'dateinput' | 'textarea' | 'other'; fieldsetProps?: ElementProps<'fieldset'>; withFieldset?: boolean; namePrefix?: string; }; /** * Only use this component if you need to create a custom form element. * * This is the main component for most form elements. It wraps the input element with a label, hint and error message. It can also wrap the input element with a fieldset if required. */ declare const FormGroup: ((props: PolymorphicComponentProps) => React.ReactElement) & Omit; withError: boolean; errorMap?: Record; className?: string; children?: ReactNode; id: string; }) => ReactNode; inputType: "input" | "radios" | "select" | "checkboxes" | "dateinput" | "textarea" | "other"; fieldsetProps?: ElementProps<"fieldset">; withFieldset?: boolean; namePrefix?: string; } & AsElementProps & Omit, "as" | keyof BaseFormElementProps | "render" | "inputType" | "fieldsetProps" | "withFieldset" | "namePrefix"> & { ref?: any; renderRoot?: (props: any) => any; }) | (BaseFormElementProps & { render: (props: BaseFormElementProps & { ref: ForwardedRef; withError: boolean; errorMap?: Record; className?: string; children?: ReactNode; id: string; }) => ReactNode; inputType: "input" | "radios" | "select" | "checkboxes" | "dateinput" | "textarea" | "other"; fieldsetProps?: ElementProps<"fieldset">; withFieldset?: boolean; namePrefix?: string; } & { as: keyof React.JSX.IntrinsicElements | React.JSXElementConstructor; renderRoot?: (props: Record) => any; })>, never> & Record; //#endregion export { BaseFormElementProps, FormGroup };