UNPKG

@helpwave/hightide

Version:

helpwave's component and theming library

37 lines (34 loc) 1.16 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import { ReactNode } from 'react'; import { LabelProps } from './Label.mjs'; type SelectOption<T> = { label: ReactNode; value: T; disabled?: boolean; className?: string; }; type SelectProps<T> = { value?: T; label?: LabelProps; options: SelectOption<T>[]; onChange: (value: T) => void; isHidingCurrentValue?: boolean; hintText?: string; showDisabledOptions?: boolean; className?: string; isDisabled?: boolean; textColor?: string; hoverColor?: string; /** * The items will be at the start of the select and aren't selectable */ additionalItems?: ReactNode[]; selectedDisplayOverwrite?: ReactNode; }; /** * A Select Component for selecting form a list of options * * The State is managed by the parent */ declare const Select: <T>({ value, label, options, onChange, isHidingCurrentValue, hintText, showDisabledOptions, isDisabled, className, textColor, hoverColor, additionalItems, selectedDisplayOverwrite, }: SelectProps<T>) => react_jsx_runtime.JSX.Element; export { Select, type SelectOption, type SelectProps };