UNPKG

@engie-group/fluid-design-system-react

Version:

Fluid Design System React

44 lines (43 loc) 1.75 kB
import React from 'react'; import { TSizeVariants } from '../../global'; import { IButtonAnchorProps, IButtonButtonProps } from '../button/NJButton'; export declare const NJInputSearch: React.ForwardRefExoticComponent<IInputSearchProps & React.RefAttributes<HTMLInputElement>>; export interface IInputSearchProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'onChange'> { /** * Label for the input search element */ label: string; /** * Function called on input change * @param e event * @param value value * @deprecated Prefer using `onChange` prop */ onSearchChange?: (e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement>, value: IInputSearchProps['value']) => void; /** * Function called on input change * @param e event * @param value value */ onChange?: (e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement>, value: IInputSearchProps['value']) => void; /** * Return search value on enter * */ onEnterKeyPress?: (e: React.KeyboardEvent<HTMLInputElement>, value: IInputSearchProps['value']) => void; /** * The title of the reset button shown when the field is filled with text */ resetButtonTitle?: string; /** * Options if you want to show a button next to the search input */ buttonOptions?: Omit<IButtonButtonProps, 'size' | 'variant' | 'emphasis' | 'iconClassName' | 'icon'> | Omit<IButtonAnchorProps, 'size' | 'variant' | 'emphasis' | 'iconClassName' | 'icon'>; /** * Size of the Search component */ scale?: Extract<TSizeVariants, 'sm' | 'md' | 'lg' | 'xl'>; /** * Whether the input is disabled */ disabled?: boolean; }