@snowball-tech/fractal
Version:
Fractal's (Snowball's design system) React component library based on RadixUI and TailwindCSS
58 lines (57 loc) • 2.3 kB
TypeScript
import { n as DropdownItemGroupProps, r as DropdownItemProps, t as CombinedRefs$1 } from "./Dropdown.types-vBCbOXFQ.js";
import { t as InputTextProps } from "./InputText.types-BVS5Vx13.js";
import { DropdownMenuContentProps } from "@radix-ui/react-dropdown-menu";
import { AllHTMLAttributes, ChangeEvent, ForwardedRef, ReactNode } from "react";
//#region src/components/Autocomplete/Autocomplete.types.d.ts
type CombinedRefs = {
container: HTMLDivElement | null;
dropdown: CombinedRefs$1 | null;
input: HTMLInputElement | null;
};
interface AutocompleteProps extends Omit<InputTextProps, 'onBlur' | 'onSelect'> {
autoFocus?: boolean;
children?: ReactNode;
defaultValue?: number | string;
description?: ReactNode;
disabled?: boolean;
dropdown?: Partial<{
className?: string;
ref?: ForwardedRef<HTMLDivElement | null>;
} & Omit<DropdownMenuContentProps, 'asChild'>>;
error?: Error | ReactNode;
fullWidth?: boolean;
id?: string;
label?: ReactNode;
labelElement?: keyof HTMLElementTagNameMap;
name?: string;
open?: boolean;
placeholder?: string;
prefix?: ReactNode;
readOnly?: boolean;
required?: boolean;
success?: ReactNode;
suffix?: ReactNode;
value?: number | string;
onBlur?: () => void;
onChange?: (event: ChangeEvent<HTMLInputElement> | null, newValue: string) => void;
onClose?: () => void;
onInputChange?: (event: ChangeEvent<HTMLInputElement>, newValue: string) => void;
onOpen?: () => void;
}
interface AutocompleteLoadingProps extends Omit<AllHTMLAttributes<HTMLDivElement>, 'label'> {
children?: ReactNode;
icon?: boolean | ReactNode;
label?: ReactNode;
spin?: boolean;
}
interface AutocompleteEmptyProps extends Omit<AllHTMLAttributes<HTMLDivElement>, 'label'> {
children?: ReactNode;
label?: ReactNode;
labelElement?: keyof HTMLElementTagNameMap;
}
type AutocompleteItemProps = DropdownItemProps;
type AutocompleteItemGroupProps = DropdownItemGroupProps;
type AutocompleteItemSeparatorProps = AllHTMLAttributes<HTMLDivElement>;
//#endregion
export { AutocompleteLoadingProps as a, AutocompleteItemSeparatorProps as i, AutocompleteItemGroupProps as n, AutocompleteProps as o, AutocompleteItemProps as r, CombinedRefs as s, AutocompleteEmptyProps as t };
//# sourceMappingURL=Autocomplete.types-CH_bKI4X.d.ts.map