import { DensityProp } from '../../composables/density.js'; import { SkeletonInjected } from '../../composables/useSkeletonState.js'; import { Nullable } from '../../types/utils.js'; import { OnyxBasicPopoverProps } from '../OnyxBasicPopover/types.js'; import { FormInjectedProps } from '../OnyxForm/OnyxForm.core.js'; export type OnyxFormElementV2Props = DensityProp & Pick & { /** * The id of a labelled form-related element. * Will be auto-generated if unset and be passed to the `default` slot. */ id?: string; /** * Label to show for the element. Required due to accessibility / screen readers. * If you want to visually hide the label, use the `label.hidden` property. */ label: string | FormElementV2LabelOptions; /** * Whether to show as skeleton. */ skeleton?: SkeletonInjected; /** * Optional message to show below the form element. */ message?: string | FormElementV2Tooltip; /** * Optional error message to show below the form element. */ error?: string | FormElementV2Tooltip; /** * Optional success message to show below the form element. */ success?: string | FormElementV2Tooltip; /** * Whether the a value for this form element is required. */ required?: boolean; /** * Whether a loading indicator should be shown. * Will hide the `leadingIcons` slot if set. */ loading?: boolean; /** * Whether the popover is currently open. */ open?: Nullable; /** * Additional popover options. */ popoverOptions?: FormElementV2PopoverOptions; }; export type OnyxFormElementV2Slots = { /** * Actual native HTML form element (e.g. `` or `