react-native-phone-country-input 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +477 -0
- package/lib/commonjs/CountrySelector/CountrySelector.js +74 -0
- package/lib/commonjs/CountrySelector/CountrySelector.js.map +1 -0
- package/lib/commonjs/CountrySelector/CountrySelectorModal.js +267 -0
- package/lib/commonjs/CountrySelector/CountrySelectorModal.js.map +1 -0
- package/lib/commonjs/Keyboard/Keyboard.js +316 -0
- package/lib/commonjs/Keyboard/Keyboard.js.map +1 -0
- package/lib/commonjs/Keyboard/KeyboardToolbar.js +70 -0
- package/lib/commonjs/Keyboard/KeyboardToolbar.js.map +1 -0
- package/lib/commonjs/Keyboard/KeypadButton.js +66 -0
- package/lib/commonjs/Keyboard/KeypadButton.js.map +1 -0
- package/lib/commonjs/Keyboard/KeypadButtonContainer.js +65 -0
- package/lib/commonjs/Keyboard/KeypadButtonContainer.js.map +1 -0
- package/lib/commonjs/Keyboard/KeypadRow.js +34 -0
- package/lib/commonjs/Keyboard/KeypadRow.js.map +1 -0
- package/lib/commonjs/PhoneCountryInput/PhoneCountryInput.js +86 -0
- package/lib/commonjs/PhoneCountryInput/PhoneCountryInput.js.map +1 -0
- package/lib/commonjs/PhoneNumberField.js +36 -0
- package/lib/commonjs/PhoneNumberField.js.map +1 -0
- package/lib/commonjs/Styling/Colors.js +197 -0
- package/lib/commonjs/Styling/Colors.js.map +1 -0
- package/lib/commonjs/Styling/Sizing.js +111 -0
- package/lib/commonjs/Styling/Sizing.js.map +1 -0
- package/lib/commonjs/consts/KEYBOARD_LAYOUT.js +45 -0
- package/lib/commonjs/consts/KEYBOARD_LAYOUT.js.map +1 -0
- package/lib/commonjs/consts/regions.js +1503 -0
- package/lib/commonjs/consts/regions.js.map +1 -0
- package/lib/commonjs/enum/CountryIds.js +264 -0
- package/lib/commonjs/enum/CountryIds.js.map +1 -0
- package/lib/commonjs/hooks/UsePhoneFieldState.js +237 -0
- package/lib/commonjs/hooks/UsePhoneFieldState.js.map +1 -0
- package/lib/commonjs/index.js +56 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/utils/characterDeletion.js +20 -0
- package/lib/commonjs/utils/characterDeletion.js.map +1 -0
- package/lib/commonjs/utils/characterInsert.js +20 -0
- package/lib/commonjs/utils/characterInsert.js.map +1 -0
- package/lib/commonjs/utils/fromMaskedNumberToUnmaskedSelection.js +14 -0
- package/lib/commonjs/utils/fromMaskedNumberToUnmaskedSelection.js.map +1 -0
- package/lib/commonjs/utils/fromUnmaskedToMaskedPosition.js +20 -0
- package/lib/commonjs/utils/fromUnmaskedToMaskedPosition.js.map +1 -0
- package/lib/commonjs/utils/generateCountryCodeList.js +23 -0
- package/lib/commonjs/utils/generateCountryCodeList.js.map +1 -0
- package/lib/commonjs/utils/getDefaultRegion.js +33 -0
- package/lib/commonjs/utils/getDefaultRegion.js.map +1 -0
- package/lib/commonjs/utils/maskToPhoneNumber.js +23 -0
- package/lib/commonjs/utils/maskToPhoneNumber.js.map +1 -0
- package/lib/commonjs/utils/matchCountryCode.js +27 -0
- package/lib/commonjs/utils/matchCountryCode.js.map +1 -0
- package/lib/module/CountrySelector/CountrySelector.js +70 -0
- package/lib/module/CountrySelector/CountrySelector.js.map +1 -0
- package/lib/module/CountrySelector/CountrySelectorModal.js +262 -0
- package/lib/module/CountrySelector/CountrySelectorModal.js.map +1 -0
- package/lib/module/Keyboard/Keyboard.js +310 -0
- package/lib/module/Keyboard/Keyboard.js.map +1 -0
- package/lib/module/Keyboard/KeyboardToolbar.js +65 -0
- package/lib/module/Keyboard/KeyboardToolbar.js.map +1 -0
- package/lib/module/Keyboard/KeypadButton.js +61 -0
- package/lib/module/Keyboard/KeypadButton.js.map +1 -0
- package/lib/module/Keyboard/KeypadButtonContainer.js +59 -0
- package/lib/module/Keyboard/KeypadButtonContainer.js.map +1 -0
- package/lib/module/Keyboard/KeypadRow.js +30 -0
- package/lib/module/Keyboard/KeypadRow.js.map +1 -0
- package/lib/module/PhoneCountryInput/PhoneCountryInput.js +80 -0
- package/lib/module/PhoneCountryInput/PhoneCountryInput.js.map +1 -0
- package/lib/module/PhoneNumberField.js +31 -0
- package/lib/module/PhoneNumberField.js.map +1 -0
- package/lib/module/Styling/Colors.js +193 -0
- package/lib/module/Styling/Colors.js.map +1 -0
- package/lib/module/Styling/Sizing.js +107 -0
- package/lib/module/Styling/Sizing.js.map +1 -0
- package/lib/module/consts/KEYBOARD_LAYOUT.js +41 -0
- package/lib/module/consts/KEYBOARD_LAYOUT.js.map +1 -0
- package/lib/module/consts/regions.js +1498 -0
- package/lib/module/consts/regions.js.map +1 -0
- package/lib/module/enum/CountryIds.js +260 -0
- package/lib/module/enum/CountryIds.js.map +1 -0
- package/lib/module/hooks/UsePhoneFieldState.js +232 -0
- package/lib/module/hooks/UsePhoneFieldState.js.map +1 -0
- package/lib/module/index.js +16 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/utils/characterDeletion.js +16 -0
- package/lib/module/utils/characterDeletion.js.map +1 -0
- package/lib/module/utils/characterInsert.js +16 -0
- package/lib/module/utils/characterInsert.js.map +1 -0
- package/lib/module/utils/fromMaskedNumberToUnmaskedSelection.js +10 -0
- package/lib/module/utils/fromMaskedNumberToUnmaskedSelection.js.map +1 -0
- package/lib/module/utils/fromUnmaskedToMaskedPosition.js +16 -0
- package/lib/module/utils/fromUnmaskedToMaskedPosition.js.map +1 -0
- package/lib/module/utils/generateCountryCodeList.js +19 -0
- package/lib/module/utils/generateCountryCodeList.js.map +1 -0
- package/lib/module/utils/getDefaultRegion.js +28 -0
- package/lib/module/utils/getDefaultRegion.js.map +1 -0
- package/lib/module/utils/maskToPhoneNumber.js +19 -0
- package/lib/module/utils/maskToPhoneNumber.js.map +1 -0
- package/lib/module/utils/matchCountryCode.js +23 -0
- package/lib/module/utils/matchCountryCode.js.map +1 -0
- package/lib/typescript/CountrySelector/CountrySelector.d.ts +19 -0
- package/lib/typescript/CountrySelector/CountrySelector.d.ts.map +1 -0
- package/lib/typescript/CountrySelector/CountrySelectorModal.d.ts +12 -0
- package/lib/typescript/CountrySelector/CountrySelectorModal.d.ts.map +1 -0
- package/lib/typescript/Keyboard/Keyboard.d.ts +25 -0
- package/lib/typescript/Keyboard/Keyboard.d.ts.map +1 -0
- package/lib/typescript/Keyboard/KeyboardToolbar.d.ts +9 -0
- package/lib/typescript/Keyboard/KeyboardToolbar.d.ts.map +1 -0
- package/lib/typescript/Keyboard/KeypadButton.d.ts +10 -0
- package/lib/typescript/Keyboard/KeypadButton.d.ts.map +1 -0
- package/lib/typescript/Keyboard/KeypadButtonContainer.d.ts +12 -0
- package/lib/typescript/Keyboard/KeypadButtonContainer.d.ts.map +1 -0
- package/lib/typescript/Keyboard/KeypadRow.d.ts +9 -0
- package/lib/typescript/Keyboard/KeypadRow.d.ts.map +1 -0
- package/lib/typescript/PhoneCountryInput/PhoneCountryInput.d.ts +16 -0
- package/lib/typescript/PhoneCountryInput/PhoneCountryInput.d.ts.map +1 -0
- package/lib/typescript/PhoneNumberField.d.ts +17 -0
- package/lib/typescript/PhoneNumberField.d.ts.map +1 -0
- package/lib/typescript/Styling/Colors.d.ts +189 -0
- package/lib/typescript/Styling/Colors.d.ts.map +1 -0
- package/lib/typescript/Styling/Sizing.d.ts +214 -0
- package/lib/typescript/Styling/Sizing.d.ts.map +1 -0
- package/lib/typescript/consts/KEYBOARD_LAYOUT.d.ts +18 -0
- package/lib/typescript/consts/KEYBOARD_LAYOUT.d.ts.map +1 -0
- package/lib/typescript/consts/regions.d.ts +10 -0
- package/lib/typescript/consts/regions.d.ts.map +1 -0
- package/lib/typescript/enum/CountryIds.d.ts +249 -0
- package/lib/typescript/enum/CountryIds.d.ts.map +1 -0
- package/lib/typescript/hooks/UsePhoneFieldState.d.ts +34 -0
- package/lib/typescript/hooks/UsePhoneFieldState.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +15 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/utils/characterDeletion.d.ts +3 -0
- package/lib/typescript/utils/characterDeletion.d.ts.map +1 -0
- package/lib/typescript/utils/characterInsert.d.ts +3 -0
- package/lib/typescript/utils/characterInsert.d.ts.map +1 -0
- package/lib/typescript/utils/fromMaskedNumberToUnmaskedSelection.d.ts +2 -0
- package/lib/typescript/utils/fromMaskedNumberToUnmaskedSelection.d.ts.map +1 -0
- package/lib/typescript/utils/fromUnmaskedToMaskedPosition.d.ts +2 -0
- package/lib/typescript/utils/fromUnmaskedToMaskedPosition.d.ts.map +1 -0
- package/lib/typescript/utils/generateCountryCodeList.d.ts +3 -0
- package/lib/typescript/utils/generateCountryCodeList.d.ts.map +1 -0
- package/lib/typescript/utils/getDefaultRegion.d.ts +4 -0
- package/lib/typescript/utils/getDefaultRegion.d.ts.map +1 -0
- package/lib/typescript/utils/maskToPhoneNumber.d.ts +2 -0
- package/lib/typescript/utils/maskToPhoneNumber.d.ts.map +1 -0
- package/lib/typescript/utils/matchCountryCode.d.ts +3 -0
- package/lib/typescript/utils/matchCountryCode.d.ts.map +1 -0
- package/package.json +92 -0
- package/src/CountrySelector/CountrySelector.tsx +77 -0
- package/src/CountrySelector/CountrySelectorModal.tsx +280 -0
- package/src/Keyboard/Keyboard.tsx +322 -0
- package/src/Keyboard/KeyboardToolbar.tsx +53 -0
- package/src/Keyboard/KeypadButton.tsx +58 -0
- package/src/Keyboard/KeypadButtonContainer.tsx +67 -0
- package/src/Keyboard/KeypadRow.tsx +29 -0
- package/src/PhoneCountryInput/PhoneCountryInput.tsx +98 -0
- package/src/PhoneNumberField.tsx +46 -0
- package/src/Styling/Colors.ts +206 -0
- package/src/Styling/Sizing.ts +110 -0
- package/src/consts/KEYBOARD_LAYOUT.ts +34 -0
- package/src/consts/regions.ts +268 -0
- package/src/enum/CountryIds.ts +256 -0
- package/src/hooks/UsePhoneFieldState.tsx +268 -0
- package/src/index.ts +27 -0
- package/src/utils/characterDeletion.ts +16 -0
- package/src/utils/characterInsert.ts +20 -0
- package/src/utils/fromMaskedNumberToUnmaskedSelection.ts +10 -0
- package/src/utils/fromUnmaskedToMaskedPosition.ts +13 -0
- package/src/utils/generateCountryCodeList.ts +22 -0
- package/src/utils/getDefaultRegion.ts +30 -0
- package/src/utils/maskToPhoneNumber.ts +30 -0
- package/src/utils/matchCountryCode.ts +23 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["characterDeletion","phoneNumber","selection","isRange","start","end","hasBeenSelected","slice","Math","max"],"sourceRoot":"../../../src","sources":["utils/characterDeletion.ts"],"mappings":";;AAEA,OAAO,SAASA,iBAAiBA,CAACC,WAAmB,EAAEC,SAAyB,EAAU;EACxF,MAAMC,OAAO,GAAGD,SAAS,CAACE,KAAK,KAAKF,SAAS,CAACG,GAAG;EAEjD,IAAI,CAACH,SAAS,CAACI,eAAe,IAAI,CAACH,OAAO,IAAID,SAAS,CAACE,KAAK,KAAK,CAAC,EAAE;IACnE,OAAOH,WAAW,CAACM,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EACjC;EACA,IAAIJ,OAAO,EAAE;IACX;IACA,OAAOF,WAAW,CAACM,KAAK,CAAC,CAAC,EAAEL,SAAS,CAACE,KAAK,GAAG,CAAC,CAAC,GAAGH,WAAW,CAACM,KAAK,CAACL,SAAS,CAACG,GAAG,GAAG,CAAC,CAAC;EACzF;EACA;EACA,MAAMD,KAAK,GAAGI,IAAI,CAACC,GAAG,CAACP,SAAS,CAACE,KAAK,EAAE,CAAC,CAAC;EAC1C,OAAOH,WAAW,CAACM,KAAK,CAAC,CAAC,EAAEH,KAAK,CAAC,GAAGH,WAAW,CAACM,KAAK,CAACH,KAAK,GAAG,CAAC,CAAC;AACnE","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function characterInsert(phoneNumber, newChar, selection) {
|
|
4
|
+
const isARange = selection.start !== selection.end;
|
|
5
|
+
if (isARange) {
|
|
6
|
+
// selection.start digits are before the selection; first selected char is at index start+1
|
|
7
|
+
return phoneNumber.slice(0, selection.start + 1) + newChar + phoneNumber.slice(selection.end + 1);
|
|
8
|
+
} else if (selection.start === 0 && !selection.hasBeenSelected) {
|
|
9
|
+
return phoneNumber + newChar;
|
|
10
|
+
} else {
|
|
11
|
+
// cursor is after `start` digits; insert before char at index start+1; clamp to protect '+'
|
|
12
|
+
const start = Math.max(selection.start, 1);
|
|
13
|
+
return phoneNumber.slice(0, start + 1) + newChar + phoneNumber.slice(start + 1);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=characterInsert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["characterInsert","phoneNumber","newChar","selection","isARange","start","end","slice","hasBeenSelected","Math","max"],"sourceRoot":"../../../src","sources":["utils/characterInsert.ts"],"mappings":";;AAEA,OAAO,SAASA,eAAeA,CAC7BC,WAAmB,EACnBC,OAAe,EACfC,SAAyB,EACjB;EACR,MAAMC,QAAQ,GAAGD,SAAS,CAACE,KAAK,KAAKF,SAAS,CAACG,GAAG;EAElD,IAAIF,QAAQ,EAAE;IACZ;IACA,OAAOH,WAAW,CAACM,KAAK,CAAC,CAAC,EAAEJ,SAAS,CAACE,KAAK,GAAG,CAAC,CAAC,GAAGH,OAAO,GAAGD,WAAW,CAACM,KAAK,CAACJ,SAAS,CAACG,GAAG,GAAG,CAAC,CAAC;EACnG,CAAC,MAAM,IAAIH,SAAS,CAACE,KAAK,KAAK,CAAC,IAAI,CAACF,SAAS,CAACK,eAAe,EAAE;IAC9D,OAAOP,WAAW,GAAGC,OAAO;EAC9B,CAAC,MAAM;IACL;IACA,MAAMG,KAAK,GAAGI,IAAI,CAACC,GAAG,CAACP,SAAS,CAACE,KAAK,EAAE,CAAC,CAAC;IAC1C,OAAOJ,WAAW,CAACM,KAAK,CAAC,CAAC,EAAEF,KAAK,GAAG,CAAC,CAAC,GAAGH,OAAO,GAAGD,WAAW,CAACM,KAAK,CAACF,KAAK,GAAG,CAAC,CAAC;EACjF;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function fromMaskedNumberToUnmaskedSelection(maskedValue, maskedPoint) {
|
|
4
|
+
let count = 0;
|
|
5
|
+
for (let i = 0; i < maskedPoint && i < maskedValue.length; i++) {
|
|
6
|
+
if (/\d/.test(maskedValue[i])) count++;
|
|
7
|
+
}
|
|
8
|
+
return count;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=fromMaskedNumberToUnmaskedSelection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fromMaskedNumberToUnmaskedSelection","maskedValue","maskedPoint","count","i","length","test"],"sourceRoot":"../../../src","sources":["utils/fromMaskedNumberToUnmaskedSelection.ts"],"mappings":";;AAAA,OAAO,SAASA,mCAAmCA,CACjDC,WAAmB,EACnBC,WAAmB,EACX;EACR,IAAIC,KAAK,GAAG,CAAC;EACb,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,WAAW,IAAIE,CAAC,GAAGH,WAAW,CAACI,MAAM,EAAED,CAAC,EAAE,EAAE;IAC9D,IAAI,IAAI,CAACE,IAAI,CAACL,WAAW,CAACG,CAAC,CAAC,CAAC,EAAED,KAAK,EAAE;EACxC;EACA,OAAOA,KAAK;AACd","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function fromUnmaskedToMaskedPosition(maskedValue, unmaskedPos) {
|
|
4
|
+
if (unmaskedPos <= 0) return 1;
|
|
5
|
+
let digitCount = 0;
|
|
6
|
+
for (let i = 0; i < maskedValue.length; i++) {
|
|
7
|
+
if (/\d/.test(maskedValue[i])) {
|
|
8
|
+
digitCount++;
|
|
9
|
+
if (digitCount === unmaskedPos) {
|
|
10
|
+
return i + 1;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return maskedValue.length;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=fromUnmaskedToMaskedPosition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fromUnmaskedToMaskedPosition","maskedValue","unmaskedPos","digitCount","i","length","test"],"sourceRoot":"../../../src","sources":["utils/fromUnmaskedToMaskedPosition.ts"],"mappings":";;AAAA,OAAO,SAASA,4BAA4BA,CAACC,WAAmB,EAAEC,WAAmB,EAAU;EAC7F,IAAIA,WAAW,IAAI,CAAC,EAAE,OAAO,CAAC;EAC9B,IAAIC,UAAU,GAAG,CAAC;EAClB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,WAAW,CAACI,MAAM,EAAED,CAAC,EAAE,EAAE;IAC3C,IAAI,IAAI,CAACE,IAAI,CAACL,WAAW,CAACG,CAAC,CAAC,CAAC,EAAE;MAC7BD,UAAU,EAAE;MACZ,IAAIA,UAAU,KAAKD,WAAW,EAAE;QAC9B,OAAOE,CAAC,GAAG,CAAC;MACd;IACF;EACF;EACA,OAAOH,WAAW,CAACI,MAAM;AAC3B","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { countryCodeList } from '../consts/regions';
|
|
4
|
+
export function generateCountryCodeList(allowedCountryCodes, disallowedCountryCodes) {
|
|
5
|
+
return countryCodeList.filter(({
|
|
6
|
+
id
|
|
7
|
+
}) => {
|
|
8
|
+
if (allowedCountryCodes && !allowedCountryCodes.includes(id)) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
if (disallowedCountryCodes && disallowedCountryCodes.includes(id)) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
})
|
|
16
|
+
// sort by longer country codes first to ensure that we match the most specific country code when parsing the phone number
|
|
17
|
+
.sort((a, b) => b.code.length - a.code.length);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=generateCountryCodeList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["countryCodeList","generateCountryCodeList","allowedCountryCodes","disallowedCountryCodes","filter","id","includes","sort","a","b","code","length"],"sourceRoot":"../../../src","sources":["utils/generateCountryCodeList.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,mBAAmB;AAGnD,OAAO,SAASC,uBAAuBA,CACrCC,mBAAiC,EACjCC,sBAAoC,EACpC;EACA,OACEH,eAAe,CACZI,MAAM,CAAC,CAAC;IAAEC;EAAG,CAAC,KAAK;IAClB,IAAIH,mBAAmB,IAAI,CAACA,mBAAmB,CAACI,QAAQ,CAACD,EAAE,CAAC,EAAE;MAC5D,OAAO,KAAK;IACd;IACA,IAAIF,sBAAsB,IAAIA,sBAAsB,CAACG,QAAQ,CAACD,EAAE,CAAC,EAAE;MACjE,OAAO,KAAK;IACd;IACA,OAAO,IAAI;EACb,CAAC;EACD;EAAA,CACCE,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKA,CAAC,CAACC,IAAI,CAACC,MAAM,GAAGH,CAAC,CAACE,IAAI,CAACC,MAAM,CAAC;AAEpD","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { getLocales } from 'expo-localization';
|
|
4
|
+
export function getDefaultRegion(filteredCountryCodes) {
|
|
5
|
+
const localization = getLocales();
|
|
6
|
+
// console.debug('localization', JSON.stringify(localization, null, 2));
|
|
7
|
+
const id = localization?.[0]?.regionCode;
|
|
8
|
+
if (id) {
|
|
9
|
+
const matchedCountry = filteredCountryCodes.find(country => country.id === id);
|
|
10
|
+
if (matchedCountry) {
|
|
11
|
+
return matchedCountry;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return filteredCountryCodes[0];
|
|
15
|
+
}
|
|
16
|
+
export function getDefaultRegionWithNullableState(filteredCountryCodes) {
|
|
17
|
+
const localization = getLocales();
|
|
18
|
+
// console.debug('localization', JSON.stringify(localization, null, 2));
|
|
19
|
+
const id = localization?.[0]?.regionCode;
|
|
20
|
+
if (id) {
|
|
21
|
+
const matchedCountry = filteredCountryCodes.find(country => country.id === id);
|
|
22
|
+
if (matchedCountry) {
|
|
23
|
+
return matchedCountry;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=getDefaultRegion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getLocales","getDefaultRegion","filteredCountryCodes","localization","id","regionCode","matchedCountry","find","country","getDefaultRegionWithNullableState"],"sourceRoot":"../../../src","sources":["utils/getDefaultRegion.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,mBAAmB;AAG9C,OAAO,SAASC,gBAAgBA,CAACC,oBAAmC,EAAe;EACjF,MAAMC,YAAY,GAAGH,UAAU,CAAC,CAAC;EACjC;EACA,MAAMI,EAAE,GAAGD,YAAY,GAAG,CAAC,CAAC,EAAEE,UAAU;EACxC,IAAID,EAAE,EAAE;IACN,MAAME,cAAc,GAAGJ,oBAAoB,CAACK,IAAI,CAAEC,OAAO,IAAKA,OAAO,CAACJ,EAAE,KAAKA,EAAE,CAAC;IAChF,IAAIE,cAAc,EAAE;MAClB,OAAOA,cAAc;IACvB;EACF;EACA,OAAOJ,oBAAoB,CAAC,CAAC,CAAC;AAChC;AAEA,OAAO,SAASO,iCAAiCA,CAC/CP,oBAAmC,EACf;EACpB,MAAMC,YAAY,GAAGH,UAAU,CAAC,CAAC;EACjC;EACA,MAAMI,EAAE,GAAGD,YAAY,GAAG,CAAC,CAAC,EAAEE,UAAU;EACxC,IAAID,EAAE,EAAE;IACN,MAAME,cAAc,GAAGJ,oBAAoB,CAACK,IAAI,CAAEC,OAAO,IAAKA,OAAO,CAACJ,EAAE,KAAKA,EAAE,CAAC;IAChF,IAAIE,cAAc,EAAE;MAClB,OAAOA,cAAc;IACvB;EACF;EACA,OAAO,IAAI;AACb","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function maskToPhoneNumber(rawInput, countryCode, mask) {
|
|
4
|
+
const justDigits = rawInput.replace(/\D/g, '');
|
|
5
|
+
const restOfNumber = justDigits.slice(countryCode.length, justDigits.length);
|
|
6
|
+
let digitIndex = 0;
|
|
7
|
+
let maskedPart = '';
|
|
8
|
+
for (const char of mask) {
|
|
9
|
+
console.debug('char', char, 'digitIndex', digitIndex, 'restOfNumber', restOfNumber, 'restOfNumber[digitIndex]', restOfNumber[digitIndex], 'Output', maskedPart);
|
|
10
|
+
if (digitIndex >= restOfNumber.length) break;
|
|
11
|
+
if (char === '#') {
|
|
12
|
+
maskedPart += restOfNumber[digitIndex++];
|
|
13
|
+
} else {
|
|
14
|
+
maskedPart += char;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return countryCode + maskedPart;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=maskToPhoneNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["maskToPhoneNumber","rawInput","countryCode","mask","justDigits","replace","restOfNumber","slice","length","digitIndex","maskedPart","char","console","debug"],"sourceRoot":"../../../src","sources":["utils/maskToPhoneNumber.ts"],"mappings":";;AAAA,OAAO,SAASA,iBAAiBA,CAACC,QAAgB,EAAEC,WAAmB,EAAEC,IAAY,EAAU;EAC7F,MAAMC,UAAU,GAAGH,QAAQ,CAACI,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;EAC9C,MAAMC,YAAY,GAAGF,UAAU,CAACG,KAAK,CAACL,WAAW,CAACM,MAAM,EAAEJ,UAAU,CAACI,MAAM,CAAC;EAC5E,IAAIC,UAAU,GAAG,CAAC;EAClB,IAAIC,UAAU,GAAG,EAAE;EAEnB,KAAK,MAAMC,IAAI,IAAIR,IAAI,EAAE;IACvBS,OAAO,CAACC,KAAK,CACX,MAAM,EACNF,IAAI,EACJ,YAAY,EACZF,UAAU,EACV,cAAc,EACdH,YAAY,EACZ,0BAA0B,EAC1BA,YAAY,CAACG,UAAU,CAAC,EACxB,QAAQ,EACRC,UACF,CAAC;IAED,IAAID,UAAU,IAAIH,YAAY,CAACE,MAAM,EAAE;IACvC,IAAIG,IAAI,KAAK,GAAG,EAAE;MAChBD,UAAU,IAAIJ,YAAY,CAACG,UAAU,EAAE,CAAC;IAC1C,CAAC,MAAM;MACLC,UAAU,IAAIC,IAAI;IACpB;EACF;EAEA,OAAOT,WAAW,GAAGQ,UAAU;AACjC","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function matchCountryCode(filteredCountryCodes, rawInput) {
|
|
4
|
+
return filteredCountryCodes.find(({
|
|
5
|
+
code
|
|
6
|
+
}) => {
|
|
7
|
+
// intentional to use _value here instead of cleanedValue because we want to match against the raw input value that includes the '+' sign and any formatting characters, since country codes are typically prefixed with a '+' and may be followed by formatting characters like dashes or parentheses. Using cleanedValue would remove these characters and could lead to incorrect matching of country codes.
|
|
8
|
+
|
|
9
|
+
const phoneNumberWithoutPlus = rawInput.replace('+', '');
|
|
10
|
+
const CountryCodeWithoutPlus = code.replace('+', '');
|
|
11
|
+
const result = phoneNumberWithoutPlus.startsWith(CountryCodeWithoutPlus);
|
|
12
|
+
// console.debug(
|
|
13
|
+
// 'checking code',
|
|
14
|
+
// code,
|
|
15
|
+
// 'against cleanedValue',
|
|
16
|
+
// cleanedValue,
|
|
17
|
+
// 'result',
|
|
18
|
+
// result
|
|
19
|
+
// );
|
|
20
|
+
return result;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=matchCountryCode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["matchCountryCode","filteredCountryCodes","rawInput","find","code","phoneNumberWithoutPlus","replace","CountryCodeWithoutPlus","result","startsWith"],"sourceRoot":"../../../src","sources":["utils/matchCountryCode.ts"],"mappings":";;AAEA,OAAO,SAASA,gBAAgBA,CAC9BC,oBAAmC,EACnCC,QAAgB,EACS;EACzB,OAAOD,oBAAoB,CAACE,IAAI,CAAC,CAAC;IAAEC;EAAK,CAAC,KAAK;IAC7C;;IAEA,MAAMC,sBAAsB,GAAGH,QAAQ,CAACI,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;IACxD,MAAMC,sBAAsB,GAAGH,IAAI,CAACE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;IACpD,MAAME,MAAM,GAAGH,sBAAsB,CAACI,UAAU,CAACF,sBAAsB,CAAC;IACxE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,OAAOC,MAAM;EACf,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CountryCode } from '../consts/regions';
|
|
2
|
+
import { Modal, Pressable } from 'react-native';
|
|
3
|
+
interface CountrySelectorButtonProps extends React.ComponentProps<typeof Pressable> {
|
|
4
|
+
value: CountryCode | null;
|
|
5
|
+
underlineButton?: React.ComponentType<React.ComponentProps<typeof Pressable>> | null;
|
|
6
|
+
isOpen?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function CountrySelectorButton(props: CountrySelectorButtonProps): import("react").JSX.Element;
|
|
9
|
+
export interface CountrySelectorProps extends React.ComponentProps<typeof CountrySelectorButton> {
|
|
10
|
+
filtedredCountryCodes?: CountryCode[] | null;
|
|
11
|
+
onSelectCountry?: (country: CountryCode) => void;
|
|
12
|
+
value: CountryCode | null;
|
|
13
|
+
underlineButton?: React.ComponentType<React.ComponentProps<typeof Pressable>> | null;
|
|
14
|
+
underlineModal?: React.ComponentType<React.ComponentProps<typeof Modal>> | null;
|
|
15
|
+
onOpenChange?: (open: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function CountrySelector(props: CountrySelectorProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=CountrySelector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CountrySelector.d.ts","sourceRoot":"","sources":["../../../src/CountrySelector/CountrySelector.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAQ,MAAM,cAAc,CAAC;AAKtD,UAAU,0BAA2B,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC;IACjF,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC;IACrF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAID,iBAAS,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,+BAgB/D;AACD,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC;IAC9F,qBAAqB,CAAC,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAC7C,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC;IACrF,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;IAChF,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,+BAoC1D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Modal } from 'react-native';
|
|
2
|
+
import { CountryCode } from '../consts/regions';
|
|
3
|
+
export interface CountrySelectorModalProps extends React.ComponentProps<typeof Modal> {
|
|
4
|
+
underlineModal?: React.ComponentType<React.ComponentProps<typeof Modal>> | null;
|
|
5
|
+
value: CountryCode | null;
|
|
6
|
+
UserCountryCodes?: CountryCode[] | null;
|
|
7
|
+
onSelectCountry: (country: CountryCode) => void;
|
|
8
|
+
isOpen?: boolean;
|
|
9
|
+
toggleModalVisablity: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function CountrySelectorModal(props: CountrySelectorModalProps): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=CountrySelectorModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CountrySelectorModal.d.ts","sourceRoot":"","sources":["../../../src/CountrySelector/CountrySelectorModal.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EASN,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAchD,MAAM,WAAW,yBAA0B,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC;IACnF,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;IAChF,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,gBAAgB,CAAC,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IACxC,eAAe,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAChD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE,MAAM,IAAI,CAAC;CAClC;AAKD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,+BA+LpE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { KEYPAD_KEY } from '../consts/KEYBOARD_LAYOUT';
|
|
3
|
+
import { Modal } from 'react-native';
|
|
4
|
+
export interface PasteErrorModalProps extends React.ComponentProps<typeof Modal> {
|
|
5
|
+
isPasteErrorVisible: boolean;
|
|
6
|
+
dismissPasteError: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface CopySuccessModalProps extends React.ComponentProps<typeof Modal> {
|
|
9
|
+
isCopySuccessVisible: boolean;
|
|
10
|
+
dismissCopySuccess: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface KeyboardProps {
|
|
13
|
+
value?: string;
|
|
14
|
+
onKeyPress: (_value: KEYPAD_KEY) => void;
|
|
15
|
+
onCopy: () => void;
|
|
16
|
+
onPaste: () => Promise<boolean>;
|
|
17
|
+
isOpen: boolean;
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
underlinePasteErrorModal?: React.ComponentType<PasteErrorModalProps> | null;
|
|
20
|
+
underlineCopySuccessModal?: React.ComponentType<CopySuccessModalProps> | null;
|
|
21
|
+
}
|
|
22
|
+
declare function Keyboard(props: KeyboardProps): React.JSX.Element;
|
|
23
|
+
declare const _default: React.MemoExoticComponent<typeof Keyboard>;
|
|
24
|
+
export default _default;
|
|
25
|
+
//# sourceMappingURL=Keyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Keyboard.d.ts","sourceRoot":"","sources":["../../../src/Keyboard/Keyboard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4E,MAAM,OAAO,CAAC;AACjG,OAAO,EAAwB,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE7E,OAAO,EAA2C,KAAK,EAAQ,MAAM,cAAc,CAAC;AAcpF,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC;IAC9E,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC;IAC/E,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wBAAwB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;IAC5E,yBAAyB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAAC;CAC/E;AAED,iBAAS,QAAQ,CAAC,KAAK,EAAE,aAAa,qBAsJrC;;AAED,wBAA8B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface KeyboardToolbarProps {
|
|
3
|
+
value?: string;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onCopy?: () => void;
|
|
6
|
+
onPaste?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export default function KeyboardToolbar({ onClose, value, onCopy, onPaste }: KeyboardToolbarProps): React.JSX.Element;
|
|
9
|
+
//# sourceMappingURL=KeyboardToolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyboardToolbar.d.ts","sourceRoot":"","sources":["../../../src/Keyboard/KeyboardToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAOvC,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,oBAAoB,qBAoBhG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { KEYPAD_KEY } from '../consts/KEYBOARD_LAYOUT';
|
|
2
|
+
export interface KeypadButtonProps {
|
|
3
|
+
currentKey: KEYPAD_KEY;
|
|
4
|
+
onPress: (_key: KEYPAD_KEY) => void;
|
|
5
|
+
}
|
|
6
|
+
declare function KeypadButton({ currentKey, onPress }: KeypadButtonProps): import("react").JSX.Element;
|
|
7
|
+
export { KeypadButton };
|
|
8
|
+
declare const _default: import("react").MemoExoticComponent<typeof KeypadButton>;
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=KeypadButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeypadButton.d.ts","sourceRoot":"","sources":["../../../src/Keyboard/KeypadButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAA2C,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAKhG,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CACrC;AAED,iBAAS,YAAY,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,iBAAiB,+BA2C/D;AAED,OAAO,EAAE,YAAY,EAAE,CAAC;;AACxB,wBAAkC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PressableProps } from 'react-native';
|
|
3
|
+
interface KeypadButtonContainerProps extends PressableProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
onPress?: PressableProps['onPress'];
|
|
6
|
+
bgColor?: string | null;
|
|
7
|
+
bgPressedColor?: string | null;
|
|
8
|
+
shouldDisableShadow?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export default function KeypadButtonContainer({ children, shouldDisableShadow, bgColor, bgPressedColor, ...props }: KeypadButtonContainerProps): React.JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=KeypadButtonContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeypadButtonContainer.d.ts","sourceRoot":"","sources":["../../../src/Keyboard/KeypadButtonContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAa,cAAc,EAA0B,MAAM,cAAc,CAAC;AAMjF,UAAU,0BAA2B,SAAQ,cAAc;IACzD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAC5C,QAAQ,EACR,mBAAmB,EACnB,OAAsB,EACtB,cAAiC,EACjC,GAAG,KAAK,EACT,EAAE,0BAA0B,qBA8B5B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { KEYPAD_KEY, KEYPAD_ROW } from '../consts/KEYBOARD_LAYOUT';
|
|
2
|
+
export interface KeypadRowProps {
|
|
3
|
+
row: KEYPAD_ROW;
|
|
4
|
+
onPress: (_value: KEYPAD_KEY) => void;
|
|
5
|
+
}
|
|
6
|
+
declare function KeypadRow({ row, onPress }: KeypadRowProps): import("react").JSX.Element;
|
|
7
|
+
declare const _default: import("react").MemoExoticComponent<typeof KeypadRow>;
|
|
8
|
+
export default _default;
|
|
9
|
+
//# sourceMappingURL=KeypadRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeypadRow.d.ts","sourceRoot":"","sources":["../../../src/Keyboard/KeypadRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,UAAU,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAIxE,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,UAAU,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACvC;AAED,iBAAS,SAAS,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,cAAc,+BAgBlD;;AAED,wBAA+B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal, Pressable } from 'react-native';
|
|
3
|
+
import { PhoneFieldOutcome, PhoneNumberFieldProps } from '../PhoneNumberField';
|
|
4
|
+
import { CountryId } from '../enum/CountryIds';
|
|
5
|
+
import { CopySuccessModalProps, PasteErrorModalProps } from '../Keyboard/Keyboard';
|
|
6
|
+
export interface PhoneCountryInputProps extends PhoneNumberFieldProps {
|
|
7
|
+
underlineButton?: React.ComponentType<React.ComponentProps<typeof Pressable>> | null;
|
|
8
|
+
underlineModal?: React.ComponentType<React.ComponentProps<typeof Modal>> | null;
|
|
9
|
+
underlinePasteErrorModal?: React.ComponentType<PasteErrorModalProps> | null;
|
|
10
|
+
underlineCopySuccessModal?: React.ComponentType<CopySuccessModalProps> | null;
|
|
11
|
+
allowedCountryCodes?: CountryId[] | null;
|
|
12
|
+
disallowedCountryCodes?: CountryId[] | null;
|
|
13
|
+
onOutcomeChange: (outcome?: PhoneFieldOutcome) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function PhoneCountryInput({ underlineButton, underlineModal, underlinePasteErrorModal, underlineCopySuccessModal, style, allowedCountryCodes, disallowedCountryCodes, onOutcomeChange, ...props }: PhoneCountryInputProps): React.JSX.Element;
|
|
16
|
+
//# sourceMappingURL=PhoneCountryInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhoneCountryInput.d.ts","sourceRoot":"","sources":["../../../src/PhoneCountryInput/PhoneCountryInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAQ,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAoB,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAGjG,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAiB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE7F,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB;IACnE,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC;IACrF,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;IAChF,wBAAwB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;IAC5E,yBAAyB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAAC;IAC9E,mBAAmB,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IACzC,sBAAsB,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAC5C,eAAe,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACxD;AAED,wBAAgB,iBAAiB,CAAC,EAChC,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,yBAAyB,EACzB,KAAK,EACL,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,GAAG,KAAK,EACT,EAAE,sBAAsB,qBAmExB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NativeSyntheticEvent, TextInput, TextInputSelectionChangeEventData } from 'react-native';
|
|
3
|
+
import { CountryCode } from './consts/regions';
|
|
4
|
+
export interface PhoneFieldOutcome {
|
|
5
|
+
countryDetails: CountryCode | null;
|
|
6
|
+
phoneNumber: string;
|
|
7
|
+
isValid: boolean;
|
|
8
|
+
correctLength: number;
|
|
9
|
+
}
|
|
10
|
+
export interface PhoneNumberFieldProps extends React.ComponentProps<typeof TextInput> {
|
|
11
|
+
underlineInput?: React.ComponentType<React.ComponentProps<typeof TextInput>> | null;
|
|
12
|
+
onInputChange?: (outcome: PhoneFieldOutcome) => void;
|
|
13
|
+
onOpen?: () => void;
|
|
14
|
+
onTextSelection?: (e: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function PhoneNumberField(props: PhoneNumberFieldProps): React.JSX.Element;
|
|
17
|
+
//# sourceMappingURL=PhoneNumberField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhoneNumberField.d.ts","sourceRoot":"","sources":["../../src/PhoneNumberField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAC;AAElG,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC;IACnF,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC;IACpF,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACrD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,oBAAoB,CAAC,iCAAiC,CAAC,KAAK,IAAI,CAAC;CACxF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBA0B5D"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
export declare const colors: {
|
|
2
|
+
readonly transparent: "transparent";
|
|
3
|
+
readonly black: "#000000";
|
|
4
|
+
readonly white: "#ffffff";
|
|
5
|
+
readonly slate: {
|
|
6
|
+
readonly 50: "#f8fafc";
|
|
7
|
+
readonly 100: "#f1f5f9";
|
|
8
|
+
readonly 200: "#e2e8f0";
|
|
9
|
+
readonly 300: "#cbd5e1";
|
|
10
|
+
readonly 400: "#94a3b8";
|
|
11
|
+
readonly 500: "#64748b";
|
|
12
|
+
readonly 600: "#475569";
|
|
13
|
+
readonly 700: "#334155";
|
|
14
|
+
readonly 800: "#1e293b";
|
|
15
|
+
readonly 900: "#0f172a";
|
|
16
|
+
readonly 950: "#020617";
|
|
17
|
+
};
|
|
18
|
+
readonly gray: {
|
|
19
|
+
readonly 50: "#f9fafb";
|
|
20
|
+
readonly 100: "#f3f4f6";
|
|
21
|
+
readonly 200: "#e5e7eb";
|
|
22
|
+
readonly 300: "#d1d5db";
|
|
23
|
+
readonly 400: "#9ca3af";
|
|
24
|
+
readonly 500: "#6b7280";
|
|
25
|
+
readonly 600: "#4b5563";
|
|
26
|
+
readonly 700: "#374151";
|
|
27
|
+
readonly 800: "#1f2937";
|
|
28
|
+
readonly 900: "#111827";
|
|
29
|
+
readonly 950: "#030712";
|
|
30
|
+
};
|
|
31
|
+
readonly zinc: {
|
|
32
|
+
readonly 50: "#fafafa";
|
|
33
|
+
readonly 100: "#f4f4f5";
|
|
34
|
+
readonly 200: "#e4e4e7";
|
|
35
|
+
readonly 300: "#d4d4d8";
|
|
36
|
+
readonly 400: "#a1a1aa";
|
|
37
|
+
readonly 500: "#71717a";
|
|
38
|
+
readonly 600: "#52525b";
|
|
39
|
+
readonly 700: "#3f3f46";
|
|
40
|
+
readonly 800: "#27272a";
|
|
41
|
+
readonly 900: "#18181b";
|
|
42
|
+
readonly 950: "#09090b";
|
|
43
|
+
};
|
|
44
|
+
readonly red: {
|
|
45
|
+
readonly 50: "#fef2f2";
|
|
46
|
+
readonly 100: "#fee2e2";
|
|
47
|
+
readonly 200: "#fecaca";
|
|
48
|
+
readonly 300: "#fca5a5";
|
|
49
|
+
readonly 400: "#f87171";
|
|
50
|
+
readonly 500: "#ef4444";
|
|
51
|
+
readonly 600: "#dc2626";
|
|
52
|
+
readonly 700: "#b91c1c";
|
|
53
|
+
readonly 800: "#991b1b";
|
|
54
|
+
readonly 900: "#7f1d1d";
|
|
55
|
+
readonly 950: "#450a0a";
|
|
56
|
+
};
|
|
57
|
+
readonly orange: {
|
|
58
|
+
readonly 50: "#fff7ed";
|
|
59
|
+
readonly 100: "#ffedd5";
|
|
60
|
+
readonly 200: "#fed7aa";
|
|
61
|
+
readonly 300: "#fdba74";
|
|
62
|
+
readonly 400: "#fb923c";
|
|
63
|
+
readonly 500: "#f97316";
|
|
64
|
+
readonly 600: "#ea580c";
|
|
65
|
+
readonly 700: "#c2410c";
|
|
66
|
+
readonly 800: "#9a3412";
|
|
67
|
+
readonly 900: "#7c2d12";
|
|
68
|
+
readonly 950: "#431407";
|
|
69
|
+
};
|
|
70
|
+
readonly amber: {
|
|
71
|
+
readonly 50: "#fffbeb";
|
|
72
|
+
readonly 100: "#fef3c7";
|
|
73
|
+
readonly 200: "#fde68a";
|
|
74
|
+
readonly 300: "#fcd34d";
|
|
75
|
+
readonly 400: "#fbbf24";
|
|
76
|
+
readonly 500: "#f59e0b";
|
|
77
|
+
readonly 600: "#d97706";
|
|
78
|
+
readonly 700: "#b45309";
|
|
79
|
+
readonly 800: "#92400e";
|
|
80
|
+
readonly 900: "#78350f";
|
|
81
|
+
readonly 950: "#451a03";
|
|
82
|
+
};
|
|
83
|
+
readonly yellow: {
|
|
84
|
+
readonly 50: "#fefce8";
|
|
85
|
+
readonly 100: "#fef9c3";
|
|
86
|
+
readonly 200: "#fef08a";
|
|
87
|
+
readonly 300: "#fde047";
|
|
88
|
+
readonly 400: "#facc15";
|
|
89
|
+
readonly 500: "#eab308";
|
|
90
|
+
readonly 600: "#ca8a04";
|
|
91
|
+
readonly 700: "#a16207";
|
|
92
|
+
readonly 800: "#854d0e";
|
|
93
|
+
readonly 900: "#713f12";
|
|
94
|
+
readonly 950: "#422006";
|
|
95
|
+
};
|
|
96
|
+
readonly green: {
|
|
97
|
+
readonly 50: "#f0fdf4";
|
|
98
|
+
readonly 100: "#dcfce7";
|
|
99
|
+
readonly 200: "#bbf7d0";
|
|
100
|
+
readonly 300: "#86efac";
|
|
101
|
+
readonly 400: "#4ade80";
|
|
102
|
+
readonly 500: "#22c55e";
|
|
103
|
+
readonly 600: "#16a34a";
|
|
104
|
+
readonly 700: "#15803d";
|
|
105
|
+
readonly 800: "#166534";
|
|
106
|
+
readonly 900: "#14532d";
|
|
107
|
+
readonly 950: "#052e16";
|
|
108
|
+
};
|
|
109
|
+
readonly teal: {
|
|
110
|
+
readonly 50: "#f0fdfa";
|
|
111
|
+
readonly 100: "#ccfbf1";
|
|
112
|
+
readonly 200: "#99f6e4";
|
|
113
|
+
readonly 300: "#5eead4";
|
|
114
|
+
readonly 400: "#2dd4bf";
|
|
115
|
+
readonly 500: "#14b8a6";
|
|
116
|
+
readonly 600: "#0d9488";
|
|
117
|
+
readonly 700: "#0f766e";
|
|
118
|
+
readonly 800: "#115e59";
|
|
119
|
+
readonly 900: "#134e4a";
|
|
120
|
+
readonly 950: "#042f2e";
|
|
121
|
+
};
|
|
122
|
+
readonly blue: {
|
|
123
|
+
readonly 50: "#eff6ff";
|
|
124
|
+
readonly 100: "#dbeafe";
|
|
125
|
+
readonly 200: "#bfdbfe";
|
|
126
|
+
readonly 300: "#93c5fd";
|
|
127
|
+
readonly 400: "#60a5fa";
|
|
128
|
+
readonly 500: "#3b82f6";
|
|
129
|
+
readonly 600: "#2563eb";
|
|
130
|
+
readonly 700: "#1d4ed8";
|
|
131
|
+
readonly 800: "#1e40af";
|
|
132
|
+
readonly 900: "#1e3a8a";
|
|
133
|
+
readonly 950: "#172554";
|
|
134
|
+
};
|
|
135
|
+
readonly indigo: {
|
|
136
|
+
readonly 50: "#eef2ff";
|
|
137
|
+
readonly 100: "#e0e7ff";
|
|
138
|
+
readonly 200: "#c7d2fe";
|
|
139
|
+
readonly 300: "#a5b4fc";
|
|
140
|
+
readonly 400: "#818cf8";
|
|
141
|
+
readonly 500: "#6366f1";
|
|
142
|
+
readonly 600: "#4f46e5";
|
|
143
|
+
readonly 700: "#4338ca";
|
|
144
|
+
readonly 800: "#3730a3";
|
|
145
|
+
readonly 900: "#312e81";
|
|
146
|
+
readonly 950: "#1e1b4b";
|
|
147
|
+
};
|
|
148
|
+
readonly violet: {
|
|
149
|
+
readonly 50: "#f5f3ff";
|
|
150
|
+
readonly 100: "#ede9fe";
|
|
151
|
+
readonly 200: "#ddd6fe";
|
|
152
|
+
readonly 300: "#c4b5fd";
|
|
153
|
+
readonly 400: "#a78bfa";
|
|
154
|
+
readonly 500: "#8b5cf6";
|
|
155
|
+
readonly 600: "#7c3aed";
|
|
156
|
+
readonly 700: "#6d28d9";
|
|
157
|
+
readonly 800: "#5b21b6";
|
|
158
|
+
readonly 900: "#4c1d95";
|
|
159
|
+
readonly 950: "#2e1065";
|
|
160
|
+
};
|
|
161
|
+
readonly pink: {
|
|
162
|
+
readonly 50: "#fdf2f8";
|
|
163
|
+
readonly 100: "#fce7f3";
|
|
164
|
+
readonly 200: "#fbcfe8";
|
|
165
|
+
readonly 300: "#f9a8d4";
|
|
166
|
+
readonly 400: "#f472b6";
|
|
167
|
+
readonly 500: "#ec4899";
|
|
168
|
+
readonly 600: "#db2777";
|
|
169
|
+
readonly 700: "#be185d";
|
|
170
|
+
readonly 800: "#9d174d";
|
|
171
|
+
readonly 900: "#831843";
|
|
172
|
+
readonly 950: "#500724";
|
|
173
|
+
};
|
|
174
|
+
readonly rose: {
|
|
175
|
+
readonly 50: "#fff1f2";
|
|
176
|
+
readonly 100: "#ffe4e6";
|
|
177
|
+
readonly 200: "#fecdd3";
|
|
178
|
+
readonly 300: "#fda4af";
|
|
179
|
+
readonly 400: "#fb7185";
|
|
180
|
+
readonly 500: "#f43f5e";
|
|
181
|
+
readonly 600: "#e11d48";
|
|
182
|
+
readonly 700: "#be123c";
|
|
183
|
+
readonly 800: "#9f1239";
|
|
184
|
+
readonly 900: "#881337";
|
|
185
|
+
readonly 950: "#4c0519";
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
export type Colors = typeof colors;
|
|
189
|
+
//# sourceMappingURL=Colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Colors.d.ts","sourceRoot":"","sources":["../../../src/Styling/Colors.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwMT,CAAA;AAEV,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAA"}
|