@superdispatch/phones 0.21.8 → 0.21.14

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.
Files changed (2) hide show
  1. package/dist-types/index.d.ts +82 -82
  2. package/package.json +34 -34
@@ -2,100 +2,100 @@ import AwesomePhoneNumber from 'awesome-phonenumber';
2
2
  import { ForwardRefExoticComponent, RefAttributes, ReactNode, ReactElement } from 'react';
3
3
  import { BaseTextFieldProps, LinkProps } from '@material-ui/core';
4
4
 
5
- declare const COUNTRY_CODE_METADATA: readonly [readonly ["US", 1, "United States"], readonly ["CA", 1, "Canada"], readonly ["AU", 61, "Australia"], readonly ["NZ", 64, "New Zealand"], readonly ["AC", 247, "Ascension Island"], readonly ["AD", 376, "Andorra"], readonly ["AE", 971, "United Arab Emirates"], readonly ["AF", 93, "Afghanistan"], readonly ["AG", 1, "Antigua and Barbuda"], readonly ["AI", 1, "Anguilla"], readonly ["AL", 355, "Albania"], readonly ["AM", 374, "Armenia"], readonly ["AO", 244, "Angola"], readonly ["AR", 54, "Argentina"], readonly ["AS", 1, "American Samoa"], readonly ["AT", 43, "Austria"], readonly ["AW", 297, "Aruba"], readonly ["AX", 358, "Åland Islands"], readonly ["AZ", 994, "Azerbaijan"], readonly ["BA", 387, "Bosnia and Herzegovina"], readonly ["BB", 1, "Barbados"], readonly ["BD", 880, "Bangladesh"], readonly ["BE", 32, "Belgium"], readonly ["BF", 226, "Burkina Faso"], readonly ["BG", 359, "Bulgaria"], readonly ["BH", 973, "Bahrain"], readonly ["BI", 257, "Burundi"], readonly ["BJ", 229, "Benin"], readonly ["BL", 590, "Saint Barthélemy"], readonly ["BM", 1, "Bermuda"], readonly ["BN", 673, "Brunei"], readonly ["BO", 591, "Bolivia"], readonly ["BQ", 599, "Caribbean Netherlands"], readonly ["BR", 55, "Brazil"], readonly ["BS", 1, "Bahamas"], readonly ["BT", 975, "Bhutan"], readonly ["BW", 267, "Botswana"], readonly ["BY", 375, "Belarus"], readonly ["BZ", 501, "Belize"], readonly ["CC", 61, "Cocos"], readonly ["CD", 243, "Congo"], readonly ["CF", 236, "Central African Republic"], readonly ["CG", 242, "Congo"], readonly ["CH", 41, "Switzerland"], readonly ["CI", 225, "Côte d’Ivoire"], readonly ["CK", 682, "Cook Islands"], readonly ["CL", 56, "Chile"], readonly ["CM", 237, "Cameroon"], readonly ["CN", 86, "China"], readonly ["CO", 57, "Colombia"], readonly ["CR", 506, "Costa Rica"], readonly ["CU", 53, "Cuba"], readonly ["CV", 238, "Cape Verde"], readonly ["CW", 599, "Curaçao"], readonly ["CX", 61, "Christmas Island"], readonly ["CY", 357, "Cyprus"], readonly ["CZ", 420, "Czech Republic"], readonly ["DE", 49, "Germany"], readonly ["DJ", 253, "Djibouti"], readonly ["DK", 45, "Denmark"], readonly ["DM", 1, "Dominica"], readonly ["DO", 1, "Dominican Republic"], readonly ["DZ", 213, "Algeria"], readonly ["EC", 593, "Ecuador"], readonly ["EE", 372, "Estonia"], readonly ["EG", 20, "Egypt"], readonly ["EH", 212, "Western Sahara"], readonly ["ER", 291, "Eritrea"], readonly ["ES", 34, "Spain"], readonly ["ET", 251, "Ethiopia"], readonly ["FI", 358, "Finland"], readonly ["FJ", 679, "Fiji"], readonly ["FK", 500, "Falkland Islands"], readonly ["FM", 691, "Micronesia"], readonly ["FO", 298, "Faroe Islands"], readonly ["FR", 33, "France"], readonly ["GA", 241, "Gabon"], readonly ["GB", 44, "United Kingdom"], readonly ["GD", 1, "Grenada"], readonly ["GE", 995, "Georgia"], readonly ["GF", 594, "French Guiana"], readonly ["GG", 44, "Guernsey"], readonly ["GH", 233, "Ghana"], readonly ["GI", 350, "Gibraltar"], readonly ["GL", 299, "Greenland"], readonly ["GM", 220, "Gambia"], readonly ["GN", 224, "Guinea"], readonly ["GP", 590, "Guadeloupe"], readonly ["GQ", 240, "Equatorial Guinea"], readonly ["GR", 30, "Greece"], readonly ["GT", 502, "Guatemala"], readonly ["GU", 1, "Guam"], readonly ["GW", 245, "Guinea-Bissau"], readonly ["GY", 592, "Guyana"], readonly ["HK", 852, "Hong Kong"], readonly ["HN", 504, "Honduras"], readonly ["HR", 385, "Croatia"], readonly ["HT", 509, "Haiti"], readonly ["HU", 36, "Hungary"], readonly ["ID", 62, "Indonesia"], readonly ["IE", 353, "Ireland"], readonly ["IL", 972, "Israel"], readonly ["IM", 44, "Isle of Man"], readonly ["IN", 91, "India"], readonly ["IO", 246, "British Indian Ocean Territory"], readonly ["IQ", 964, "Iraq"], readonly ["IR", 98, "Iran"], readonly ["IS", 354, "Iceland"], readonly ["IT", 39, "Italy"], readonly ["JE", 44, "Jersey"], readonly ["JM", 1, "Jamaica"], readonly ["JO", 962, "Jordan"], readonly ["JP", 81, "Japan"], readonly ["KE", 254, "Kenya"], readonly ["KG", 996, "Kyrgyzstan"], readonly ["KH", 855, "Cambodia"], readonly ["KI", 686, "Kiribati"], readonly ["KM", 269, "Comoros"], readonly ["KN", 1, "Saint Kitts and Nevis"], readonly ["KP", 850, "North Korea"], readonly ["KR", 82, "South Korea"], readonly ["KW", 965, "Kuwait"], readonly ["KY", 1, "Cayman Islands"], readonly ["KZ", 7, "Kazakhstan"], readonly ["LA", 856, "Laos"], readonly ["LB", 961, "Lebanon"], readonly ["LC", 1, "Saint Lucia"], readonly ["LI", 423, "Liechtenstein"], readonly ["LK", 94, "Sri Lanka"], readonly ["LR", 231, "Liberia"], readonly ["LS", 266, "Lesotho"], readonly ["LT", 370, "Lithuania"], readonly ["LU", 352, "Luxembourg"], readonly ["LV", 371, "Latvia"], readonly ["LY", 218, "Libya"], readonly ["MA", 212, "Morocco"], readonly ["MC", 377, "Monaco"], readonly ["MD", 373, "Moldova"], readonly ["ME", 382, "Montenegro"], readonly ["MF", 590, "Saint Martin"], readonly ["MG", 261, "Madagascar"], readonly ["MH", 692, "Marshall Islands"], readonly ["MK", 389, "Macedonia"], readonly ["ML", 223, "Mali"], readonly ["MM", 95, "Myanmar"], readonly ["MN", 976, "Mongolia"], readonly ["MO", 853, "Macau"], readonly ["MP", 1, "Northern Mariana Islands"], readonly ["MQ", 596, "Martinique"], readonly ["MR", 222, "Mauritania"], readonly ["MS", 1, "Montserrat"], readonly ["MT", 356, "Malta"], readonly ["MU", 230, "Mauritius"], readonly ["MV", 960, "Maldives"], readonly ["MW", 265, "Malawi"], readonly ["MX", 52, "Mexico"], readonly ["MY", 60, "Malaysia"], readonly ["MZ", 258, "Mozambique"], readonly ["NA", 264, "Namibia"], readonly ["NC", 687, "New Caledonia"], readonly ["NE", 227, "Niger"], readonly ["NF", 672, "Norfolk Island"], readonly ["NG", 234, "Nigeria"], readonly ["NI", 505, "Nicaragua"], readonly ["NL", 31, "Netherlands"], readonly ["NO", 47, "Norway"], readonly ["NP", 977, "Nepal"], readonly ["NR", 674, "Nauru"], readonly ["NU", 683, "Niue"], readonly ["OM", 968, "Oman"], readonly ["PA", 507, "Panama"], readonly ["PE", 51, "Peru"], readonly ["PF", 689, "French Polynesia"], readonly ["PG", 675, "Papua New Guinea"], readonly ["PH", 63, "Philippines"], readonly ["PK", 92, "Pakistan"], readonly ["PL", 48, "Poland"], readonly ["PM", 508, "Saint Pierre and Miquelon"], readonly ["PR", 1, "Puerto Rico"], readonly ["PS", 970, "Palestine"], readonly ["PT", 351, "Portugal"], readonly ["PW", 680, "Palau"], readonly ["PY", 595, "Paraguay"], readonly ["QA", 974, "Qatar"], readonly ["RE", 262, "Réunion"], readonly ["RO", 40, "Romania"], readonly ["RS", 381, "Serbia"], readonly ["RU", 7, "Russia"], readonly ["RW", 250, "Rwanda"], readonly ["SA", 966, "Saudi Arabia"], readonly ["SB", 677, "Solomon Islands"], readonly ["SC", 248, "Seychelles"], readonly ["SD", 249, "Sudan"], readonly ["SE", 46, "Sweden"], readonly ["SG", 65, "Singapore"], readonly ["SH", 290, "Saint Helena"], readonly ["SI", 386, "Slovenia"], readonly ["SJ", 47, "Svalbard and Jan Mayen"], readonly ["SK", 421, "Slovakia"], readonly ["SL", 232, "Sierra Leone"], readonly ["SM", 378, "San Marino"], readonly ["SN", 221, "Senegal"], readonly ["SO", 252, "Somalia"], readonly ["SR", 597, "Suriname"], readonly ["SS", 211, "South Sudan"], readonly ["ST", 239, "São Tomé and Príncipe"], readonly ["SV", 503, "El Salvador"], readonly ["SX", 1, "Sint Maarten"], readonly ["SY", 963, "Syria"], readonly ["SZ", 268, "Swaziland"], readonly ["TA", 290, "Tristan da Cunha"], readonly ["TC", 1, "Turks and Caicos Islands"], readonly ["TD", 235, "Chad"], readonly ["TG", 228, "Togo"], readonly ["TH", 66, "Thailand"], readonly ["TJ", 992, "Tajikistan"], readonly ["TK", 690, "Tokelau"], readonly ["TL", 670, "Timor-Leste"], readonly ["TM", 993, "Turkmenistan"], readonly ["TN", 216, "Tunisia"], readonly ["TO", 676, "Tonga"], readonly ["TR", 90, "Turkey"], readonly ["TT", 1, "Trinidad and Tobago"], readonly ["TV", 688, "Tuvalu"], readonly ["TW", 886, "Taiwan"], readonly ["TZ", 255, "Tanzania"], readonly ["UA", 380, "Ukraine"], readonly ["UG", 256, "Uganda"], readonly ["UY", 598, "Uruguay"], readonly ["UZ", 998, "Uzbekistan"], readonly ["VA", 39, "Vatican City"], readonly ["VC", 1, "Saint Vincent and the Grenadines"], readonly ["VE", 58, "Venezuela"], readonly ["VG", 1, "British Virgin Islands"], readonly ["VI", 1, "U.S. Virgin Islands"], readonly ["VN", 84, "Vietnam"], readonly ["VU", 678, "Vanuatu"], readonly ["WF", 681, "Wallis and Futuna"], readonly ["WS", 685, "Samoa"], readonly ["XK", 383, "Kosovo"], readonly ["YE", 967, "Yemen"], readonly ["YT", 262, "Mayotte"], readonly ["ZA", 27, "South Africa"], readonly ["ZM", 260, "Zambia"], readonly ["ZW", 263, "Zimbabwe"]];
6
- declare type CountryISO = typeof COUNTRY_CODE_METADATA[number][0];
7
- declare const DEFAULT_COUNTRY: CountryISO;
8
- declare function listCountries(): readonly CountryISO[];
9
- declare function isCountryISO(value: unknown): value is CountryISO;
10
- declare function toCountryISO(value: unknown): CountryISO;
11
- declare function getCountryCode(country: CountryISO): number;
5
+ declare const COUNTRY_CODE_METADATA: readonly [readonly ["US", 1, "United States"], readonly ["CA", 1, "Canada"], readonly ["AU", 61, "Australia"], readonly ["NZ", 64, "New Zealand"], readonly ["AC", 247, "Ascension Island"], readonly ["AD", 376, "Andorra"], readonly ["AE", 971, "United Arab Emirates"], readonly ["AF", 93, "Afghanistan"], readonly ["AG", 1, "Antigua and Barbuda"], readonly ["AI", 1, "Anguilla"], readonly ["AL", 355, "Albania"], readonly ["AM", 374, "Armenia"], readonly ["AO", 244, "Angola"], readonly ["AR", 54, "Argentina"], readonly ["AS", 1, "American Samoa"], readonly ["AT", 43, "Austria"], readonly ["AW", 297, "Aruba"], readonly ["AX", 358, "Åland Islands"], readonly ["AZ", 994, "Azerbaijan"], readonly ["BA", 387, "Bosnia and Herzegovina"], readonly ["BB", 1, "Barbados"], readonly ["BD", 880, "Bangladesh"], readonly ["BE", 32, "Belgium"], readonly ["BF", 226, "Burkina Faso"], readonly ["BG", 359, "Bulgaria"], readonly ["BH", 973, "Bahrain"], readonly ["BI", 257, "Burundi"], readonly ["BJ", 229, "Benin"], readonly ["BL", 590, "Saint Barthélemy"], readonly ["BM", 1, "Bermuda"], readonly ["BN", 673, "Brunei"], readonly ["BO", 591, "Bolivia"], readonly ["BQ", 599, "Caribbean Netherlands"], readonly ["BR", 55, "Brazil"], readonly ["BS", 1, "Bahamas"], readonly ["BT", 975, "Bhutan"], readonly ["BW", 267, "Botswana"], readonly ["BY", 375, "Belarus"], readonly ["BZ", 501, "Belize"], readonly ["CC", 61, "Cocos"], readonly ["CD", 243, "Congo"], readonly ["CF", 236, "Central African Republic"], readonly ["CG", 242, "Congo"], readonly ["CH", 41, "Switzerland"], readonly ["CI", 225, "Côte d’Ivoire"], readonly ["CK", 682, "Cook Islands"], readonly ["CL", 56, "Chile"], readonly ["CM", 237, "Cameroon"], readonly ["CN", 86, "China"], readonly ["CO", 57, "Colombia"], readonly ["CR", 506, "Costa Rica"], readonly ["CU", 53, "Cuba"], readonly ["CV", 238, "Cape Verde"], readonly ["CW", 599, "Curaçao"], readonly ["CX", 61, "Christmas Island"], readonly ["CY", 357, "Cyprus"], readonly ["CZ", 420, "Czech Republic"], readonly ["DE", 49, "Germany"], readonly ["DJ", 253, "Djibouti"], readonly ["DK", 45, "Denmark"], readonly ["DM", 1, "Dominica"], readonly ["DO", 1, "Dominican Republic"], readonly ["DZ", 213, "Algeria"], readonly ["EC", 593, "Ecuador"], readonly ["EE", 372, "Estonia"], readonly ["EG", 20, "Egypt"], readonly ["EH", 212, "Western Sahara"], readonly ["ER", 291, "Eritrea"], readonly ["ES", 34, "Spain"], readonly ["ET", 251, "Ethiopia"], readonly ["FI", 358, "Finland"], readonly ["FJ", 679, "Fiji"], readonly ["FK", 500, "Falkland Islands"], readonly ["FM", 691, "Micronesia"], readonly ["FO", 298, "Faroe Islands"], readonly ["FR", 33, "France"], readonly ["GA", 241, "Gabon"], readonly ["GB", 44, "United Kingdom"], readonly ["GD", 1, "Grenada"], readonly ["GE", 995, "Georgia"], readonly ["GF", 594, "French Guiana"], readonly ["GG", 44, "Guernsey"], readonly ["GH", 233, "Ghana"], readonly ["GI", 350, "Gibraltar"], readonly ["GL", 299, "Greenland"], readonly ["GM", 220, "Gambia"], readonly ["GN", 224, "Guinea"], readonly ["GP", 590, "Guadeloupe"], readonly ["GQ", 240, "Equatorial Guinea"], readonly ["GR", 30, "Greece"], readonly ["GT", 502, "Guatemala"], readonly ["GU", 1, "Guam"], readonly ["GW", 245, "Guinea-Bissau"], readonly ["GY", 592, "Guyana"], readonly ["HK", 852, "Hong Kong"], readonly ["HN", 504, "Honduras"], readonly ["HR", 385, "Croatia"], readonly ["HT", 509, "Haiti"], readonly ["HU", 36, "Hungary"], readonly ["ID", 62, "Indonesia"], readonly ["IE", 353, "Ireland"], readonly ["IL", 972, "Israel"], readonly ["IM", 44, "Isle of Man"], readonly ["IN", 91, "India"], readonly ["IO", 246, "British Indian Ocean Territory"], readonly ["IQ", 964, "Iraq"], readonly ["IR", 98, "Iran"], readonly ["IS", 354, "Iceland"], readonly ["IT", 39, "Italy"], readonly ["JE", 44, "Jersey"], readonly ["JM", 1, "Jamaica"], readonly ["JO", 962, "Jordan"], readonly ["JP", 81, "Japan"], readonly ["KE", 254, "Kenya"], readonly ["KG", 996, "Kyrgyzstan"], readonly ["KH", 855, "Cambodia"], readonly ["KI", 686, "Kiribati"], readonly ["KM", 269, "Comoros"], readonly ["KN", 1, "Saint Kitts and Nevis"], readonly ["KP", 850, "North Korea"], readonly ["KR", 82, "South Korea"], readonly ["KW", 965, "Kuwait"], readonly ["KY", 1, "Cayman Islands"], readonly ["KZ", 7, "Kazakhstan"], readonly ["LA", 856, "Laos"], readonly ["LB", 961, "Lebanon"], readonly ["LC", 1, "Saint Lucia"], readonly ["LI", 423, "Liechtenstein"], readonly ["LK", 94, "Sri Lanka"], readonly ["LR", 231, "Liberia"], readonly ["LS", 266, "Lesotho"], readonly ["LT", 370, "Lithuania"], readonly ["LU", 352, "Luxembourg"], readonly ["LV", 371, "Latvia"], readonly ["LY", 218, "Libya"], readonly ["MA", 212, "Morocco"], readonly ["MC", 377, "Monaco"], readonly ["MD", 373, "Moldova"], readonly ["ME", 382, "Montenegro"], readonly ["MF", 590, "Saint Martin"], readonly ["MG", 261, "Madagascar"], readonly ["MH", 692, "Marshall Islands"], readonly ["MK", 389, "Macedonia"], readonly ["ML", 223, "Mali"], readonly ["MM", 95, "Myanmar"], readonly ["MN", 976, "Mongolia"], readonly ["MO", 853, "Macau"], readonly ["MP", 1, "Northern Mariana Islands"], readonly ["MQ", 596, "Martinique"], readonly ["MR", 222, "Mauritania"], readonly ["MS", 1, "Montserrat"], readonly ["MT", 356, "Malta"], readonly ["MU", 230, "Mauritius"], readonly ["MV", 960, "Maldives"], readonly ["MW", 265, "Malawi"], readonly ["MX", 52, "Mexico"], readonly ["MY", 60, "Malaysia"], readonly ["MZ", 258, "Mozambique"], readonly ["NA", 264, "Namibia"], readonly ["NC", 687, "New Caledonia"], readonly ["NE", 227, "Niger"], readonly ["NF", 672, "Norfolk Island"], readonly ["NG", 234, "Nigeria"], readonly ["NI", 505, "Nicaragua"], readonly ["NL", 31, "Netherlands"], readonly ["NO", 47, "Norway"], readonly ["NP", 977, "Nepal"], readonly ["NR", 674, "Nauru"], readonly ["NU", 683, "Niue"], readonly ["OM", 968, "Oman"], readonly ["PA", 507, "Panama"], readonly ["PE", 51, "Peru"], readonly ["PF", 689, "French Polynesia"], readonly ["PG", 675, "Papua New Guinea"], readonly ["PH", 63, "Philippines"], readonly ["PK", 92, "Pakistan"], readonly ["PL", 48, "Poland"], readonly ["PM", 508, "Saint Pierre and Miquelon"], readonly ["PR", 1, "Puerto Rico"], readonly ["PS", 970, "Palestine"], readonly ["PT", 351, "Portugal"], readonly ["PW", 680, "Palau"], readonly ["PY", 595, "Paraguay"], readonly ["QA", 974, "Qatar"], readonly ["RE", 262, "Réunion"], readonly ["RO", 40, "Romania"], readonly ["RS", 381, "Serbia"], readonly ["RU", 7, "Russia"], readonly ["RW", 250, "Rwanda"], readonly ["SA", 966, "Saudi Arabia"], readonly ["SB", 677, "Solomon Islands"], readonly ["SC", 248, "Seychelles"], readonly ["SD", 249, "Sudan"], readonly ["SE", 46, "Sweden"], readonly ["SG", 65, "Singapore"], readonly ["SH", 290, "Saint Helena"], readonly ["SI", 386, "Slovenia"], readonly ["SJ", 47, "Svalbard and Jan Mayen"], readonly ["SK", 421, "Slovakia"], readonly ["SL", 232, "Sierra Leone"], readonly ["SM", 378, "San Marino"], readonly ["SN", 221, "Senegal"], readonly ["SO", 252, "Somalia"], readonly ["SR", 597, "Suriname"], readonly ["SS", 211, "South Sudan"], readonly ["ST", 239, "São Tomé and Príncipe"], readonly ["SV", 503, "El Salvador"], readonly ["SX", 1, "Sint Maarten"], readonly ["SY", 963, "Syria"], readonly ["SZ", 268, "Swaziland"], readonly ["TA", 290, "Tristan da Cunha"], readonly ["TC", 1, "Turks and Caicos Islands"], readonly ["TD", 235, "Chad"], readonly ["TG", 228, "Togo"], readonly ["TH", 66, "Thailand"], readonly ["TJ", 992, "Tajikistan"], readonly ["TK", 690, "Tokelau"], readonly ["TL", 670, "Timor-Leste"], readonly ["TM", 993, "Turkmenistan"], readonly ["TN", 216, "Tunisia"], readonly ["TO", 676, "Tonga"], readonly ["TR", 90, "Turkey"], readonly ["TT", 1, "Trinidad and Tobago"], readonly ["TV", 688, "Tuvalu"], readonly ["TW", 886, "Taiwan"], readonly ["TZ", 255, "Tanzania"], readonly ["UA", 380, "Ukraine"], readonly ["UG", 256, "Uganda"], readonly ["UY", 598, "Uruguay"], readonly ["UZ", 998, "Uzbekistan"], readonly ["VA", 39, "Vatican City"], readonly ["VC", 1, "Saint Vincent and the Grenadines"], readonly ["VE", 58, "Venezuela"], readonly ["VG", 1, "British Virgin Islands"], readonly ["VI", 1, "U.S. Virgin Islands"], readonly ["VN", 84, "Vietnam"], readonly ["VU", 678, "Vanuatu"], readonly ["WF", 681, "Wallis and Futuna"], readonly ["WS", 685, "Samoa"], readonly ["XK", 383, "Kosovo"], readonly ["YE", 967, "Yemen"], readonly ["YT", 262, "Mayotte"], readonly ["ZA", 27, "South Africa"], readonly ["ZM", 260, "Zambia"], readonly ["ZW", 263, "Zimbabwe"]];
6
+ declare type CountryISO = typeof COUNTRY_CODE_METADATA[number][0];
7
+ declare const DEFAULT_COUNTRY: CountryISO;
8
+ declare function listCountries(): readonly CountryISO[];
9
+ declare function isCountryISO(value: unknown): value is CountryISO;
10
+ declare function toCountryISO(value: unknown): CountryISO;
11
+ declare function getCountryCode(country: CountryISO): number;
12
12
  declare function formatCountry(country: CountryISO): string;
