@longline/aqua-ui 1.0.187 → 1.0.188

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.
@@ -0,0 +1,2 @@
1
+ declare const Countries: Record<string, string[]>;
2
+ export { Countries };
@@ -0,0 +1,262 @@
1
+ var Countries = {
2
+ "AC": ["Ascension Island"],
3
+ "AD": ["Andorra", "Andorran"],
4
+ "AE": ["United Arab Emirates", "UAE", "Emirati"],
5
+ "AF": ["Afghanistan", "Afghan"],
6
+ "AG": ["Antigua and Barbuda", "Antiguan, Barbudan"],
7
+ "AI": ["Anguilla", "Anguillian"],
8
+ "AL": ["Albania", "Albanian"],
9
+ "AM": ["Armenia", "Armenian"],
10
+ "AN": ["Netherlands Antilles"],
11
+ "AO": ["Angola", "Angolan"],
12
+ "AQ": ["Antarctica", "Antarctican"],
13
+ "AR": ["Argentina", "Argentine"],
14
+ "AS": ["American Samoa", "American Samoan"],
15
+ "AT": ["Austria", "Austrian"],
16
+ "AU": ["Australia", "Australian"],
17
+ "AW": ["Aruba", "Aruban"],
18
+ "AX": ["Åland Islands", "Ålandish"],
19
+ "AZ": ["Azerbaijan", "Azerbaijani"],
20
+ "BA": ["Bosnia and Herzegovina", "Bosnian, Herzegovinian"],
21
+ "BB": ["Barbados", "Barbadian"],
22
+ "BD": ["Bangladesh", "Bangladeshi"],
23
+ "BE": ["Belgium", "Belgian"],
24
+ "BF": ["Burkina Faso", "Burkinabe"],
25
+ "BG": ["Bulgaria", "Bulgarian"],
26
+ "BH": ["Bahrain", "Bahraini"],
27
+ "BI": ["Burundi", "Burundian"],
28
+ "BJ": ["Benin", "Beninese"],
29
+ "BL": ["Saint Barthélemy", "Barthélemois", "Saint Barth"],
30
+ "BM": ["Bermuda", "Bermudian"],
31
+ "BN": ["Brunei Darussalam", "Bruneian"],
32
+ "BO": ["Bolivia, Plurinational State of", "Bolivian"],
33
+ "BR": ["Brazil", "Brazilian"],
34
+ "BS": ["Bahamas", "Bahamian"],
35
+ "BT": ["Bhutan", "Bhutanese"],
36
+ "BQ": ["Caribbean Netherlands"],
37
+ "BV": ["Bouvet Island"],
38
+ "BW": ["Botswana", "Motswana"],
39
+ "BY": ["Belarus", "Belarusian"],
40
+ "BZ": ["Belize", "Belizean"],
41
+ "CA": ["Canada", "Canadian"],
42
+ "CC": ["Cocos (Keeling) Islands", "Cocos Islander"],
43
+ "CD": ["Congo, The Democratic Republic of the"],
44
+ "CF": ["Central African Republic", "Central African"],
45
+ "CG": ["Congo"],
46
+ "CH": ["Switzerland", "Swiss"],
47
+ "CI": ["Cote D'Ivoire", "Côte d'Ivoire", "Ivorian"],
48
+ "CK": ["Cook Islands", "Cook Islander"],
49
+ "CL": ["Chile", "Chilean"],
50
+ "CM": ["Cameroon", "Cameroonian"],
51
+ "CN": ["China", "Chinese"],
52
+ "CO": ["Colombia", "Colombian"],
53
+ "CP": ["Clipperton Island"],
54
+ "CR": ["Costa Rica", "Costa Rican"],
55
+ "CU": ["Cuba", "Cuban"],
56
+ "CV": ["Cape Verde", "Cape Verdian"],
57
+ "CW": ["Curaçao", "Curaçaoan"],
58
+ "CX": ["Christmas Island", "Christmas Islander"],
59
+ "CY": ["Cyprus", "Cypriot"],
60
+ "CZ": ["Czechia", "Czech Republic", "Czech"],
61
+ "DE": ["Germany", "German"],
62
+ "DG": ["Diego Garcia"],
63
+ "DJ": ["Djibouti"],
64
+ "DK": ["Denmark", "Danish"],
65
+ "DM": ["Dominica"],
66
+ "DO": ["Dominican Republic"],
67
+ "DZ": ["Algeria", "Algerian"],
68
+ "EA": ["Ceuta, Melilla"],
69
+ "EC": ["Ecuador", "Ecuadorean"],
70
+ "EE": ["Estonia", "Estonian"],
71
+ "EG": ["Egypt", "Egyptian"],
72
+ "EH": ["Western Sahara", "Sahrawi"],
73
+ "ER": ["Eritrea", "Eritrean"],
74
+ "ES": ["Spain", "Spanish"],
75
+ "ET": ["Ethiopia", "Ethiopian"],
76
+ "EU": ["European Union"],
77
+ "FI": ["Finland", "Finnish"],
78
+ "FJ": ["Fiji", "Fijian"],
79
+ "FK": ["Falkland Islands (Malvinas)", "Falkland Islander"],
80
+ "FM": ["Micronesia, Federated States of", "Micronesian"],
81
+ "FO": ["Faroe Islands", "Faroese"],
82
+ "FR": ["France", "French"],
83
+ "GA": ["Gabon", "Gabonese"],
84
+ "GB": ["United Kingdom", "UK", "British"],
85
+ "GD": ["Grenada", "Grenadian"],
86
+ "GE": ["Georgia", "Georgian"],
87
+ "GF": ["French Guiana", "Guianan"],
88
+ "GG": ["Guernsey"],
89
+ "GH": ["Ghana", "Ghanaian"],
90
+ "GI": ["Gibraltar"],
91
+ "GL": ["Greenland", "Greenlandic"],
92
+ "GM": ["Gambia", "Gambian"],
93
+ "GN": ["Guinea", "Guinean"],
94
+ "GP": ["Guadeloupe", "Guadeloupian"],
95
+ "GQ": ["Equatorial Guinea", "Equatorial Guinean"],
96
+ "GR": ["Greece", "Greek"],
97
+ "GS": ["South Georgia and the South Sandwich Islands", "South Georgian South Sandwich Islander"],
98
+ "GT": ["Guatemala", "Guatemalan"],
99
+ "GU": ["Guam", "Guamanian"],
100
+ "GW": ["Guinea-Bissau", "Guinea-Bissauan"],
101
+ "GY": ["Guyana", "Guyanese"],
102
+ "HK": ["Hong Kong", "Hong Konger"],
103
+ "HM": ["Heard Island and Mcdonald Islands", "Heard and McDonald Islander"],
104
+ "HN": ["Honduras", "Honduran"],
105
+ "HR": ["Croatia", "Croatian"],
106
+ "HT": ["Haiti", "Haitian"],
107
+ "HU": ["Hungary", "Hungarian"],
108
+ "IC": ["Canary Islands", "Canarian"],
109
+ "ID": ["Indonesia", "Indonesian"],
110
+ "IE": ["Ireland", "Irish"],
111
+ "IL": ["Israel", "Israeli"],
112
+ "IM": ["Isle of Man", "Manx"],
113
+ "IN": ["India", "Indian"],
114
+ "IO": ["British Indian Ocean Territory"],
115
+ "IQ": ["Iraq", "Iraqi"],
116
+ "IR": ["Iran, Islamic Republic Of", "Iranian"],
117
+ "IS": ["Iceland", "Icelander"],
118
+ "IT": ["Italy", "Italian"],
119
+ "JE": ["Jersey"],
120
+ "JM": ["Jamaica", "Jamaican"],
121
+ "JO": ["Jordan", "Jordanian"],
122
+ "JP": ["Japan", "Japanese"],
123
+ "KE": ["Kenya", "Kenyan"],
124
+ "KG": ["Kyrgyzstan", "Kirghiz"],
125
+ "KH": ["Cambodia", "Cambodian"],
126
+ "KI": ["Kiribati", "I-Kiribati"],
127
+ "KM": ["Comoros", "Comoran"],
128
+ "KN": ["Saint Kitts and Nevis", "Kittitian or Nevisian"],
129
+ "KP": ["Korea, Democratic People's Republic of", "North Korea", "North Korean", "DPRK"],
130
+ "KR": ["Korea, Republic of", "South Korea", "South Korean"],
131
+ "KW": ["Kuwait", "Kuwaiti"],
132
+ "KY": ["Cayman Islands", "Caymanian"],
133
+ "KZ": ["Kazakhstan", "Kazakhstani"],
134
+ "LA": ["Lao People's Democratic Republic", "Laos", "Laotian"],
135
+ "LB": ["Lebanon", "Lebanese"],
136
+ "LC": ["Saint Lucia", "Saint Lucian"],
137
+ "LI": ["Liechtenstein", "Liechtensteiner"],
138
+ "LK": ["Sri Lanka", "Sri Lankan"],
139
+ "LR": ["Liberia", "Liberian"],
140
+ "LS": ["Lesotho", "Mosotho"],
141
+ "LT": ["Lithuania", "Lithuanian"],
142
+ "LU": ["Luxembourg", "Luxembourger"],
143
+ "LV": ["Latvia", "Latvian"],
144
+ "LY": ["Libyan Arab Jamahiriya", "Libya", "Libyan"],
145
+ "MA": ["Morocco", "Moroccan"],
146
+ "MC": ["Monaco", "Monegasque"],
147
+ "MD": ["Moldova, Republic of", "Moldovan"],
148
+ "ME": ["Montenegro", "Montenegrin"],
149
+ "MF": ["Saint Martin", "Saint-Martinois"],
150
+ "MG": ["Madagascar", "Malagasy"],
151
+ "MH": ["Marshall Islands", "Marshallese"],
152
+ "MK": ["Republic of North Macedonia", "North Macedonia", "Macedonia, The Former Yugoslav Republic of", "Macedonian"],
153
+ "ML": ["Mali", "Malian"],
154
+ "MM": ["Myanmar", "Burma", "Burmese"],
155
+ "MN": ["Mongolia", "Mongolian"],
156
+ "MO": ["Macao", "Macau", "Macanese"],
157
+ "MP": ["Northern Mariana Islands"],
158
+ "MQ": ["Martinique"],
159
+ "MR": ["Mauritania", "Mauritanian"],
160
+ "MS": ["Montserrat", "Montserratian"],
161
+ "MT": ["Malta", "Maltese"],
162
+ "MU": ["Mauritius", "Mauritian"],
163
+ "MV": ["Maldives", "Maldivan"],
164
+ "MW": ["Malawi", "Malawian"],
165
+ "MX": ["Mexico", "Mexican"],
166
+ "MY": ["Malaysia", "Malaysian"],
167
+ "MZ": ["Mozambique", "Mozambican"],
168
+ "NA": ["Namibia", "Namibian"],
169
+ "NC": ["New Caledonia", "New Caledonian"],
170
+ "NE": ["Niger", "Nigerien"],
171
+ "NF": ["Norfolk Island", "Norfolk Islander"],
172
+ "NG": ["Nigeria", "Nigerian"],
173
+ "NI": ["Nicaragua", "Nicaraguan"],
174
+ "NL": ["Netherlands", "Dutch"],
175
+ "NO": ["Norway", "Norwegian"],
176
+ "NP": ["Nepal", "Nepalese"],
177
+ "NR": ["Nauru", "Nauruan"],
178
+ "NU": ["Niue", "Niuean"],
179
+ "NZ": ["New Zealand", "New Zealander"],
180
+ "OM": ["Oman", "Omani"],
181
+ "PA": ["Panama", "Panamanian"],
182
+ "PE": ["Peru", "Peruvian"],
183
+ "PF": ["French Polynesia", "French Polynesian"],
184
+ "PG": ["Papua New Guinea", "Papua New Guinean"],
185
+ "PH": ["Philippines", "Filipino"],
186
+ "PK": ["Pakistan", "Pakistani"],
187
+ "PL": ["Poland", "Polish"],
188
+ "PM": ["Saint Pierre and Miquelon"],
189
+ "PN": ["Pitcairn", "Pitcairn Islands", "Pitcairn Islander"],
190
+ "PR": ["Puerto Rico", "Puerto Rican"],
191
+ "PS": ["Palestinian Territory, Occupied", "Palestine", "Palestinian"],
192
+ "PT": ["Portugal", "Portuguese"],
193
+ "PW": ["Palau", "Palauan"],
194
+ "PY": ["Paraguay", "Paraguayan"],
195
+ "QA": ["Qatar", "Qatari"],
196
+ "RE": ["Reunion", "Réunion"],
197
+ "RO": ["Romania", "Romanian"],
198
+ "RS": ["Serbia", "Serbian"],
199
+ "RU": ["Russian Federation", "Russia", "Russian"],
200
+ "RW": ["Rwanda", "Rwandan"],
201
+ "SA": ["Saudi Arabia", "Saudi Arabian"],
202
+ "SB": ["Solomon Islands", "Solomon Islander"],
203
+ "SC": ["Seychelles", "Seychellois"],
204
+ "SD": ["Sudan", "Sudanese"],
205
+ "SE": ["Sweden", "Swedish"],
206
+ "SG": ["Singapore", "Singaporean"],
207
+ "SH": ["Saint Helena", "Saint Helenian"],
208
+ "SI": ["Slovenia", "Slovene"],
209
+ "SJ": ["Svalbard and Jan Mayen"],
210
+ "SK": ["Slovakia", "Slovak"],
211
+ "SL": ["Sierra Leone", "Sierra Leonean"],
212
+ "SM": ["San Marino", "Sammarinese"],
213
+ "SN": ["Senegal", "Senegalese"],
214
+ "SO": ["Somalia", "Somali"],
215
+ "SR": ["Suriname", "Surinamer"],
216
+ "SS": ["Republic of South Sudan", "South Sudan", "South Sudanese"],
217
+ "ST": ["Sao Tome and Principe", "São Tomé and Príncipe", "Sao Tomean"],
218
+ "SV": ["El Salvador", "Salvadoran"],
219
+ "SX": ["Sint Maarten", "Sint Maartener"],
220
+ "SY": ["Syrian Arab Republic", "Syria", "Syrian"],
221
+ "SZ": ["Eswatini", "Swaziland", "Swazi"],
222
+ "TA": ["Tristan da Cunha"],
223
+ "TC": ["Turks and Caicos Islands", "Turks and Caicos Islander"],
224
+ "TD": ["Chad", "Chadian"],
225
+ "TF": ["French Southern Territories"],
226
+ "TG": ["Togo", "Togolese"],
227
+ "TH": ["Thailand", "Thai"],
228
+ "TJ": ["Tajikistan", "Tadzhik"],
229
+ "TK": ["Tokelau", "Tokelauan"],
230
+ "TL": ["Timor-Leste", "East Timorese"],
231
+ "TM": ["Turkmenistan", "Turkmen"],
232
+ "TN": ["Tunisia", "Tunisian"],
233
+ "TO": ["Tonga", "Tongan"],
234
+ "TR": ["Türkiye", "Turkey", "Turkish"],
235
+ "TT": ["Trinidad and Tobago", "Trinidadian"],
236
+ "TV": ["Tuvalu", "Tuvaluan"],
237
+ "TW": ["Taiwan", "Taiwanese"],
238
+ "TZ": ["Tanzania, United Republic of", "Tanzanian"],
239
+ "UA": ["Ukraine", "Ukrainian"],
240
+ "UG": ["Uganda", "Ugandan"],
241
+ "UM": ["United States Minor Outlying Islands"],
242
+ "UN": ["United Nations"],
243
+ "US": ["United States", "USA", "US", "American"],
244
+ "UY": ["Uruguay", "Uruguayan"],
245
+ "UZ": ["Uzbekistan", "Uzbekistani"],
246
+ "VA": ["Holy See (Vatican City State)", "Vatican"],
247
+ "VC": ["Saint Vincent and the Grenadines", "Saint Vincentian"],
248
+ "VE": ["Venezuela", "Venezuelan"],
249
+ "VG": ["Virgin Islands, British"],
250
+ "VI": ["Virgin Islands, U.S."],
251
+ "VN": ["Vietnam", "Viet Nam", "Vietnamese"],
252
+ "VU": ["Vanuatu", "Ni-Vanuatu"],
253
+ "WF": ["Wallis and Futuna", "Wallis and Futuna Islander"],
254
+ "WS": ["Samoa", "Samoan"],
255
+ "XK": ["Kosovo", "Kosovar"],
256
+ "YE": ["Yemen", "Yemeni"],
257
+ "YT": ["Mayotte", "Mahoran"],
258
+ "ZA": ["South Africa", "South African"],
259
+ "ZM": ["Zambia", "Zambian"],
260
+ "ZW": ["Zimbabwe", "Zimbabwean"]
261
+ };
262
+ export { Countries };
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ interface IProps {
3
+ /**
4
+ * The country code (e.g. "FR") or name (e.g. "France") to format.
5
+ */
6
+ value: string;
7
+ /**
8
+ * The type of output to return. This can be either `flag` (to show a flag),
9
+ * `name` (to show the country name), or `both` (to show both the flag and
10
+ * name).
11
+ * @default both
12
+ */
13
+ type?: 'flag' | 'name' | 'both';
14
+ }
15
+ /**
16
+ * The `Country` formatter takes a country code or name and produces either
17
+ * an emoji flag, the country name, or both, depending on the `type` prop.
18
+ */
19
+ declare const Country: ({ value, type }: IProps) => React.JSX.Element;
20
+ export { Country };
@@ -0,0 +1,29 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import * as React from 'react';
6
+ import styled from 'styled-components';
7
+ import { CountryUtil } from './CountryUtil';
8
+ /**
9
+ * The `Country` formatter takes a country code or name and produces either
10
+ * an emoji flag, the country name, or both, depending on the `type` prop.
11
+ */
12
+ var Country = function (_a) {
13
+ var value = _a.value, _b = _a.type, type = _b === void 0 ? 'both' : _b;
14
+ switch (type) {
15
+ case 'flag':
16
+ return React.createElement(Flag, null, CountryUtil.getFlag(value));
17
+ case 'name':
18
+ return React.createElement(Name, null, CountryUtil.getName(value));
19
+ default:
20
+ return (React.createElement(FlagAndCountry, null,
21
+ React.createElement(Flag, null, CountryUtil.getFlag(value)),
22
+ React.createElement(Name, null, CountryUtil.getName(value))));
23
+ }
24
+ };
25
+ var Flag = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: \"Twemoji Country Flags\", \"Helvetica\", \"Comic Sans\", serif;\n"], ["\n font-family: \"Twemoji Country Flags\", \"Helvetica\", \"Comic Sans\", serif;\n"])));
26
+ var Name = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n text-overflow: ellipsis;\n overflow: hidden; \n"], ["\n text-overflow: ellipsis;\n overflow: hidden; \n"])));
27
+ var FlagAndCountry = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n gap: 6px;\n align-items: center;\n"], ["\n display: flex;\n flex-direction: row;\n gap: 6px;\n align-items: center;\n"])));
28
+ export { Country };
29
+ var templateObject_1, templateObject_2, templateObject_3;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Utility class for country code and name conversions, flag emoji generation,
3
+ * and fuzzy string matching for user input.
4
+ */
5
+ declare class CountryUtil {
6
+ /**
7
+ * Normalizes country name formatting for names like
8
+ * "Virgin Islands, British" → "British Virgin Islands".
9
+ *
10
+ * @param name - Raw country name.
11
+ * @returns Normalized country name, or the original string if no formatting was needed.
12
+ */
13
+ static normalizeOutput: (name: string) => string;
14
+ /**
15
+ * Cleans and normalizes country names by:
16
+ * - Replacing ampersands with "and"
17
+ * - Removing diacritics
18
+ * - Reformatting comma-separated names
19
+ *
20
+ * @param name - Country name to normalize.
21
+ * @returns A normalized name used for fuzzy matching.
22
+ */
23
+ static normalizeName: (name: string) => string;
24
+ /**
25
+ * Performs a fuzzy comparison between two country names.
26
+ * Handles partial matches and normalization like:
27
+ * - "UK" vs "United Kingdom"
28
+ * - "Vatican" vs "Holy See (Vatican City State)"
29
+ *
30
+ * @param input - User input or free-form name.
31
+ * @param name - Official or alternative country name.
32
+ * @returns `true` if the two names match fuzzily; otherwise, `false`.
33
+ */
34
+ static fuzzyCompare: (input: string, name: string) => boolean;
35
+ /**
36
+ * Converts a full country name or common alias to its ISO 3166-1 alpha-2 code.
37
+ * Special-cases like "UK" are mapped to "GB".
38
+ *
39
+ * @param value - Country name or 2-letter ISO code.
40
+ * @returns The matching ISO code, or `null` if ambiguous or not found.
41
+ */
42
+ static nameToCode: (value: string) => string;
43
+ /**
44
+ * Returns the primary name associated with a given ISO country code.
45
+ *
46
+ * @param code - ISO 3166-1 alpha-2 code (e.g. "FR").
47
+ * @returns The display country name, or `undefined` if not found.
48
+ */
49
+ static codeToName: (code: string) => string;
50
+ /**
51
+ * Resolves a country name or code into a standardized display name.
52
+ *
53
+ * @param value - A country name or ISO code.
54
+ * @returns Country name, or `null` if not matched.
55
+ */
56
+ static getName: (value: string) => string;
57
+ /**
58
+ * Returns the Unicode flag emoji for a given country name or ISO code.
59
+ *
60
+ * Example: "FR" → 🇫🇷
61
+ *
62
+ * @param value - Country name or ISO code.
63
+ * @returns Flag emoji string, or `null` if not matched.
64
+ */
65
+ static getFlag: (value: string) => string;
66
+ }
67
+ export { CountryUtil };
@@ -0,0 +1,159 @@
1
+ import { Countries } from './Countries';
2
+ // Polyfill for country flag emojis in environments that don't support them
3
+ // natively.
4
+ // See https://www.npmjs.com/package/country-flag-emoji-polyfill
5
+ import { polyfillCountryFlagEmojis } from "country-flag-emoji-polyfill";
6
+ polyfillCountryFlagEmojis();
7
+ var CODE_RE = /^[a-z]{2}$/i;
8
+ var MAGIC_NUMBER = 0x1F1E6 - 65; // Base offset for regional indicator symbols
9
+ /**
10
+ * Utility class for country code and name conversions, flag emoji generation,
11
+ * and fuzzy string matching for user input.
12
+ */
13
+ var CountryUtil = /** @class */ (function () {
14
+ function CountryUtil() {
15
+ }
16
+ var _a;
17
+ _a = CountryUtil;
18
+ /**
19
+ * Normalizes country name formatting for names like
20
+ * "Virgin Islands, British" → "British Virgin Islands".
21
+ *
22
+ * @param name - Raw country name.
23
+ * @returns Normalized country name, or the original string if no formatting was needed.
24
+ */
25
+ CountryUtil.normalizeOutput = function (name) {
26
+ if (!name)
27
+ return name;
28
+ if (name.includes(", ")) {
29
+ name = name.split(", ").reverse().join(' ');
30
+ }
31
+ return name;
32
+ };
33
+ /**
34
+ * Cleans and normalizes country names by:
35
+ * - Replacing ampersands with "and"
36
+ * - Removing diacritics
37
+ * - Reformatting comma-separated names
38
+ *
39
+ * @param name - Country name to normalize.
40
+ * @returns A normalized name used for fuzzy matching.
41
+ */
42
+ CountryUtil.normalizeName = function (name) {
43
+ if (!name)
44
+ return name;
45
+ // Replace & with and
46
+ name = name.replace(/\s*&\s*/g, ' and ');
47
+ // Replace diacritics with their base characters
48
+ name = name.normalize('NFD').replace(/[\u0300-\u036F]/g, '');
49
+ name = _a.normalizeOutput(name);
50
+ return name;
51
+ };
52
+ /**
53
+ * Performs a fuzzy comparison between two country names.
54
+ * Handles partial matches and normalization like:
55
+ * - "UK" vs "United Kingdom"
56
+ * - "Vatican" vs "Holy See (Vatican City State)"
57
+ *
58
+ * @param input - User input or free-form name.
59
+ * @param name - Official or alternative country name.
60
+ * @returns `true` if the two names match fuzzily; otherwise, `false`.
61
+ */
62
+ CountryUtil.fuzzyCompare = function (input, name) {
63
+ name = name.toLowerCase();
64
+ input = input.toLowerCase();
65
+ // Cases like:
66
+ // "Vatican" <-> "Holy See (Vatican City State)"
67
+ // "Russia" <-> "Russian Federation"
68
+ if (name.includes(input) || input.includes(name)) {
69
+ return true;
70
+ }
71
+ var normalizedName = _a.normalizeName(name);
72
+ var normalizedInput = _a.normalizeName(input);
73
+ // Cases like:
74
+ // "British Virgin Islands" <-> "Virgin Islands, British"
75
+ // "Republic of Moldova" <-> "Moldova, Republic of"
76
+ // "Trinidad & Tobago" <-> "Trinidad and Tobago"
77
+ if (normalizedName !== name || normalizedInput !== input) {
78
+ if (normalizedName.includes(normalizedInput) || normalizedInput.includes(normalizedName)) {
79
+ return true;
80
+ }
81
+ }
82
+ return false;
83
+ };
84
+ /**
85
+ * Converts a full country name or common alias to its ISO 3166-1 alpha-2 code.
86
+ * Special-cases like "UK" are mapped to "GB".
87
+ *
88
+ * @param value - Country name or 2-letter ISO code.
89
+ * @returns The matching ISO code, or `null` if ambiguous or not found.
90
+ */
91
+ CountryUtil.nameToCode = function (value) {
92
+ if (!value)
93
+ return null;
94
+ // Is this already a country code?
95
+ // (UK is an exception, as it must map to "GB").
96
+ if (CODE_RE.test(value) && value !== 'UK')
97
+ return value;
98
+ value = value.trim().toLowerCase();
99
+ // Look for exact match
100
+ for (var _i = 0, _b = Object.entries(Countries); _i < _b.length; _i++) {
101
+ var _c = _b[_i], code = _c[0], names = _c[1];
102
+ if (names.some(function (n) { return n.toLowerCase() === value; })) {
103
+ return code;
104
+ }
105
+ }
106
+ // Look for inexact match
107
+ var matches = Object.keys(Countries)
108
+ .filter(function (code) {
109
+ return Countries[code].some(function (n) { return _a.fuzzyCompare(value, n); });
110
+ });
111
+ // Return only when exactly one match was found
112
+ // prevents cases like "United"
113
+ if (matches.length === 1) {
114
+ return matches[0];
115
+ }
116
+ return null;
117
+ };
118
+ /**
119
+ * Returns the primary name associated with a given ISO country code.
120
+ *
121
+ * @param code - ISO 3166-1 alpha-2 code (e.g. "FR").
122
+ * @returns The display country name, or `undefined` if not found.
123
+ */
124
+ CountryUtil.codeToName = function (code) {
125
+ var _b;
126
+ return _a.normalizeOutput((_b = Countries[code.toUpperCase()]) === null || _b === void 0 ? void 0 : _b[0]);
127
+ };
128
+ /**
129
+ * Resolves a country name or code into a standardized display name.
130
+ *
131
+ * @param value - A country name or ISO code.
132
+ * @returns Country name, or `null` if not matched.
133
+ */
134
+ CountryUtil.getName = function (value) {
135
+ var code = _a.nameToCode(value);
136
+ if (!code)
137
+ return null;
138
+ return _a.codeToName(code);
139
+ };
140
+ /**
141
+ * Returns the Unicode flag emoji for a given country name or ISO code.
142
+ *
143
+ * Example: "FR" → 🇫🇷
144
+ *
145
+ * @param value - Country name or ISO code.
146
+ * @returns Flag emoji string, or `null` if not matched.
147
+ */
148
+ CountryUtil.getFlag = function (value) {
149
+ var code = _a.nameToCode(value);
150
+ if (!code)
151
+ return null;
152
+ return code
153
+ .split("")
154
+ .map(function (c) { return String.fromCodePoint(MAGIC_NUMBER + c.charCodeAt(0)); })
155
+ .join("");
156
+ };
157
+ return CountryUtil;
158
+ }());
159
+ export { CountryUtil };
@@ -133,4 +133,4 @@ declare const Dropdown: {
133
133
  displayName: string;
134
134
  };
