UNPKG

@accelint/design-toolkit

Version:

An open-source component library to serve as part of the entire ecosystem of UX for Accelint.

61 lines (58 loc) 1.96 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import * as react from 'react'; import { ContextValue } from 'react-aria-components'; import { ProviderProps } from '../../lib/types.js'; import { SearchFieldProps } from './types.js'; import 'tailwind-variants'; import '../button/types.js'; import '../button/styles.js'; import 'tailwind-merge'; import '../icon/types.js'; import './styles.js'; declare const SearchFieldContext: react.Context<ContextValue<SearchFieldProps, HTMLDivElement>>; declare function SearchFieldProvider({ children, ...props }: ProviderProps<SearchFieldProps>): react_jsx_runtime.JSX.Element; declare namespace SearchFieldProvider { var displayName: string; } /** * SearchField - A customizable search input component built on React Aria Components * * Provides a search input with integrated search icon, loading state, and clear functionality. * Supports two visual variants (filled/outlined), and granular styling control. * * @example * // Basic search field * <SearchField placeholder="Search..." /> * * @example * // Filled variant with custom styling * <SearchField * variant="filled" * placeholder="Search products" * classNames={{ * input: "bg-info-bold", * searchIcon: "fg-accent-primary-bold" * }} * /> * * @example * // With event handlers * <SearchField * placeholder="Type to search" * onSubmit={(value) => console.log('Search:', value)} * onChange={(value) => setQuery(value)} * /> * * @example * // Using context provider for default props * <SearchField.Provider variant="filled"> * <SearchField placeholder="Search 1" /> * <SearchField placeholder="Search 2" /> * </SearchField.Provider> */ declare function SearchField({ ref, ...props }: SearchFieldProps): react_jsx_runtime.JSX.Element; declare namespace SearchField { var displayName: string; var Provider: typeof SearchFieldProvider; } export { SearchField, SearchFieldContext };