@transferwise/components 46.127.1 → 46.128.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.
Files changed (73) hide show
  1. package/build/alert/Alert.js +3 -0
  2. package/build/alert/Alert.js.map +1 -1
  3. package/build/alert/Alert.mjs +3 -0
  4. package/build/alert/Alert.mjs.map +1 -1
  5. package/build/index.js +1 -0
  6. package/build/index.js.map +1 -1
  7. package/build/index.mjs +1 -1
  8. package/build/inputs/SelectInput.js +81 -12
  9. package/build/inputs/SelectInput.js.map +1 -1
  10. package/build/inputs/SelectInput.mjs +81 -13
  11. package/build/inputs/SelectInput.mjs.map +1 -1
  12. package/build/main.css +15 -7
  13. package/build/prompt/ActionPrompt/ActionPrompt.js +6 -4
  14. package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
  15. package/build/prompt/ActionPrompt/ActionPrompt.mjs +6 -4
  16. package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
  17. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
  18. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
  19. package/build/prompt/InlinePrompt/InlinePrompt.js +1 -1
  20. package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
  21. package/build/prompt/InlinePrompt/InlinePrompt.mjs +1 -1
  22. package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
  23. package/build/styles/main.css +15 -7
  24. package/build/styles/prompt/ActionPrompt/ActionPrompt.css +4 -0
  25. package/build/styles/prompt/InfoPrompt/InfoPrompt.css +7 -5
  26. package/build/styles/prompt/InlinePrompt/InlinePrompt.css +3 -2
  27. package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -0
  28. package/build/types/alert/Alert.d.ts +15 -0
  29. package/build/types/alert/Alert.d.ts.map +1 -1
  30. package/build/types/index.d.ts +1 -1
  31. package/build/types/index.d.ts.map +1 -1
  32. package/build/types/inputs/SelectInput.d.ts +19 -0
  33. package/build/types/inputs/SelectInput.d.ts.map +1 -1
  34. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +7 -0
  35. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
  36. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +4 -2
  37. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -1
  38. package/package.json +5 -5
  39. package/src/alert/Alert.story.tsx +4 -0
  40. package/src/alert/Alert.test.story.tsx +1 -1
  41. package/src/alert/Alert.tsx +16 -0
  42. package/src/iconButton/IconButton.story.tsx +173 -48
  43. package/src/iconButton/IconButton.test.story.tsx +194 -0
  44. package/src/index.ts +1 -0
  45. package/src/inputs/SelectInput.story.tsx +33 -20
  46. package/src/inputs/SelectInput.test.story.tsx +1285 -5
  47. package/src/inputs/SelectInput.tsx +93 -15
  48. package/src/listItem/_stories/ListItem.story.tsx +0 -1
  49. package/src/main.css +15 -7
  50. package/src/prompt/ActionPrompt/ActionPrompt.accessibility.docs.mdx +2 -18
  51. package/src/prompt/ActionPrompt/ActionPrompt.css +4 -0
  52. package/src/prompt/ActionPrompt/ActionPrompt.less +5 -1
  53. package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +323 -108
  54. package/src/prompt/ActionPrompt/ActionPrompt.test.story.tsx +86 -3
  55. package/src/prompt/ActionPrompt/ActionPrompt.tsx +17 -6
  56. package/src/prompt/InfoPrompt/InfoPrompt.accessibility.docs.mdx +79 -0
  57. package/src/prompt/InfoPrompt/InfoPrompt.css +7 -5
  58. package/src/prompt/InfoPrompt/InfoPrompt.less +8 -8
  59. package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +112 -82
  60. package/src/prompt/InfoPrompt/InfoPrompt.test.story.tsx +54 -1
  61. package/src/prompt/InfoPrompt/InfoPrompt.tsx +4 -2
  62. package/src/prompt/InlinePrompt/InlinePrompt.accessibility.docs.mdx +63 -0
  63. package/src/prompt/InlinePrompt/InlinePrompt.css +3 -2
  64. package/src/prompt/InlinePrompt/InlinePrompt.less +2 -2
  65. package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +25 -30
  66. package/src/prompt/InlinePrompt/InlinePrompt.test.story.tsx +21 -0
  67. package/src/prompt/InlinePrompt/InlinePrompt.test.tsx +10 -3
  68. package/src/prompt/InlinePrompt/InlinePrompt.tsx +1 -1
  69. package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -0
  70. package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +2 -1
  71. package/src/sentimentSurface/SentimentSurface.docs.mdx +1 -1
  72. package/src/sentimentSurface/SentimentSurface.story.tsx +1 -1
  73. package/src/sentimentSurface/SentimentSurface.test.story.tsx +1 -1
@@ -1,13 +1,14 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
- import { fireEvent, fn, type Mock, within } from 'storybook/test';
2
+ import { fireEvent, fn, type Mock, screen, userEvent, within } from 'storybook/test';
3
+
3
4
  import { allModes } from '../../.storybook/modes';
4
- import { lorem5, lorem500 } from '../test-utils';
5
- import { Field } from '../field/Field';
6
5
  import Body from '../body';
7
- import { SelectInput, type SelectInputProps } from './SelectInput';
6
+ import { Field } from '../field/Field';
7
+ import { lorem5, lorem500 } from '../test-utils';
8
+ import { SelectInput, type SelectInputProps, sortByRelevance } from './SelectInput';
8
9
 
