diff --git a/src/components/Select/Select.tsx b/src/components/Select/Select.tsx index 65eabc35..8d77f787 100644 --- a/src/components/Select/Select.tsx +++ b/src/components/Select/Select.tsx @@ -1,118 +1,194 @@ -// @ts-ignore -import React, { useState, useRef, useEffect } from 'react'; +import React, { useState, forwardRef, useEffect } from 'react'; import ReactSelect, { - components as ReactSelectComponents, - Props as ReactSelectProps, + OptionProps, + MultiValueProps, + IndicatorProps, + StylesConfig, + Props as SelectProps, ActionMeta, - SingleValue, - MultiValue, - ValueContainerProps, } from 'react-select'; import AsyncSelect from 'react-select/async'; -import AsyncCreatableSelect from 'react-select/async-creatable'; import CreatableSelect from 'react-select/creatable'; +import AsyncCreatableSelect from 'react-select/async-creatable'; +import Icon from '../Icon/Icon'; +import Badge from '../Badge/Badge'; -export interface Option { - label: string; - value: any; -} +// Type definitions +type OptionType = { label: string; value: any; disabled?: boolean }; -interface SelectProps extends Omit, 'onChange'> { - options?: Option[]; - defaultValue?: Option | Option[] | null; - value?: Option | Option[] | null; - onChange?: (value: Option | Option[] | null, action: ActionMeta