135
135
  };
136
- export { Dropdown };
136
+ export { Dropdown, IDropdownProps };
@@ -1 +1 @@
1
- export { Dropdown } from './Dropdown';
1
+ export { Dropdown, IDropdownProps } from './Dropdown';
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- interface IProps {
2
+ interface ISliderProps {
3
3
  /** @ignore */
4
4
  className?: string;
5
5
  /**
@@ -64,5 +64,5 @@ interface IProps {
64
64
  * They're ideal for adjusting settings such as volume and brightness, or for
65
65
  * applying image filters.
66
66
  */
67
- declare const Slider: ({ min, max, fluid, ...props }: IProps) => React.JSX.Element;
68
- export { Slider, IProps };
67
+ declare const Slider: ({ min, max, fluid, ...props }: ISliderProps) => React.JSX.Element;
68
+ export { Slider, ISliderProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.187",
3
+ "version": "1.0.188",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",
@@ -49,6 +49,7 @@
49
49
  "@types/react": "^18.3.10",
50
50
  "@types/react-dom": "^18.3.0",
51
51
  "awesome-debounce-promise": "^2.1.0",
52
+ "country-flag-emoji-polyfill": "^0.1.8",
52
53
  "gl-matrix": "^3.4.3",
53
54
  "mapbox-gl": "^3.9.4",
54
55
  "overlayscrollbars-react": "^0.5.6",