react-native-country-select 0.1.1

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/lib/index.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+
3
+ import {
4
+ ICountry,
5
+ ICountryCca2,
6
+ ICountryItemProps,
7
+ ICountrySelectProps,
8
+ ICountrySelectLanguages,
9
+ } from './interface';
10
+
11
+ declare const CountrySelect: React.FC<ICountrySelectProps>;
12
+
13
+ export default CountrySelect;
14
+
15
+ export {
16
+ ICountry,
17
+ ICountryCca2,
18
+ ICountryItemProps,
19
+ ICountrySelectProps,
20
+ ICountrySelectLanguages,
21
+ };
package/lib/index.tsx ADDED
@@ -0,0 +1,18 @@
1
+ import {CountrySelect} from './components';
2
+ import {
3
+ ICountry,
4
+ ICountryCca2,
5
+ ICountryItemProps,
6
+ ICountrySelectProps,
7
+ ICountrySelectLanguages,
8
+ } from './interface';
9
+
10
+ export default CountrySelect;
11
+
12
+ export type {
13
+ ICountry,
14
+ ICountryCca2,
15
+ ICountryItemProps,
16
+ ICountrySelectProps,
17
+ ICountrySelectLanguages,
18
+ };
@@ -0,0 +1,111 @@
1
+ import {ICountryCca2} from './countryCca2';
2
+
3
+ // Currency interface
4
+ export interface ICountryCurrency {
5
+ name: string;
6
+ symbol: string;
7
+ }
8
+
9
+ // Currencies object interface
10
+ export interface ICountryCurrencies {
11
+ [key: string]: ICountryCurrency | undefined;
12
+ }
13
+
14
+ // Demonym interface
15
+ export interface ICountryDemonym {
16
+ f: string;
17
+ m: string;
18
+ }
19
+
20
+ // Demonyms object interface
21
+ export interface ICountryDemonyms {
22
+ [key: string]: ICountryDemonym;
23
+ }
24
+
25
+ export interface ICountryNameTranslation {
26
+ official: string;
27
+ common: string;
28
+ }
29
+
30
+ export interface ICountryNativeName {
31
+ [key: string]: ICountryNameTranslation | undefined;
32
+ }
33
+
34
+ export interface ICountryName {
35
+ common: string;
36
+ official: string;
37
+ native: ICountryNativeName;
38
+ }
39
+
40
+ // Country name translation interface
41
+ export interface ICountryTranslations {
42
+ ara?: ICountryNameTranslation; // Arabic
43
+ bel?: ICountryNameTranslation; // Belarusian
44
+ bre?: ICountryNameTranslation; // Breton
45
+ bul?: ICountryNameTranslation; // Bulgarian
46
+ ces?: ICountryNameTranslation; // Czech
47
+ deu?: ICountryNameTranslation; // German
48
+ ell?: ICountryNameTranslation; // Greek
49
+ eng?: ICountryNameTranslation; // English
50
+ est?: ICountryNameTranslation; // Estonian
51
+ fin?: ICountryNameTranslation; // Finnish
52
+ fra?: ICountryNameTranslation; // French
53
+ heb?: ICountryNameTranslation; // Hebrew
54
+ hrv?: ICountryNameTranslation; // Croatian
55
+ hun?: ICountryNameTranslation; // Hungarian
56
+ ita?: ICountryNameTranslation; // Italian
57
+ jpn?: ICountryNameTranslation; // Japanese
58
+ kor?: ICountryNameTranslation; // Korean
59
+ nld?: ICountryNameTranslation; // Dutch
60
+ per?: ICountryNameTranslation; // Persian
61
+ pol?: ICountryNameTranslation; // Polish
62
+ por?: ICountryNameTranslation; // Portuguese
63
+ ron?: ICountryNameTranslation; // Romanian
64
+ rus?: ICountryNameTranslation; // Russian
65
+ slk?: ICountryNameTranslation; // Slovak
66
+ spa?: ICountryNameTranslation; // Spanish
67
+ srp?: ICountryNameTranslation; // Serbian
68
+ swe?: ICountryNameTranslation; // Swedish
69
+ tur?: ICountryNameTranslation; // Turkish
70
+ ukr?: ICountryNameTranslation; // Ukrainian
71
+ urd?: ICountryNameTranslation; // Urdu
72
+ zho?: ICountryNameTranslation; // Chinese
73
+ 'zho-Hans'?: ICountryNameTranslation; // Simplified Chinese
74
+ 'zho-Hant'?: ICountryNameTranslation; // Traditional Chinese
75
+ }
76
+
77
+ // Languages object interface
78
+ export interface ICountryLanguages {
79
+ [key: string]: string;
80
+ }
81
+
82
+ // Complete Country interface matching countries.json structure
83
+ export interface ICountry {
84
+ name: ICountryName;
85
+ tld: string[];
86
+ cca2: ICountryCca2;
87
+ ccn3: string;
88
+ cca3: string;
89
+ cioc: string;
90
+ independent: boolean;
91
+ status: string;
92
+ unMember: boolean;
93
+ unRegionalGroup: string;
94
+ currencies: ICountryCurrencies;
95
+ idd: {
96
+ root: string;
97
+ suffixes: string[];
98
+ };
99
+ capital: string[];
100
+ altSpellings: string[];
101
+ region: string;
102
+ subregion: string;
103
+ languages: ICountryLanguages;
104
+ translations: ICountryTranslations;
105
+ latlng: [number, number];
106
+ landlocked: boolean;
107
+ borders: string[];
108
+ area: number;
109
+ flag: string;
110
+ demonyms: ICountryDemonyms;
111
+ }
@@ -0,0 +1,251 @@
1
+ // Country code type (2 characters)
2
+ export type ICountryCca2 =
3
+ | 'AW'
4
+ | 'AF'
5
+ | 'AO'
6
+ | 'AI'
7
+ | 'AX'
8
+ | 'AL'
9
+ | 'AD'
10
+ | 'AE'
11
+ | 'AR'
12
+ | 'AM'
13
+ | 'AS'
14
+ | 'AQ'
15
+ | 'TF'
16
+ | 'AG'
17
+ | 'AU'
18
+ | 'AT'
19
+ | 'AZ'
20
+ | 'BI'
21
+ | 'BE'
22
+ | 'BJ'
23
+ | 'BF'
24
+ | 'BD'
25
+ | 'BG'
26
+ | 'BH'
27
+ | 'BS'
28
+ | 'BA'
29
+ | 'BL'
30
+ | 'BY'
31
+ | 'BZ'
32
+ | 'BM'
33
+ | 'BO'
34
+ | 'BR'
35
+ | 'BB'
36
+ | 'BN'
37
+ | 'BT'
38
+ | 'BV'
39
+ | 'BW'
40
+ | 'CF'
41
+ | 'CA'
42
+ | 'CC'
43
+ | 'CH'
44
+ | 'CL'
45
+ | 'CN'
46
+ | 'CI'
47
+ | 'CM'
48
+ | 'CD'
49
+ | 'CG'
50
+ | 'CK'
51
+ | 'CO'
52
+ | 'KM'
53
+ | 'CV'
54
+ | 'CR'
55
+ | 'CU'
56
+ | 'CW'
57
+ | 'CX'
58
+ | 'KY'
59
+ | 'CY'
60
+ | 'CZ'
61
+ | 'DE'
62
+ | 'DJ'
63
+ | 'DM'
64
+ | 'DK'
65
+ | 'DO'
66
+ | 'DZ'
67
+ | 'EC'
68
+ | 'EG'
69
+ | 'ER'
70
+ | 'EH'
71
+ | 'ES'
72
+ | 'EE'
73
+ | 'ET'
74
+ | 'FI'
75
+ | 'FJ'
76
+ | 'FK'
77
+ | 'FR'
78
+ | 'FO'
79
+ | 'FM'
80
+ | 'GA'
81
+ | 'GB'
82
+ | 'GE'
83
+ | 'GG'
84
+ | 'GH'
85
+ | 'GI'
86
+ | 'GN'
87
+ | 'GP'
88
+ | 'GM'
89
+ | 'GW'
90
+ | 'GQ'
91
+ | 'GR'
92
+ | 'GD'
93
+ | 'GL'
94
+ | 'GT'
95
+ | 'GF'
96
+ | 'GU'
97
+ | 'GY'
98
+ | 'HK'
99
+ | 'HM'
100
+ | 'HN'
101
+ | 'HR'
102
+ | 'HT'
103
+ | 'HU'
104
+ | 'ID'
105
+ | 'IM'
106
+ | 'IN'
107
+ | 'IO'
108
+ | 'IE'
109
+ | 'IR'
110
+ | 'IQ'
111
+ | 'IS'
112
+ | 'IL'
113
+ | 'IT'
114
+ | 'JM'
115
+ | 'JE'
116
+ | 'JO'
117
+ | 'JP'
118
+ | 'KZ'
119
+ | 'KE'
120
+ | 'KG'
121
+ | 'KH'
122
+ | 'KI'
123
+ | 'KN'
124
+ | 'KR'
125
+ | 'KW'
126
+ | 'LA'
127
+ | 'LB'
128
+ | 'LR'
129
+ | 'LY'
130
+ | 'LC'
131
+ | 'LI'
132
+ | 'LK'
133
+ | 'LS'
134
+ | 'LT'
135
+ | 'LU'
136
+ | 'LV'
137
+ | 'MO'
138
+ | 'MF'
139
+ | 'MA'
140
+ | 'MC'
141
+ | 'MD'
142
+ | 'MG'
143
+ | 'MV'
144
+ | 'MX'
145
+ | 'MH'
146
+ | 'MK'
147
+ | 'ML'
148
+ | 'MT'
149
+ | 'MM'
150
+ | 'ME'
151
+ | 'MN'
152
+ | 'MP'
153
+ | 'MZ'
154
+ | 'MR'
155
+ | 'MS'
156
+ | 'MQ'
157
+ | 'MU'
158
+ | 'MW'
159
+ | 'MY'
160
+ | 'YT'
161
+ | 'NA'
162
+ | 'NC'
163
+ | 'NE'
164
+ | 'NF'
165
+ | 'NG'
166
+ | 'NI'
167
+ | 'NU'
168
+ | 'NL'
169
+ | 'NO'
170
+ | 'NP'
171
+ | 'NR'
172
+ | 'NZ'
173
+ | 'OM'
174
+ | 'PK'
175
+ | 'PA'
176
+ | 'PN'
177
+ | 'PE'
178
+ | 'PH'
179
+ | 'PW'
180
+ | 'PG'
181
+ | 'PL'
182
+ | 'PR'
183
+ | 'KP'
184
+ | 'PT'
185
+ | 'PY'
186
+ | 'PS'
187
+ | 'PF'
188
+ | 'QA'
189
+ | 'RE'
190
+ | 'RO'
191
+ | 'RU'
192
+ | 'RW'
193
+ | 'SA'
194
+ | 'SD'
195
+ | 'SN'
196
+ | 'SG'
197
+ | 'GS'
198
+ | 'SH'
199
+ | 'SJ'
200
+ | 'SB'
201
+ | 'SL'
202
+ | 'SV'
203
+ | 'SM'
204
+ | 'SO'
205
+ | 'PM'
206
+ | 'RS'
207
+ | 'SS'
208
+ | 'ST'
209
+ | 'SR'
210
+ | 'SK'
211
+ | 'SI'
212
+ | 'SE'
213
+ | 'SZ'
214
+ | 'SX'
215
+ | 'SC'
216
+ | 'SY'
217
+ | 'TC'
218
+ | 'TD'
219
+ | 'TG'
220
+ | 'TH'
221
+ | 'TJ'
222
+ | 'TK'
223
+ | 'TM'
224
+ | 'TL'
225
+ | 'TO'
226
+ | 'TT'
227
+ | 'TN'
228
+ | 'TR'
229
+ | 'TV'
230
+ | 'TW'
231
+ | 'TZ'
232
+ | 'UG'
233
+ | 'UA'
234
+ | 'UM'
235
+ | 'UY'
236
+ | 'US'
237
+ | 'UZ'
238
+ | 'VA'
239
+ | 'VC'
240
+ | 'VE'
241
+ | 'VG'
242
+ | 'VI'
243
+ | 'VN'
244
+ | 'VU'
245
+ | 'WF'
246
+ | 'WS'
247
+ | 'XK'
248
+ | 'YE'
249
+ | 'ZA'
250
+ | 'ZM'
251
+ | 'ZW';
@@ -0,0 +1,10 @@
1
+ import {ICountry} from './country';
2
+ import {ICountrySelectLanguages} from './countrySelectLanguages';
3
+
4
+ export interface ICountryItemProps {
5
+ item: ICountry;
6
+ onSelect: (country: ICountry) => void;
7
+ onClose: () => void;
8
+ language: ICountrySelectLanguages;
9
+ theme?: 'light' | 'dark';
10
+ }
@@ -0,0 +1,34 @@
1
+ export type ICountrySelectLanguages =
2
+ | 'ara' // Arabic
3
+ | 'bel' // Belarusian
4
+ | 'bre' // Breton
5
+ | 'bul' // Bulgarian
6
+ | 'ces' // Czech
7
+ | 'deu' // German
8
+ | 'ell' // Greek
9
+ | 'eng' // English
10
+ | 'est' // Estonian
11
+ | 'fin' // Finnish
12
+ | 'fra' // French
13
+ | 'heb' // Hebrew
14
+ | 'hrv' // Croatian
15
+ | 'hun' // Hungarian
16
+ | 'ita' // Italian
17
+ | 'jpn' // Japanese
18
+ | 'kor' // Korean
19
+ | 'nld' // Dutch
20
+ | 'per' // Persian
21
+ | 'pol' // Polish
22
+ | 'por' // Portuguese
23
+ | 'ron' // Romanian
24
+ | 'rus' // Russian
25
+ | 'slk' // Slovak
26
+ | 'spa' // Spanish
27
+ | 'srp' // Serbian
28
+ | 'swe' // Swedish
29
+ | 'tur' // Turkish
30
+ | 'ukr' // Ukrainian
31
+ | 'urd' // Urdu
32
+ | 'zho' // Chinese
33
+ | 'zho-Hans' // Simplified Chinese
34
+ | 'zho-Hant'; // Traditional Chinese
@@ -0,0 +1,11 @@
1
+ import {ModalProps} from 'react-native';
2
+ import {ICountry} from './country';
3
+ import {ICountrySelectLanguages} from './countrySelectLanguages';
4
+
5
+ export interface ICountrySelectProps extends ModalProps {
6
+ visible: boolean;
7
+ onClose: () => void;
8
+ onSelect: (country: ICountry) => void;
9
+ theme?: 'light' | 'dark';
10
+ language?: ICountrySelectLanguages;
11
+ }
@@ -0,0 +1,9 @@
1
+ // Re-export all interfaces from their respective files
2
+ export * from './countryCca2';
3
+ export * from './countrySelectLanguages';
4
+ export * from './country';
5
+ export * from './countrySelectProps';
6
+ export * from './countrySelectStyles';
7
+ export * from './countryItemProps';
8
+ export * from './sectionTitle';
9
+ export * from './itemList';
@@ -0,0 +1,45 @@
1
+ import {ICountrySelectLanguages} from '../interface';
2
+
3
+ type TranslationKey = 'searchPlaceholder';
4
+ type TranslationMap = Record<
5
+ TranslationKey,
6
+ Record<ICountrySelectLanguages, string>
7
+ >;
8
+
9
+ export const translations: TranslationMap = {
10
+ searchPlaceholder: {
11
+ ara: 'البحث عن بلد...',
12
+ bel: 'Пошук краіны...',
13
+ bre: 'Klask bro...',
14
+ bul: 'Търсене на държава...',
15
+ ces: 'Hledat zemi...',
16
+ deu: 'Land suchen...',
17
+ ell: 'Αναζήτηση χώρας...',
18
+ eng: 'Search country...',
19
+ est: 'Otsi riiki...',
20
+ fin: 'Etsi maata...',
21
+ fra: 'Rechercher un pays...',
22
+ heb: 'חיפוש מדינה...',
23
+ hrv: 'Pretraži državu...',
24
+ hun: 'Ország keresése...',
25
+ ita: 'Cerca paese...',
26
+ jpn: '国を検索...',
27
+ kor: '국가 검색...',
28
+ nld: 'Zoek land...',
29
+ per: 'جستجوی کشور...',
30
+ pol: 'Szukaj kraju...',
31
+ por: 'Buscar país...',
32
+ ron: 'Căutare țară...',
33
+ rus: 'Поиск страны...',
34
+ slk: 'Hľadať krajinu...',
35
+ spa: 'Buscar país...',
36
+ srp: 'Претрага државе...',
37
+ swe: 'Sök land...',
38
+ tur: 'Ülke ara...',
39
+ ukr: 'Пошук країни...',
40
+ urd: '...ملک تلاش کریں',
41
+ zho: '搜索国家...',
42
+ 'zho-Hans': '搜索国家...',
43
+ 'zho-Hant': '搜尋國家...',
44
+ },
45
+ } as const;
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "react-native-country-select",
3
+ "version": "0.1.1",
4
+ "description": "🌍 A lightweight and customizable country picker for React Native with modern UI, flags, search engine, and i18n support. Includes TypeScript types, offline support and no dependencies.",
5
+ "main": "lib/index.tsx",
6
+ "types": "lib/index.d.ts",
7
+ "keywords": [
8
+ "react-native",
9
+ "cross-platform",
10
+ "ios",
11
+ "android",
12
+ "web",
13
+ "flags",
14
+ "countries",
15
+ "country-picker",
16
+ "country-select",
17
+ "country-codes",
18
+ "i18n",
19
+ "international",
20
+ "offline-support",
21
+ "custom-lib"
22
+ ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/AstrOOnauta/react-native-country-select.git"
26
+ },
27
+ "author": "AstrOOnauta (https://github.com/AstrOOnauta)",
28
+ "license": "ISC",
29
+ "bugs": {
30
+ "url": "https://github.com/AstrOOnauta/react-native-country-select/issues"
31
+ },
32
+ "homepage": "https://github.com/AstrOOnauta/react-native-country-select#readme",
33
+ "publishConfig": {
34
+ "registry": "https://registry.npmjs.org/"
35
+ },
36
+ "dependencies": {},
37
+ "devDependencies": {},
38
+ "peerDependencies": {
39
+ "react": "*",
40
+ "react-native": "*"
41
+ }
42
+ }