UNPKG

@navinc/base-react-components

Version:
41 lines (40 loc) 2.85 kB
import { InferComponentProps } from '../../types.js'; import { Select } from './select.js'; export type SimpleSelectOptionObject = { label: string; value: string; disabled?: boolean; }; export type SimpleSelectOption = string | SimpleSelectOptionObject; export declare const isSimpleSelectOptionObject: (option: SimpleSelectOption) => option is SimpleSelectOptionObject; export type SimpleSelectProps = Omit<InferComponentProps<typeof Select>, 'children'> & { options?: readonly SimpleSelectOption[]; }; export declare const SimpleSelect: import("react").ForwardRefExoticComponent<Omit<InferComponentProps<import("react").ForwardRefExoticComponent<{ children: import("react").ReactNode; placeholder?: import("react").ReactNode; contentOverlayStyle?: import("react").CSSProperties; onChange?: (event: { target: { name?: string; value: string; }; }) => void; } & Pick<InferComponentProps<import("react").FC<import("@radix-ui/react-select").SelectProps>>, "name" | "open" | "disabled" | "defaultValue" | "dir" | "value" | "autoComplete" | "required" | "defaultOpen" | "onOpenChange" | "onValueChange"> & Omit<InferComponentProps<import("react").ComponentType<import("@radix-ui/react-select").SelectTriggerProps & import("react").RefAttributes<HTMLButtonElement>>>, "children" | "onChange" | "placeholder"> & import("react").RefAttributes<HTMLButtonElement>>>, "children"> & { options?: readonly SimpleSelectOption[]; } & import("react").RefAttributes<HTMLButtonElement>>; export declare const SimpleSelectField: import("react").ForwardRefExoticComponent<Omit<Omit<InferComponentProps<import("react").ForwardRefExoticComponent<{ children: import("react").ReactNode; placeholder?: import("react").ReactNode; contentOverlayStyle?: import("react").CSSProperties; onChange?: (event: { target: { name?: string; value: string; }; }) => void; } & Pick<InferComponentProps<import("react").FC<import("@radix-ui/react-select").SelectProps>>, "name" | "open" | "disabled" | "defaultValue" | "dir" | "value" | "autoComplete" | "required" | "defaultOpen" | "onOpenChange" | "onValueChange"> & Omit<InferComponentProps<import("react").ComponentType<import("@radix-ui/react-select").SelectTriggerProps & import("react").RefAttributes<HTMLButtonElement>>>, "children" | "onChange" | "placeholder"> & import("react").RefAttributes<HTMLButtonElement>>>, "children"> & { options?: readonly SimpleSelectOption[]; } & import("react").RefAttributes<HTMLButtonElement> & { error?: string; } & import("../../types.js").DataAttributes & Pick<import("../input-components/input-wrapper.js").InputWrapperProps, "label" | "className" | "required" | "helperText" | "optional">, "ref"> & import("react").RefAttributes<HTMLInputElement>>;