import { ReactNode } from 'react'; import { SelectProps as RaSelectProps, ListBoxProps as RaListBoxProps, ListBoxItemProps as RaListBoxItemProps, ListBoxSectionProps as RaListBoxSectionProps } from 'react-aria-components'; import { HTMLChakraProps, SlotRecipeProps } from '@chakra-ui/react/styled-system'; import { OmitInternalProps } from '../../type-utils/omit-props'; type SelectRecipeProps = { /** * Size variant of the select */ size?: SlotRecipeProps<"nimbusSelect">["size"]; /** * Visual style variant of the select */ variant?: SlotRecipeProps<"nimbusSelect">["variant"]; }; export type SelectRootSlotProps = HTMLChakraProps<"div", SelectRecipeProps & RaSelectProps>; export type SelectTriggerSlotProps = HTMLChakraProps<"button">; export type SelectTriggerLabelSlotProps = HTMLChakraProps<"span">; export type SelectOptionsSlotProps = HTMLChakraProps<"div">; export type SelectOptionSlotProps = HTMLChakraProps<"div">; export type SelectOptionGroupSlotProps = HTMLChakraProps<"div">; export type SelectProps = OmitInternalProps & RaSelectProps & { /** * Whether the select is in a loading state * @default false */ isLoading?: boolean; /** * Children elements (must be ReactNode, no render props/functions allowed) */ children: ReactNode; /** * Optional element to display at the start of the input field * Respects text direction (left in LTR, right in RTL) */ leadingElement?: ReactNode; /** * Whether to show a clear button when a value is selected * @default false */ isClearable?: boolean; /** * Ref forwarding to the root element */ ref?: React.Ref; }; export type SelectOptionsProps = RaListBoxProps & OmitInternalProps>; export type SelectOptionProps = Omit & OmitInternalProps & { /** * Ref forwarding to the option element */ ref?: React.Ref; }; export type SelectOptionGroupProps = RaListBoxSectionProps & OmitInternalProps> & { /** * Label text for the option group section */ label: string; }; export {};