react-native-country-select 0.1.1 → 0.1.3

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.
@@ -1,251 +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';
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';
@@ -1,10 +1,12 @@
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
- }
1
+ import {ICountry} from './country';
2
+ import {ICountrySelectStyle} from './countrySelectStyles';
3
+ import {ICountrySelectLanguages} from './countrySelectLanguages';
4
+
5
+ export interface ICountryItemProps {
6
+ item: ICountry;
7
+ onSelect: (country: ICountry) => void;
8
+ onClose: () => void;
9
+ language: ICountrySelectLanguages;
10
+ theme?: 'light' | 'dark';
11
+ countrySelectStyle?: ICountrySelectStyle;
12
+ }
@@ -1,34 +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
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
@@ -1,11 +1,31 @@
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
- }
1
+ import React from 'react';
2
+ import {ModalProps} from 'react-native';
3
+
4
+ import {ICountry} from './country';
5
+ import {ICountryCca2} from './countryCca2';
6
+ import {ISectionTitle} from './sectionTitle';
7
+ import {ICountrySelectStyle} from './countrySelectStyles';
8
+ import {ICountrySelectLanguages} from './countrySelectLanguages';
9
+
10
+ export interface ICountrySelectProps extends ModalProps {
11
+ visible: boolean;
12
+ onClose: () => void;
13
+ onSelect: (country: ICountry) => void;
14
+ countrySelectStyle?: ICountrySelectStyle;
15
+ theme?: 'light' | 'dark';
16
+ isFullScreen?: boolean;
17
+ popularCountries?: string[];
18
+ visibleCountries?: ICountryCca2[];
19
+ hiddenCountries?: ICountryCca2[];
20
+ language?: ICountrySelectLanguages;
21
+ showSearchInput?: boolean;
22
+ searchPlaceholder?: string;
23
+ disabledBackdropPress?: boolean;
24
+ removedBackdrop?: boolean;
25
+ onBackdropPress?: () => void;
26
+ countryItemComponent?: (item: ICountry) => React.ReactElement;
27
+ sectionTitleComponent?: (item: ISectionTitle) => React.ReactElement;
28
+ popularCountriesTitle?: string;
29
+ allCountriesTitle?: string;
30
+ showsVerticalScrollIndicator?: boolean;
31
+ }
@@ -0,0 +1,28 @@
1
+ import {StyleProp, TextStyle, ViewStyle} from 'react-native';
2
+
3
+ interface IBaseModalStyle {
4
+ backdrop?: StyleProp<ViewStyle>;
5
+ closeButton?: StyleProp<ViewStyle>;
6
+ closeButtonText?: StyleProp<TextStyle>;
7
+ searchContainer?: StyleProp<ViewStyle>;
8
+ searchInput?: StyleProp<TextStyle>;
9
+ searchInputPlaceholder?: {
10
+ color: string;
11
+ };
12
+ sectionTitle?: StyleProp<TextStyle>;
13
+ list?: StyleProp<ViewStyle>;
14
+ countryItem?: StyleProp<ViewStyle>;
15
+ flag?: StyleProp<TextStyle>;
16
+ countryInfo?: StyleProp<ViewStyle>;
17
+ callingCode?: StyleProp<TextStyle>;
18
+ countryName?: StyleProp<TextStyle>;
19
+ }
20
+
21
+ interface IPopupStyle extends IBaseModalStyle {
22
+ popupContainer?: StyleProp<ViewStyle>;
23
+ popupContent?: StyleProp<ViewStyle>;
24
+ }
25
+
26
+ export interface ICountrySelectStyle {
27
+ popup?: IPopupStyle;
28
+ }
@@ -1,9 +1,8 @@
1
- // Re-export all interfaces from their respective files
2
1
  export * from './countryCca2';
3
2
  export * from './countrySelectLanguages';
4
3
  export * from './country';
5
4
  export * from './countrySelectProps';
6
- export * from './countrySelectStyles';
7
5
  export * from './countryItemProps';
8
6
  export * from './sectionTitle';
9
7
  export * from './itemList';
8
+ export * from './countrySelectStyles';
@@ -0,0 +1,4 @@
1
+ import {ICountry} from './country';
2
+ import {ISectionTitle} from './sectionTitle';
3
+
4
+ export type IListItem = ICountry | ISectionTitle;
@@ -0,0 +1,4 @@
1
+ export type ISectionTitle = {
2
+ isSection: true;
3
+ title: string;
4
+ };