13
13
 
14
- declare type APNType = AwesomePhoneNumber;
14
+ declare type APNType = AwesomePhoneNumber;
15
15
  declare type APNStatic = typeof AwesomePhoneNumber;
16
16
 
17
- declare type PhoneNumberPossibility = 'is-possible' | 'invalid-country-code' | 'invalid-number' | 'too-long' | 'too-short' | 'unknown';
18
- interface PhoneNumberJSON {
19
- valid: boolean;
20
- possible: boolean;
21
- possibility: PhoneNumberPossibility;
22
- regionCode: CountryISO;
23
- number: {
24
- input: string;
25
- international?: string;
26
- };
27
- }
28
- interface PhoneNumberInfo {
29
- country: CountryISO;
30
- nationalNumber: string;
31
- }
32
- declare type PhoneNumberFormat = 'e164' | 'international' | 'national' | 'rfc3966';
33
- interface PhoneValidationRules {
34
- required?: boolean;
35
- requiredMessage?: string;
36
- tooShortMessage?: string;
37
- tooLongMessage?: string;
38
- invalidMessage?: string;
39
- }
40
- interface PhoneFormatOptions {
41
- fallback?: string;
42
- country?: CountryISO;
43
- format?: PhoneNumberFormat;
44
- }
45
- declare class PhoneService {
46
- static load(): Promise<PhoneService>;
47
- static checkPossibility(input: unknown): Promise<PhoneNumberPossibility>;
48
- static validate(input: unknown, rules?: PhoneValidationRules): Promise<string | undefined>;
49
- readonly APN: typeof AwesomePhonenumber.PhoneNumber;
50
- constructor(APN: APNStatic);
51
- createAPN(phone: string, country?: CountryISO): APNType;
52
- getJSON(phone: string, country?: CountryISO): PhoneNumberJSON;
53
- checkPossibility(input: unknown): PhoneNumberPossibility;
54
- validate(input: unknown, { required, requiredMessage, invalidMessage, tooLongMessage, tooShortMessage, }?: PhoneValidationRules): string | undefined;
55
- deletePrefix(phone: string, country: CountryISO): string;
56
- getInfo(phone: string): PhoneNumberInfo;
57
- format(input: unknown, { fallback, format, country: countryOption, }?: PhoneFormatOptions): string;
58
- formatNationalNumber(apn: APNType, country: CountryISO): string | undefined;
59
- private customFormat;
60
- }
17
+ declare type PhoneNumberPossibility = 'is-possible' | 'invalid-country-code' | 'invalid-number' | 'too-long' | 'too-short' | 'unknown';
18
+ interface PhoneNumberJSON {
19
+ valid: boolean;
20
+ possible: boolean;
21
+ possibility: PhoneNumberPossibility;
22
+ regionCode: CountryISO;
23
+ number: {
24
+ input: string;
25
+ international?: string;
26
+ };
27
+ }
28
+ interface PhoneNumberInfo {
29
+ country: CountryISO;
30
+ nationalNumber: string;
31
+ }
32
+ declare type PhoneNumberFormat = 'e164' | 'international' | 'national' | 'rfc3966';
33
+ interface PhoneValidationRules {
34
+ required?: boolean;
35
+ requiredMessage?: string;
36
+ tooShortMessage?: string;
37
+ tooLongMessage?: string;
38
+ invalidMessage?: string;
39
+ }
40
+ interface PhoneFormatOptions {
41
+ fallback?: string;
42
+ country?: CountryISO;
43
+ format?: PhoneNumberFormat;
44
+ }
45
+ declare class PhoneService {
46
+ static load(): Promise<PhoneService>;
47
+ static checkPossibility(input: unknown): Promise<PhoneNumberPossibility>;
48
+ static validate(input: unknown, rules?: PhoneValidationRules): Promise<string | undefined>;
49
+ readonly APN: typeof AwesomePhonenumber.PhoneNumber;
50
+ constructor(APN: APNStatic);
51
+ createAPN(phone: string, country?: CountryISO): APNType;
52
+ getJSON(phone: string, country?: CountryISO): PhoneNumberJSON;
53
+ checkPossibility(input: unknown): PhoneNumberPossibility;
54
+ validate(input: unknown, { required, requiredMessage, invalidMessage, tooLongMessage, tooShortMessage, }?: PhoneValidationRules): string | undefined;
55
+ deletePrefix(phone: string, country: CountryISO): string;
56
+ getInfo(phone: string): PhoneNumberInfo;
57
+ format(input: unknown, { fallback, format, country: countryOption, }?: PhoneFormatOptions): string;
58
+ formatNationalNumber(apn: APNType, country: CountryISO): string | undefined;
59
+ private customFormat;
60
+ }
61
61
  declare function usePhoneService(): PhoneService;
