@makolabs/ripple 1.9.1 → 1.9.2

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,504 @@
1
+ /** ISO 3166-1 alpha-2 codes (generated from ISO dataset). */
2
+ export const ALL_COUNTRY_CODES = [
3
+ 'AD',
4
+ 'AE',
5
+ 'AF',
6
+ 'AG',
7
+ 'AI',
8
+ 'AL',
9
+ 'AM',
10
+ 'AO',
11
+ 'AQ',
12
+ 'AR',
13
+ 'AS',
14
+ 'AT',
15
+ 'AU',
16
+ 'AW',
17
+ 'AX',
18
+ 'AZ',
19
+ 'BA',
20
+ 'BB',
21
+ 'BD',
22
+ 'BE',
23
+ 'BF',
24
+ 'BG',
25
+ 'BH',
26
+ 'BI',
27
+ 'BJ',
28
+ 'BL',
29
+ 'BM',
30
+ 'BN',
31
+ 'BO',
32
+ 'BQ',
33
+ 'BR',
34
+ 'BS',
35
+ 'BT',
36
+ 'BV',
37
+ 'BW',
38
+ 'BY',
39
+ 'BZ',
40
+ 'CA',
41
+ 'CC',
42
+ 'CD',
43
+ 'CF',
44
+ 'CG',
45
+ 'CH',
46
+ 'CI',
47
+ 'CK',
48
+ 'CL',
49
+ 'CM',
50
+ 'CN',
51
+ 'CO',
52
+ 'CR',
53
+ 'CU',
54
+ 'CV',
55
+ 'CW',
56
+ 'CX',
57
+ 'CY',
58
+ 'CZ',
59
+ 'DE',
60
+ 'DJ',
61
+ 'DK',
62
+ 'DM',
63
+ 'DO',
64
+ 'DZ',
65
+ 'EC',
66
+ 'EE',
67
+ 'EG',
68
+ 'EH',
69
+ 'ER',
70
+ 'ES',
71
+ 'ET',
72
+ 'FI',
73
+ 'FJ',
74
+ 'FK',
75
+ 'FM',
76
+ 'FO',
77
+ 'FR',
78
+ 'GA',
79
+ 'GB',
80
+ 'GD',
81
+ 'GE',
82
+ 'GF',
83
+ 'GG',
84
+ 'GH',
85
+ 'GI',
86
+ 'GL',
87
+ 'GM',
88
+ 'GN',
89
+ 'GP',
90
+ 'GQ',
91
+ 'GR',
92
+ 'GS',
93
+ 'GT',
94
+ 'GU',
95
+ 'GW',
96
+ 'GY',
97
+ 'HK',
98
+ 'HM',
99
+ 'HN',
100
+ 'HR',
101
+ 'HT',
102
+ 'HU',
103
+ 'ID',
104
+ 'IE',
105
+ 'IL',
106
+ 'IM',
107
+ 'IN',
108
+ 'IO',
109
+ 'IQ',
110
+ 'IR',
111
+ 'IS',
112
+ 'IT',
113
+ 'JE',
114
+ 'JM',
115
+ 'JO',
116
+ 'JP',
117
+ 'KE',
118
+ 'KG',
119
+ 'KH',
120
+ 'KI',
121
+ 'KM',
122
+ 'KN',
123
+ 'KP',
124
+ 'KR',
125
+ 'KW',
126
+ 'KY',
127
+ 'KZ',
128
+ 'LA',
129
+ 'LB',
130
+ 'LC',
131
+ 'LI',
132
+ 'LK',
133
+ 'LR',
134
+ 'LS',
135
+ 'LT',
136
+ 'LU',
137
+ 'LV',
138
+ 'LY',
139
+ 'MA',
140
+ 'MC',
141
+ 'MD',
142
+ 'ME',
143
+ 'MF',
144
+ 'MG',
145
+ 'MH',
146
+ 'MK',
147
+ 'ML',
148
+ 'MM',
149
+ 'MN',
150
+ 'MO',
151
+ 'MP',
152
+ 'MQ',
153
+ 'MR',
154
+ 'MS',
155
+ 'MT',
156
+ 'MU',
157
+ 'MV',
158
+ 'MW',
159
+ 'MX',
160
+ 'MY',
161
+ 'MZ',
162
+ 'NA',
163
+ 'NC',
164
+ 'NE',
165
+ 'NF',
166
+ 'NG',
167
+ 'NI',
168
+ 'NL',
169
+ 'NO',
170
+ 'NP',
171
+ 'NR',
172
+ 'NU',
173
+ 'NZ',
174
+ 'OM',
175
+ 'PA',
176
+ 'PE',
177
+ 'PF',
178
+ 'PG',
179
+ 'PH',
180
+ 'PK',
181
+ 'PL',
182
+ 'PM',
183
+ 'PN',
184
+ 'PR',
185
+ 'PS',
186
+ 'PT',
187
+ 'PW',
188
+ 'PY',
189
+ 'QA',
190
+ 'RE',
191
+ 'RO',
192
+ 'RS',
193
+ 'RU',
194
+ 'RW',
195
+ 'SA',
196
+ 'SB',
197
+ 'SC',
198
+ 'SD',
199
+ 'SE',
200
+ 'SG',
201
+ 'SH',
202
+ 'SI',
203
+ 'SJ',
204
+ 'SK',
205
+ 'SL',
206
+ 'SM',
207
+ 'SN',
208
+ 'SO',
209
+ 'SR',
210
+ 'SS',
211
+ 'ST',
212
+ 'SV',
213
+ 'SX',
214
+ 'SY',
215
+ 'SZ',
216
+ 'TC',
217
+ 'TD',
218
+ 'TF',
219
+ 'TG',
220
+ 'TH',
221
+ 'TJ',
222
+ 'TK',
223
+ 'TL',
224
+ 'TM',
225
+ 'TN',
226
+ 'TO',
227
+ 'TR',
228
+ 'TT',
229
+ 'TV',
230
+ 'TW',
231
+ 'TZ',
232
+ 'UA',
233
+ 'UG',
234
+ 'UM',
235
+ 'US',
236
+ 'UY',
237
+ 'UZ',
238
+ 'VA',
239
+ 'VC',
240
+ 'VE',
241
+ 'VG',
242
+ 'VI',
243
+ 'VN',
244
+ 'VU',
245
+ 'WF',
246
+ 'WS',
247
+ 'YE',
248
+ 'YT',
249
+ 'ZA',
250
+ 'ZM',
251
+ 'ZW'
252
+ ];
253
+ /** English short names (ISO list). */
254
+ export const COUNTRY_NAMES = {
255
+ AD: 'Andorra',
256
+ AE: 'United Arab Emirates',
257
+ AF: 'Afghanistan',
258
+ AG: 'Antigua and Barbuda',
259
+ AI: 'Anguilla',
260
+ AL: 'Albania',
261
+ AM: 'Armenia',
262
+ AO: 'Angola',
263
+ AQ: 'Antarctica',
264
+ AR: 'Argentina',
265
+ AS: 'American Samoa',
266
+ AT: 'Austria',
267
+ AU: 'Australia',
268
+ AW: 'Aruba',
269
+ AX: 'Åland Islands',
270
+ AZ: 'Azerbaijan',
271
+ BA: 'Bosnia and Herzegovina',
272
+ BB: 'Barbados',
273
+ BD: 'Bangladesh',
274
+ BE: 'Belgium',
275
+ BF: 'Burkina Faso',
276
+ BG: 'Bulgaria',
277
+ BH: 'Bahrain',
278
+ BI: 'Burundi',
279
+ BJ: 'Benin',
280
+ BL: 'Saint Barthélemy',
281
+ BM: 'Bermuda',
282
+ BN: 'Brunei Darussalam',
283
+ BO: 'Bolivia, Plurinational State of',
284
+ BQ: 'Bonaire, Sint Eustatius and Saba',
285
+ BR: 'Brazil',
286
+ BS: 'Bahamas',
287
+ BT: 'Bhutan',
288
+ BV: 'Bouvet Island',
289
+ BW: 'Botswana',
290
+ BY: 'Belarus',
291
+ BZ: 'Belize',
292
+ CA: 'Canada',
293
+ CC: 'Cocos (Keeling) Islands',
294
+ CD: 'Congo, Democratic Republic of the',
295
+ CF: 'Central African Republic',
296
+ CG: 'Congo',
297
+ CH: 'Switzerland',
298
+ CI: "Côte d'Ivoire",
299
+ CK: 'Cook Islands',
300
+ CL: 'Chile',
301
+ CM: 'Cameroon',
302
+ CN: 'China',
303
+ CO: 'Colombia',
304
+ CR: 'Costa Rica',
305
+ CU: 'Cuba',
306
+ CV: 'Cabo Verde',
307
+ CW: 'Curaçao',
308
+ CX: 'Christmas Island',
309
+ CY: 'Cyprus',
310
+ CZ: 'Czechia',
311
+ DE: 'Germany',
312
+ DJ: 'Djibouti',
313
+ DK: 'Denmark',
314
+ DM: 'Dominica',
315
+ DO: 'Dominican Republic',
316
+ DZ: 'Algeria',
317
+ EC: 'Ecuador',
318
+ EE: 'Estonia',
319
+ EG: 'Egypt',
320
+ EH: 'Western Sahara',
321
+ ER: 'Eritrea',
322
+ ES: 'Spain',
323
+ ET: 'Ethiopia',
324
+ FI: 'Finland',
325
+ FJ: 'Fiji',
326
+ FK: 'Falkland Islands (Malvinas)',
327
+ FM: 'Micronesia, Federated States of',
328
+ FO: 'Faroe Islands',
329
+ FR: 'France',
330
+ GA: 'Gabon',
331
+ GB: 'United Kingdom of Great Britain and Northern Ireland',
332
+ GD: 'Grenada',
333
+ GE: 'Georgia',
334
+ GF: 'French Guiana',
335
+ GG: 'Guernsey',
336
+ GH: 'Ghana',
337
+ GI: 'Gibraltar',
338
+ GL: 'Greenland',
339
+ GM: 'Gambia',
340
+ GN: 'Guinea',
341
+ GP: 'Guadeloupe',
342
+ GQ: 'Equatorial Guinea',
343
+ GR: 'Greece',
344
+ GS: 'South Georgia and the South Sandwich Islands',
345
+ GT: 'Guatemala',
346
+ GU: 'Guam',
347
+ GW: 'Guinea-Bissau',
348
+ GY: 'Guyana',
349
+ HK: 'Hong Kong',
350
+ HM: 'Heard Island and McDonald Islands',
351
+ HN: 'Honduras',
352
+ HR: 'Croatia',
353
+ HT: 'Haiti',
354
+ HU: 'Hungary',
355
+ ID: 'Indonesia',
356
+ IE: 'Ireland',
357
+ IL: 'Israel',
358
+ IM: 'Isle of Man',
359
+ IN: 'India',
360
+ IO: 'British Indian Ocean Territory',
361
+ IQ: 'Iraq',
362
+ IR: 'Iran, Islamic Republic of',
363
+ IS: 'Iceland',
364
+ IT: 'Italy',
365
+ JE: 'Jersey',
366
+ JM: 'Jamaica',
367
+ JO: 'Jordan',
368
+ JP: 'Japan',
369
+ KE: 'Kenya',
370
+ KG: 'Kyrgyzstan',
371
+ KH: 'Cambodia',
372
+ KI: 'Kiribati',
373
+ KM: 'Comoros',
374
+ KN: 'Saint Kitts and Nevis',
375
+ KP: "Korea, Democratic People's Republic of",
376
+ KR: 'Korea, Republic of',
377
+ KW: 'Kuwait',
378
+ KY: 'Cayman Islands',
379
+ KZ: 'Kazakhstan',
380
+ LA: "Lao People's Democratic Republic",
381
+ LB: 'Lebanon',
382
+ LC: 'Saint Lucia',
383
+ LI: 'Liechtenstein',
384
+ LK: 'Sri Lanka',
385
+ LR: 'Liberia',
386
+ LS: 'Lesotho',
387
+ LT: 'Lithuania',
388
+ LU: 'Luxembourg',
389
+ LV: 'Latvia',
390
+ LY: 'Libya',
391
+ MA: 'Morocco',
392
+ MC: 'Monaco',
393
+ MD: 'Moldova, Republic of',
394
+ ME: 'Montenegro',
395
+ MF: 'Saint Martin (French part)',
396
+ MG: 'Madagascar',
397
+ MH: 'Marshall Islands',
398
+ MK: 'North Macedonia',
399
+ ML: 'Mali',
400
+ MM: 'Myanmar',
401
+ MN: 'Mongolia',
402
+ MO: 'Macao',
403
+ MP: 'Northern Mariana Islands',
404
+ MQ: 'Martinique',
405
+ MR: 'Mauritania',
406
+ MS: 'Montserrat',
407
+ MT: 'Malta',
408
+ MU: 'Mauritius',
409
+ MV: 'Maldives',
410
+ MW: 'Malawi',
411
+ MX: 'Mexico',
412
+ MY: 'Malaysia',
413
+ MZ: 'Mozambique',
414
+ NA: 'Namibia',
415
+ NC: 'New Caledonia',
416
+ NE: 'Niger',
417
+ NF: 'Norfolk Island',
418
+ NG: 'Nigeria',
419
+ NI: 'Nicaragua',
420
+ NL: 'Netherlands, Kingdom of the',
421
+ NO: 'Norway',
422
+ NP: 'Nepal',
423
+ NR: 'Nauru',
424
+ NU: 'Niue',
425
+ NZ: 'New Zealand',
426
+ OM: 'Oman',
427
+ PA: 'Panama',
428
+ PE: 'Peru',
429
+ PF: 'French Polynesia',
430
+ PG: 'Papua New Guinea',
431
+ PH: 'Philippines',
432
+ PK: 'Pakistan',
433
+ PL: 'Poland',
434
+ PM: 'Saint Pierre and Miquelon',
435
+ PN: 'Pitcairn',
436
+ PR: 'Puerto Rico',
437
+ PS: 'Palestine, State of',
438
+ PT: 'Portugal',
439
+ PW: 'Palau',
440
+ PY: 'Paraguay',
441
+ QA: 'Qatar',
442
+ RE: 'Réunion',
443
+ RO: 'Romania',
444
+ RS: 'Serbia',
445
+ RU: 'Russian Federation',
446
+ RW: 'Rwanda',
447
+ SA: 'Saudi Arabia',
448
+ SB: 'Solomon Islands',
449
+ SC: 'Seychelles',
450
+ SD: 'Sudan',
451
+ SE: 'Sweden',
452
+ SG: 'Singapore',
453
+ SH: 'Saint Helena, Ascension and Tristan da Cunha',
454
+ SI: 'Slovenia',
455
+ SJ: 'Svalbard and Jan Mayen',
456
+ SK: 'Slovakia',
457
+ SL: 'Sierra Leone',
458
+ SM: 'San Marino',
459
+ SN: 'Senegal',
460
+ SO: 'Somalia',
461
+ SR: 'Suriname',
462
+ SS: 'South Sudan',
463
+ ST: 'Sao Tome and Principe',
464
+ SV: 'El Salvador',
465
+ SX: 'Sint Maarten (Dutch part)',
466
+ SY: 'Syrian Arab Republic',
467
+ SZ: 'Eswatini',
468
+ TC: 'Turks and Caicos Islands',
469
+ TD: 'Chad',
470
+ TF: 'French Southern Territories',
471
+ TG: 'Togo',
472
+ TH: 'Thailand',
473
+ TJ: 'Tajikistan',
474
+ TK: 'Tokelau',
475
+ TL: 'Timor-Leste',
476
+ TM: 'Turkmenistan',
477
+ TN: 'Tunisia',
478
+ TO: 'Tonga',
479
+ TR: 'Türkiye',
480
+ TT: 'Trinidad and Tobago',
481
+ TV: 'Tuvalu',
482
+ TW: 'Taiwan, Province of China',
483
+ TZ: 'Tanzania, United Republic of',
484
+ UA: 'Ukraine',
485
+ UG: 'Uganda',
486
+ UM: 'United States Minor Outlying Islands',
487
+ US: 'United States of America',
488
+ UY: 'Uruguay',
489
+ UZ: 'Uzbekistan',
490
+ VA: 'Holy See',
491
+ VC: 'Saint Vincent and the Grenadines',
492
+ VE: 'Venezuela, Bolivarian Republic of',
493
+ VG: 'Virgin Islands (British)',
494
+ VI: 'Virgin Islands (U.S.)',
495
+ VN: 'Viet Nam',
496
+ VU: 'Vanuatu',
497
+ WF: 'Wallis and Futuna',
498
+ WS: 'Samoa',
499
+ YE: 'Yemen',
500
+ YT: 'Mayotte',
501
+ ZA: 'South Africa',
502
+ ZM: 'Zambia',
503
+ ZW: 'Zimbabwe'
504
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Regional-indicator flag emoji from ISO 3166-1 alpha-2 (e.g. DE → 🇩🇪).
3
+ * Returns empty string if the code is not two ASCII letters.
4
+ */
5
+ export declare function countryCodeToFlagEmoji(code: string): string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Regional-indicator flag emoji from ISO 3166-1 alpha-2 (e.g. DE → 🇩🇪).
3
+ * Returns empty string if the code is not two ASCII letters.
4
+ */
5
+ export function countryCodeToFlagEmoji(code) {
6
+ const u = code.trim().toUpperCase();
7
+ if (u.length !== 2 || !/^[A-Z]{2}$/.test(u))
8
+ return '';
9
+ const base = 0x1f1e6; // Regional Indicator Symbol Letter A
10
+ return String.fromCodePoint(base + u.charCodeAt(0) - 65, base + u.charCodeAt(1) - 65);
11
+ }
@@ -0,0 +1,27 @@
1
+ import type { ClassValue } from 'tailwind-variants';
2
+ import type { CountryCode } from './country-data.js';
3
+ import type { VariantColors, VariantSizes } from '../../index.js';
4
+ export type MarketSelectorProps = {
5
+ /**
6
+ * Non-empty ordered list of ISO 3166-1 alpha-2 codes to show (e.g. `[Market.DE, Market.GB, Market.CH]`).
7
+ * United Kingdom is `Market.GB` (not `UK`).
8
+ */
9
+ markets: CountryCode[];
10
+ /** Selected market; use `bind:selectedMarket`. */
11
+ selectedMarket?: CountryCode;
12
+ /** Used when `selectedMarket` is unset or not in `markets` (e.g. first paint or bad URL). */
13
+ defaultMarket?: CountryCode;
14
+ showFlags?: boolean;
15
+ label?: string;
16
+ appearance?: 'surface' | 'inverted';
17
+ orientation?: 'horizontal' | 'vertical';
18
+ color?: VariantColors;
19
+ size?: VariantSizes;
20
+ compact?: boolean;
21
+ disabled?: boolean;
22
+ class?: ClassValue;
23
+ /** Optional form field name (hidden input), same as `SegmentedControl`. */
24
+ name?: string;
25
+ onchange?: (market: CountryCode) => void;
26
+ testId?: string;
27
+ };
@@ -0,0 +1 @@
1
+ export {};