import * as RMWC from '@rmwc/types'; import React from 'react'; import { MDCSelectFoundation } from '@material/select'; import { MenuProps } from '@rmwc/menu'; export interface FormattedOption extends Omit, 'label'> { label: React.ReactNode; value?: string; options?: FormattedOption[]; } export declare type EnhancedType = boolean | (MenuProps & { ref?: React.Ref; }); export declare type OptionsType = FormattedOption[] | string[] | { [value: string]: string; }; /** A Select Component */ export interface SelectProps { /** The value for a controlled select. */ value?: string; /** Adds help text to the field */ helpText?: React.ReactNode | SelectHelperTextProps; /** Options accepts flat arrays, value => label maps, and more. See examples for details. */ options?: OptionsType; /** A label for the form control. */ label?: string; /** Placeholder text for the form control. Set to a blank string to create a non-floating placeholder label. */ placeholder?: string; /** Makes the select outlined. */ outlined?: boolean; /** Makes the Select visually invalid. This is sometimes automatically my material-components-web. */ invalid?: boolean; /** Makes the Select disabled. */ disabled?: boolean; /** Makes the Select required. */ required?: boolean; /** Renders a non native / enhanced dropdown */ enhanced?: EnhancedType; /** Props for the root element. By default, additional props spread to the native select element. */ rootProps?: Object; /** A reference to the native select element. Not applicable when `enhanced` is true. */ inputRef?: (ref: HTMLSelectElement | null) => void; /** Add a leading icon. */ icon?: RMWC.IconPropT; /** Advanced: A reference to the MDCFoundation. */ foundationRef?: React.Ref; } export declare type SelectHTMLProps = RMWC.HTMLProps, 'onSelect'>>; export declare const Select: RMWC.ComponentType; /** A help text component */ export interface SelectHelperTextProps { /** Make the help text always visible */ persistent?: boolean; /** Make the help a validation message style */ validationMsg?: boolean; /** Content for the help text */ children: React.ReactNode; } /** A help text component */ export declare const SelectHelperText: RMWC.ComponentType;