62
62
 
63
63
  declare function useFormattedPhoneNumber(input: unknown, { format, country, fallback }?: PhoneFormatOptions): string;
64
64
 
65
- interface PhoneFieldProps extends Pick<BaseTextFieldProps, 'disabled' | 'error' | 'fullWidth' | 'helperText' | 'id' | 'label' | 'name' | 'placeholder' | 'required'> {
66
- value?: null | string;
67
- onBlur?: (value: string) => void;
68
- onFocus?: (value: string) => void;
69
- onChange?: (value: string) => void;
70
- }
71
- declare const PhoneField: ForwardRefExoticComponent<PhoneFieldProps & RefAttributes<HTMLDivElement>>;
72
- interface SuspendedPhoneFieldProps extends PhoneFieldProps {
73
- suspenseFallback?: ReactNode;
74
- }
65
+ interface PhoneFieldProps extends Pick<BaseTextFieldProps, 'disabled' | 'error' | 'fullWidth' | 'helperText' | 'id' | 'label' | 'name' | 'placeholder' | 'required'> {
66
+ value?: null | string;
67
+ onBlur?: (value: string) => void;
68
+ onFocus?: (value: string) => void;
69
+ onChange?: (value: string) => void;
70
+ }
71
+ declare const PhoneField: ForwardRefExoticComponent<PhoneFieldProps & RefAttributes<HTMLDivElement>>;
72
+ interface SuspendedPhoneFieldProps extends PhoneFieldProps {
73
+ suspenseFallback?: ReactNode;
74
+ }
75
75
  declare const SuspendedPhoneField: ForwardRefExoticComponent<SuspendedPhoneFieldProps & RefAttributes<HTMLDivElement>>;
