@razorpay/blade 11.1.0 → 11.2.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.
- package/README.md +1 -1
- package/build/lib/native/components/Amount/Amount.js +4 -3
- package/build/lib/native/components/Amount/Amount.js.map +1 -1
- package/build/lib/native/components/Amount/amountTokens.js +2 -2
- package/build/lib/native/components/Amount/amountTokens.js.map +1 -1
- package/build/lib/native/components/Dropdown/Dropdown.js +2 -2
- package/build/lib/native/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/development/components/Amount/Amount.js +107 -106
- package/build/lib/web/development/components/Amount/Amount.js.map +1 -1
- package/build/lib/web/development/components/Amount/amountTokens.js +1 -415
- package/build/lib/web/development/components/Amount/amountTokens.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js +60 -51
- package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +10 -0
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/production/components/Amount/Amount.js +107 -106
- package/build/lib/web/production/components/Amount/Amount.js.map +1 -1
- package/build/lib/web/production/components/Amount/amountTokens.js +1 -415
- package/build/lib/web/production/components/Amount/amountTokens.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js +60 -51
- package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +10 -0
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/types/components/index.d.ts +4 -384
- package/build/types/components/index.native.d.ts +4 -384
- package/package.json +6 -3
|
@@ -62,419 +62,5 @@ var amountLineHeights = {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
var currencyIndicatorMapping = {
|
|
67
|
-
AED: {
|
|
68
|
-
'currency-symbol': 'د.إ',
|
|
69
|
-
'currency-code': 'AED'
|
|
70
|
-
},
|
|
71
|
-
ALL: {
|
|
72
|
-
'currency-symbol': 'Lek',
|
|
73
|
-
'currency-code': 'ALL'
|
|
74
|
-
},
|
|
75
|
-
AMD: {
|
|
76
|
-
'currency-symbol': '֏',
|
|
77
|
-
'currency-code': 'AMD'
|
|
78
|
-
},
|
|
79
|
-
ARS: {
|
|
80
|
-
'currency-symbol': 'ARS',
|
|
81
|
-
'currency-code': 'ARS'
|
|
82
|
-
},
|
|
83
|
-
AUD: {
|
|
84
|
-
'currency-symbol': 'A$',
|
|
85
|
-
'currency-code': 'AUD'
|
|
86
|
-
},
|
|
87
|
-
AWG: {
|
|
88
|
-
'currency-symbol': 'Afl.',
|
|
89
|
-
'currency-code': 'AWG'
|
|
90
|
-
},
|
|
91
|
-
BBD: {
|
|
92
|
-
'currency-symbol': '$',
|
|
93
|
-
'currency-code': 'BBD'
|
|
94
|
-
},
|
|
95
|
-
BDT: {
|
|
96
|
-
'currency-symbol': '৳',
|
|
97
|
-
'currency-code': 'BDT'
|
|
98
|
-
},
|
|
99
|
-
BMD: {
|
|
100
|
-
'currency-symbol': '$',
|
|
101
|
-
'currency-code': 'BMD'
|
|
102
|
-
},
|
|
103
|
-
BND: {
|
|
104
|
-
'currency-symbol': 'BND',
|
|
105
|
-
'currency-code': 'BND'
|
|
106
|
-
},
|
|
107
|
-
BOB: {
|
|
108
|
-
'currency-symbol': 'Bs',
|
|
109
|
-
'currency-code': 'BOB'
|
|
110
|
-
},
|
|
111
|
-
BSD: {
|
|
112
|
-
'currency-symbol': 'B$',
|
|
113
|
-
'currency-code': 'BSD'
|
|
114
|
-
},
|
|
115
|
-
BWP: {
|
|
116
|
-
'currency-symbol': 'P',
|
|
117
|
-
'currency-code': 'BWP'
|
|
118
|
-
},
|
|
119
|
-
BZD: {
|
|
120
|
-
'currency-symbol': 'BZ$',
|
|
121
|
-
'currency-code': 'BZD'
|
|
122
|
-
},
|
|
123
|
-
CAD: {
|
|
124
|
-
'currency-symbol': 'C$',
|
|
125
|
-
'currency-code': 'CAD'
|
|
126
|
-
},
|
|
127
|
-
CHF: {
|
|
128
|
-
'currency-symbol': 'CHf',
|
|
129
|
-
'currency-code': 'CHF'
|
|
130
|
-
},
|
|
131
|
-
CNY: {
|
|
132
|
-
'currency-symbol': '¥',
|
|
133
|
-
'currency-code': 'CNY'
|
|
134
|
-
},
|
|
135
|
-
COP: {
|
|
136
|
-
'currency-symbol': 'COL$',
|
|
137
|
-
'currency-code': 'COP'
|
|
138
|
-
},
|
|
139
|
-
CRC: {
|
|
140
|
-
'currency-symbol': '₡',
|
|
141
|
-
'currency-code': 'CRC'
|
|
142
|
-
},
|
|
143
|
-
CUP: {
|
|
144
|
-
'currency-symbol': '$MN',
|
|
145
|
-
'currency-code': 'CUP'
|
|
146
|
-
},
|
|
147
|
-
CZK: {
|
|
148
|
-
'currency-symbol': 'Kč',
|
|
149
|
-
'currency-code': 'CZK'
|
|
150
|
-
},
|
|
151
|
-
DKK: {
|
|
152
|
-
'currency-symbol': 'DKK',
|
|
153
|
-
'currency-code': 'DKK'
|
|
154
|
-
},
|
|
155
|
-
DOP: {
|
|
156
|
-
'currency-symbol': 'RD$',
|
|
157
|
-
'currency-code': 'DOP'
|
|
158
|
-
},
|
|
159
|
-
DZD: {
|
|
160
|
-
'currency-symbol': 'د.ج',
|
|
161
|
-
'currency-code': 'DZD'
|
|
162
|
-
},
|
|
163
|
-
EGP: {
|
|
164
|
-
'currency-symbol': 'E£',
|
|
165
|
-
'currency-code': 'EGP'
|
|
166
|
-
},
|
|
167
|
-
ETB: {
|
|
168
|
-
'currency-symbol': 'ብር',
|
|
169
|
-
'currency-code': 'ETB'
|
|
170
|
-
},
|
|
171
|
-
EUR: {
|
|
172
|
-
'currency-symbol': '€',
|
|
173
|
-
'currency-code': 'EUR'
|
|
174
|
-
},
|
|
175
|
-
FJD: {
|
|
176
|
-
'currency-symbol': 'FJ$',
|
|
177
|
-
'currency-code': 'FJD'
|
|
178
|
-
},
|
|
179
|
-
GBP: {
|
|
180
|
-
'currency-symbol': '£',
|
|
181
|
-
'currency-code': 'GBP'
|
|
182
|
-
},
|
|
183
|
-
GHS: {
|
|
184
|
-
'currency-symbol': 'GH₵',
|
|
185
|
-
'currency-code': 'GHS'
|
|
186
|
-
},
|
|
187
|
-
GIP: {
|
|
188
|
-
'currency-symbol': 'GIP',
|
|
189
|
-
'currency-code': 'GIP'
|
|
190
|
-
},
|
|
191
|
-
GMD: {
|
|
192
|
-
'currency-symbol': 'D',
|
|
193
|
-
'currency-code': 'GMD'
|
|
194
|
-
},
|
|
195
|
-
GTQ: {
|
|
196
|
-
'currency-symbol': 'Q',
|
|
197
|
-
'currency-code': 'GTQ'
|
|
198
|
-
},
|
|
199
|
-
GYD: {
|
|
200
|
-
'currency-symbol': 'G$',
|
|
201
|
-
'currency-code': 'GYD'
|
|
202
|
-
},
|
|
203
|
-
HKD: {
|
|
204
|
-
'currency-symbol': 'HK$',
|
|
205
|
-
'currency-code': 'HKD'
|
|
206
|
-
},
|
|
207
|
-
HNL: {
|
|
208
|
-
'currency-symbol': 'HNL',
|
|
209
|
-
'currency-code': 'HNL'
|
|
210
|
-
},
|
|
211
|
-
HRK: {
|
|
212
|
-
'currency-symbol': 'kn',
|
|
213
|
-
'currency-code': 'HRK'
|
|
214
|
-
},
|
|
215
|
-
HTG: {
|
|
216
|
-
'currency-symbol': 'G',
|
|
217
|
-
'currency-code': 'HTG'
|
|
218
|
-
},
|
|
219
|
-
HUF: {
|
|
220
|
-
'currency-symbol': 'Ft',
|
|
221
|
-
'currency-code': 'HUF'
|
|
222
|
-
},
|
|
223
|
-
IDR: {
|
|
224
|
-
'currency-symbol': 'Rp',
|
|
225
|
-
'currency-code': 'IDR'
|
|
226
|
-
},
|
|
227
|
-
ILS: {
|
|
228
|
-
'currency-symbol': '₪',
|
|
229
|
-
'currency-code': 'ILS'
|
|
230
|
-
},
|
|
231
|
-
INR: {
|
|
232
|
-
'currency-symbol': '₹',
|
|
233
|
-
'currency-code': 'INR'
|
|
234
|
-
},
|
|
235
|
-
JMD: {
|
|
236
|
-
'currency-symbol': 'J$',
|
|
237
|
-
'currency-code': 'JMD'
|
|
238
|
-
},
|
|
239
|
-
KES: {
|
|
240
|
-
'currency-symbol': 'Ksh',
|
|
241
|
-
'currency-code': 'KES'
|
|
242
|
-
},
|
|
243
|
-
KGS: {
|
|
244
|
-
'currency-symbol': 'Лв',
|
|
245
|
-
'currency-code': 'KGS'
|
|
246
|
-
},
|
|
247
|
-
KHR: {
|
|
248
|
-
'currency-symbol': '៛',
|
|
249
|
-
'currency-code': 'KHR'
|
|
250
|
-
},
|
|
251
|
-
KYD: {
|
|
252
|
-
'currency-symbol': 'CI$',
|
|
253
|
-
'currency-code': 'KYD'
|
|
254
|
-
},
|
|
255
|
-
KZT: {
|
|
256
|
-
'currency-symbol': '₸',
|
|
257
|
-
'currency-code': 'KZT'
|
|
258
|
-
},
|
|
259
|
-
LAK: {
|
|
260
|
-
'currency-symbol': '₭',
|
|
261
|
-
'currency-code': 'LAK'
|
|
262
|
-
},
|
|
263
|
-
LKR: {
|
|
264
|
-
'currency-symbol': 'රු',
|
|
265
|
-
'currency-code': 'LKR'
|
|
266
|
-
},
|
|
267
|
-
LRD: {
|
|
268
|
-
'currency-symbol': 'L$',
|
|
269
|
-
'currency-code': 'LRD'
|
|
270
|
-
},
|
|
271
|
-
LSL: {
|
|
272
|
-
'currency-symbol': 'LSL',
|
|
273
|
-
'currency-code': 'LSL'
|
|
274
|
-
},
|
|
275
|
-
MAD: {
|
|
276
|
-
'currency-symbol': 'د.م.',
|
|
277
|
-
'currency-code': 'MAD'
|
|
278
|
-
},
|
|
279
|
-
MDL: {
|
|
280
|
-
'currency-symbol': 'MDL',
|
|
281
|
-
'currency-code': 'MDL'
|
|
282
|
-
},
|
|
283
|
-
MKD: {
|
|
284
|
-
'currency-symbol': 'ден',
|
|
285
|
-
'currency-code': 'MKD'
|
|
286
|
-
},
|
|
287
|
-
MMK: {
|
|
288
|
-
'currency-symbol': 'MMK',
|
|
289
|
-
'currency-code': 'MMK'
|
|
290
|
-
},
|
|
291
|
-
MNT: {
|
|
292
|
-
'currency-symbol': '₮',
|
|
293
|
-
'currency-code': 'MNT'
|
|
294
|
-
},
|
|
295
|
-
MOP: {
|
|
296
|
-
'currency-symbol': 'MOP$',
|
|
297
|
-
'currency-code': 'MOP'
|
|
298
|
-
},
|
|
299
|
-
MUR: {
|
|
300
|
-
'currency-symbol': '₨',
|
|
301
|
-
'currency-code': 'MUR'
|
|
302
|
-
},
|
|
303
|
-
MVR: {
|
|
304
|
-
'currency-symbol': 'Rf',
|
|
305
|
-
'currency-code': 'MVR'
|
|
306
|
-
},
|
|
307
|
-
MWK: {
|
|
308
|
-
'currency-symbol': 'MK',
|
|
309
|
-
'currency-code': 'MWK'
|
|
310
|
-
},
|
|
311
|
-
MXN: {
|
|
312
|
-
'currency-symbol': 'Mex$',
|
|
313
|
-
'currency-code': 'MXN'
|
|
314
|
-
},
|
|
315
|
-
MYR: {
|
|
316
|
-
'currency-symbol': 'RM',
|
|
317
|
-
'currency-code': 'MYR'
|
|
318
|
-
},
|
|
319
|
-
NAD: {
|
|
320
|
-
'currency-symbol': 'N$',
|
|
321
|
-
'currency-code': 'NAD'
|
|
322
|
-
},
|
|
323
|
-
NGN: {
|
|
324
|
-
'currency-symbol': '₦',
|
|
325
|
-
'currency-code': 'NGN'
|
|
326
|
-
},
|
|
327
|
-
NIO: {
|
|
328
|
-
'currency-symbol': 'NIO',
|
|
329
|
-
'currency-code': 'NIO'
|
|
330
|
-
},
|
|
331
|
-
NOK: {
|
|
332
|
-
'currency-symbol': 'NOK',
|
|
333
|
-
'currency-code': 'NOK'
|
|
334
|
-
},
|
|
335
|
-
NPR: {
|
|
336
|
-
'currency-symbol': 'रू',
|
|
337
|
-
'currency-code': 'NPR'
|
|
338
|
-
},
|
|
339
|
-
NZD: {
|
|
340
|
-
'currency-symbol': 'NZ$',
|
|
341
|
-
'currency-code': 'NZD'
|
|
342
|
-
},
|
|
343
|
-
PEN: {
|
|
344
|
-
'currency-symbol': 'S/',
|
|
345
|
-
'currency-code': 'PEN'
|
|
346
|
-
},
|
|
347
|
-
PGK: {
|
|
348
|
-
'currency-symbol': 'PGK',
|
|
349
|
-
'currency-code': 'PGK'
|
|
350
|
-
},
|
|
351
|
-
PHP: {
|
|
352
|
-
'currency-symbol': '₱',
|
|
353
|
-
'currency-code': 'PHP'
|
|
354
|
-
},
|
|
355
|
-
PKR: {
|
|
356
|
-
'currency-symbol': '₨',
|
|
357
|
-
'currency-code': 'PKR'
|
|
358
|
-
},
|
|
359
|
-
QAR: {
|
|
360
|
-
'currency-symbol': 'QR',
|
|
361
|
-
'currency-code': 'QAR'
|
|
362
|
-
},
|
|
363
|
-
RUB: {
|
|
364
|
-
'currency-symbol': '₽',
|
|
365
|
-
'currency-code': 'RUB'
|
|
366
|
-
},
|
|
367
|
-
SAR: {
|
|
368
|
-
'currency-symbol': 'SR',
|
|
369
|
-
'currency-code': 'SAR'
|
|
370
|
-
},
|
|
371
|
-
SCR: {
|
|
372
|
-
'currency-symbol': 'SRe',
|
|
373
|
-
'currency-code': 'SCR'
|
|
374
|
-
},
|
|
375
|
-
SEK: {
|
|
376
|
-
'currency-symbol': 'SEK',
|
|
377
|
-
'currency-code': 'SEK'
|
|
378
|
-
},
|
|
379
|
-
SGD: {
|
|
380
|
-
'currency-symbol': 'S$',
|
|
381
|
-
'currency-code': 'SGD'
|
|
382
|
-
},
|
|
383
|
-
SLL: {
|
|
384
|
-
'currency-symbol': 'Le',
|
|
385
|
-
'currency-code': 'SLL'
|
|
386
|
-
},
|
|
387
|
-
SOS: {
|
|
388
|
-
'currency-symbol': 'Sh.so.',
|
|
389
|
-
'currency-code': 'SOS'
|
|
390
|
-
},
|
|
391
|
-
SSP: {
|
|
392
|
-
'currency-symbol': 'SS£',
|
|
393
|
-
'currency-code': 'SSP'
|
|
394
|
-
},
|
|
395
|
-
SVC: {
|
|
396
|
-
'currency-symbol': '₡',
|
|
397
|
-
'currency-code': 'SVC'
|
|
398
|
-
},
|
|
399
|
-
SZL: {
|
|
400
|
-
'currency-symbol': 'E',
|
|
401
|
-
'currency-code': 'SZL'
|
|
402
|
-
},
|
|
403
|
-
THB: {
|
|
404
|
-
'currency-symbol': '฿',
|
|
405
|
-
'currency-code': 'THB'
|
|
406
|
-
},
|
|
407
|
-
TTD: {
|
|
408
|
-
'currency-symbol': 'TT$',
|
|
409
|
-
'currency-code': 'TTD'
|
|
410
|
-
},
|
|
411
|
-
TZS: {
|
|
412
|
-
'currency-symbol': 'Sh',
|
|
413
|
-
'currency-code': 'TZS'
|
|
414
|
-
},
|
|
415
|
-
USD: {
|
|
416
|
-
'currency-symbol': '$',
|
|
417
|
-
'currency-code': 'USD'
|
|
418
|
-
},
|
|
419
|
-
UYU: {
|
|
420
|
-
'currency-symbol': '$U',
|
|
421
|
-
'currency-code': 'UYU'
|
|
422
|
-
},
|
|
423
|
-
UZS: {
|
|
424
|
-
'currency-symbol': "so'm",
|
|
425
|
-
'currency-code': 'UZS'
|
|
426
|
-
},
|
|
427
|
-
YER: {
|
|
428
|
-
'currency-symbol': '﷼',
|
|
429
|
-
'currency-code': 'YER'
|
|
430
|
-
},
|
|
431
|
-
ZAR: {
|
|
432
|
-
'currency-symbol': 'R',
|
|
433
|
-
'currency-code': 'ZAR'
|
|
434
|
-
},
|
|
435
|
-
KWD: {
|
|
436
|
-
'currency-symbol': 'د.ك',
|
|
437
|
-
'currency-code': 'KWD'
|
|
438
|
-
},
|
|
439
|
-
BHD: {
|
|
440
|
-
'currency-symbol': 'د.ب.',
|
|
441
|
-
'currency-code': 'BHD'
|
|
442
|
-
},
|
|
443
|
-
OMR: {
|
|
444
|
-
'currency-symbol': 'ر.ع.',
|
|
445
|
-
'currency-code': 'OMR'
|
|
446
|
-
}
|
|
447
|
-
};
|
|
448
|
-
var getCurrencyAbbreviations = function getCurrencyAbbreviations(currency) {
|
|
449
|
-
if (currency === 'INR') {
|
|
450
|
-
return [{
|
|
451
|
-
value: 1e7,
|
|
452
|
-
symbol: 'Cr'
|
|
453
|
-
}, {
|
|
454
|
-
value: 1e5,
|
|
455
|
-
symbol: 'L'
|
|
456
|
-
}, {
|
|
457
|
-
value: 1e3,
|
|
458
|
-
symbol: 'k'
|
|
459
|
-
}];
|
|
460
|
-
}
|
|
461
|
-
return [{
|
|
462
|
-
value: 1e9,
|
|
463
|
-
symbol: 'B'
|
|
464
|
-
}, {
|
|
465
|
-
value: 1e6,
|
|
466
|
-
symbol: 'M'
|
|
467
|
-
}, {
|
|
468
|
-
value: 1e3,
|
|
469
|
-
symbol: 'K'
|
|
470
|
-
}];
|
|
471
|
-
};
|
|
472
|
-
var currencyPositionMapping = {
|
|
473
|
-
DZD: 'right',
|
|
474
|
-
BHD: 'right',
|
|
475
|
-
OMR: 'right',
|
|
476
|
-
KWD: 'right'
|
|
477
|
-
};
|
|
478
|
-
|
|
479
|
-
export { amountLineHeights, currencyIndicatorMapping, currencyPositionMapping, getCurrencyAbbreviations, normalAmountSizes, subtleFontSizes };
|
|
65
|
+
export { amountLineHeights, normalAmountSizes, subtleFontSizes };
|
|
480
66
|
//# sourceMappingURL=amountTokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amountTokens.js","sources":["../../../../../../src/components/Amount/amountTokens.ts"],"sourcesContent":["import type { FontSize, Typography } from '~tokens/global';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\n\ntype AmountSizes = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge';\n\ntype AmountDisplayProps = {\n type?: 'display';\n size?: Extract<AmountSizes, 'small' | 'medium' | 'large' | 'xlarge'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n};\n\ntype AmountHeadingProps = {\n type?: 'heading';\n size?: Extract<AmountSizes, 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'semibold'>;\n};\n\ntype AmountBodyProps = {\n type?: 'body';\n size?: Extract<AmountSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n};\n\ntype AmountTypeProps = AmountDisplayProps | AmountHeadingProps | AmountBodyProps;\n\nconst normalAmountSizes: Record<\n 'body' | 'heading' | 'display',\n Partial<Record<NonNullable<AmountTypeProps['size']>, keyof FontSize>>\n> = {\n body: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n heading: {\n small: 300,\n medium: 400,\n large: 500,\n xlarge: 600,\n '2xlarge': 700,\n },\n display: {\n small: 800,\n medium: 900,\n large: 1000,\n xlarge: 1100,\n },\n};\n\nconst subtleFontSizes: Record<\n 'body' | 'heading' | 'display',\n Partial<Record<NonNullable<AmountTypeProps['size']>, keyof FontSize>>\n> = {\n body: {\n xsmall: normalAmountSizes.body.xsmall,\n small: normalAmountSizes.body.xsmall,\n medium: normalAmountSizes.body.xsmall,\n large: normalAmountSizes.body.small,\n },\n heading: {\n small: normalAmountSizes.body.small,\n medium: normalAmountSizes.body.medium,\n large: normalAmountSizes.body.large,\n xlarge: normalAmountSizes.heading.medium,\n '2xlarge': normalAmountSizes.heading.large,\n },\n display: {\n small: normalAmountSizes.heading.xlarge,\n medium: normalAmountSizes.heading['2xlarge'],\n large: normalAmountSizes.heading['2xlarge'],\n xlarge: normalAmountSizes.display.small,\n },\n};\n\nconst amountLineHeights: Record<\n 'body' | 'heading' | 'display',\n Partial<Record<NonNullable<AmountTypeProps['size']>, keyof Typography['lineHeights']>>\n> = {\n body: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n heading: {\n small: 300,\n medium: 400,\n large: 500,\n xlarge: 600,\n '2xlarge': 700,\n },\n display: {\n small: 800,\n medium: 900,\n large: 1000,\n xlarge: 1100,\n },\n};\n\n// All the supported currency codes are taken from Razorpay's Merchant Dashboard codebase\nconst currencyIndicatorMapping = {\n AED: { 'currency-symbol': 'د.إ', 'currency-code': 'AED' },\n ALL: { 'currency-symbol': 'Lek', 'currency-code': 'ALL' },\n AMD: { 'currency-symbol': '֏', 'currency-code': 'AMD' },\n ARS: { 'currency-symbol': 'ARS', 'currency-code': 'ARS' },\n AUD: { 'currency-symbol': 'A$', 'currency-code': 'AUD' },\n AWG: { 'currency-symbol': 'Afl.', 'currency-code': 'AWG' },\n BBD: { 'currency-symbol': '$', 'currency-code': 'BBD' },\n BDT: { 'currency-symbol': '৳', 'currency-code': 'BDT' },\n BMD: { 'currency-symbol': '$', 'currency-code': 'BMD' },\n BND: { 'currency-symbol': 'BND', 'currency-code': 'BND' },\n BOB: { 'currency-symbol': 'Bs', 'currency-code': 'BOB' },\n BSD: { 'currency-symbol': 'B$', 'currency-code': 'BSD' },\n BWP: { 'currency-symbol': 'P', 'currency-code': 'BWP' },\n BZD: { 'currency-symbol': 'BZ$', 'currency-code': 'BZD' },\n CAD: { 'currency-symbol': 'C$', 'currency-code': 'CAD' },\n CHF: { 'currency-symbol': 'CHf', 'currency-code': 'CHF' },\n CNY: { 'currency-symbol': '¥', 'currency-code': 'CNY' },\n COP: { 'currency-symbol': 'COL$', 'currency-code': 'COP' },\n CRC: { 'currency-symbol': '₡', 'currency-code': 'CRC' },\n CUP: { 'currency-symbol': '$MN', 'currency-code': 'CUP' },\n CZK: { 'currency-symbol': 'Kč', 'currency-code': 'CZK' },\n DKK: { 'currency-symbol': 'DKK', 'currency-code': 'DKK' },\n DOP: { 'currency-symbol': 'RD$', 'currency-code': 'DOP' },\n DZD: { 'currency-symbol': 'د.ج', 'currency-code': 'DZD' },\n EGP: { 'currency-symbol': 'E£', 'currency-code': 'EGP' },\n ETB: { 'currency-symbol': 'ብር', 'currency-code': 'ETB' },\n EUR: { 'currency-symbol': '€', 'currency-code': 'EUR' },\n FJD: { 'currency-symbol': 'FJ$', 'currency-code': 'FJD' },\n GBP: { 'currency-symbol': '£', 'currency-code': 'GBP' },\n GHS: { 'currency-symbol': 'GH₵', 'currency-code': 'GHS' },\n GIP: { 'currency-symbol': 'GIP', 'currency-code': 'GIP' },\n GMD: { 'currency-symbol': 'D', 'currency-code': 'GMD' },\n GTQ: { 'currency-symbol': 'Q', 'currency-code': 'GTQ' },\n GYD: { 'currency-symbol': 'G$', 'currency-code': 'GYD' },\n HKD: { 'currency-symbol': 'HK$', 'currency-code': 'HKD' },\n HNL: { 'currency-symbol': 'HNL', 'currency-code': 'HNL' },\n HRK: { 'currency-symbol': 'kn', 'currency-code': 'HRK' },\n HTG: { 'currency-symbol': 'G', 'currency-code': 'HTG' },\n HUF: { 'currency-symbol': 'Ft', 'currency-code': 'HUF' },\n IDR: { 'currency-symbol': 'Rp', 'currency-code': 'IDR' },\n ILS: { 'currency-symbol': '₪', 'currency-code': 'ILS' },\n INR: { 'currency-symbol': '₹', 'currency-code': 'INR' },\n JMD: { 'currency-symbol': 'J$', 'currency-code': 'JMD' },\n KES: { 'currency-symbol': 'Ksh', 'currency-code': 'KES' },\n KGS: { 'currency-symbol': 'Лв', 'currency-code': 'KGS' },\n KHR: { 'currency-symbol': '៛', 'currency-code': 'KHR' },\n KYD: { 'currency-symbol': 'CI$', 'currency-code': 'KYD' },\n KZT: { 'currency-symbol': '₸', 'currency-code': 'KZT' },\n LAK: { 'currency-symbol': '₭', 'currency-code': 'LAK' },\n LKR: { 'currency-symbol': 'රු', 'currency-code': 'LKR' },\n LRD: { 'currency-symbol': 'L$', 'currency-code': 'LRD' },\n LSL: { 'currency-symbol': 'LSL', 'currency-code': 'LSL' },\n MAD: { 'currency-symbol': 'د.م.', 'currency-code': 'MAD' },\n MDL: { 'currency-symbol': 'MDL', 'currency-code': 'MDL' },\n MKD: { 'currency-symbol': 'ден', 'currency-code': 'MKD' },\n MMK: { 'currency-symbol': 'MMK', 'currency-code': 'MMK' },\n MNT: { 'currency-symbol': '₮', 'currency-code': 'MNT' },\n MOP: { 'currency-symbol': 'MOP$', 'currency-code': 'MOP' },\n MUR: { 'currency-symbol': '₨', 'currency-code': 'MUR' },\n MVR: { 'currency-symbol': 'Rf', 'currency-code': 'MVR' },\n MWK: { 'currency-symbol': 'MK', 'currency-code': 'MWK' },\n MXN: { 'currency-symbol': 'Mex$', 'currency-code': 'MXN' },\n MYR: { 'currency-symbol': 'RM', 'currency-code': 'MYR' },\n NAD: { 'currency-symbol': 'N$', 'currency-code': 'NAD' },\n NGN: { 'currency-symbol': '₦', 'currency-code': 'NGN' },\n NIO: { 'currency-symbol': 'NIO', 'currency-code': 'NIO' },\n NOK: { 'currency-symbol': 'NOK', 'currency-code': 'NOK' },\n NPR: { 'currency-symbol': 'रू', 'currency-code': 'NPR' },\n NZD: { 'currency-symbol': 'NZ$', 'currency-code': 'NZD' },\n PEN: { 'currency-symbol': 'S/', 'currency-code': 'PEN' },\n PGK: { 'currency-symbol': 'PGK', 'currency-code': 'PGK' },\n PHP: { 'currency-symbol': '₱', 'currency-code': 'PHP' },\n PKR: { 'currency-symbol': '₨', 'currency-code': 'PKR' },\n QAR: { 'currency-symbol': 'QR', 'currency-code': 'QAR' },\n RUB: { 'currency-symbol': '₽', 'currency-code': 'RUB' },\n SAR: { 'currency-symbol': 'SR', 'currency-code': 'SAR' },\n SCR: { 'currency-symbol': 'SRe', 'currency-code': 'SCR' },\n SEK: { 'currency-symbol': 'SEK', 'currency-code': 'SEK' },\n SGD: { 'currency-symbol': 'S$', 'currency-code': 'SGD' },\n SLL: { 'currency-symbol': 'Le', 'currency-code': 'SLL' },\n SOS: { 'currency-symbol': 'Sh.so.', 'currency-code': 'SOS' },\n SSP: { 'currency-symbol': 'SS£', 'currency-code': 'SSP' },\n SVC: { 'currency-symbol': '₡', 'currency-code': 'SVC' },\n SZL: { 'currency-symbol': 'E', 'currency-code': 'SZL' },\n THB: { 'currency-symbol': '฿', 'currency-code': 'THB' },\n TTD: { 'currency-symbol': 'TT$', 'currency-code': 'TTD' },\n TZS: { 'currency-symbol': 'Sh', 'currency-code': 'TZS' },\n USD: { 'currency-symbol': '$', 'currency-code': 'USD' },\n UYU: { 'currency-symbol': '$U', 'currency-code': 'UYU' },\n UZS: { 'currency-symbol': \"so'm\", 'currency-code': 'UZS' },\n YER: { 'currency-symbol': '﷼', 'currency-code': 'YER' },\n ZAR: { 'currency-symbol': 'R', 'currency-code': 'ZAR' },\n KWD: { 'currency-symbol': 'د.ك', 'currency-code': 'KWD' },\n BHD: { 'currency-symbol': 'د.ب.', 'currency-code': 'BHD' },\n OMR: { 'currency-symbol': 'ر.ع.', 'currency-code': 'OMR' },\n};\n\ntype CurrencyAbbreviation = {\n value: number;\n symbol: string;\n};\n\ntype Currency = keyof typeof currencyIndicatorMapping;\n\nconst getCurrencyAbbreviations = (currency: Currency): CurrencyAbbreviation[] => {\n if (currency === 'INR') {\n return [\n { value: 1e7, symbol: 'Cr' },\n { value: 1e5, symbol: 'L' },\n { value: 1e3, symbol: 'k' },\n ];\n }\n\n return [\n { value: 1e9, symbol: 'B' },\n { value: 1e6, symbol: 'M' },\n { value: 1e3, symbol: 'K' },\n ];\n};\n\nconst currencyPositionMapping: Record<string, string> = {\n DZD: 'right',\n BHD: 'right',\n OMR: 'right',\n KWD: 'right',\n};\n\nexport {\n subtleFontSizes,\n normalAmountSizes,\n amountLineHeights,\n currencyPositionMapping,\n currencyIndicatorMapping,\n getCurrencyAbbreviations,\n};\n\nexport type { Currency, AmountBodyProps, AmountDisplayProps, AmountHeadingProps, AmountTypeProps };\n"],"names":["normalAmountSizes","body","xsmall","small","medium","large","heading","xlarge","display","subtleFontSizes","amountLineHeights","currencyIndicatorMapping","AED","ALL","AMD","ARS","AUD","AWG","BBD","BDT","BMD","BND","BOB","BSD","BWP","BZD","CAD","CHF","CNY","COP","CRC","CUP","CZK","DKK","DOP","DZD","EGP","ETB","EUR","FJD","GBP","GHS","GIP","GMD","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","INR","JMD","KES","KGS","KHR","KYD","KZT","LAK","LKR","LRD","LSL","MAD","MDL","MKD","MMK","MNT","MOP","MUR","MVR","MWK","MXN","MYR","NAD","NGN","NIO","NOK","NPR","NZD","PEN","PGK","PHP","PKR","QAR","RUB","SAR","SCR","SEK","SGD","SLL","SOS","SSP","SVC","SZL","THB","TTD","TZS","USD","UYU","UZS","YER","ZAR","KWD","BHD","OMR","getCurrencyAbbreviations","currency","value","symbol","currencyPositionMapping"],"mappings":"AAyBA,IAAMA,iBAGL,GAAG;AACFC,EAAAA,IAAI,EAAE;AACJC,IAAAA,MAAM,EAAE,EAAE;AACVC,IAAAA,KAAK,EAAE,EAAE;AACTC,IAAAA,MAAM,EAAE,GAAG;AACXC,IAAAA,KAAK,EAAE,GAAA;GACR;AACDC,EAAAA,OAAO,EAAE;AACPH,IAAAA,KAAK,EAAE,GAAG;AACVC,IAAAA,MAAM,EAAE,GAAG;AACXC,IAAAA,KAAK,EAAE,GAAG;AACVE,IAAAA,MAAM,EAAE,GAAG;AACX,IAAA,SAAS,EAAE,GAAA;GACZ;AACDC,EAAAA,OAAO,EAAE;AACPL,IAAAA,KAAK,EAAE,GAAG;AACVC,IAAAA,MAAM,EAAE,GAAG;AACXC,IAAAA,KAAK,EAAE,IAAI;AACXE,IAAAA,MAAM,EAAE,IAAA;AACV,GAAA;AACF,EAAC;AAED,IAAME,eAGL,GAAG;AACFR,EAAAA,IAAI,EAAE;AACJC,IAAAA,MAAM,EAAEF,iBAAiB,CAACC,IAAI,CAACC,MAAM;AACrCC,IAAAA,KAAK,EAAEH,iBAAiB,CAACC,IAAI,CAACC,MAAM;AACpCE,IAAAA,MAAM,EAAEJ,iBAAiB,CAACC,IAAI,CAACC,MAAM;AACrCG,IAAAA,KAAK,EAAEL,iBAAiB,CAACC,IAAI,CAACE,KAAAA;GAC/B;AACDG,EAAAA,OAAO,EAAE;AACPH,IAAAA,KAAK,EAAEH,iBAAiB,CAACC,IAAI,CAACE,KAAK;AACnCC,IAAAA,MAAM,EAAEJ,iBAAiB,C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AAG,EAAE;AAAE,IAAA,iBAAiB,EAAE,KAAK;AAAE,IAAA,eAAe,EAAE,KAAA;GAAO;AACzDC,EAAAA,GAAG,EAAE;AAAE,IAAA,iBAAiB,EAAE,MAAM;AAAE,IAAA,eAAe,EAAE,KAAA;GAAO;AAC1DC,EAAAA,GAAG,EAAE;AAAE,IAAA,iBAAiB,EAAE,MAAM;AAAE,IAAA,eAAe,EAAE,KAAA;AAAM,GAAA;AAC3D,EAAC;AASD,IAAMC,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAIC,QAAkB,EAA6B;EAC/E,IAAIA,QAAQ,KAAK,KAAK,EAAE;AACtB,IAAA,OAAO,CACL;AAAEC,MAAAA,KAAK,EAAE,GAAG;AAAEC,MAAAA,MAAM,EAAE,IAAA;AAAK,KAAC,EAC5B;AAAED,MAAAA,KAAK,EAAE,GAAG;AAAEC,MAAAA,MAAM,EAAE,GAAA;AAAI,KAAC,EAC3B;AAAED,MAAAA,KAAK,EAAE,GAAG;AAAEC,MAAAA,MAAM,EAAE,GAAA;AAAI,KAAC,CAC5B,CAAA;AACH,GAAA;AAEA,EAAA,OAAO,CACL;AAAED,IAAAA,KAAK,EAAE,GAAG;AAAEC,IAAAA,MAAM,EAAE,GAAA;AAAI,GAAC,EAC3B;AAAED,IAAAA,KAAK,EAAE,GAAG;AAAEC,IAAAA,MAAM,EAAE,GAAA;AAAI,GAAC,EAC3B;AAAED,IAAAA,KAAK,EAAE,GAAG;AAAEC,IAAAA,MAAM,EAAE,GAAA;AAAI,GAAC,CAC5B,CAAA;AACH,EAAC;AAED,IAAMC,uBAA+C,GAAG;AACtD5E,EAAAA,GAAG,EAAE,OAAO;AACZsE,EAAAA,GAAG,EAAE,OAAO;AACZC,EAAAA,GAAG,EAAE,OAAO;AACZF,EAAAA,GAAG,EAAE,OAAA;AACP;;;;"}
|
|
1
|
+
{"version":3,"file":"amountTokens.js","sources":["../../../../../../src/components/Amount/amountTokens.ts"],"sourcesContent":["import type { FontSize, Typography } from '~tokens/global';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\n\ntype AmountSizes = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge';\n\ntype AmountDisplayProps = {\n type?: 'display';\n size?: Extract<AmountSizes, 'small' | 'medium' | 'large' | 'xlarge'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n};\n\ntype AmountHeadingProps = {\n type?: 'heading';\n size?: Extract<AmountSizes, 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'semibold'>;\n};\n\ntype AmountBodyProps = {\n type?: 'body';\n size?: Extract<AmountSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n};\n\ntype AmountTypeProps = AmountDisplayProps | AmountHeadingProps | AmountBodyProps;\n\nconst normalAmountSizes: Record<\n 'body' | 'heading' | 'display',\n Partial<Record<NonNullable<AmountTypeProps['size']>, keyof FontSize>>\n> = {\n body: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n heading: {\n small: 300,\n medium: 400,\n large: 500,\n xlarge: 600,\n '2xlarge': 700,\n },\n display: {\n small: 800,\n medium: 900,\n large: 1000,\n xlarge: 1100,\n },\n};\n\nconst subtleFontSizes: Record<\n 'body' | 'heading' | 'display',\n Partial<Record<NonNullable<AmountTypeProps['size']>, keyof FontSize>>\n> = {\n body: {\n xsmall: normalAmountSizes.body.xsmall,\n small: normalAmountSizes.body.xsmall,\n medium: normalAmountSizes.body.xsmall,\n large: normalAmountSizes.body.small,\n },\n heading: {\n small: normalAmountSizes.body.small,\n medium: normalAmountSizes.body.medium,\n large: normalAmountSizes.body.large,\n xlarge: normalAmountSizes.heading.medium,\n '2xlarge': normalAmountSizes.heading.large,\n },\n display: {\n small: normalAmountSizes.heading.xlarge,\n medium: normalAmountSizes.heading['2xlarge'],\n large: normalAmountSizes.heading['2xlarge'],\n xlarge: normalAmountSizes.display.small,\n },\n};\n\nconst amountLineHeights: Record<\n 'body' | 'heading' | 'display',\n Partial<Record<NonNullable<AmountTypeProps['size']>, keyof Typography['lineHeights']>>\n> = {\n body: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n heading: {\n small: 300,\n medium: 400,\n large: 500,\n xlarge: 600,\n '2xlarge': 700,\n },\n display: {\n small: 800,\n medium: 900,\n large: 1000,\n xlarge: 1100,\n },\n};\n\nexport { subtleFontSizes, normalAmountSizes, amountLineHeights };\n\nexport type { AmountBodyProps, AmountDisplayProps, AmountHeadingProps, AmountTypeProps };\n"],"names":["normalAmountSizes","body","xsmall","small","medium","large","heading","xlarge","display","subtleFontSizes","amountLineHeights"],"mappings":"AAyBA,IAAMA,iBAGL,GAAG;AACFC,EAAAA,IAAI,EAAE;AACJC,IAAAA,MAAM,EAAE,EAAE;AACVC,IAAAA,KAAK,EAAE,EAAE;AACTC,IAAAA,MAAM,EAAE,GAAG;AACXC,IAAAA,KAAK,EAAE,GAAA;GACR;AACDC,EAAAA,OAAO,EAAE;AACPH,IAAAA,KAAK,EAAE,GAAG;AACVC,IAAAA,MAAM,EAAE,GAAG;AACXC,IAAAA,KAAK,EAAE,GAAG;AACVE,IAAAA,MAAM,EAAE,GAAG;AACX,IAAA,SAAS,EAAE,GAAA;GACZ;AACDC,EAAAA,OAAO,EAAE;AACPL,IAAAA,KAAK,EAAE,GAAG;AACVC,IAAAA,MAAM,EAAE,GAAG;AACXC,IAAAA,KAAK,EAAE,IAAI;AACXE,IAAAA,MAAM,EAAE,IAAA;AACV,GAAA;AACF,EAAC;AAED,IAAME,eAGL,GAAG;AACFR,EAAAA,IAAI,EAAE;AACJC,IAAAA,MAAM,EAAEF,iBAAiB,CAACC,IAAI,CAACC,MAAM;AACrCC,IAAAA,KAAK,EAAEH,iBAAiB,CAACC,IAAI,CAACC,MAAM;AACpCE,IAAAA,MAAM,EAAEJ,i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AA,MAAM,EAAE,IAAA;AACV,GAAA;AACF;;;;"}
|
|
@@ -14,7 +14,7 @@ import '../../utils/isValidAllowedChildren/index.js';
|
|
|
14
14
|
import '../../utils/index.js';
|
|
15
15
|
import '../../utils/metaAttribute/index.js';
|
|
16
16
|
import '../../utils/logger/index.js';
|
|
17
|
-
import {
|
|
17
|
+
import { useControllableState } from '../../utils/useControllable.js';
|
|
18
18
|
import { jsx } from 'react/jsx-runtime';
|
|
19
19
|
import { getComponentId, isValidAllowedChildren } from '../../utils/isValidAllowedChildren/isValidAllowedChildren.js';
|
|
20
20
|
import { throwBladeError } from '../../utils/logger/logger.js';
|
|
@@ -64,63 +64,59 @@ var _Dropdown = function _Dropdown(_ref) {
|
|
|
64
64
|
selectionType = _ref$selectionType === void 0 ? 'single' : _ref$selectionType,
|
|
65
65
|
testID = _ref.testID,
|
|
66
66
|
styledProps = _objectWithoutProperties(_ref, _excluded);
|
|
67
|
-
var _React$useState = React__default.useState(
|
|
67
|
+
var _React$useState = React__default.useState([]),
|
|
68
68
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
options = _React$useState2[0],
|
|
70
|
+
setOptions = _React$useState2[1];
|
|
71
71
|
var _React$useState3 = React__default.useState([]),
|
|
72
72
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
filteredValues = _React$useState4[0],
|
|
74
|
+
setFilteredValues = _React$useState4[1];
|
|
75
75
|
var _React$useState5 = React__default.useState([]),
|
|
76
76
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
selectedIndices = _React$useState6[0],
|
|
78
|
+
setSelectedIndices = _React$useState6[1];
|
|
79
79
|
var _React$useState7 = React__default.useState([]),
|
|
80
80
|
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var _React$useState9 = React__default.useState(
|
|
81
|
+
controlledValueIndices = _React$useState8[0],
|
|
82
|
+
setControlledValueIndices = _React$useState8[1];
|
|
83
|
+
var _React$useState9 = React__default.useState(-1),
|
|
84
84
|
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
activeIndex = _React$useState10[0],
|
|
86
|
+
setActiveIndex = _React$useState10[1];
|
|
87
87
|
var _React$useState11 = React__default.useState(-1),
|
|
88
88
|
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var _React$useState13 = React__default.useState(
|
|
89
|
+
activeTagIndex = _React$useState12[0],
|
|
90
|
+
setActiveTagIndex = _React$useState12[1];
|
|
91
|
+
var _React$useState13 = React__default.useState(false),
|
|
92
92
|
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
shouldIgnoreBlurAnimation = _React$useState14[0],
|
|
94
|
+
setShouldIgnoreBlurAnimation = _React$useState14[1];
|
|
95
95
|
var _React$useState15 = React__default.useState(false),
|
|
96
96
|
_React$useState16 = _slicedToArray(_React$useState15, 2),
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
hasFooterAction = _React$useState16[0],
|
|
98
|
+
setHasFooterAction = _React$useState16[1];
|
|
99
99
|
var _React$useState17 = React__default.useState(false),
|
|
100
100
|
_React$useState18 = _slicedToArray(_React$useState17, 2),
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
hasAutoCompleteInBottomSheetHeader = _React$useState18[0],
|
|
102
|
+
setHasAutoCompleteInBottomSheetHeader = _React$useState18[1];
|
|
103
103
|
var _React$useState19 = React__default.useState(false),
|
|
104
104
|
_React$useState20 = _slicedToArray(_React$useState19, 2),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
var _React$useState21 = React__default.useState(
|
|
105
|
+
isKeydownPressed = _React$useState20[0],
|
|
106
|
+
setIsKeydownPressed = _React$useState20[1];
|
|
107
|
+
var _React$useState21 = React__default.useState(0),
|
|
108
108
|
_React$useState22 = _slicedToArray(_React$useState21, 2),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
var _React$useState23 = React__default.useState(
|
|
109
|
+
changeCallbackTriggerer = _React$useState22[0],
|
|
110
|
+
setChangeCallbackTriggerer = _React$useState22[1];
|
|
111
|
+
var _React$useState23 = React__default.useState(false),
|
|
112
112
|
_React$useState24 = _slicedToArray(_React$useState23, 2),
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
isControlled = _React$useState24[0],
|
|
114
|
+
setIsControlled = _React$useState24[1];
|
|
115
|
+
// keep track if dropdown contains bottomsheet
|
|
115
116
|
var _React$useState25 = React__default.useState(false),
|
|
116
117
|
_React$useState26 = _slicedToArray(_React$useState25, 2),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
// keep track if dropdown contains bottomsheet
|
|
120
|
-
var _React$useState27 = React__default.useState(false),
|
|
121
|
-
_React$useState28 = _slicedToArray(_React$useState27, 2),
|
|
122
|
-
dropdownHasBottomSheet = _React$useState28[0],
|
|
123
|
-
setDropdownHasBottomSheet = _React$useState28[1];
|
|
118
|
+
dropdownHasBottomSheet = _React$useState26[0],
|
|
119
|
+
setDropdownHasBottomSheet = _React$useState26[1];
|
|
124
120
|
|
|
125
121
|
/**
|
|
126
122
|
* In inputs, actual input is smaller than the visible input wrapper.
|
|
@@ -138,18 +134,29 @@ var _Dropdown = function _Dropdown(_ref) {
|
|
|
138
134
|
});
|
|
139
135
|
var dropdownContainerRef = React__default.useRef(null);
|
|
140
136
|
var dropdownBaseId = useId('dropdown');
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
137
|
+
var isDropdownOpenRef = React__default.useRef(isOpenControlled);
|
|
138
|
+
var _useControllableState = useControllableState({
|
|
139
|
+
value: isOpenControlled,
|
|
140
|
+
defaultValue: false,
|
|
141
|
+
onChange: function onChange(isOpenControlledValue) {
|
|
142
|
+
isDropdownOpenRef.current = isOpenControlledValue;
|
|
143
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(isOpenControlledValue);
|
|
144
|
+
}
|
|
145
|
+
}),
|
|
146
|
+
_useControllableState2 = _slicedToArray(_useControllableState, 2),
|
|
147
|
+
isDropdownOpen = _useControllableState2[0],
|
|
148
|
+
setIsDropdownOpen = _useControllableState2[1];
|
|
149
|
+
isDropdownOpenRef.current = isDropdownOpen;
|
|
150
|
+
var setIsOpen = function setIsOpen(isOpenValue) {
|
|
151
|
+
isDropdownOpenRef.current = isOpenValue;
|
|
152
|
+
setIsDropdownOpen(function () {
|
|
153
|
+
return isOpenValue;
|
|
154
|
+
});
|
|
155
|
+
};
|
|
150
156
|
var close = React__default.useCallback(function () {
|
|
151
157
|
setActiveTagIndex(-1);
|
|
152
158
|
setIsOpen(false);
|
|
159
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
153
160
|
}, []);
|
|
154
161
|
React__default.Children.map(children, function (child) {
|
|
155
162
|
if ( /*#__PURE__*/React__default.isValidElement(child)) {
|
|
@@ -175,7 +182,7 @@ var _Dropdown = function _Dropdown(_ref) {
|
|
|
175
182
|
});
|
|
176
183
|
var contextValue = React__default.useMemo(function () {
|
|
177
184
|
return {
|
|
178
|
-
isOpen:
|
|
185
|
+
isOpen: isDropdownOpen,
|
|
179
186
|
setIsOpen: setIsOpen,
|
|
180
187
|
close: close,
|
|
181
188
|
selectedIndices: selectedIndices,
|
|
@@ -213,10 +220,10 @@ var _Dropdown = function _Dropdown(_ref) {
|
|
|
213
220
|
};
|
|
214
221
|
},
|
|
215
222
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
216
|
-
[
|
|
223
|
+
[isDropdownOpen, isOpenControlled, selectedIndices, controlledValueIndices, options, filteredValues, activeIndex, activeTagIndex, shouldIgnoreBlurAnimation, selectionType, hasFooterAction, isKeydownPressed, changeCallbackTriggerer, isControlled]);
|
|
217
224
|
var BottomSheetAndDropdownGlueContextValue = React__default.useMemo(function () {
|
|
218
225
|
return {
|
|
219
|
-
isOpen:
|
|
226
|
+
isOpen: isDropdownOpen,
|
|
220
227
|
dropdownHasBottomSheet: dropdownHasBottomSheet,
|
|
221
228
|
hasAutoCompleteInBottomSheetHeader: hasAutoCompleteInBottomSheetHeader,
|
|
222
229
|
setDropdownHasBottomSheet: setDropdownHasBottomSheet,
|
|
@@ -224,7 +231,7 @@ var _Dropdown = function _Dropdown(_ref) {
|
|
|
224
231
|
// Basically <BottomSheet onDismiss={onBottomSheetDismiss} />
|
|
225
232
|
onBottomSheetDismiss: close
|
|
226
233
|
};
|
|
227
|
-
}, [dropdownHasBottomSheet, hasAutoCompleteInBottomSheetHeader,
|
|
234
|
+
}, [dropdownHasBottomSheet, hasAutoCompleteInBottomSheetHeader, isDropdownOpen, close]);
|
|
228
235
|
React__default.useEffect(function () {
|
|
229
236
|
if (!isReactNative()) {
|
|
230
237
|
var dropdown = dropdownContainerRef.current;
|
|
@@ -234,7 +241,9 @@ var _Dropdown = function _Dropdown(_ref) {
|
|
|
234
241
|
if (!target || !dropdown) {
|
|
235
242
|
return;
|
|
236
243
|
}
|
|
237
|
-
|
|
244
|
+
var isOutsideClick = !dropdown.contains(target) && !((_isTagDismissedRef$cu = isTagDismissedRef.current) !== null && _isTagDismissedRef$cu !== void 0 && _isTagDismissedRef$cu.value);
|
|
245
|
+
var isDropdownOpenState = isDropdownOpenRef.current;
|
|
246
|
+
if (isOutsideClick && isDropdownOpenState) {
|
|
238
247
|
close();
|
|
239
248
|
}
|
|
240
249
|
if ((_isTagDismissedRef$cu2 = isTagDismissedRef.current) !== null && _isTagDismissedRef$cu2 !== void 0 && _isTagDismissedRef$cu2.value) {
|