UNPKG

jobiqo-cl

Version:

[![CircleCI](https://circleci.com/gh/jobiqo/jobiqo-cl.svg?style=svg&circle-token=5a24efa5b8bbc4879276123e77d0d3f35ca7144c)](https://circleci.com/gh/jobiqo/jobiqo-cl)

47 lines (46 loc) 1.14 kB
/** * @file index.tsx * * @fileoverview Renders a normal select. */ import { FocusEvent } from 'react'; import { SelectItem } from '~/models/forms'; export interface SelectProps { /** * The id for this select. It will be used for accessibility purposes. */ id?: string; /** * Marks if a field is in an error state. * * @default false */ error?: boolean; /** * An array of selected items for the select. * * @default [] */ items: SelectItem[]; /** * The value that is selected. */ selectedValue?: string; /** * The label for the select. */ label?: string; /** * If the select is a required element. */ required?: boolean; /** * The event to fire when something changes in the select. */ onChange?(item: SelectItem): any; /** * The event to fire when the user clicks outside the select. */ onBlur?(event: FocusEvent<HTMLSelectElement>): void; } export declare const Select: ({ id, items, label, error, required, onChange, onBlur, selectedValue }: SelectProps) => JSX.Element;