@unicity/design-system
Version:
A comprehensive React component library built on Material-UI with advanced theming capabilities including neumorphism design support
143 lines • 3.31 kB
TypeScript
import React from 'react';
export interface OptionData {
/**
* Unique identifier
*/
id: string | number;
/**
* Display label
*/
label: string;
/**
* Optional description
*/
description?: string;
/**
* Optional avatar/image URL
*/
avatar?: string;
/**
* Optional icon
*/
icon?: React.ReactNode;
/**
* Optional category
*/
category?: string;
/**
* Whether option is disabled
*/
disabled?: boolean;
/**
* Additional metadata
*/
metadata?: Record<string, any>;
}
export interface AutocompleteProps<T extends OptionData> {
/**
* Array of options
*/
options: T[];
/**
* Current value
*/
value?: T | T[] | null;
/**
* Callback fired when value changes
*/
onChange?: (value: T | T[] | null) => void;
/**
* Input label
*/
label?: string;
/**
* Placeholder text
*/
placeholder?: string;
/**
* Helper text
*/
helperText?: string;
/**
* Whether field has error
*/
error?: boolean;
/**
* Whether field is required
*/
required?: boolean;
/**
* Visual variant
*/
variant?: 'default' | 'outlined' | 'filled';
/**
* Size of the component
*/
size?: 'small' | 'medium';
/**
* Whether to allow multiple selections
*/
multiple?: boolean;
/**
* Whether component is in loading state
*/
loading?: boolean;
/**
* Whether to show avatars in options
*/
showAvatars?: boolean;
/**
* Whether to show descriptions in options
*/
showDescriptions?: boolean;
/**
* Whether to highlight matching text
*/
highlightMatches?: boolean;
/**
* Whether to group options by category
*/
groupByCategory?: boolean;
/**
* Custom loading text
*/
loadingText?: string;
/**
* Custom no options text
*/
noOptionsText?: string;
/**
* Whether to allow creation of new options
*/
allowCreate?: boolean;
/**
* Callback for creating new options
*/
onCreateOption?: (inputValue: string) => T;
/**
* Custom chip props for multiple selection
*/
chipProps?: any;
/**
* Maximum number of selections (for multiple)
*/
maxSelections?: number;
/**
* Whether to show selected indicator
*/
showSelectedIndicator?: boolean;
/**
* Custom filter function
*/
filterOptions?: (options: T[], params: any) => T[];
/**
* Function to group options
*/
groupBy?: (option: T) => string;
/**
* Async function to load options
*/
loadOptions?: (inputValue: string) => Promise<T[]>;
}
export declare const Autocomplete: <T extends OptionData>({ options, value, onChange, label, placeholder, helperText, error, required, variant, size, showAvatars, showDescriptions, highlightMatches, groupByCategory, loadingText, noOptionsText, allowCreate, onCreateOption, chipProps, maxSelections, showSelectedIndicator, filterOptions, loadOptions, multiple, loading, ...props }: AutocompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=Autocomplete.d.ts.map