UNPKG

@yamada-ui/form-control

Version:

Yamada UI form control component

125 lines (122 loc) 3.1 kB
import * as _yamada_ui_core from '@yamada-ui/core'; import { HTMLUIProps, ThemeProps } from '@yamada-ui/core'; import { ReactNode } from 'react'; import { ErrorMessageProps, HelperMessageProps } from './form-control.mjs'; import '@yamada-ui/utils'; interface FieldsetOptions { /** * If `true`, the fieldset will be disabled. * * @default false */ disabled?: boolean; /** * The fieldset error message to use. */ errorMessage?: ReactNode; /** * The fieldset helper message to use. */ helperMessage?: ReactNode; /** * If `true`, the fieldset will be invalid. * * @default false */ invalid?: boolean; /** * If `true`, the fieldset will be disabled. * * @default false * * @deprecated Use `disabled` instead. */ isDisabled?: boolean; /** * If `true`, the fieldset will be invalid. * * @default false * * @deprecated Use `invalid` instead. */ isInvalid?: boolean; /** * If `true`, the fieldset will be readonly. * * @default false * * @deprecated Use `readOnly` instead. */ isReadOnly?: boolean; /** * If `true`, switch between helper message and error message using isInvalid. * * @default true * * @deprecated Use `replace` instead. */ isReplace?: boolean; /** * If `true`, the fieldset will be required. * * @default false * * @deprecated Use `required` instead. */ isRequired?: boolean; /** * The fieldset legend to use. */ legend?: ReactNode; /** * If `true`, the fieldset will be readonly. * * @default false */ readOnly?: boolean; /** * If `true`, switch between helper message and error message using isInvalid. * * @default true */ replace?: boolean; /** * If `true`, the fieldset will be required. * * @default false */ required?: boolean; /** * Props the error message component. */ errorMessageProps?: ErrorMessageProps; /** * Props the helper message component. */ helperMessageProps?: HelperMessageProps; /** * Props the label component. */ legendProps?: LegendProps; } interface FieldsetProps extends HTMLUIProps<"fieldset">, ThemeProps<"Fieldset">, LegendOptions, FieldsetOptions { } /** * `Fieldset` is a component used to fieldset elements with legend, helper message, error message, etc. * * @see Docs https://yamada-ui.com/components/forms/fieldset */ declare const Fieldset: _yamada_ui_core.Component<"fieldset", FieldsetProps>; interface LegendOptions { /** * @deprecated Use `required` instead. */ isRequired?: boolean; optionalIndicator?: ReactNode; required?: boolean; requiredIndicator?: ReactNode; } interface LegendProps extends HTMLUIProps<"legend">, LegendOptions { } declare const Legend: _yamada_ui_core.Component<"legend", LegendProps>; export { Fieldset, type FieldsetProps, Legend, type LegendProps };