import { LegacyRef } from 'react' import { CheckboxProps, FormLabelProps, InputProps, SelectProps, StyledProps, TouchableRef, } from '@/design-system' // ----------------------- // -------- INPUT -------- // ----------------------- export type FieldInputProps = InputProps & FormLabelProps & { helperText?: string errorMessage?: string errorIcon?: JSX.Element onFocus?: () => void } // ----------------------- // ------- SELECT -------- // ----------------------- export type FieldSelectProps = SelectProps & FormLabelProps & { helperText?: string errorMessage?: string errorIcon?: JSX.Element isInvalid?: boolean } & StyledProps // ----------------------- // -------- RADIO -------- // ----------------------- export type RadioGroupItemProps = { label: string value: T } export type FieldRadioGroupProps = FormLabelProps & { // Items logic items?: RadioGroupItemProps[] onSelectItem: (val: T) => void selectedItem?: string | number // UI logic errorMessage?: string isInvalid?: boolean isDisabled?: boolean name?: string radioRef?: LegacyRef label?: string isError?: boolean size?: 'sm' | 'md' } // ----------------------- // --- CHECKBOX GROUP ---- // ----------------------- export type CheckboxItemProps = { label: string value: T } export type FieldCheckboxGroupProps = FormLabelProps & { // Items logic items: CheckboxItemProps[] onSelectItem: (val: T[]) => void selectedItems?: T[] // UI logic errorMessage?: string isInvalid?: boolean isDisabled?: boolean name: string label?: string isError?: boolean size?: 'sm' | 'md' } // ----------------------- // ------ CHECKBOX ------- // ----------------------- export type FieldCheckboxProps = FormLabelProps & CheckboxProps & { errorMessage?: string }