import { StateChangeOptions } from 'downshift'; import { ReactNode } from 'react'; import { LabelProps, SupportLabelProps } from '../input-group/types.js'; export type CommonProps = ({ label: string; labelProps?: Omit; inputId?: null; labelId?: null; } | { label?: null; labelProps?: null; inputId: string; labelId: string; }) & { className?: string; isOpen?: boolean; /** @deprecated Bruk helpLabel eller flytt denne teksten ovenfor skjemafeltets label */ leadText?: string; errorLabel?: string; helpLabel?: string; supportLabelProps?: Omit; tooltip?: ReactNode; variant?: "large" | "medium" | "small"; placeholder?: string; /** @deprecated Bruk noHits med text og evt. defaultverdier for items */ noHitsMessage?: ReactNode; maxNumberOfHits?: number; showDropdownControllerButton?: boolean; onInputValueChange?: (inputValue: string) => void; noHits?: { items: string[]; text: ReactNode; }; }; export interface AutosuggestStringItemProps { allItems: string[]; value: string; onChange?: (item: string) => void; onStateChange?: (changes: StateChangeOptions) => void; onConfirm?: () => void; } export type AutosuggestProps = CommonProps & AutosuggestStringItemProps;