import { BoxProps, ElementProps, Factory, StylesApiProps } from '../../core'; import { ComboboxProps } from '../Combobox'; import { __BaseInputProps, __InputStylesNames, InputVariant } from '../Input'; import { PhoneInputCountryData } from './phone-data'; export type PhoneInputStylesNames = __InputStylesNames | 'countryButton' | 'countryButtonFlag' | 'countryButtonCode' | 'dropdown' | 'search' | 'countryOption' | 'optionDialCode' | 'optionName' | 'divider'; export interface PhoneInputChangeDetails { /** Formatted display string, e.g. "+1 (202) 555-1234" */ formattedValue: string; /** Country data for the currently selected country, null when no country is selected */ country: PhoneInputCountryData | null; /** Extension digits when `withExtension` is enabled, empty string when no extension is entered */ extension?: string; } export interface PhoneInputProps extends BoxProps, __BaseInputProps, StylesApiProps, ElementProps<'input', 'onChange' | 'size' | 'value' | 'defaultValue'> { /** Controlled value — raw digits with + prefix, e.g. "+12025551234", with an optional "x1234" suffix when `withExtension` is enabled */ value?: string; /** Uncontrolled default value */ defaultValue?: string; /** Called when value changes */ onChange?: (rawValue: string, details: PhoneInputChangeDetails) => void; /** Default country ISO2 code, e.g. "us" */ defaultCountry?: string; /** Countries pinned to top of dropdown with separator, ISO2 codes */ preferredCountries?: string[]; /** Only show these countries, ISO2 codes */ onlyCountries?: string[]; /** Hide these countries, ISO2 codes */ excludeCountries?: string[]; /** Called when selected country changes */ onCountryChange?: (country: PhoneInputCountryData) => void; /** Selects a country by ISO2 code when multiple countries share the detected dial code; return undefined to use the default area-code and priority detection */ resolveCountry?: (rawValue: string, countries: PhoneInputCountryData[]) => string | undefined; /** Enable search in country dropdown @default true */ searchable?: boolean; /** Show +dialCode in input @default true */ international?: boolean; /** Allow a phone extension separated by "x", e.g. "+12025551234x1234" @default false */ withExtension?: boolean; /** Auto-detect country from typed dial code digits @default false */ withCountryAutoDetect?: boolean; /** Handling of national trunk prefixes: 'auto' preserves ambiguous typed digits, 'strip' removes a typed prefix, 'preserve' disables prefix removal (the mask still applies) @default 'auto' */ nationalPrefixBehavior?: 'auto' | 'strip' | 'preserve'; /** Custom flag renderer for country selector button and dropdown options, receives null when no country is selected */ renderFlag?: (country: PhoneInputCountryData | null) => React.ReactNode; /** Custom renderer for country dropdown options */ renderCountryOption?: (country: PhoneInputCountryData) => React.ReactNode; /** Maximum dropdown height in px @default 250 */ maxDropdownHeight?: number | string; /** Controlled dropdown opened state */ dropdownOpened?: boolean; /** Props passed down to the underlying Combobox component */ comboboxProps?: ComboboxProps; /** Called when dropdown opens */ onDropdownOpen?: () => void; /** Called when dropdown closes */ onDropdownClose?: () => void; /** Display chevron in the country button @default false */ withChevron?: boolean; /** Message displayed when no countries match the search query */ nothingFoundMessage?: React.ReactNode; /** Placeholder of the search input in the dropdown @default 'Search countries' */ searchPlaceholder?: string; /** `aria-label` of the country button when no country is selected @default 'Select country' */ selectCountryLabel?: string; /** Returns a localized country name, used as the country button `aria-label` and matched in search in addition to the English name */ getCountryLabel?: (country: PhoneInputCountryData) => string; } export type PhoneInputFactory = Factory<{ props: PhoneInputProps; ref: HTMLInputElement; stylesNames: PhoneInputStylesNames; variant: InputVariant; }>; export declare const PhoneInput: import("../..").MantineComponent<{ props: PhoneInputProps; ref: HTMLInputElement; stylesNames: PhoneInputStylesNames; variant: InputVariant; }>; export declare namespace PhoneInput { type Props = PhoneInputProps; type StylesNames = PhoneInputStylesNames; type Factory = PhoneInputFactory; }