@navinc/base-react-components
Version:
Nav's Pattern Library
49 lines (48 loc) • 3.65 kB
TypeScript
import { InferComponentProps } from './types.js';
import { ChangeEvent } from 'react';
declare const SelectField: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Substitute<import("styled-components/dist/types.js").Substitute<import("styled-components/dist/types.js").Substitute<import("styled-components/dist/types.js").Substitute<(import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>) | (Omit<import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<import("react").Component<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, any, any>>), {
isInvalid?: boolean;
}> & import("styled-components/dist/types.js").BaseObject, import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>>, import("styled-components/dist/types.js").BaseObject>, import("styled-components/dist/types.js").BaseObject>> & string;
type OptionObject = {
label: string;
value: string;
disabled?: boolean;
};
type Option = string | OptionObject;
type SelectProps = Omit<InferComponentProps<typeof SelectField>, 'onChange' | 'checked'> & {
label?: string;
hasSpaceForErrors?: boolean;
helperText?: string;
isInvalid?: boolean;
options?: Option[];
value?: string;
required?: boolean;
errors?: Array<string>;
lede?: string;
onChange?: (event: ChangeEvent<HTMLSelectElement>) => void;
placeholder?: string;
isPrivate?: boolean;
};
/**
* @deprecated This component is deprecated and will be removed in a future release. Avoid using it in new code.
*/
export declare const Select: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<InferComponentProps<import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Substitute<import("styled-components/dist/types.js").Substitute<import("styled-components/dist/types.js").Substitute<import("styled-components/dist/types.js").Substitute<(import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>) | (Omit<import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<import("react").Component<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, any, any>>), {
isInvalid?: boolean;
}> & import("styled-components/dist/types.js").BaseObject, import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>>, import("styled-components/dist/types.js").BaseObject>, import("styled-components/dist/types.js").BaseObject>> & string>, "onChange" | "checked"> & {
label?: string;
hasSpaceForErrors?: boolean;
helperText?: string;
isInvalid?: boolean;
options?: Option[];
value?: string;
required?: boolean;
errors?: Array<string>;
lede?: string;
onChange?: (event: ChangeEvent<HTMLSelectElement>) => void;
placeholder?: string;
isPrivate?: boolean;
}, never>> & string & Omit<{
({ className, label, hasSpaceForErrors, helperText, isInvalid, options, value, required, errors, lede, onChange, placeholder, isPrivate, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
displayName: string;
}, keyof import("react").Component<any, {}, any>>;
export {};