import type { InputHTMLAttributes, ReactNode } from 'react';
import type { Option } from './useCombobox';
import type { FormFieldProps } from './useFormField/useFormField';
export type ComboboxProps = {
/**
* Label for the combobox.
*
* Passed label will be encapsulated by a `label` element.
*/
label?: ReactNode;
/**
* Visually hides `label` and `description` (still available for screen readers)
* @default false
*/
hideLabel?: boolean;
/**
* String array of selected options. Contains only one option during single selection mode.
*/
value?: string[];
/**
* String array of initial selected options. Contains only one option during single selection mode.
*/
initialValue?: string[];
/**
* Callback function that is called when the value changes
*/
onValueChange?: (value: string[]) => void;
/**
* Multiple options can be selected
* @default false
*/
multiple?: boolean;
/**
* Name of the value when used in a formPuse
*/
name?: string;
/**
* Exposes the HTML `size` attribute.
* @default 0
*/
htmlSize?: number;
/**
* Hides chips when multiple options are selected
* @default false
*/
hideChips?: boolean;
/**
* Hides the clear button
* @default false
*/
hideClearButton?: boolean;
/**
* Label for the clear button
* @default 'Fjern alt'
*/
clearButtonLabel?: string;
/**
* Enables virtualizing of options list.
* @see https://tanstack.com/virtual
* @default false
*/
virtual?: boolean;
/**
* Value of the input field
*/
inputValue?: string;
/**
* Adds `aria-busy` and displays loading state for the Combobox
* All options will be hidden and replaced with a loading message.
* @default false
*/
loading?: boolean;
/**
* Text to display when the combobox is loading
* @default 'Laster...'
*/
loadingLabel?: string;
/**
* Filter function for filtering the list of options. Return `true` to show option, `false` to hide option.
* @param inputValue
* @param option
* @returns boolean
*
* @default (inputValue, option) => option.value.toLowerCase().startsWith(inputValue.toLowerCase())
*/
filter?: (inputValue: string, option: Option) => boolean;
/**
* Add a screen reader label to the chips
* @param option
* @returns string
*
* @default (option) => 'Slett ' + option.label,
*/
chipSrLabel?: (option: Option) => string;
/**
* Portals the floating element outside of the app root and into the body.
* @see https://floating-ui.com/docs/floatingportal
* @default false
*/
portal?: boolean;
} & FormFieldProps & Omit, 'size'>;
/**
* @deprecated Use `Suggestion` instead
*/
export declare const ComboboxComponent: import("react").ForwardRefExoticComponent<{
/**
* Label for the combobox.
*
* Passed label will be encapsulated by a `label` element.
*/
label?: ReactNode;
/**
* Visually hides `label` and `description` (still available for screen readers)
* @default false
*/
hideLabel?: boolean;
/**
* String array of selected options. Contains only one option during single selection mode.
*/
value?: string[];
/**
* String array of initial selected options. Contains only one option during single selection mode.
*/
initialValue?: string[];
/**
* Callback function that is called when the value changes
*/
onValueChange?: (value: string[]) => void;
/**
* Multiple options can be selected
* @default false
*/
multiple?: boolean;
/**
* Name of the value when used in a formPuse
*/
name?: string;
/**
* Exposes the HTML `size` attribute.
* @default 0
*/
htmlSize?: number;
/**
* Hides chips when multiple options are selected
* @default false
*/
hideChips?: boolean;
/**
* Hides the clear button
* @default false
*/
hideClearButton?: boolean;
/**
* Label for the clear button
* @default 'Fjern alt'
*/
clearButtonLabel?: string;
/**
* Enables virtualizing of options list.
* @see https://tanstack.com/virtual
* @default false
*/
virtual?: boolean;
/**
* Value of the input field
*/
inputValue?: string;
/**
* Adds `aria-busy` and displays loading state for the Combobox
* All options will be hidden and replaced with a loading message.
* @default false
*/
loading?: boolean;
/**
* Text to display when the combobox is loading
* @default 'Laster...'
*/
loadingLabel?: string;
/**
* Filter function for filtering the list of options. Return `true` to show option, `false` to hide option.
* @param inputValue
* @param option
* @returns boolean
*
* @default (inputValue, option) => option.value.toLowerCase().startsWith(inputValue.toLowerCase())
*/
filter?: (inputValue: string, option: Option) => boolean;
/**
* Add a screen reader label to the chips
* @param option
* @returns string
*
* @default (option) => 'Slett ' + option.label,
*/
chipSrLabel?: (option: Option) => string;
/**
* Portals the floating element outside of the app root and into the body.
* @see https://floating-ui.com/docs/floatingportal
* @default false
*/
portal?: boolean;
} & {
error?: ReactNode;
errorId?: string;
disabled?: boolean;
description?: ReactNode;
id?: string;
readOnly?: boolean;
size?: import("packages/types/dist/types").Size;
} & Pick, "aria-describedby"> & Omit, "size"> & import("react").RefAttributes>;
export declare const Combobox: import("react").ForwardRefExoticComponent<{
/**
* Label for the combobox.
*
* Passed label will be encapsulated by a `label` element.
*/
label?: ReactNode;
/**
* Visually hides `label` and `description` (still available for screen readers)
* @default false
*/
hideLabel?: boolean;
/**
* String array of selected options. Contains only one option during single selection mode.
*/
value?: string[];
/**
* String array of initial selected options. Contains only one option during single selection mode.
*/
initialValue?: string[];
/**
* Callback function that is called when the value changes
*/
onValueChange?: (value: string[]) => void;
/**
* Multiple options can be selected
* @default false
*/
multiple?: boolean;
/**
* Name of the value when used in a formPuse
*/
name?: string;
/**
* Exposes the HTML `size` attribute.
* @default 0
*/
htmlSize?: number;
/**
* Hides chips when multiple options are selected
* @default false
*/
hideChips?: boolean;
/**
* Hides the clear button
* @default false
*/
hideClearButton?: boolean;
/**
* Label for the clear button
* @default 'Fjern alt'
*/
clearButtonLabel?: string;
/**
* Enables virtualizing of options list.
* @see https://tanstack.com/virtual
* @default false
*/
virtual?: boolean;
/**
* Value of the input field
*/
inputValue?: string;
/**
* Adds `aria-busy` and displays loading state for the Combobox
* All options will be hidden and replaced with a loading message.
* @default false
*/
loading?: boolean;
/**
* Text to display when the combobox is loading
* @default 'Laster...'
*/
loadingLabel?: string;
/**
* Filter function for filtering the list of options. Return `true` to show option, `false` to hide option.
* @param inputValue
* @param option
* @returns boolean
*
* @default (inputValue, option) => option.value.toLowerCase().startsWith(inputValue.toLowerCase())
*/
filter?: (inputValue: string, option: Option) => boolean;
/**
* Add a screen reader label to the chips
* @param option
* @returns string
*
* @default (option) => 'Slett ' + option.label,
*/
chipSrLabel?: (option: Option) => string;
/**
* Portals the floating element outside of the app root and into the body.
* @see https://floating-ui.com/docs/floatingportal
* @default false
*/
portal?: boolean;
} & {
error?: ReactNode;
errorId?: string;
disabled?: boolean;
description?: ReactNode;
id?: string;
readOnly?: boolean;
size?: import("packages/types/dist/types").Size;
} & Pick, "aria-describedby"> & Omit, "size"> & import("react").RefAttributes>;
//# sourceMappingURL=Combobox.d.ts.map