export interface IPhoneFormat { iso2: string; dialCode: string; patterns: string; possibleLengths: string; example: string | number; countryCode: string; nationalPrefix?: string; } export interface ICurrency { code: string; name: string; symbol: string; countryCode: string; precision: number; } export interface ITimezone { name: string; offset: number; offset_name: string; abbreviation: string; tzName: string; countryCode: string; } export interface IDivision { name: string; iso2: string; timezone: string; countryCode: string; } export interface ICountry { name: string; iso2: string; iso3: string; phone_code: string; division_type: string; /** Emoji flag computed from iso2 */ flag: string; /** SVG/Image URL for the country flag */ flag_url: string; /** Default language code for the country */ language_code: string; /** Default currency code for the country */ currency_code: string; /** Label for tax identification number (e.g. "VAT", "SSN", "ABN") */ tax_id_label: string; /** Placeholder for tax identification number */ tax_id_placeholder: string; /** Label for postal/zip code (e.g. "ZIP Code", "Postcode", "PIN Code") */ postal_code_label: string; /** Preferred date format, e.g. "DD/MM/YYYY", "MM/DD/YYYY", "YYYY-MM-DD" */ date_format: string; /** Preferred date separator, e.g. "/", "-", "." */ date_separator: string; /** First day of the week (0 = Sunday, 1 = Monday, 6 = Saturday) */ week_start: number; } export interface ILanguage { code: string; english_name: string; native_name: string; } export interface ICountryPickerProps { /** Currently selected country */ value?: ICountry | null; /** Callback when user selects a country */ onChange: (country: ICountry) => void; placeholder?: string; /** Enable search input */ searchable?: boolean; /** Show emoji flag next to country name */ showFlag?: boolean; /** Show phone dial code */ showPhoneCode?: boolean; /** Disable the picker */ disabled?: boolean; /** Additional wrapper class */ className?: string; /** aria-label */ label?: string; } export interface ICurrencyPickerProps { value?: ICurrency | null; onChange: (currency: ICurrency) => void; placeholder?: string; searchable?: boolean; /** Filter currencies to a specific country (iso2) and enable auto-selection */ countryIso2?: string; /** Auto-select the first currency if countryIso2 is provided. Defaults to true if countryIso2 is present and value is empty. */ autoSelect?: boolean; /** Show currency symbol alongside code */ showSymbol?: boolean; disabled?: boolean; className?: string; label?: string; } export interface ITimezonePickerProps { value?: ITimezone | null; onChange: (timezone: ITimezone) => void; placeholder?: string; searchable?: boolean; /** Filter timezones to a specific country (iso2) and enable auto-selection */ countryIso2?: string; /** Auto-select the first timezone if countryIso2 is provided. Defaults to true if countryIso2 is present and value is empty. */ autoSelect?: boolean; disabled?: boolean; className?: string; label?: string; } export interface ILanguagePickerProps { value?: ILanguage | null; onChange: (language: ILanguage) => void; placeholder?: string; searchable?: boolean; /** Show native language name alongside english name */ showNativeName?: boolean; disabled?: boolean; className?: string; label?: string; } export interface IDivisionPickerProps { /** ISO2 code of the parent country (required) */ countryIso2: string; value?: IDivision | null; onChange: (division: IDivision) => void; placeholder?: string; searchable?: boolean; disabled?: boolean; className?: string; label?: string; } export interface IUsePickerReturn { isOpen: boolean; searchQuery: string; filteredItems: T[]; selectedItem: T | null; open: () => void; close: () => void; toggle: () => void; setSearchQuery: (query: string) => void; selectItem: (item: T) => void; clearSelection: () => void; } /** * Phone number validation rules and metadata for a country */ export interface IPhoneValidation { /** Min phone number length (without dial code) */ minLength?: number; /** Max phone number length (without dial code) */ maxLength?: number; /** Regex pattern for validation */ pattern?: string; /** Example phone number without dial code */ example?: string; /** Placeholder text for the phone input */ placeholder?: string; /** National prefix that can optionally be typed in front, e.g. "0" */ nationalPrefix?: string; } /** * Value object returned by PhoneInput. */ export interface IPhoneValue { /** Full Country object of the selected country */ country: ICountry; /** Dial code with + prefix, e.g. "+1" */ dialCode: string; /** Raw phone number without dial code, e.g. "4155551234" */ number: string; /** Full number with dial code, e.g. "+14155551234" */ full: string; /** Validation rules and metadata for the phone number */ validation?: IPhoneValidation; } export interface IPhoneInputProps { value?: IPhoneValue | null; onChange: (value: IPhoneValue) => void; /** Pre-select a country by ISO2 on first render */ defaultCountryIso2?: string; placeholder?: string; showFlag?: boolean; disabled?: boolean; className?: string; label?: string; } export interface ICountryMultiSelectProps { value: ICountry[]; onChange: (countries: ICountry[]) => void; placeholder?: string; /** Maximum number of selections (undefined = unlimited) */ maxItems?: number; showFlags?: boolean; searchable?: boolean; disabled?: boolean; className?: string; label?: string; } export interface ICurrencyMultiSelectProps { value: ICurrency[]; onChange: (currencies: ICurrency[]) => void; placeholder?: string; maxItems?: number; showSymbol?: boolean; searchable?: boolean; disabled?: boolean; className?: string; label?: string; } export interface IUseMultiSelectReturn { isOpen: boolean; searchQuery: string; filteredItems: T[]; selectedItems: T[]; open: () => void; close: () => void; toggle: () => void; setSearchQuery: (query: string) => void; toggleItem: (item: T) => void; isSelected: (item: T) => boolean; removeItem: (item: T) => void; clearAll: () => void; } export interface IDateFormat { countryCode: string; format: string; separator: string; weekStart: number; } export interface IUseCountryReturn { country: ICountry | null; divisions: IDivision[]; timezones: ITimezone[]; currency: ICurrency | null; phoneFormat: IPhoneFormat | null; phoneLengths: { min?: number; max?: number; }; exampleNumber?: string; tax: { label: string; placeholder: string; }; postalCode: { label: string; }; dateFormat: IDateFormat | null; }