@engie-group/fluid-design-system-react
Version:
Fluid Design System React
23 lines (22 loc) • 1.13 kB
TypeScript
import React from 'react';
import { ICommonFormItemProps } from '../form-item/NJFormItem';
import { type IListItemProps } from '../list';
export declare const NJSelectInput: React.ForwardRefExoticComponent<ICommonFormItemProps & ISelectInputProps & React.RefAttributes<HTMLInputElement>>;
export interface ISelectInputProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'onChange' | 'size'> {
/**
* Instructions on how to navigate the list. It is appended after the input label.
* @example "Use up and down arrows and Enter to select a value"
*/
listNavigationLabel: string;
/**
* Button default label when no value is selected. It is append after the input label.
* @example "Select a value"
*/
buttonDefaultValueLabel: string;
children: React.ReactElement<IListItemProps> | React.ReactElement<IListItemProps>[];
onChange: (newValue: string) => void;
/** If set to true (default value) the dropdown menu is closed when an item is selected
* otherwise, the dropdown stays open to allow selection of another item.
*/
shouldCloseOnSelect?: boolean;
}