import { AriaSelectProps } from 'react-aria/useSelect'; import { ClassNameOrFunction, ContextValue, RACValidation, RenderProps, SlotProps } from './utils'; import { GlobalDOMAttributes } from '@react-types/shared'; import React, { HTMLAttributes } from 'react'; import { SelectState } from 'react-stately/useSelectState'; type SelectionMode = 'single' | 'multiple'; export interface SelectRenderProps { /** * Whether the select is focused, either via a mouse or keyboard. * @selector [data-focused] */ isFocused: boolean; /** * Whether the select is keyboard focused. * @selector [data-focus-visible] */ isFocusVisible: boolean; /** * Whether the select is disabled. * @selector [data-disabled] */ isDisabled: boolean; /** * Whether the select is currently open. * @selector [data-open] */ isOpen: boolean; /** * Whether the select is invalid. * @selector [data-invalid] */ isInvalid: boolean; /** * Whether the select is required. * @selector [data-required] */ isRequired: boolean; } export interface SelectProps extends Omit, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior' | 'items'>, RACValidation, RenderProps, SlotProps, GlobalDOMAttributes { /** * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. * @default 'react-aria-Select' */ className?: ClassNameOrFunction; /** * Temporary text that occupies the select when it is empty. * @default 'Select an item' (localized) */ placeholder?: string; } export declare const SelectContext: React.Context, HTMLDivElement>>; export declare const SelectStateContext: React.Context | null>; /** * A select displays a collapsible list of options and allows a user to select one of them. */ export declare const Select: (props: SelectProps & React.RefAttributes) => React.ReactElement> | null; export interface SelectValueRenderProps { /** * Whether the value is a placeholder. * @selector [data-placeholder] */ isPlaceholder: boolean; /** * The object value of the first selected item. * @deprecated */ selectedItem: T | null; /** The object values of the currently selected items. */ selectedItems: (T | null)[]; /** The textValue of the currently selected items. */ selectedText: string; /** The state of the select. */ state: SelectState; } export interface SelectValueProps extends Omit, keyof RenderProps>, RenderProps, 'span'> { /** * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. * @default 'react-aria-SelectValue' */ className?: ClassNameOrFunction>; } export declare const SelectValueContext: React.Context, HTMLSpanElement>>; /** * SelectValue renders the current value of a Select, or a placeholder if no value is selected. * It is usually placed within the button element. */ export declare const SelectValue: (props: SelectValueProps & React.RefAttributes) => React.ReactElement> | null; export {};