UNPKG

@helpwave/hightide

Version:

helpwave's component and theming library

44 lines (41 loc) 1.44 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import { ReactNode } from 'react'; import { PropsForTranslation } from '../../hooks/useTranslation.js'; import { LabelProps } from './Label.js'; import '../../hooks/useLanguage.js'; type MultiSelectTranslation = { select: string; search: string; selected: string; }; type MultiSelectOption<T> = { label: string; value: T; selected: boolean; disabled?: boolean; className?: string; }; type SearchProps<T> = { initialSearch?: string; searchMapping: (value: MultiSelectOption<T>) => string[]; }; type MultiSelectProps<T> = { options: MultiSelectOption<T>[]; onChange: (options: MultiSelectOption<T>[]) => void; search?: SearchProps<T>; disabled?: boolean; selectedDisplay?: (props: { items: MultiSelectOption<T>[]; disabled: boolean; }) => ReactNode; label?: LabelProps; hintText?: string; showDisabledOptions?: boolean; className?: string; triggerClassName?: string; }; /** * A Component for multi selection */ declare const MultiSelect: <T>({ overwriteTranslation, options, onChange, search, disabled, selectedDisplay, label, hintText, showDisabledOptions, className, triggerClassName, }: PropsForTranslation<MultiSelectTranslation, MultiSelectProps<T>>) => react_jsx_runtime.JSX.Element; export { MultiSelect, type MultiSelectOption, type MultiSelectProps, type SearchProps };