import { FC, FormEvent, ReactNode, Ref, MouseEvent, KeyboardEvent } from 'react'; import { TextFieldProps } from '../TextField'; import { CountryCode } from 'libphonenumber-js'; export interface PhoneFieldCountry { iso: CountryCode; label: string; } export type PhoneSelectFieldChangeEvent = MouseEvent | KeyboardEvent | FormEvent | null; export interface PhoneSelectFieldProps extends Omit { /** * The default country code (ISO 3166-1 alpha-2) used for initial formatting and selection. * Example: 'US', 'DE', 'RU'. */ defaultCountry?: CountryCode; /** * Controlled country code for external state management. * Overrides `defaultCountry` when provided. */ country?: CountryCode; /** * The initial value of the phone input when uncontrolled. */ defaultValue?: string; /** * List of supported countries for selection in the dropdown. * Each entry includes metadata (e.g., flag, name, dial code). */ countries: PhoneFieldCountry[]; /** * Expands the dropdown listbox to match the full width of the input. * Useful for responsive or alignment-sensitive layouts. */ fullWidthListbox?: boolean; /** * Callback triggered when the selected country changes. * * @param country - The new selected country code */ onCountryChanged?: (country: CountryCode) => void; /** * Callback fired when the phone number input changes. * * @param event - The original input change event * @param value - The parsed phone number string */ onChange?: (event: PhoneSelectFieldChangeEvent, value: string) => void; /** * Custom node(s) rendered inside the country select trigger. * Useful for injecting flags, icons, or text labels. */ selectSlot?: ReactNode | ReactNode[]; /** * Controlled value of the phone input field. * Used for full external state control. */ value?: string; /** * Ref forwarded to the underlying phone input element. * Enables focus, scroll, or measurement logic. */ ref?: Ref; } /** A PhoneSelectField is a UI component that allows users to select or input a phone number, typically featuring a dropdown to choose a country code and an input field for the number itself. It is commonly used in forms where phone number validation and international formats are required */ export declare const PhoneSelectField: FC;