import type { NativeValue, TamaguiChangeEventDetails, TamaguiEventDetails, ViewProps } from '@tamagui/core'; import type { DismissableProps } from '@tamagui/dismissable'; import type { HTMLProps, MutableRefObject, ReactNode, RefObject } from 'react'; import type { SelectItemRegistry, SelectMode, SelectSelection } from './selectionController.js'; type ContextData = Record; type ReferenceType = Element; type FloatingContext = { refs: { reference: RefObject; floating: RefObject; setFloating: (el: HTMLElement | null) => void; setReference: (el: RT | null) => void; [key: string]: any; }; dataRef: RefObject; update?: () => void; [key: string]: any; }; export type SelectDirection = 'ltr' | 'rtl'; export type SelectScopes = string; export type SelectScopedProps

= P & { scope?: SelectScopes; }; export type SelectValueForMode = Multiple extends true ? Value[] : Multiple extends false | undefined ? Value : Value | Value[]; export type SelectValueChangeDetails = TamaguiChangeEventDetails<'item-press' | 'keyboard' | 'native-change'>; export type SelectOpenChangeDetails = TamaguiChangeEventDetails<'trigger-press' | 'keyboard' | 'outside-press' | 'escape-key' | 'item-press'>; export type SelectActiveChangeDetails = TamaguiEventDetails<'item-hover' | 'list-navigation' | 'keyboard', unknown, { index: number; }>; export type SelectImplProps = SelectScopedProps> & { activeIndexRef: any; selectedIndexRef: any; listContentRef: any; }; export interface SelectProps { id?: string; children?: ReactNode; multiple?: Multiple; value?: SelectValueForMode; defaultValue?: SelectValueForMode; onValueChange?(value: SelectValueForMode, details: SelectValueChangeDetails): void; open?: boolean; defaultOpen?: boolean; onOpenChange?(open: boolean, details: SelectOpenChangeDetails): void; dir?: SelectDirection; /** a skin-owned size name, threaded opaquely to the skin parts */ size?: string | boolean; /** * If passed, will render a native component instead of the custom one. Currently only `web` is supported. */ native?: NativeValue<'web'>; /** * When true, avoids removing the scrollbar from the body when open */ disablePreventBodyScroll?: boolean; /** * Called when an item is hovered by mouse or navigated to by keyboard. */ onActiveChange?(value: string, details: SelectActiveChangeDetails): void; /** * Render function for the selected value. Use this for SSR support. * When provided, this is called synchronously during render to display * the selected value, avoiding hydration mismatches. * * @example * ```tsx *