beta-parity-react
Version:
Beta Parity React Components
84 lines • 2.34 kB
TypeScript
import React from 'react';
import './index.css';
import './variables.css';
import { Input } from '../BaseInput';
import { ButtonProps } from '../Button';
/**
* Props for the SearchInput component.
*
* Extends properties from the `Input` component.
*/
export interface SearchInputProps extends React.ComponentPropsWithoutRef<typeof Input> {
/**
* Indicates whether the search input is in a pending state.
*
* @default false
* @memberof SearchInputProps
*/
isPending?: boolean;
/**
* Determines if a search button should be displayed.
*
* @default false
* @memberof SearchInputProps
*/
searchButton?: boolean;
/**
* Props for the search button, if displayed.
*
* @memberof SearchInputProps
*/
searchButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
/**
* An auxiliary icon displayed alongside the input field.
*
* @memberof SearchInputProps
*/
auxiliaryIcon?: React.ReactNode;
/**
* Indicates whether the auxiliary icon/action is active.
*
* @default false
* @memberof SearchInputProps
*/
auxiliaryActive?: boolean;
/**
* Props for the auxiliary action button, if applicable.
*
* @memberof SearchInputProps
*/
auxiliaryActionProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;
/**
* A keyboard shortcut string to trigger the search action.
*
* Example: `"Ctrl+K"` or `"Cmd+K"`
*
* @memberof SearchInputProps
*/
shortCut?: string;
/**
* Props for the button displaying the shortcut.
*
* @memberof SearchInputProps
*/
shortCutButtonProps?: React.PropsWithoutRef<ButtonProps>;
/**
* Callback triggered when the search action is performed.
*
* @memberof SearchInputProps
*/
onSearch?: () => void | any;
/**
* Callback triggered when the auxiliary action is performed.
*
* @memberof SearchInputProps
*/
onAuxiliaryAction?: () => void | any;
}
/**
* **Parity SearchInput**.
*
* @see {@link https://beta-parity-react.vercel.app/search-input Parity SearchInput}
*/
export declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
//# sourceMappingURL=index.d.ts.map