import React from 'react'; import { MarginProps, WidthProps } from 'styled-system'; import { Status } from '../helpers/status'; import { FlexItemProps } from '../helpers/styled'; import { LabelProps } from '../Label/Label'; import { TooltipProps } from '../Tooltip/Tooltip'; export declare type TooltipAlignment = 'left' | 'right'; interface AccessibleProps { name: string; fieldId: string; ariaDescribedBy?: string; labelId: string; tooltipId: string; statusId: string; status?: Status; statusMessage?: React.ReactNode; disabled?: boolean; disableTooltip?: boolean; } declare type RenderFunc = (props: AccessibleProps) => React.ReactNode; interface CommonProps { name: string; label: React.ReactNode; labelProps?: Omit; tooltip?: React.ReactNode; tooltipProps?: Omit; error?: React.ReactNode; warning?: React.ReactNode; success?: React.ReactNode; autoTooltip?: boolean; isOpen?: boolean; disableTooltip?: boolean; alignTooltip?: TooltipAlignment; } export interface FieldProps extends CommonProps, FlexItemProps, MarginProps { } interface InnerProps extends CommonProps, Omit, 'children' | 'defaultChecked' | 'defaultValue'> { children: React.ReactElement | RenderFunc; disabled?: boolean; } interface AccessibleFieldProps extends InnerProps, FlexItemProps, MarginProps, WidthProps { } interface AccessibleHookArgs { id?: string; name?: string; disabled?: boolean; tooltip?: React.ReactNode; error?: React.ReactNode; warning?: React.ReactNode; success?: React.ReactNode; } export declare type ExtFieldProps = Omit; export declare function useAccessibleField({ id, name, error, warning, success, disabled, tooltip, }: AccessibleHookArgs): AccessibleProps; export declare const AccessibleField: React.FC; export default AccessibleField;