import React, { ChangeEvent, FocusEvent, ReactNode } from 'react'; import { FieldNamesType, FieldValidationMethodType, OptionType } from '../../types'; export interface SelectProps { /** * Should the field be disabled? */ disabled?: boolean; /** * The error message for the field as a string. */ error?: string; /** * The form ID for the field. */ formId: string; /** * The id of the field. */ id?: string; /** * A string of Tailwind classes to apply to the label. */ labelTheme?: string; /** * The name of the field. The name must match a key in the `validationSchema` object. */ name: FieldNamesType; /** * The onBlur event handler for the field. */ onBlur?: (e: FocusEvent) => void; /** * The onChange event handler for the field. */ onChange?: (e: ChangeEvent) => void; /** * The onFocus event handler for the field. */ onFocus?: (e: FocusEvent) => void; /** * Should the optional subtext be displayed? */ optional?: boolean; /** * The options to display in the select dropdown. */ options: OptionType[]; /** * The register function from the `useForm` hook. * @see https://react-hook-form.com/docs/useform/register */ register: Function; /** * Should the field be required */ required?: boolean; /** * A string of Tailwind classes to apply to the `select` tag. */ selectTheme?: string; /** * A string of Tailwind classes to apply to the `div` wrapping the `label` tag. */ theme?: string; /** * The title of the field. */ title: string | ReactNode; /** * Our custom validation strategy for the field. `all` will use zod validation, `requiredOnly` will only check if the field is required, `none` will skip validation. */ validation?: FieldValidationMethodType; } /** * This is only to be consumed inside the HookForm component. You should not need to use this component directly. Did you mean to use `` component? */ declare const HookFormSelect: ({ disabled, error, formId, id, labelTheme, name, onBlur, onChange, onFocus, optional, options, register, required, selectTheme, theme, title, validation, }: SelectProps) => React.JSX.Element; export default HookFormSelect;