import { ToggleProps } from "@components/Toggle/Toggle.interface"; import { ClassName } from "@helpers/types"; import { HTMLAttributes, ReactNode } from "react"; import { SingleValue, MultiValue, FormatOptionLabelMeta } from "react-select"; export type DropdownValueOptions = SingleValue | MultiValue; export interface IOptionContentClassNames { contentWrapper?: string; leftIcon?: string; label?: string; } export interface IDropdownOption { id: string; value: string; label: string; supportingText?: string; leftIcon?: ReactNode; rightIcon?: ReactNode; caption?: string; onSelect?: (value?: IDropdownOption) => void; toggleProps?: Pick; optionContentClassNames?: IOptionContentClassNames; areAllMultiValuesShown?: boolean; } export interface IOptionContentProps { option: IDropdownOption; variant: OptionVariants; isFocused?: boolean; isSelected?: boolean; onSelect?: (value?: IDropdownOption) => void; id?: string; formatOptionLabel?: (data: IDropdownOption, formatOptionLabelMeta: FormatOptionLabelMeta) => ReactNode; } export type OptionVariants = "default" | "person" | "toggle" | "checkbox-left" | "checkbox-right"; type DropdownErrorType = "label" | "supportingText" | "errorMessage"; export interface IDropdownErrorProps { message?: string; type: DropdownErrorType; } export interface IOptionLabelProps extends Pick { isPersonVariant?: boolean; iconClassName?: string; labelClassName?: string; } export interface IOptionProps extends ClassName { option: IDropdownOption; optionVariant?: OptionVariants; isSelected?: boolean; onSelect?: (item: IDropdownOption) => void; id?: string; } export interface IContainerProps extends HTMLAttributes { isOpen: boolean; variant?: "default" | "multiSection"; } export {};