76
76
 
77
- interface PhoneLinkProps extends RefAttributes<HTMLAnchorElement>, Omit<LinkProps, 'ref' | 'href' | 'children'> {
78
- phone: unknown;
79
- country?: CountryISO;
80
- format?: PhoneNumberFormat;
81
- fallback?: ReactNode;
82
- }
83
- declare const PhoneLink: ForwardRefExoticComponent<PhoneLinkProps>;
84
- interface SuspendedPhoneLinkProps extends PhoneLinkProps {
85
- suspenseFallback?: ReactNode;
86
- }
77
+ interface PhoneLinkProps extends RefAttributes<HTMLAnchorElement>, Omit<LinkProps, 'ref' | 'href' | 'children'> {
78
+ phone: unknown;
79
+ country?: CountryISO;
80
+ format?: PhoneNumberFormat;
81
+ fallback?: ReactNode;
82
+ }
83
+ declare const PhoneLink: ForwardRefExoticComponent<PhoneLinkProps>;
84
+ interface SuspendedPhoneLinkProps extends PhoneLinkProps {
85
+ suspenseFallback?: ReactNode;
86
+ }
87
87
  declare const SuspendedPhoneLink: ForwardRefExoticComponent<SuspendedPhoneLinkProps>;
88
88
 
89
- interface PhoneTextProps {
90
- phone: unknown;
91
- fallback?: ReactNode;
92
- country?: CountryISO;
93
- format?: PhoneNumberFormat;
94
- }
95
- declare function PhoneText({ phone, country, fallback, format, }: PhoneTextProps): null | ReactElement;
96
- interface SuspendedPhoneTextProps extends PhoneTextProps {
97
- suspenseFallback?: ReactNode;
98
- }
89
+ interface PhoneTextProps {
90
+ phone: unknown;
91
+ fallback?: ReactNode;
92
+ country?: CountryISO;
93
+ format?: PhoneNumberFormat;
94
+ }
95
+ declare function PhoneText({ phone, country, fallback, format, }: PhoneTextProps): null | ReactElement;
96
+ interface SuspendedPhoneTextProps extends PhoneTextProps {
97
+ suspenseFallback?: ReactNode;
98
+ }
99
99
  declare function SuspendedPhoneText({ suspenseFallback, ...props }: SuspendedPhoneTextProps): ReactElement;