9
10
  const meta = {
10
- title: 'Forms/SelectInput/tests',
11
+ title: 'Forms/SelectInput/Tests',
11
12
  component: SelectInput,
12
13
  args: {
13
14
  onFilterChange: fn() satisfies Mock,
@@ -21,6 +22,1285 @@ export default meta;
21
22
 
22
23
  type Story<T, M extends boolean = false> = StoryObj<SelectInputProps<T, M>>;
23
24
 
25
+ /**
26
+ * Test story with a large list of countries where almost all have "United States dollar"
27
+ * in their metadata. This reproduces the bug where searching "united" would scroll to
28
+ * the bottom of the list instead of staying at the top.
29
+ * https://transferwise.atlassian.net/browse/DS-8048
30
+ */
31
+ export const VirtualizedCountryListTest: Story<{ title: string; value: string }> = {
32
+ args: {
33
+ items: [
34
+ // Popular countries group - all have USD in metadata
35
+ {
36
+ type: 'group',
37
+ label: 'Popular countries',
38
+ options: [
39
+ {
40
+ type: 'option',
41
+ value: { title: 'United States', value: 'US' },
42
+ filterMatchers: ['United States', 'USA', 'United States dollar', 'USD'],
43
+ },
44
+ {
45
+ type: 'option',
46
+ value: { title: 'United Kingdom', value: 'GB' },
47
+ filterMatchers: [
48
+ 'United Kingdom',
49
+ 'UK',
50
+ 'British pound',
51
+ 'GBP',
52
+ 'United States dollar',
53
+ 'USD',
54
+ ],
55
+ },
56
+ {
57
+ type: 'option',
58
+ value: { title: 'Germany', value: 'DE' },
59
+ filterMatchers: [
60
+ 'Germany',
61
+ 'Deutschland',
62
+ 'Euro',
63
+ 'EUR',
64
+ 'United States dollar',
65
+ 'USD',
66
+ ],
67
+ },
68
+ {
69
+ type: 'option',
70
+ value: { title: 'France', value: 'FR' },
71
+ filterMatchers: ['France', 'Euro', 'EUR', 'United States dollar', 'USD'],
72
+ },
73
+ ],
74
+ },
75
+ // All countries group - massive list with USD in most
76
+ {
77
+ type: 'group',
78
+ label: 'All countries',
79
+ options: [
80
+ {
81
+ type: 'option',
82
+ value: { title: 'Afghanistan', value: 'AF' },
83
+ filterMatchers: ['Afghanistan', 'Afghan afghani', 'AFN', 'United States dollar', 'USD'],
84
+ },
85
+ {
86
+ type: 'option',
87
+ value: { title: 'Albania', value: 'AL' },
88
+ filterMatchers: ['Albania', 'Albanian lek', 'ALL', 'United States dollar', 'USD'],
89
+ },
90
+ {
91
+ type: 'option',
92
+ value: { title: 'Algeria', value: 'DZ' },
93
+ filterMatchers: ['Algeria', 'Algerian dinar', 'DZD', 'United States dollar', 'USD'],
94
+ },
95
+ {
96
+ type: 'option',
97
+ value: { title: 'Andorra', value: 'AD' },
98
+ filterMatchers: ['Andorra', 'Euro', 'EUR', 'United States dollar', 'USD'],
99
+ },
100
+ {
101
+ type: 'option',
102
+ value: { title: 'Angola', value: 'AO' },
103
+ filterMatchers: ['Angola', 'Angolan kwanza', 'AOA', 'United States dollar', 'USD'],
104
+ },
105
+ {
106
+ type: 'option',
107
+ value: { title: 'Argentina', value: 'AR' },
108
+ filterMatchers: ['Argentina', 'Argentine peso', 'ARS', 'United States dollar', 'USD'],
109
+ },
110
+ {
111
+ type: 'option',
112
+ value: { title: 'Armenia', value: 'AM' },
113
+ filterMatchers: ['Armenia', 'Armenian dram', 'AMD', 'United States dollar', 'USD'],
114
+ },
115
+ {
116
+ type: 'option',
117
+ value: { title: 'Australia', value: 'AU' },
118
+ filterMatchers: [
119
+ 'Australia',
120
+ 'Australian dollar',
121
+ 'AUD',
122
+ 'United States dollar',
123
+ 'USD',
124
+ ],
125
+ },
126
+ {
127
+ type: 'option',
128
+ value: { title: 'Austria', value: 'AT' },
129
+ filterMatchers: ['Austria', 'Euro', 'EUR', 'United States dollar', 'USD'],
130
+ },
131
+ {
132
+ type: 'option',
133
+ value: { title: 'Azerbaijan', value: 'AZ' },
134
+ filterMatchers: [
135
+ 'Azerbaijan',
136
+ 'Azerbaijani manat',
137
+ 'AZN',
138
+ 'United States dollar',
139
+ 'USD',
140
+ ],
141
+ },
142
+ {
143
+ type: 'option',
144
+ value: { title: 'Bahamas', value: 'BS' },
145
+ filterMatchers: ['Bahamas', 'Bahamian dollar', 'BSD', 'United States dollar', 'USD'],
146
+ },
147
+ {
148
+ type: 'option',
149
+ value: { title: 'Bahrain', value: 'BH' },
150
+ filterMatchers: ['Bahrain', 'Bahraini dinar', 'BHD', 'United States dollar', 'USD'],
151
+ },
152
+ {
153
+ type: 'option',
154
+ value: { title: 'Bangladesh', value: 'BD' },
155
+ filterMatchers: [
156
+ 'Bangladesh',
157
+ 'Bangladeshi taka',
158
+ 'BDT',
159
+ 'United States dollar',
160
+ 'USD',
161
+ ],
162
+ },
163
+ {
164
+ type: 'option',
165
+ value: { title: 'Barbados', value: 'BB' },
166
+ filterMatchers: ['Barbados', 'Barbadian dollar', 'BBD', 'United States dollar', 'USD'],
167
+ },
168
+ {
169
+ type: 'option',
170
+ value: { title: 'Belarus', value: 'BY' },
171
+ filterMatchers: ['Belarus', 'Belarusian ruble', 'BYN', 'United States dollar', 'USD'],
172
+ },
173
+ {
174
+ type: 'option',
175
+ value: { title: 'Belgium', value: 'BE' },
176
+ filterMatchers: ['Belgium', 'Euro', 'EUR', 'United States dollar', 'USD'],
177
+ },
178
+ {
179
+ type: 'option',
180
+ value: { title: 'Belize', value: 'BZ' },
181
+ filterMatchers: ['Belize', 'Belize dollar', 'BZD', 'United States dollar', 'USD'],
182
+ },
183
+ {
184
+ type: 'option',
185
+ value: { title: 'Benin', value: 'BJ' },
186
+ filterMatchers: [
187
+ 'Benin',
188
+ 'West African CFA franc',
189
+ 'XOF',
190
+ 'United States dollar',
191
+ 'USD',
192
+ ],
193
+ },
194
+ {
195
+ type: 'option',
196
+ value: { title: 'Bhutan', value: 'BT' },
197
+ filterMatchers: ['Bhutan', 'Bhutanese ngultrum', 'BTN', 'United States dollar', 'USD'],
198
+ },
199
+ {
200
+ type: 'option',
201
+ value: { title: 'Bolivia', value: 'BO' },
202
+ filterMatchers: ['Bolivia', 'Bolivian boliviano', 'BOB', 'United States dollar', 'USD'],
203
+ },
204
+ {
205
+ type: 'option',
206
+ value: { title: 'Bosnia and Herzegovina', value: 'BA' },
207
+ filterMatchers: [
208
+ 'Bosnia',
209
+ 'Herzegovina',
210
+ 'Convertible mark',
211
+ 'BAM',
212
+ 'United States dollar',
213
+ 'USD',
214
+ ],
215
+ },
216
+ {
217
+ type: 'option',
218
+ value: { title: 'Botswana', value: 'BW' },
219
+ filterMatchers: ['Botswana', 'Botswana pula', 'BWP', 'United States dollar', 'USD'],
220
+ },
221
+ {
222
+ type: 'option',
223
+ value: { title: 'Brazil', value: 'BR' },
224
+ filterMatchers: ['Brazil', 'Brazilian real', 'BRL', 'United States dollar', 'USD'],
225
+ },
226
+ {
227
+ type: 'option',
228
+ value: { title: 'Brunei', value: 'BN' },
229
+ filterMatchers: ['Brunei', 'Brunei dollar', 'BND', 'United States dollar', 'USD'],
230
+ },
231
+ {
232
+ type: 'option',
233
+ value: { title: 'Bulgaria', value: 'BG' },
234
+ filterMatchers: ['Bulgaria', 'Bulgarian lev', 'BGN', 'United States dollar', 'USD'],
235
+ },
236
+ {
237
+ type: 'option',
238
+ value: { title: 'Burkina Faso', value: 'BF' },
239
+ filterMatchers: [
240
+ 'Burkina Faso',
241
+ 'West African CFA franc',
242
+ 'XOF',
243
+ 'United States dollar',
244
+ 'USD',
245
+ ],
246
+ },
247
+ {
248
+ type: 'option',
249
+ value: { title: 'Burundi', value: 'BI' },
250
+ filterMatchers: ['Burundi', 'Burundian franc', 'BIF', 'United States dollar', 'USD'],
251
+ },
252
+ {
253
+ type: 'option',
254
+ value: { title: 'Cambodia', value: 'KH' },
255
+ filterMatchers: ['Cambodia', 'Cambodian riel', 'KHR', 'United States dollar', 'USD'],
256
+ },
257
+ {
258
+ type: 'option',
259
+ value: { title: 'Cameroon', value: 'CM' },
260
+ filterMatchers: [
261
+ 'Cameroon',
262
+ 'Central African CFA franc',
263
+ 'XAF',
264
+ 'United States dollar',
265
+ 'USD',
266
+ ],
267
+ },
268
+ {
269
+ type: 'option',
270
+ value: { title: 'Canada', value: 'CA' },
271
+ filterMatchers: ['Canada', 'Canadian dollar', 'CAD', 'United States dollar', 'USD'],
272
+ },
273
+ {
274
+ type: 'option',
275
+ value: { title: 'Cape Verde', value: 'CV' },
276
+ filterMatchers: [
277
+ 'Cape Verde',
278
+ 'Cape Verdean escudo',
279
+ 'CVE',
280
+ 'United States dollar',
281
+ 'USD',
282
+ ],
283
+ },
284
+ {
285
+ type: 'option',
286
+ value: { title: 'Central African Republic', value: 'CF' },
287
+ filterMatchers: [
288
+ 'Central African Republic',
289
+ 'Central African CFA franc',
290
+ 'XAF',
291
+ 'United States dollar',
292
+ 'USD',
293
+ ],
294
+ },
295
+ {
296
+ type: 'option',
297
+ value: { title: 'Chad', value: 'TD' },
298
+ filterMatchers: [
299
+ 'Chad',
300
+ 'Central African CFA franc',
301
+ 'XAF',
302
+ 'United States dollar',
303
+ 'USD',
304
+ ],
305
+ },
306
+ {
307
+ type: 'option',
308
+ value: { title: 'Chile', value: 'CL' },
309
+ filterMatchers: ['Chile', 'Chilean peso', 'CLP', 'United States dollar', 'USD'],
310
+ },
311
+ {
312
+ type: 'option',
313
+ value: { title: 'China', value: 'CN' },
314
+ filterMatchers: ['China', 'Chinese yuan', 'CNY', 'United States dollar', 'USD'],
315
+ },
316
+ {
317
+ type: 'option',
318
+ value: { title: 'Colombia', value: 'CO' },
319
+ filterMatchers: ['Colombia', 'Colombian peso', 'COP', 'United States dollar', 'USD'],
320
+ },
321
+ {
322
+ type: 'option',
323
+ value: { title: 'Comoros', value: 'KM' },
324
+ filterMatchers: ['Comoros', 'Comorian franc', 'KMF', 'United States dollar', 'USD'],
325
+ },
326
+ {
327
+ type: 'option',
328
+ value: { title: 'Congo', value: 'CG' },
329
+ filterMatchers: [
330
+ 'Congo',
331
+ 'Central African CFA franc',
332
+ 'XAF',
333
+ 'United States dollar',
334
+ 'USD',
335
+ ],
336
+ },
337
+ {
338
+ type: 'option',
339
+ value: { title: 'Costa Rica', value: 'CR' },
340
+ filterMatchers: [
341
+ 'Costa Rica',
342
+ 'Costa Rican colón',
343
+ 'CRC',
344
+ 'United States dollar',
345
+ 'USD',
346
+ ],
347
+ },
348
+ {
349
+ type: 'option',
350
+ value: { title: 'Croatia', value: 'HR' },
351
+ filterMatchers: ['Croatia', 'Euro', 'EUR', 'United States dollar', 'USD'],
352
+ },
353
+ {
354
+ type: 'option',
355
+ value: { title: 'Cuba', value: 'CU' },
356
+ filterMatchers: ['Cuba', 'Cuban peso', 'CUP', 'United States dollar', 'USD'],
357
+ },
358
+ {
359
+ type: 'option',
360
+ value: { title: 'Cyprus', value: 'CY' },
361
+ filterMatchers: ['Cyprus', 'Euro', 'EUR', 'United States dollar', 'USD'],
362
+ },
363
+ {
364
+ type: 'option',
365
+ value: { title: 'Czech Republic', value: 'CZ' },
366
+ filterMatchers: [
367
+ 'Czech Republic',
368
+ 'Czech koruna',
369
+ 'CZK',
370
+ 'United States dollar',
371
+ 'USD',
372
+ ],
373
+ },
374
+ {
375
+ type: 'option',
376
+ value: { title: 'Denmark', value: 'DK' },
377
+ filterMatchers: ['Denmark', 'Danish krone', 'DKK', 'United States dollar', 'USD'],
378
+ },
379
+ {
380
+ type: 'option',
381
+ value: { title: 'Djibouti', value: 'DJ' },
382
+ filterMatchers: ['Djibouti', 'Djiboutian franc', 'DJF', 'United States dollar', 'USD'],
383
+ },
384
+ {
385
+ type: 'option',
386
+ value: { title: 'Dominica', value: 'DM' },
387
+ filterMatchers: [
388
+ 'Dominica',
389
+ 'East Caribbean dollar',
390
+ 'XCD',
391
+ 'United States dollar',
392
+ 'USD',
393
+ ],
394
+ },
395
+ {
396
+ type: 'option',
397
+ value: { title: 'Dominican Republic', value: 'DO' },
398
+ filterMatchers: [
399
+ 'Dominican Republic',
400
+ 'Dominican peso',
401
+ 'DOP',
402
+ 'United States dollar',
403
+ 'USD',
404
+ ],
405
+ },
406
+ {
407
+ type: 'option',
408
+ value: { title: 'Ecuador', value: 'EC' },
409
+ filterMatchers: ['Ecuador', 'United States dollar', 'USD'],
410
+ },
411
+ {
412
+ type: 'option',
413
+ value: { title: 'Egypt', value: 'EG' },
414
+ filterMatchers: ['Egypt', 'Egyptian pound', 'EGP', 'United States dollar', 'USD'],
415
+ },
416
+ {
417
+ type: 'option',
418
+ value: { title: 'El Salvador', value: 'SV' },
419
+ filterMatchers: ['El Salvador', 'United States dollar', 'USD'],
420
+ },
421
+ {
422
+ type: 'option',
423
+ value: { title: 'Equatorial Guinea', value: 'GQ' },
424
+ filterMatchers: [
425
+ 'Equatorial Guinea',
426
+ 'Central African CFA franc',
427
+ 'XAF',
428
+ 'United States dollar',
429
+ 'USD',
430
+ ],
431
+ },
432
+ {
433
+ type: 'option',
434
+ value: { title: 'Eritrea', value: 'ER' },
435
+ filterMatchers: ['Eritrea', 'Eritrean nakfa', 'ERN', 'United States dollar', 'USD'],
436
+ },
437
+ {
438
+ type: 'option',
439
+ value: { title: 'Estonia', value: 'EE' },
440
+ filterMatchers: ['Estonia', 'Euro', 'EUR', 'United States dollar', 'USD'],
441
+ },
442
+ {
443
+ type: 'option',
444
+ value: { title: 'Ethiopia', value: 'ET' },
445
+ filterMatchers: ['Ethiopia', 'Ethiopian birr', 'ETB', 'United States dollar', 'USD'],
446
+ },
447
+ {
448
+ type: 'option',
449
+ value: { title: 'Fiji', value: 'FJ' },
450
+ filterMatchers: ['Fiji', 'Fijian dollar', 'FJD', 'United States dollar', 'USD'],
451
+ },
452
+ {
453
+ type: 'option',
454
+ value: { title: 'Finland', value: 'FI' },
455
+ filterMatchers: ['Finland', 'Euro', 'EUR', 'United States dollar', 'USD'],
456
+ },
457
+ {
458
+ type: 'option',
459
+ value: { title: 'Gabon', value: 'GA' },
460
+ filterMatchers: [
461
+ 'Gabon',
462
+ 'Central African CFA franc',
463
+ 'XAF',
464
+ 'United States dollar',
465
+ 'USD',
466
+ ],
467
+ },
468
+ {
469
+ type: 'option',
470
+ value: { title: 'Gambia', value: 'GM' },
471
+ filterMatchers: ['Gambia', 'Gambian dalasi', 'GMD', 'United States dollar', 'USD'],
472
+ },
473
+ {
474
+ type: 'option',
475
+ value: { title: 'Georgia', value: 'GE' },
476
+ filterMatchers: ['Georgia', 'Georgian lari', 'GEL', 'United States dollar', 'USD'],
477
+ },
478
+ {
479
+ type: 'option',
480
+ value: { title: 'Ghana', value: 'GH' },
481
+ filterMatchers: ['Ghana', 'Ghanaian cedi', 'GHS', 'United States dollar', 'USD'],
482
+ },
483
+ {
484
+ type: 'option',
485
+ value: { title: 'Greece', value: 'GR' },
486
+ filterMatchers: ['Greece', 'Euro', 'EUR', 'United States dollar', 'USD'],
487
+ },
488
+ {
489
+ type: 'option',
490
+ value: { title: 'Grenada', value: 'GD' },
491
+ filterMatchers: [
492
+ 'Grenada',
493
+ 'East Caribbean dollar',
494
+ 'XCD',
495
+ 'United States dollar',
496
+ 'USD',
497
+ ],
498
+ },
499
+ {
500
+ type: 'option',
501
+ value: { title: 'Guatemala', value: 'GT' },
502
+ filterMatchers: [
503
+ 'Guatemala',
504
+ 'Guatemalan quetzal',
505
+ 'GTQ',
506
+ 'United States dollar',
507
+ 'USD',
508
+ ],
509
+ },
510
+ {
511
+ type: 'option',
512
+ value: { title: 'Guinea', value: 'GN' },
513
+ filterMatchers: ['Guinea', 'Guinean franc', 'GNF', 'United States dollar', 'USD'],
514
+ },
515
+ {
516
+ type: 'option',
517
+ value: { title: 'Guinea-Bissau', value: 'GW' },
518
+ filterMatchers: [
519
+ 'Guinea-Bissau',
520
+ 'West African CFA franc',
521
+ 'XOF',
522
+ 'United States dollar',
523
+ 'USD',
524
+ ],
525
+ },
526
+ {
527
+ type: 'option',
528
+ value: { title: 'Guyana', value: 'GY' },
529
+ filterMatchers: ['Guyana', 'Guyanese dollar', 'GYD', 'United States dollar', 'USD'],
530
+ },
531
+ {
532
+ type: 'option',
533
+ value: { title: 'Haiti', value: 'HT' },
534
+ filterMatchers: ['Haiti', 'Haitian gourde', 'HTG', 'United States dollar', 'USD'],
535
+ },
536
+ {
537
+ type: 'option',
538
+ value: { title: 'Honduras', value: 'HN' },
539
+ filterMatchers: ['Honduras', 'Honduran lempira', 'HNL', 'United States dollar', 'USD'],
540
+ },
541
+ {
542
+ type: 'option',
543
+ value: { title: 'Hungary', value: 'HU' },
544
+ filterMatchers: ['Hungary', 'Hungarian forint', 'HUF', 'United States dollar', 'USD'],
545
+ },
546
+ {
547
+ type: 'option',
548
+ value: { title: 'Iceland', value: 'IS' },
549
+ filterMatchers: ['Iceland', 'Icelandic króna', 'ISK', 'United States dollar', 'USD'],
550
+ },
551
+ {
552
+ type: 'option',
553
+ value: { title: 'India', value: 'IN' },
554
+ filterMatchers: ['India', 'Indian rupee', 'INR', 'United States dollar', 'USD'],
555
+ },
556
+ {
557
+ type: 'option',
558
+ value: { title: 'Indonesia', value: 'ID' },
559
+ filterMatchers: [
560
+ 'Indonesia',
561
+ 'Indonesian rupiah',
562
+ 'IDR',
563
+ 'United States dollar',
564
+ 'USD',
565
+ ],
566
+ },
567
+ {
568
+ type: 'option',
569
+ value: { title: 'Iran', value: 'IR' },
570
+ filterMatchers: ['Iran', 'Iranian rial', 'IRR', 'United States dollar', 'USD'],
571
+ },
572
+ {
573
+ type: 'option',
574
+ value: { title: 'Iraq', value: 'IQ' },
575
+ filterMatchers: ['Iraq', 'Iraqi dinar', 'IQD', 'United States dollar', 'USD'],
576
+ },
577
+ {
578
+ type: 'option',
579
+ value: { title: 'Ireland', value: 'IE' },
580
+ filterMatchers: ['Ireland', 'Euro', 'EUR', 'United States dollar', 'USD'],
581
+ },
582
+ {
583
+ type: 'option',
584
+ value: { title: 'Israel', value: 'IL' },
585
+ filterMatchers: ['Israel', 'Israeli new shekel', 'ILS', 'United States dollar', 'USD'],
586
+ },
587
+ {
588
+ type: 'option',
589
+ value: { title: 'Italy', value: 'IT' },
590
+ filterMatchers: ['Italy', 'Euro', 'EUR', 'United States dollar', 'USD'],
591
+ },
592
+ {
593
+ type: 'option',
594
+ value: { title: 'Jamaica', value: 'JM' },
595
+ filterMatchers: ['Jamaica', 'Jamaican dollar', 'JMD', 'United States dollar', 'USD'],
596
+ },
597
+ {
598
+ type: 'option',
599
+ value: { title: 'Japan', value: 'JP' },
600
+ filterMatchers: ['Japan', 'Japanese yen', 'JPY', 'United States dollar', 'USD'],
601
+ },
602
+ {
603
+ type: 'option',
604
+ value: { title: 'Jordan', value: 'JO' },
605
+ filterMatchers: ['Jordan', 'Jordanian dinar', 'JOD', 'United States dollar', 'USD'],
606
+ },
607
+ // This one country does NOT have USD - to verify filtering works
608
+ {
609
+ type: 'option',
610
+ value: { title: 'Kazakhstan', value: 'KZ' },
611
+ filterMatchers: ['Kazakhstan', 'Kazakhstani tenge', 'KZT'],
612
+ },
613
+ {
614
+ type: 'option',
615
+ value: { title: 'Kenya', value: 'KE' },
616
+ filterMatchers: ['Kenya', 'Kenyan shilling', 'KES', 'United States dollar', 'USD'],
617
+ },
618
+ {
619
+ type: 'option',
620
+ value: { title: 'Kiribati', value: 'KI' },
621
+ filterMatchers: ['Kiribati', 'Australian dollar', 'AUD', 'United States dollar', 'USD'],
622
+ },
623
+ {
624
+ type: 'option',
625
+ value: { title: 'Kuwait', value: 'KW' },
626
+ filterMatchers: ['Kuwait', 'Kuwaiti dinar', 'KWD', 'United States dollar', 'USD'],
627
+ },
628
+ {
629
+ type: 'option',
630
+ value: { title: 'Kyrgyzstan', value: 'KG' },
631
+ filterMatchers: ['Kyrgyzstan', 'Kyrgyzstani som', 'KGS', 'United States dollar', 'USD'],
632
+ },
633
+ {
634
+ type: 'option',
635
+ value: { title: 'Laos', value: 'LA' },
636
+ filterMatchers: ['Laos', 'Lao kip', 'LAK', 'United States dollar', 'USD'],
637
+ },
638
+ {
639
+ type: 'option',
640
+ value: { title: 'Latvia', value: 'LV' },
641
+ filterMatchers: ['Latvia', 'Euro', 'EUR', 'United States dollar', 'USD'],
642
+ },
643
+ {
644
+ type: 'option',
645
+ value: { title: 'Lebanon', value: 'LB' },
646
+ filterMatchers: ['Lebanon', 'Lebanese pound', 'LBP', 'United States dollar', 'USD'],
647
+ },
648
+ {
649
+ type: 'option',
650
+ value: { title: 'Lesotho', value: 'LS' },
651
+ filterMatchers: ['Lesotho', 'Lesotho loti', 'LSL', 'United States dollar', 'USD'],
652
+ },
653
+ {
654
+ type: 'option',
655
+ value: { title: 'Liberia', value: 'LR' },
656
+ filterMatchers: ['Liberia', 'Liberian dollar', 'LRD', 'United States dollar', 'USD'],
657
+ },
658
+ {
659
+ type: 'option',
660
+ value: { title: 'Libya', value: 'LY' },
661
+ filterMatchers: ['Libya', 'Libyan dinar', 'LYD', 'United States dollar', 'USD'],
662
+ },
663
+ {
664
+ type: 'option',
665
+ value: { title: 'Liechtenstein', value: 'LI' },
666
+ filterMatchers: ['Liechtenstein', 'Swiss franc', 'CHF', 'United States dollar', 'USD'],
667
+ },
668
+ {
669
+ type: 'option',
670
+ value: { title: 'Lithuania', value: 'LT' },
671
+ filterMatchers: ['Lithuania', 'Euro', 'EUR', 'United States dollar', 'USD'],
672
+ },
673
+ {
674
+ type: 'option',
675
+ value: { title: 'Luxembourg', value: 'LU' },
676
+ filterMatchers: ['Luxembourg', 'Euro', 'EUR', 'United States dollar', 'USD'],
677
+ },
678
+ {
679
+ type: 'option',
680
+ value: { title: 'Madagascar', value: 'MG' },
681
+ filterMatchers: ['Madagascar', 'Malagasy ariary', 'MGA', 'United States dollar', 'USD'],
682
+ },
683
+ {
684
+ type: 'option',
685
+ value: { title: 'Malawi', value: 'MW' },
686
+ filterMatchers: ['Malawi', 'Malawian kwacha', 'MWK', 'United States dollar', 'USD'],
687
+ },
688
+ {
689
+ type: 'option',
690
+ value: { title: 'Malaysia', value: 'MY' },
691
+ filterMatchers: ['Malaysia', 'Malaysian ringgit', 'MYR', 'United States dollar', 'USD'],
692
+ },
693
+ {
694
+ type: 'option',
695
+ value: { title: 'Maldives', value: 'MV' },
696
+ filterMatchers: ['Maldives', 'Maldivian rufiyaa', 'MVR', 'United States dollar', 'USD'],
697
+ },
698
+ {
699
+ type: 'option',
700
+ value: { title: 'Mali', value: 'ML' },
701
+ filterMatchers: [
702
+ 'Mali',
703
+ 'West African CFA franc',
704
+ 'XOF',
705
+ 'United States dollar',
706
+ 'USD',
707
+ ],
708
+ },
709
+ {
710
+ type: 'option',
711
+ value: { title: 'Malta', value: 'MT' },
712
+ filterMatchers: ['Malta', 'Euro', 'EUR', 'United States dollar', 'USD'],
713
+ },
714
+ {
715
+ type: 'option',
716
+ value: { title: 'Marshall Islands', value: 'MH' },
717
+ filterMatchers: ['Marshall Islands', 'United States dollar', 'USD'],
718
+ },
719
+ {
720
+ type: 'option',
721
+ value: { title: 'Mauritania', value: 'MR' },
722
+ filterMatchers: [
723
+ 'Mauritania',
724
+ 'Mauritanian ouguiya',
725
+ 'MRU',
726
+ 'United States dollar',
727
+ 'USD',
728
+ ],
729
+ },
730
+ {
731
+ type: 'option',
732
+ value: { title: 'Mauritius', value: 'MU' },
733
+ filterMatchers: ['Mauritius', 'Mauritian rupee', 'MUR', 'United States dollar', 'USD'],
734
+ },
735
+ {
736
+ type: 'option',
737
+ value: { title: 'Mexico', value: 'MX' },
738
+ filterMatchers: ['Mexico', 'Mexican peso', 'MXN', 'United States dollar', 'USD'],
739
+ },
740
+ {
741
+ type: 'option',
742
+ value: { title: 'Micronesia', value: 'FM' },
743
+ filterMatchers: ['Micronesia', 'United States dollar', 'USD'],
744
+ },
745
+ {
746
+ type: 'option',
747
+ value: { title: 'Moldova', value: 'MD' },
748
+ filterMatchers: ['Moldova', 'Moldovan leu', 'MDL', 'United States dollar', 'USD'],
749
+ },
750
+ {
751
+ type: 'option',
752
+ value: { title: 'Monaco', value: 'MC' },
753
+ filterMatchers: ['Monaco', 'Euro', 'EUR', 'United States dollar', 'USD'],
754
+ },
755
+ {
756
+ type: 'option',
757
+ value: { title: 'Mongolia', value: 'MN' },
758
+ filterMatchers: ['Mongolia', 'Mongolian tögrög', 'MNT', 'United States dollar', 'USD'],
759
+ },
760
+ {
761
+ type: 'option',
762
+ value: { title: 'Montenegro', value: 'ME' },
763
+ filterMatchers: ['Montenegro', 'Euro', 'EUR', 'United States dollar', 'USD'],
764
+ },
765
+ {
766
+ type: 'option',
767
+ value: { title: 'Morocco', value: 'MA' },
768
+ filterMatchers: ['Morocco', 'Moroccan dirham', 'MAD', 'United States dollar', 'USD'],
769
+ },
770
+ {
771
+ type: 'option',
772
+ value: { title: 'Mozambique', value: 'MZ' },
773
+ filterMatchers: [
774
+ 'Mozambique',
775
+ 'Mozambican metical',
776
+ 'MZN',
777
+ 'United States dollar',
778
+ 'USD',
779
+ ],
780
+ },
781
+ {
782
+ type: 'option',
783
+ value: { title: 'Myanmar', value: 'MM' },
784
+ filterMatchers: ['Myanmar', 'Burmese kyat', 'MMK', 'United States dollar', 'USD'],
785
+ },
786
+ {
787
+ type: 'option',
788
+ value: { title: 'Namibia', value: 'NA' },
789
+ filterMatchers: ['Namibia', 'Namibian dollar', 'NAD', 'United States dollar', 'USD'],
790
+ },
791
+ {
792
+ type: 'option',
793
+ value: { title: 'Nauru', value: 'NR' },
794
+ filterMatchers: ['Nauru', 'Australian dollar', 'AUD', 'United States dollar', 'USD'],
795
+ },
796
+ {
797
+ type: 'option',
798
+ value: { title: 'Nepal', value: 'NP' },
799
+ filterMatchers: ['Nepal', 'Nepalese rupee', 'NPR', 'United States dollar', 'USD'],
800
+ },
801
+ {
802
+ type: 'option',
803
+ value: { title: 'Netherlands', value: 'NL' },
804
+ filterMatchers: ['Netherlands', 'Euro', 'EUR', 'United States dollar', 'USD'],
805
+ },
806
+ {
807
+ type: 'option',
808
+ value: { title: 'New Zealand', value: 'NZ' },
809
+ filterMatchers: [
810
+ 'New Zealand',
811
+ 'New Zealand dollar',
812
+ 'NZD',
813
+ 'United States dollar',
814
+ 'USD',
815
+ ],
816
+ },
817
+ {
818
+ type: 'option',
819
+ value: { title: 'Nicaragua', value: 'NI' },
820
+ filterMatchers: [
821
+ 'Nicaragua',
822
+ 'Nicaraguan córdoba',
823
+ 'NIO',
824
+ 'United States dollar',
825
+ 'USD',
826
+ ],
827
+ },
828
+ {
829
+ type: 'option',
830
+ value: { title: 'Niger', value: 'NE' },
831
+ filterMatchers: [
832
+ 'Niger',
833
+ 'West African CFA franc',
834
+ 'XOF',
835
+ 'United States dollar',
836
+ 'USD',
837
+ ],
838
+ },
839
+ {
840
+ type: 'option',
841
+ value: { title: 'Nigeria', value: 'NG' },
842
+ filterMatchers: ['Nigeria', 'Nigerian naira', 'NGN', 'United States dollar', 'USD'],
843
+ },
844
+ {
845
+ type: 'option',
846
+ value: { title: 'North Macedonia', value: 'MK' },
847
+ filterMatchers: [
848
+ 'North Macedonia',
849
+ 'Macedonian denar',
850
+ 'MKD',
851
+ 'United States dollar',
852
+ 'USD',
853
+ ],
854
+ },
855
+ {
856
+ type: 'option',
857
+ value: { title: 'Norway', value: 'NO' },
858
+ filterMatchers: ['Norway', 'Norwegian krone', 'NOK', 'United States dollar', 'USD'],
859
+ },
860
+ {
861
+ type: 'option',
862
+ value: { title: 'Oman', value: 'OM' },
863
+ filterMatchers: ['Oman', 'Omani rial', 'OMR', 'United States dollar', 'USD'],
864
+ },
865
+ {
866
+ type: 'option',
867
+ value: { title: 'Pakistan', value: 'PK' },
868
+ filterMatchers: ['Pakistan', 'Pakistani rupee', 'PKR', 'United States dollar', 'USD'],
869
+ },
870
+ {
871
+ type: 'option',
872
+ value: { title: 'Palau', value: 'PW' },
873
+ filterMatchers: ['Palau', 'United States dollar', 'USD'],
874
+ },
875
+ {
876
+ type: 'option',
877
+ value: { title: 'Panama', value: 'PA' },
878
+ filterMatchers: ['Panama', 'Panamanian balboa', 'PAB', 'United States dollar', 'USD'],
879
+ },
880
+ {
881
+ type: 'option',
882
+ value: { title: 'Papua New Guinea', value: 'PG' },
883
+ filterMatchers: [
884
+ 'Papua New Guinea',
885
+ 'Papua New Guinean kina',
886
+ 'PGK',
887
+ 'United States dollar',
888
+ 'USD',
889
+ ],
890
+ },
891
+ {
892
+ type: 'option',
893
+ value: { title: 'Paraguay', value: 'PY' },
894
+ filterMatchers: [
895
+ 'Paraguay',
896
+ 'Paraguayan guaraní',
897
+ 'PYG',
898
+ 'United States dollar',
899
+ 'USD',
900
+ ],
901
+ },
902
+ {
903
+ type: 'option',
904
+ value: { title: 'Peru', value: 'PE' },
905
+ filterMatchers: ['Peru', 'Peruvian sol', 'PEN', 'United States dollar', 'USD'],
906
+ },
907
+ {
908
+ type: 'option',
909
+ value: { title: 'Philippines', value: 'PH' },
910
+ filterMatchers: [
911
+ 'Philippines',
912
+ 'Philippine peso',
913
+ 'PHP',
914
+ 'United States dollar',
915
+ 'USD',
916
+ ],
917
+ },
918
+ {
919
+ type: 'option',
920
+ value: { title: 'Poland', value: 'PL' },
921
+ filterMatchers: ['Poland', 'Polish złoty', 'PLN', 'United States dollar', 'USD'],
922
+ },
923
+ {
924
+ type: 'option',
925
+ value: { title: 'Portugal', value: 'PT' },
926
+ filterMatchers: ['Portugal', 'Euro', 'EUR', 'United States dollar', 'USD'],
927
+ },
928
+ {
929
+ type: 'option',
930
+ value: { title: 'Qatar', value: 'QA' },
931
+ filterMatchers: ['Qatar', 'Qatari riyal', 'QAR', 'United States dollar', 'USD'],
932
+ },
933
+ {
934
+ type: 'option',
935
+ value: { title: 'Romania', value: 'RO' },
936
+ filterMatchers: ['Romania', 'Romanian leu', 'RON', 'United States dollar', 'USD'],
937
+ },
938
+ {
939
+ type: 'option',
940
+ value: { title: 'Russia', value: 'RU' },
941
+ filterMatchers: ['Russia', 'Russian ruble', 'RUB', 'United States dollar', 'USD'],
942
+ },
943
+ {
944
+ type: 'option',
945
+ value: { title: 'Rwanda', value: 'RW' },
946
+ filterMatchers: ['Rwanda', 'Rwandan franc', 'RWF', 'United States dollar', 'USD'],
947
+ },
948
+ {
949
+ type: 'option',
950
+ value: { title: 'Saint Lucia', value: 'LC' },
951
+ filterMatchers: [
952
+ 'Saint Lucia',
953
+ 'East Caribbean dollar',
954
+ 'XCD',
955
+ 'United States dollar',
956
+ 'USD',
957
+ ],
958
+ },
959
+ {
960
+ type: 'option',
961
+ value: { title: 'Samoa', value: 'WS' },
962
+ filterMatchers: ['Samoa', 'Samoan tālā', 'WST', 'United States dollar', 'USD'],
963
+ },
964
+ {
965
+ type: 'option',
966
+ value: { title: 'San Marino', value: 'SM' },
967
+ filterMatchers: ['San Marino', 'Euro', 'EUR', 'United States dollar', 'USD'],
968
+ },
969
+ {
970
+ type: 'option',
971
+ value: { title: 'Saudi Arabia', value: 'SA' },
972
+ filterMatchers: ['Saudi Arabia', 'Saudi riyal', 'SAR', 'United States dollar', 'USD'],
973
+ },
974
+ {
975
+ type: 'option',
976
+ value: { title: 'Senegal', value: 'SN' },
977
+ filterMatchers: [
978
+ 'Senegal',
979
+ 'West African CFA franc',
980
+ 'XOF',
981
+ 'United States dollar',
982
+ 'USD',
983
+ ],
984
+ },
985
+ {
986
+ type: 'option',
987
+ value: { title: 'Serbia', value: 'RS' },
988
+ filterMatchers: ['Serbia', 'Serbian dinar', 'RSD', 'United States dollar', 'USD'],
989
+ },
990
+ {
991
+ type: 'option',
992
+ value: { title: 'Seychelles', value: 'SC' },
993
+ filterMatchers: [
994
+ 'Seychelles',
995
+ 'Seychellois rupee',
996
+ 'SCR',
997
+ 'United States dollar',
998
+ 'USD',
999
+ ],
1000
+ },
1001
+ {
1002
+ type: 'option',
1003
+ value: { title: 'Sierra Leone', value: 'SL' },
1004
+ filterMatchers: [
1005
+ 'Sierra Leone',
1006
+ 'Sierra Leonean leone',
1007
+ 'SLL',
1008
+ 'United States dollar',
1009
+ 'USD',
1010
+ ],
1011
+ },
1012
+ {
1013
+ type: 'option',
1014
+ value: { title: 'Singapore', value: 'SG' },
1015
+ filterMatchers: ['Singapore', 'Singapore dollar', 'SGD', 'United States dollar', 'USD'],
1016
+ },
1017
+ {
1018
+ type: 'option',
1019
+ value: { title: 'Slovakia', value: 'SK' },
1020
+ filterMatchers: ['Slovakia', 'Euro', 'EUR', 'United States dollar', 'USD'],
1021
+ },
1022
+ {
1023
+ type: 'option',
1024
+ value: { title: 'Slovenia', value: 'SI' },
1025
+ filterMatchers: ['Slovenia', 'Euro', 'EUR', 'United States dollar', 'USD'],
1026
+ },
1027
+ {
1028
+ type: 'option',
1029
+ value: { title: 'Solomon Islands', value: 'SB' },
1030
+ filterMatchers: [
1031
+ 'Solomon Islands',
1032
+ 'Solomon Islands dollar',
1033
+ 'SBD',
1034
+ 'United States dollar',
1035
+ 'USD',
1036
+ ],
1037
+ },
1038
+ {
1039
+ type: 'option',
1040
+ value: { title: 'Somalia', value: 'SO' },
1041
+ filterMatchers: ['Somalia', 'Somali shilling', 'SOS', 'United States dollar', 'USD'],
1042
+ },
1043
+ {
1044
+ type: 'option',
1045
+ value: { title: 'South Africa', value: 'ZA' },
1046
+ filterMatchers: [
1047
+ 'South Africa',
1048
+ 'South African rand',
1049
+ 'ZAR',
1050
+ 'United States dollar',
1051
+ 'USD',
1052
+ ],
1053
+ },
1054
+ {
1055
+ type: 'option',
1056
+ value: { title: 'South Korea', value: 'KR' },
1057
+ filterMatchers: ['South Korea', 'Korean won', 'KRW', 'United States dollar', 'USD'],
1058
+ },
1059
+ {
1060
+ type: 'option',
1061
+ value: { title: 'South Sudan', value: 'SS' },
1062
+ filterMatchers: [
1063
+ 'South Sudan',
1064
+ 'South Sudanese pound',
1065
+ 'SSP',
1066
+ 'United States dollar',
1067
+ 'USD',
1068
+ ],
1069
+ },
1070
+ {
1071
+ type: 'option',
1072
+ value: { title: 'Spain', value: 'ES' },
1073
+ filterMatchers: ['Spain', 'Euro', 'EUR', 'United States dollar', 'USD'],
1074
+ },
1075
+ {
1076
+ type: 'option',
1077
+ value: { title: 'Sri Lanka', value: 'LK' },
1078
+ filterMatchers: ['Sri Lanka', 'Sri Lankan rupee', 'LKR', 'United States dollar', 'USD'],
1079
+ },
1080
+ {
1081
+ type: 'option',
1082
+ value: { title: 'Sudan', value: 'SD' },
1083
+ filterMatchers: ['Sudan', 'Sudanese pound', 'SDG', 'United States dollar', 'USD'],
1084
+ },
1085
+ {
1086
+ type: 'option',
1087
+ value: { title: 'Suriname', value: 'SR' },
1088
+ filterMatchers: ['Suriname', 'Surinamese dollar', 'SRD', 'United States dollar', 'USD'],
1089
+ },
1090
+ {
1091
+ type: 'option',
1092
+ value: { title: 'Sweden', value: 'SE' },
1093
+ filterMatchers: ['Sweden', 'Swedish krona', 'SEK', 'United States dollar', 'USD'],
1094
+ },
1095
+ {
1096
+ type: 'option',
1097
+ value: { title: 'Switzerland', value: 'CH' },
1098
+ filterMatchers: ['Switzerland', 'Swiss franc', 'CHF', 'United States dollar', 'USD'],
1099
+ },
1100
+ {
1101
+ type: 'option',
1102
+ value: { title: 'Syria', value: 'SY' },
1103
+ filterMatchers: ['Syria', 'Syrian pound', 'SYP', 'United States dollar', 'USD'],
1104
+ },
1105
+ {
1106
+ type: 'option',
1107
+ value: { title: 'Taiwan', value: 'TW' },
1108
+ filterMatchers: ['Taiwan', 'New Taiwan dollar', 'TWD', 'United States dollar', 'USD'],
1109
+ },
1110
+ {
1111
+ type: 'option',
1112
+ value: { title: 'Tajikistan', value: 'TJ' },
1113
+ filterMatchers: [
1114
+ 'Tajikistan',
1115
+ 'Tajikistani somoni',
1116
+ 'TJS',
1117
+ 'United States dollar',
1118
+ 'USD',
1119
+ ],
1120
+ },
1121
+ {
1122
+ type: 'option',
1123
+ value: { title: 'Tanzania', value: 'TZ' },
1124
+ filterMatchers: [
1125
+ 'Tanzania',
1126
+ 'Tanzanian shilling',
1127
+ 'TZS',
1128
+ 'United States dollar',
1129
+ 'USD',
1130
+ ],
1131
+ },
1132
+ {
1133
+ type: 'option',
1134
+ value: { title: 'Thailand', value: 'TH' },
1135
+ filterMatchers: ['Thailand', 'Thai baht', 'THB', 'United States dollar', 'USD'],
1136
+ },
1137
+ {
1138
+ type: 'option',
1139
+ value: { title: 'Timor-Leste', value: 'TL' },
1140
+ filterMatchers: ['Timor-Leste', 'United States dollar', 'USD'],
1141
+ },
1142
+ {
1143
+ type: 'option',
1144
+ value: { title: 'Togo', value: 'TG' },
1145
+ filterMatchers: [
1146
+ 'Togo',
1147
+ 'West African CFA franc',
1148
+ 'XOF',
1149
+ 'United States dollar',
1150
+ 'USD',
1151
+ ],
1152
+ },
1153
+ {
1154
+ type: 'option',
1155
+ value: { title: 'Tonga', value: 'TO' },
1156
+ filterMatchers: ['Tonga', 'Tongan paʻanga', 'TOP', 'United States dollar', 'USD'],
1157
+ },
1158
+ {
1159
+ type: 'option',
1160
+ value: { title: 'Trinidad and Tobago', value: 'TT' },
1161
+ filterMatchers: [
1162
+ 'Trinidad and Tobago',
1163
+ 'Trinidad and Tobago dollar',
1164
+ 'TTD',
1165
+ 'United States dollar',
1166
+ 'USD',
1167
+ ],
1168
+ },
1169
+ {
1170
+ type: 'option',
1171
+ value: { title: 'Tunisia', value: 'TN' },
1172
+ filterMatchers: ['Tunisia', 'Tunisian dinar', 'TND', 'United States dollar', 'USD'],
1173
+ },
1174
+ {
1175
+ type: 'option',
1176
+ value: { title: 'Turkey', value: 'TR' },
1177
+ filterMatchers: ['Turkey', 'Turkish lira', 'TRY', 'United States dollar', 'USD'],
1178
+ },
1179
+ {
1180
+ type: 'option',
1181
+ value: { title: 'Turkmenistan', value: 'TM' },
1182
+ filterMatchers: [
1183
+ 'Turkmenistan',
1184
+ 'Turkmenistan manat',
1185
+ 'TMT',
1186
+ 'United States dollar',
1187
+ 'USD',
1188
+ ],
1189
+ },
1190
+ {
1191
+ type: 'option',
1192
+ value: { title: 'Tuvalu', value: 'TV' },
1193
+ filterMatchers: ['Tuvalu', 'Australian dollar', 'AUD', 'United States dollar', 'USD'],
1194
+ },
1195
+ {
1196
+ type: 'option',
1197
+ value: { title: 'Uganda', value: 'UG' },
1198
+ filterMatchers: ['Uganda', 'Ugandan shilling', 'UGX', 'United States dollar', 'USD'],
1199
+ },
1200
+ {
1201
+ type: 'option',
1202
+ value: { title: 'Ukraine', value: 'UA' },
1203
+ filterMatchers: ['Ukraine', 'Ukrainian hryvnia', 'UAH', 'United States dollar', 'USD'],
1204
+ },
1205
+ {
1206
+ type: 'option',
1207
+ value: { title: 'United Arab Emirates', value: 'AE' },
1208
+ filterMatchers: [
1209
+ 'United Arab Emirates',
1210
+ 'UAE',
1211
+ 'UAE dirham',
1212
+ 'AED',
1213
+ 'United States dollar',
1214
+ 'USD',
1215
+ ],
1216
+ },
1217
+ {
1218
+ type: 'option',
1219
+ value: { title: 'Uruguay', value: 'UY' },
1220
+ filterMatchers: ['Uruguay', 'Uruguayan peso', 'UYU', 'United States dollar', 'USD'],
1221
+ },
1222
+ {
1223
+ type: 'option',
1224
+ value: { title: 'Uzbekistan', value: 'UZ' },
1225
+ filterMatchers: [
1226
+ 'Uzbekistan',
1227
+ 'Uzbekistani soʻm',
1228
+ 'UZS',
1229
+ 'United States dollar',
1230
+ 'USD',
1231
+ ],
1232
+ },
1233
+ {
1234
+ type: 'option',
1235
+ value: { title: 'Vanuatu', value: 'VU' },
1236
+ filterMatchers: ['Vanuatu', 'Vanuatu vatu', 'VUV', 'United States dollar', 'USD'],
1237
+ },
1238
+ {
1239
+ type: 'option',
1240
+ value: { title: 'Vatican City', value: 'VA' },
1241
+ filterMatchers: ['Vatican City', 'Euro', 'EUR', 'United States dollar', 'USD'],
1242
+ },
1243
+ {
1244
+ type: 'option',
1245
+ value: { title: 'Venezuela', value: 'VE' },
1246
+ filterMatchers: [
1247
+ 'Venezuela',
1248
+ 'Venezuelan bolívar',
1249
+ 'VES',
1250
+ 'United States dollar',
1251
+ 'USD',
1252
+ ],
1253
+ },
1254
+ {
1255
+ type: 'option',
1256
+ value: { title: 'Vietnam', value: 'VN' },
1257
+ filterMatchers: ['Vietnam', 'Vietnamese đồng', 'VND', 'United States dollar', 'USD'],
1258
+ },
1259
+ {
1260
+ type: 'option',
1261
+ value: { title: 'Yemen', value: 'YE' },
1262
+ filterMatchers: ['Yemen', 'Yemeni rial', 'YER', 'United States dollar', 'USD'],
1263
+ },
1264
+ {
1265
+ type: 'option',
1266
+ value: { title: 'Zambia', value: 'ZM' },
1267
+ filterMatchers: ['Zambia', 'Zambian kwacha', 'ZMW', 'United States dollar', 'USD'],
1268
+ },
1269
+ {
1270
+ type: 'option',
1271
+ value: { title: 'Zimbabwe', value: 'ZW' },
1272
+ filterMatchers: ['Zimbabwe', 'Zimbabwean dollar', 'ZWL', 'United States dollar', 'USD'],
1273
+ },
1274
+ ],
1275
+ },
1276
+ ],
1277
+ placeholder: 'Select a country',
1278
+ filterable: true,
1279
+ filterPlaceholder: 'Search countries...',
1280
+ sortFilteredOptions: sortByRelevance((value) => value.title),
1281
+ size: 'lg',
1282
+ renderValue: (value) => value.title,
1283
+ compareValues: (a, b) => a?.value === b?.value,
1284
+ } satisfies Story<{ title: string; value: string }>['args'],
1285
+ /**
1286
+ * Test steps:
1287
+ * 1. Open the dropdown
1288
+ * 2. Search for "united"
1289
+ * 3. Expected: List should stay at the top showing United States, United Kingdom, United Arab Emirates first
1290
+ * 4. Bug (if present): List would scroll to the bottom automatically
1291
+ *
1292
+ * Note: Kazakhstan is the only country without USD in metadata - searching for it should
1293
+ * show it's properly filtered out when searching "united".
1294
+ */
1295
+ play: async ({ canvasElement }) => {
1296
+ const canvas = within(canvasElement);
1297
+ const combobox = canvas.getByRole('combobox');
1298
+ await userEvent.click(combobox);
1299
+ const searchInput = screen.getByPlaceholderText('Search countries...');
1300
+ await userEvent.type(searchInput, 'united');
1301
+ },
1302
+ };
1303
+
24
1304
  const wait = async (duration = 500) =>
25
1305
  new Promise<void>((resolve) => {
26
1306
  setTimeout(resolve, duration);