diff --git a/example/src/App.tsx b/example/src/App.tsx index 720e6b6..87e2abc 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -6,11 +6,12 @@ import { TouchableOpacity, View, } from 'react-native'; -import type { - CallingCode, - CountryCode, -} from 'react-native-country-picker-modal'; -import { PhoneInput, isValidNumber } from 'react-native-phone-entry'; +import { + PhoneInput, + isValidNumber, + type CallingCode, + type CountryCode, +} from 'react-native-phone-entry'; export default function App() { const [phoneNumber, setPhoneNumber] = useState(''); diff --git a/src/PhoneInput/PhoneInput.types.ts b/src/PhoneInput/PhoneInput.types.ts index 1e9b3c8..7b15fe7 100644 --- a/src/PhoneInput/PhoneInput.types.ts +++ b/src/PhoneInput/PhoneInput.types.ts @@ -30,11 +30,12 @@ export type PhoneInputProps = { renderCustomDropdown?: JSX.Element; theme?: Theme; maskInputProps?: MaskInputProps; - countryPickerProps?: Parameters[0]; + countryPickerProps?: Partial[0]>; flagProps?: Parameters[0]; isCallingCodeEditable?: boolean; dropDownImageProps?: ImageProps; }; + interface Theme { containerStyle?: StyleProp; textInputStyle?: StyleProp; diff --git a/src/PhoneInput/constants.ts b/src/PhoneInput/constants.ts index f285274..214af83 100644 --- a/src/PhoneInput/constants.ts +++ b/src/PhoneInput/constants.ts @@ -636,7 +636,7 @@ export const MASK_PER_COUNTRY: Partial<{ NZ: [/\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/], NI: [/\d/, /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/], NE: [/\d/, /\d/, '-', /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/], - NG: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/], + NG: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/], NU: [/\d/, /\d/, /\d/, /\d/], MK: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/], MP: ['(', '6', '7', '0', ')', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/], @@ -720,7 +720,7 @@ export const MASK_PER_COUNTRY: Partial<{ WS: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/], SM: [/\d/, /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/, /\d/, /\d/], ST: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/, /\d/], - SA: [/\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/], + SA: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/], SN: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/], RS: [/\d/, /\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/], SC: [/\d/, '-', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/], diff --git a/src/PhoneInput/index.ts b/src/PhoneInput/index.ts index 352b246..9d5ab4e 100644 --- a/src/PhoneInput/index.ts +++ b/src/PhoneInput/index.ts @@ -7,3 +7,8 @@ export { PhoneInput } from './PhoneInput'; export { isValidNumber } from './utils'; export type { PhoneInputProps } from './PhoneInput.types'; + +export type { + CallingCode, + CountryCode, +} from 'react-native-country-picker-modal'; diff --git a/src/index.ts b/src/index.ts index d40b5ac..8500b4f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,5 +4,7 @@ export { isValidNumber, MASK_PER_COUNTRY, PhoneInput, + type CallingCode, + type CountryCode, type PhoneInputProps, } from './PhoneInput'; diff --git a/yarn.lock b/yarn.lock index b03fba8..189d727 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4855,9 +4855,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.30001688": - version: 1.0.30001695 - resolution: "caniuse-lite@npm:1.0.30001695" - checksum: 97729756cc19e9a93d46061ff11690d9a7d2facdb9c275111b19548adcba29d29638339bd6e659b7ddcb3649f17926a66a4cfb407605232f21918b70650a40be + version: 1.0.30001745 + resolution: "caniuse-lite@npm:1.0.30001745" + checksum: a018bfbf6eda6e2728184cd39f3d0438cea04011893664fc7de19568d8e6f26cbc09e59460137bb2f4e792d1cdb7f1a48ad35f31a1c1388c1d7f74b3c889d35b languageName: node linkType: hard