100
100
 
101
101
  export { CountryISO, DEFAULT_COUNTRY, PhoneField, PhoneFieldProps, PhoneFormatOptions, PhoneLink, PhoneLinkProps, PhoneNumberFormat, PhoneNumberInfo, PhoneNumberPossibility, PhoneService, PhoneText, PhoneTextProps, PhoneValidationRules, SuspendedPhoneField, SuspendedPhoneFieldProps, SuspendedPhoneLink, SuspendedPhoneLinkProps, SuspendedPhoneText, SuspendedPhoneTextProps, formatCountry, getCountryCode, isCountryISO, listCountries, toCountryISO, useFormattedPhoneNumber, usePhoneService };
package/package.json CHANGED
@@ -1,34 +1,34 @@
1
- {
2
- "name": "@superdispatch/phones",
3
- "version": "0.21.8",
4
- "license": "MIT",
5
- "files": [
6
- "dist-*/",
7
- "bin/"
8
- ],
9
- "pika": true,
10
- "sideEffects": false,
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/superdispatch/ui.git"
14
- },
15
- "dependencies": {
16
- "@superdispatch/ui": "^0.21.8",
17
- "awesome-phonenumber": "^2.70.0",
18
- "clsx": "^1.1.1"
19
- },
20
- "peerDependencies": {
21
- "@babel/runtime": "^7.0.0",
22
- "@material-ui/core": "^4.7.2",
23
- "@material-ui/icons": "^4.5.1",
24
- "react": "^17.0.2"
25
- },
26
- "publishConfig": {
27
- "access": "public",
28
- "directory": "pkg"
29
- },
30
- "esnext": "dist-src/index.js",
31
- "module": "dist-web/index.js",
32
- "main": "dist-node/index.js",
33
- "types": "dist-types/index.d.ts"
34
- }
1
+ {
2
+ "name": "@superdispatch/phones",
3
+ "version": "0.21.14",
4
+ "license": "MIT",
5
+ "files": [
6
+ "dist-*/",
7
+ "bin/"
8
+ ],
9
+ "pika": true,
10
+ "sideEffects": false,
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/superdispatch/ui.git"
14
+ },
15
+ "dependencies": {
16
+ "@superdispatch/ui": "^0.21.14",
17
+ "awesome-phonenumber": "^2.70.0",
18
+ "clsx": "^1.1.1"
19
+ },
20
+ "peerDependencies": {
21
+ "@babel/runtime": "^7.0.0",
22
+ "@material-ui/core": "^4.7.2",
23
+ "@material-ui/icons": "^4.5.1",
24
+ "react": "^17.0.2"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public",
28
+ "directory": "pkg"
29
+ },
30
+ "esnext": "dist-src/index.js",
31
+ "module": "dist-web/index.js",
32
+ "main": "dist-node/index.js",
33
+ "types": "dist-types/index.d.ts"
34
+ }