@transferwise/components 0.0.0-experimental-b9f8dc1 → 0.0.0-experimental-e1f66d5
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/build/main.css +210 -209
- package/build/moneyInput/MoneyInput.js +1 -0
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +1 -0
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/styles/main.css +210 -209
- package/build/styles/uploadInput/UploadInput.css +81 -13
- package/build/styles/uploadInput/uploadButton/UploadButton.css +31 -77
- package/build/styles/uploadInput/uploadItem/UploadItem.css +109 -130
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/types/uploadInput/uploadButton/UploadButton.d.ts +0 -5
- package/build/types/uploadInput/uploadButton/UploadButton.d.ts.map +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts.map +1 -1
- package/build/uploadInput/UploadInput.js +20 -30
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +20 -30
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js +32 -25
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs +32 -25
- package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +38 -32
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +39 -33
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItemLink.js +1 -2
- package/build/uploadInput/uploadItem/UploadItemLink.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItemLink.mjs +1 -2
- package/build/uploadInput/uploadItem/UploadItemLink.mjs.map +1 -1
- package/package.json +3 -3
- package/src/main.css +210 -209
- package/src/moneyInput/MoneyInput.tsx +1 -0
- package/src/uploadInput/UploadInput.css +81 -13
- package/src/uploadInput/UploadInput.less +80 -18
- package/src/uploadInput/UploadInput.tests.story.tsx +5 -5
- package/src/uploadInput/UploadInput.tsx +32 -43
- package/src/uploadInput/uploadButton/UploadButton.css +31 -77
- package/src/uploadInput/uploadButton/UploadButton.less +35 -77
- package/src/uploadInput/uploadButton/UploadButton.tsx +26 -37
- package/src/uploadInput/uploadItem/UploadItem.css +109 -130
- package/src/uploadInput/uploadItem/UploadItem.less +118 -130
- package/src/uploadInput/uploadItem/UploadItem.tsx +28 -26
- package/src/uploadInput/uploadItem/UploadItemLink.tsx +3 -3
package/build/main.css
CHANGED
|
@@ -5454,279 +5454,280 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5454
5454
|
.upload-error-message .alert {
|
|
5455
5455
|
min-width: 100px;
|
|
5456
5456
|
}
|
|
5457
|
-
.np-upload-
|
|
5458
|
-
|
|
5459
|
-
padding: 16px;
|
|
5460
|
-
padding: var(--size-16);
|
|
5461
|
-
display: flex;
|
|
5462
|
-
align-items: center;
|
|
5463
|
-
margin: 0;
|
|
5464
|
-
border-bottom-left-radius: 10px;
|
|
5465
|
-
border-bottom-left-radius: var(--radius-small);
|
|
5466
|
-
border-bottom-right-radius: 10px;
|
|
5467
|
-
border-bottom-right-radius: var(--radius-small);
|
|
5468
|
-
border: var(--outerBorder);
|
|
5469
|
-
cursor: pointer;
|
|
5457
|
+
.np-upload-button-container {
|
|
5458
|
+
border-style: solid;
|
|
5470
5459
|
}
|
|
5471
|
-
.np-upload-
|
|
5472
|
-
|
|
5473
|
-
-webkit-text-decoration: underline;
|
|
5474
|
-
text-decoration: underline;
|
|
5475
|
-
text-underline-offset: 0.3em;
|
|
5476
|
-
}
|
|
5477
|
-
.np-upload-input__upload-button .np-upload-input__title + .np-upload-input__text {
|
|
5478
|
-
margin-top: 4px;
|
|
5479
|
-
margin-top: var(--size-4);
|
|
5480
|
-
}
|
|
5481
|
-
.np-upload-input__upload-button .np-upload-input__icon {
|
|
5482
|
-
padding-right: 16px;
|
|
5483
|
-
padding-right: var(--size-16);
|
|
5484
|
-
color: var(--color-interactive-primary);
|
|
5460
|
+
.np-upload-button-container .droppable-card-content {
|
|
5461
|
+
display: flex;
|
|
5485
5462
|
}
|
|
5486
|
-
.np-upload-
|
|
5487
|
-
|
|
5488
|
-
|
|
5463
|
+
.np-upload-button-container.droppable-dropping {
|
|
5464
|
+
border-color: #c9cbce !important;
|
|
5465
|
+
border-color: var(--color-interactive-secondary) !important;
|
|
5489
5466
|
}
|
|
5490
|
-
.np-upload-
|
|
5491
|
-
|
|
5492
|
-
outline: var(--ring-outline-color) solid 3px;
|
|
5493
|
-
outline-offset: -3px;
|
|
5467
|
+
.np-upload-button-container.droppable-dropping:before {
|
|
5468
|
+
z-index: 2;
|
|
5494
5469
|
}
|
|
5495
|
-
.np-upload-
|
|
5496
|
-
position: absolute;
|
|
5470
|
+
.np-upload-button-container input[type="file"] {
|
|
5497
5471
|
opacity: 0;
|
|
5498
5472
|
z-index: -1;
|
|
5499
|
-
}
|
|
5500
|
-
.np-upload-input__upload-button-input:focus {
|
|
5501
|
-
outline: none;
|
|
5502
|
-
}
|
|
5503
|
-
.np-upload-input__upload-button .np-upload-input__drop-file-overlay {
|
|
5504
|
-
display: flex;
|
|
5505
|
-
flex: 1;
|
|
5506
|
-
padding: 13px 0 !important;
|
|
5507
|
-
background-color: transparent;
|
|
5508
|
-
transition: transform 0.3s ease;
|
|
5509
|
-
position: relative;
|
|
5510
|
-
}
|
|
5511
|
-
.np-upload-input__upload-button--with-entries {
|
|
5512
|
-
border-top-width: 0;
|
|
5513
|
-
}
|
|
5514
|
-
.np-upload-input__upload-button--with-entries:before {
|
|
5515
|
-
display: block;
|
|
5516
5473
|
position: absolute;
|
|
5517
|
-
height: 1px;
|
|
5518
|
-
background-color: rgba(0,0,0,0.10196);
|
|
5519
|
-
background-color: var(--color-border-neutral);
|
|
5520
|
-
content: " ";
|
|
5521
|
-
left: 16px;
|
|
5522
|
-
left: var(--size-16);
|
|
5523
|
-
width: calc(100% - 2 * 16px);
|
|
5524
|
-
width: calc(100% - 2 * var(--size-16));
|
|
5525
|
-
top: 0;
|
|
5526
5474
|
}
|
|
5527
|
-
.np-upload-
|
|
5528
|
-
border
|
|
5529
|
-
border-radius: 10px;
|
|
5530
|
-
border-radius: var(--radius-small);
|
|
5531
|
-
}
|
|
5532
|
-
.np-upload-input__upload-button--enabled.is-dropping,
|
|
5533
|
-
.np-upload-input__upload-button--enabled:hover,
|
|
5534
|
-
.np-upload-input__upload-button--enabled:active {
|
|
5535
|
-
background: rgba(134,167,189,0.10196);
|
|
5536
|
-
background: var(--color-background-neutral);
|
|
5475
|
+
.np-upload-button-container .np-upload-button {
|
|
5476
|
+
border: none;
|
|
5537
5477
|
}
|
|
5538
|
-
.np-upload-
|
|
5539
|
-
.np-upload-input__upload-button--enabled:hover:before,
|
|
5540
|
-
.np-upload-input__upload-button--enabled:active:before {
|
|
5478
|
+
.np-upload-button {
|
|
5541
5479
|
width: 100%;
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5480
|
+
border-top: 1px solid transparent;
|
|
5481
|
+
padding: 16px;
|
|
5482
|
+
padding: var(--padding-small);
|
|
5483
|
+
border-radius: 0;
|
|
5546
5484
|
}
|
|
5547
|
-
.np-upload-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
border-radius: var(--radius-small);
|
|
5485
|
+
label.np-upload-button:not(.disabled):hover,
|
|
5486
|
+
label.np-upload-button:not(.disabled):active {
|
|
5487
|
+
background-color: var(--color-background-screen-hover);
|
|
5551
5488
|
}
|
|
5552
|
-
.
|
|
5553
|
-
|
|
5489
|
+
.disabled label.np-upload-button:not(.disabled):hover,
|
|
5490
|
+
.disabled label.np-upload-button:not(.disabled):active {
|
|
5491
|
+
background-color: transparent;
|
|
5554
5492
|
}
|
|
5555
|
-
.np-upload-
|
|
5556
|
-
|
|
5557
|
-
border-radius: var(--radius-small);
|
|
5558
|
-
border-bottom: var(--outerBorder);
|
|
5493
|
+
.np-upload-button .media {
|
|
5494
|
+
align-items: flex-start;
|
|
5559
5495
|
}
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5496
|
+
@media (max-width: 320px) {
|
|
5497
|
+
.np-upload-icon {
|
|
5498
|
+
padding-left: 0;
|
|
5499
|
+
}
|
|
5564
5500
|
}
|
|
5565
|
-
.np-upload-
|
|
5566
|
-
|
|
5567
|
-
padding:
|
|
5568
|
-
padding:
|
|
5569
|
-
display: flex;
|
|
5570
|
-
align-items: flex-start;
|
|
5571
|
-
border-left: var(--outerBorder);
|
|
5572
|
-
border-right: var(--outerBorder);
|
|
5501
|
+
.np-upload-input.form-control {
|
|
5502
|
+
height: auto;
|
|
5503
|
+
padding: 0;
|
|
5504
|
+
padding: initial;
|
|
5573
5505
|
}
|
|
5574
|
-
.np-upload-
|
|
5575
|
-
|
|
5506
|
+
.np-upload-input > div:first-child,
|
|
5507
|
+
.np-upload-input > div:first-child .np-upload-item--single-file,
|
|
5508
|
+
.np-upload-input > div:first-child .np-upload-item--link {
|
|
5576
5509
|
border-top-left-radius: 10px;
|
|
5577
5510
|
border-top-left-radius: var(--radius-small);
|
|
5578
5511
|
border-top-right-radius: 10px;
|
|
5579
5512
|
border-top-right-radius: var(--radius-small);
|
|
5580
5513
|
}
|
|
5581
|
-
.np-upload-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
width: calc(100% - 2 * var(--size-16));
|
|
5590
|
-
top: 0;
|
|
5591
|
-
background: rgba(0,0,0,0.10196);
|
|
5592
|
-
background: var(--color-border-neutral);
|
|
5514
|
+
.np-upload-input > div:last-child {
|
|
5515
|
+
border-bottom-left-radius: 10px;
|
|
5516
|
+
border-bottom-left-radius: var(--radius-small);
|
|
5517
|
+
border-bottom-right-radius: 10px;
|
|
5518
|
+
border-bottom-right-radius: var(--radius-small);
|
|
5519
|
+
}
|
|
5520
|
+
.np-theme-personal .np-upload-input.disabled .btn {
|
|
5521
|
+
cursor: inherit;
|
|
5593
5522
|
}
|
|
5594
|
-
.np-upload-
|
|
5523
|
+
.np-theme-personal .np-upload-input .np-upload-icon {
|
|
5524
|
+
color: var(--color-interactive-primary);
|
|
5525
|
+
}
|
|
5526
|
+
.np-theme-personal .np-upload-input .media-body {
|
|
5595
5527
|
padding-right: 32px;
|
|
5596
5528
|
padding-right: var(--size-32);
|
|
5597
|
-
|
|
5529
|
+
color: var(--color-content-link);
|
|
5530
|
+
white-space: break-spaces;
|
|
5598
5531
|
}
|
|
5599
5532
|
@media (max-width: 320px) {
|
|
5600
|
-
.np-
|
|
5533
|
+
.np-theme-personal .np-upload-input .media-body {
|
|
5601
5534
|
padding-right: 64px;
|
|
5602
5535
|
padding-right: var(--size-64);
|
|
5603
5536
|
}
|
|
5604
5537
|
}
|
|
5605
|
-
.np-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
text-align-last: left;
|
|
5610
|
-
color: #5d7079;
|
|
5611
|
-
color: var(--color-content-secondary);
|
|
5538
|
+
.np-theme-personal .np-upload-input .media-body .np-text-body-large-bold {
|
|
5539
|
+
-webkit-text-decoration: underline;
|
|
5540
|
+
text-decoration: underline;
|
|
5541
|
+
text-underline-offset: 0.3em;
|
|
5612
5542
|
}
|
|
5613
|
-
.np-
|
|
5614
|
-
|
|
5615
|
-
|
|
5543
|
+
.np-theme-personal .np-upload-input .media-body .np-text-body-default,
|
|
5544
|
+
.np-theme-personal .np-upload-input .media-body .np-upload-description,
|
|
5545
|
+
.np-theme-personal .np-upload-input .media-body .text-positive {
|
|
5546
|
+
color: #5d7079 !important;
|
|
5547
|
+
color: var(--color-content-secondary) !important;
|
|
5616
5548
|
}
|
|
5617
|
-
.np-
|
|
5618
|
-
|
|
5619
|
-
padding-right: var(--size-16);
|
|
5549
|
+
.np-theme-personal .np-upload-input .media-body .text-negative {
|
|
5550
|
+
color: var(--color-sentiment-negative) !important;
|
|
5620
5551
|
}
|
|
5621
|
-
.np-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
display: flex;
|
|
5625
|
-
width: 100%;
|
|
5552
|
+
.np-theme-personal .np-upload-input-errors {
|
|
5553
|
+
list-style: none;
|
|
5554
|
+
padding-left: 0;
|
|
5626
5555
|
}
|
|
5627
|
-
.np-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5556
|
+
.np-theme-personal .np-upload-input-errors li {
|
|
5557
|
+
position: relative;
|
|
5558
|
+
padding-left: 16px;
|
|
5559
|
+
padding-left: var(--size-16);
|
|
5560
|
+
}
|
|
5561
|
+
@media (max-width: 320px) {
|
|
5562
|
+
.np-theme-personal .np-upload-input-errors li {
|
|
5563
|
+
padding-left: 32px;
|
|
5564
|
+
padding-left: var(--size-32);
|
|
5565
|
+
}
|
|
5566
|
+
}
|
|
5567
|
+
.np-theme-personal .np-upload-input-errors li:before {
|
|
5568
|
+
content: '•';
|
|
5632
5569
|
position: absolute;
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5570
|
+
display: block;
|
|
5571
|
+
left: 0;
|
|
5572
|
+
}
|
|
5573
|
+
.np-theme-personal .np-upload-input .status-circle {
|
|
5574
|
+
width: 24px;
|
|
5575
|
+
width: var(--size-x-small);
|
|
5576
|
+
height: 24px;
|
|
5577
|
+
height: var(--size-x-small);
|
|
5637
5578
|
}
|
|
5638
5579
|
@media (max-width: 320px) {
|
|
5639
|
-
.np-
|
|
5640
|
-
|
|
5641
|
-
|
|
5580
|
+
.np-theme-personal .np-upload-input .status-circle {
|
|
5581
|
+
width: 48px;
|
|
5582
|
+
width: var(--size-large);
|
|
5583
|
+
height: 48px;
|
|
5584
|
+
height: var(--size-large);
|
|
5642
5585
|
}
|
|
5643
5586
|
}
|
|
5644
|
-
.np-upload-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
height: var(--iconSize);
|
|
5649
|
-
width: var(--iconSize);
|
|
5650
|
-
padding: 0 4px;
|
|
5651
|
-
padding: 0 var(--size-4);
|
|
5652
|
-
border-radius: 50%;
|
|
5653
|
-
border: 0;
|
|
5654
|
-
background-color: rgba(134,167,189,0.10196);
|
|
5655
|
-
background-color: var(--color-background-neutral);
|
|
5656
|
-
color: var(--color-interactive-primary);
|
|
5657
|
-
transition: color, background-color 0.15s ease-in-out;
|
|
5658
|
-
outline-offset: 0;
|
|
5659
|
-
display: flex;
|
|
5660
|
-
align-items: center;
|
|
5661
|
-
justify-content: center;
|
|
5587
|
+
.np-upload-item {
|
|
5588
|
+
border: 1px solid #c9cbce;
|
|
5589
|
+
border: 1px solid var(--color-interactive-secondary);
|
|
5590
|
+
position: relative;
|
|
5662
5591
|
}
|
|
5663
|
-
.np-upload-
|
|
5664
|
-
|
|
5592
|
+
.np-upload-item:first-child ~ div:not(.np-upload-item--link):before,
|
|
5593
|
+
.np-upload-item:not(:first-child).np-upload-item--link .np-upload-item__link:before,
|
|
5594
|
+
.np-upload-item.np-upload-item--link:hover .np-upload-item__link:after {
|
|
5665
5595
|
display: block;
|
|
5666
|
-
width: var(--clickAreaSize);
|
|
5667
|
-
height: var(--clickAreaSize);
|
|
5668
|
-
border-radius: 50%;
|
|
5669
5596
|
position: absolute;
|
|
5670
|
-
|
|
5671
|
-
|
|
5597
|
+
height: 1px;
|
|
5598
|
+
background-color: rgba(0,0,0,0.10196);
|
|
5599
|
+
background-color: var(--color-border-neutral);
|
|
5600
|
+
content: " ";
|
|
5601
|
+
left: 16px;
|
|
5602
|
+
left: var(--size-16);
|
|
5603
|
+
width: calc(100% - 2 * 16px);
|
|
5604
|
+
width: calc(100% - 2 * var(--size-16));
|
|
5672
5605
|
}
|
|
5673
|
-
.np-upload-
|
|
5674
|
-
|
|
5675
|
-
|
|
5606
|
+
.np-upload-item:first-child ~ div:not(.np-upload-item--link):before,
|
|
5607
|
+
.np-upload-item:not(:first-child).np-upload-item--link .np-upload-item__link:before {
|
|
5608
|
+
top: 0;
|
|
5676
5609
|
}
|
|
5677
|
-
.np-upload-
|
|
5678
|
-
|
|
5610
|
+
.np-upload-item.np-upload-item--link:hover .np-upload-item__link:after {
|
|
5611
|
+
bottom: -1px;
|
|
5679
5612
|
}
|
|
5680
|
-
.np-upload-
|
|
5681
|
-
|
|
5613
|
+
.np-upload-item:first-child ~ div {
|
|
5614
|
+
border-top: 1px;
|
|
5682
5615
|
}
|
|
5683
|
-
.np-upload-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
left: 0;
|
|
5616
|
+
.np-upload-item:not(:first-child) .np-upload-item__link:hover {
|
|
5617
|
+
border-top-color: rgba(0,0,0,0.10196);
|
|
5618
|
+
border-top-color: var(--color-border-neutral);
|
|
5687
5619
|
}
|
|
5688
|
-
.np-upload-
|
|
5689
|
-
|
|
5690
|
-
|
|
5620
|
+
.np-upload-item:not(:last-child) {
|
|
5621
|
+
border-bottom: 0;
|
|
5622
|
+
}
|
|
5623
|
+
.np-upload-item.np-upload-item--link:hover + .np-upload-item:before,
|
|
5624
|
+
.np-upload-item.np-upload-item--link:hover + .np-upload-button-container:before,
|
|
5625
|
+
.np-upload-item.np-upload-item--link:hover + .np-upload-item .np-upload-item__link:before,
|
|
5626
|
+
.np-upload-item.np-upload-item--link:hover + .np-upload-button-container .np-upload-item__link:before {
|
|
5627
|
+
display: none;
|
|
5628
|
+
}
|
|
5629
|
+
.np-upload-button-container:hover:before,
|
|
5630
|
+
.np-upload-button-container.droppable-dropping:before {
|
|
5631
|
+
left: 0 !important;
|
|
5632
|
+
width: 100% !important;
|
|
5633
|
+
}
|
|
5634
|
+
.np-upload-button-container:has(:focus-visible) {
|
|
5635
|
+
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
5636
|
+
outline-offset: var(--ring-outline-offset);
|
|
5637
|
+
border-color: transparent;
|
|
5638
|
+
outline-offset: -3px;
|
|
5639
|
+
}
|
|
5640
|
+
.np-upload-item--single-file:focus-visible,
|
|
5641
|
+
.np-upload-item__link:focus-visible,
|
|
5642
|
+
.np-upload-button-container:has(:focus-visible) {
|
|
5643
|
+
outline-width: 3px;
|
|
5644
|
+
}
|
|
5645
|
+
.np-upload-item--link a {
|
|
5646
|
+
flex: 1;
|
|
5691
5647
|
-webkit-text-decoration: none;
|
|
5692
5648
|
text-decoration: none;
|
|
5693
|
-
border-radius: inherit;
|
|
5694
5649
|
border-top: 1px solid transparent;
|
|
5695
|
-
|
|
5650
|
+
border-radius: inherit;
|
|
5696
5651
|
}
|
|
5697
|
-
.np-upload-
|
|
5652
|
+
.np-upload-item--link a:focus-visible {
|
|
5698
5653
|
outline-offset: -2px;
|
|
5699
|
-
outline-width: 3px;
|
|
5700
5654
|
}
|
|
5701
|
-
.np-upload-
|
|
5702
|
-
|
|
5655
|
+
.np-upload-item--link a:hover:before {
|
|
5656
|
+
display: none !important;
|
|
5657
|
+
}
|
|
5658
|
+
.np-upload-item--link a:hover:after {
|
|
5659
|
+
left: 0 !important;
|
|
5660
|
+
width: 100% !important;
|
|
5661
|
+
}
|
|
5662
|
+
.np-upload-item--link a:hover,
|
|
5663
|
+
.np-upload-item--link a:active {
|
|
5664
|
+
-webkit-text-decoration: none;
|
|
5665
|
+
text-decoration: none;
|
|
5666
|
+
}
|
|
5667
|
+
.np-upload-item--link a:hover .np-upload-button,
|
|
5668
|
+
.np-upload-item--link a:active .np-upload-button {
|
|
5703
5669
|
background-color: rgba(134,167,189,0.10196);
|
|
5704
5670
|
background-color: var(--color-background-neutral);
|
|
5671
|
+
border-radius: inherit;
|
|
5705
5672
|
}
|
|
5706
|
-
.np-upload-
|
|
5707
|
-
border-top
|
|
5708
|
-
}
|
|
5709
|
-
.np-upload-input__item .np-upload-input-errors {
|
|
5710
|
-
padding-left: 0;
|
|
5711
|
-
list-style-type: "";
|
|
5673
|
+
.np-upload-item--link:first-of-type a {
|
|
5674
|
+
border-top: 0;
|
|
5712
5675
|
}
|
|
5713
|
-
.np-upload-
|
|
5676
|
+
.np-upload-item__body {
|
|
5677
|
+
display: flex;
|
|
5678
|
+
align-items: center;
|
|
5679
|
+
justify-content: space-between;
|
|
5714
5680
|
position: relative;
|
|
5715
|
-
|
|
5716
|
-
padding-left: var(--size-16);
|
|
5681
|
+
border-radius: inherit;
|
|
5717
5682
|
}
|
|
5718
|
-
.np-upload-
|
|
5719
|
-
|
|
5683
|
+
.np-upload-item__remove-button {
|
|
5684
|
+
display: flex;
|
|
5685
|
+
align-items: center;
|
|
5686
|
+
justify-content: center;
|
|
5687
|
+
align-self: flex-start;
|
|
5720
5688
|
position: absolute;
|
|
5721
|
-
|
|
5722
|
-
|
|
5689
|
+
height: 24px;
|
|
5690
|
+
height: var(--size-24);
|
|
5691
|
+
min-height: 0;
|
|
5692
|
+
width: 24px;
|
|
5693
|
+
width: var(--size-24);
|
|
5694
|
+
padding: 0;
|
|
5695
|
+
border-radius: 50% !important;
|
|
5696
|
+
outline-offset: 0 !important;
|
|
5697
|
+
background-color: rgba(134,167,189,0.10196);
|
|
5698
|
+
background-color: var(--color-background-neutral);
|
|
5699
|
+
border: none;
|
|
5700
|
+
color: var(--color-interactive-primary);
|
|
5701
|
+
right: 16px;
|
|
5702
|
+
right: var(--size-16);
|
|
5703
|
+
top: 16px;
|
|
5704
|
+
top: var(--size-16);
|
|
5705
|
+
transition: color, background-color 0.15s ease-in-out;
|
|
5723
5706
|
}
|
|
5724
5707
|
@media (max-width: 320px) {
|
|
5725
|
-
.np-upload-
|
|
5726
|
-
|
|
5727
|
-
|
|
5708
|
+
.np-upload-item__remove-button {
|
|
5709
|
+
top: 16px;
|
|
5710
|
+
top: var(--size-16);
|
|
5711
|
+
right: 16px;
|
|
5712
|
+
right: var(--size-16);
|
|
5713
|
+
height: 48px;
|
|
5714
|
+
height: var(--size-48);
|
|
5715
|
+
width: 48px;
|
|
5716
|
+
width: var(--size-48);
|
|
5728
5717
|
}
|
|
5729
5718
|
}
|
|
5719
|
+
.np-upload-item__remove-button:hover {
|
|
5720
|
+
background-color: var(--color-sentiment-negative);
|
|
5721
|
+
color: var(--color-contrast-overlay) !important;
|
|
5722
|
+
}
|
|
5723
|
+
.np-upload-item__remove-button:before {
|
|
5724
|
+
display: block;
|
|
5725
|
+
width: 44px;
|
|
5726
|
+
height: 44px;
|
|
5727
|
+
content: '';
|
|
5728
|
+
border-radius: 50%;
|
|
5729
|
+
position: absolute;
|
|
5730
|
+
}
|
|
5730
5731
|
.np-progress {
|
|
5731
5732
|
border-radius: 10px;
|
|
5732
5733
|
border-radius: var(--radius-small);
|
|
@@ -259,6 +259,7 @@ class MoneyInput extends React.Component {
|
|
|
259
259
|
children: selectedCurrency.currency.toUpperCase()
|
|
260
260
|
})]
|
|
261
261
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
262
|
+
translate: "no",
|
|
262
263
|
className: clsx.clsx(this.style('input-group-btn'), this.style('amount-currency-select-btn')),
|
|
263
264
|
children: /*#__PURE__*/jsxRuntime.jsx(SelectInput.SelectInput, {
|
|
264
265
|
UNSAFE_triggerButtonProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoneyInput.js","sources":["../../src/moneyInput/MoneyInput.tsx"],"sourcesContent":["import { isEmpty, isNumber, isNull } from '@transferwise/neptune-validation';\nimport { Flag } from '@wise/art';\nimport { clsx } from 'clsx';\nimport { Component } from 'react';\nimport { injectIntl, WrappedComponentProps } from 'react-intl';\n\nimport { Typography, Size, SizeLarge, SizeMedium, SizeSmall } from '../common';\nimport { withInputAttributes, WithInputAttributesProps } from '../inputs/contexts';\nimport { Input } from '../inputs/Input';\nimport {\n SelectInput,\n SelectInputItem,\n SelectInputOptionContent,\n SelectInputOptionItem,\n SelectInputProps,\n} from '../inputs/SelectInput';\nimport Title from '../title';\n\nimport messages from './MoneyInput.messages';\nimport { formatAmount, parseAmount } from './currencyFormatting';\nimport withId from '../withId';\n\nexport interface CurrencyOptionItem {\n header?: never;\n value: string;\n label: string;\n currency: string;\n note?: string;\n searchable?: string;\n}\n\nexport interface CurrencyHeaderItem {\n header: string;\n}\n\nexport type CurrencyItem = CurrencyOptionItem | CurrencyHeaderItem;\n\nconst isNumberOrNull = (v: unknown): v is number | null => isNumber(v) || isNull(v);\n\nconst formatAmountIfSet = ({\n amount,\n currency,\n locale,\n}: {\n amount: number | null | undefined;\n currency: string;\n locale: string;\n}) => {\n return typeof amount === 'number' ? formatAmount(amount, currency, locale) : '';\n};\n\nconst parseNumber = ({\n amount,\n currency,\n locale,\n}: {\n amount: string;\n currency: string;\n locale: string;\n}) => {\n return parseAmount(amount, currency, locale);\n};\n\nconst allowedInputKeys = new Set([\n 'Backspace',\n 'Delete',\n ',',\n '.',\n 'ArrowDown',\n 'ArrowUp',\n 'ArrowLeft',\n 'ArrowRight',\n 'Enter',\n 'Escape',\n 'Tab',\n]);\n\nexport interface MoneyInputProps extends WrappedComponentProps {\n id?: string;\n 'aria-labelledby'?: string;\n currencies: readonly CurrencyItem[];\n selectedCurrency: CurrencyOptionItem;\n onCurrencyChange?: (value: CurrencyOptionItem) => void;\n placeholder?: number;\n amount: number | null;\n size?: SizeSmall | SizeMedium | SizeLarge;\n onAmountChange?: (value: number | null) => void;\n addon?: React.ReactNode;\n searchPlaceholder?: string;\n /**\n * Allows the consumer to react to searching, while the search itself is handled internally.\n */\n onSearchChange?: (value: { searchQuery: string; filteredOptions: CurrencyItem[] }) => void;\n customActionLabel?: React.ReactNode;\n onCustomAction?: () => void;\n classNames?: Record<string, string>;\n selectProps?: Partial<SelectInputProps<CurrencyOptionItem>>;\n}\n\ntype MoneyInputPropsWithInputAttributes = MoneyInputProps & Partial<WithInputAttributesProps>;\n\ninterface MoneyInputState {\n searchQuery: string;\n formattedAmount: string;\n locale: string;\n}\n\nclass MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInputState> {\n declare props: MoneyInputPropsWithInputAttributes &\n Required<Pick<MoneyInputPropsWithInputAttributes, keyof typeof MoneyInput.defaultProps>>;\n\n static defaultProps = {\n size: Size.LARGE,\n classNames: {},\n selectProps: {},\n } satisfies Partial<MoneyInputPropsWithInputAttributes>;\n\n amountFocused = false;\n\n constructor(props: MoneyInputProps) {\n super(props);\n this.state = {\n searchQuery: '',\n formattedAmount: formatAmountIfSet({\n amount: props.amount,\n currency: props.selectedCurrency.currency,\n locale: props.intl.locale,\n }),\n locale: props.intl.locale,\n };\n }\n\n UNSAFE_componentWillReceiveProps(nextProps: MoneyInputProps) {\n this.setState({ locale: nextProps.intl.locale });\n\n if (!this.amountFocused) {\n this.setState({\n formattedAmount: formatAmountIfSet({\n amount: nextProps.amount,\n currency: nextProps.selectedCurrency.currency,\n locale: nextProps.intl.locale,\n }),\n });\n }\n }\n\n isInputAllowedForKeyEvent = (event: React.KeyboardEvent<HTMLInputElement>) => {\n const { metaKey, key, ctrlKey } = event;\n const isNumberKey = isNumber(Number.parseInt(key, 10));\n\n return isNumberKey || metaKey || ctrlKey || allowedInputKeys.has(key);\n };\n\n handleKeyDown: React.KeyboardEventHandler<HTMLInputElement> = (event) => {\n if (!this.isInputAllowedForKeyEvent(event)) {\n event.preventDefault();\n }\n };\n\n handlePaste: React.ClipboardEventHandler<HTMLInputElement> = (event) => {\n const paste = event.clipboardData.getData('text');\n const { locale } = this.state;\n const parsed = isEmpty(paste)\n ? null\n : parseNumber({\n amount: paste,\n currency: this.props.selectedCurrency.currency,\n locale,\n });\n\n if (isNumberOrNull(parsed)) {\n this.setState({\n formattedAmount: formatAmountIfSet({\n amount: parsed,\n currency: this.props.selectedCurrency.currency,\n locale,\n }),\n });\n this.props.onAmountChange?.(parsed);\n }\n\n event.preventDefault();\n };\n\n onAmountChange: React.ChangeEventHandler<HTMLInputElement> = (event) => {\n const { value } = event.target;\n this.setState({\n formattedAmount: value,\n });\n const parsed = isEmpty(value)\n ? null\n : parseNumber({\n amount: value,\n currency: this.props.selectedCurrency.currency,\n locale: this.state.locale,\n });\n if (isNumberOrNull(parsed)) {\n this.props.onAmountChange?.(parsed);\n }\n };\n\n onAmountBlur = () => {\n this.amountFocused = false;\n this.setAmount();\n };\n\n onAmountFocus = () => {\n this.amountFocused = true;\n };\n\n getSelectOptions() {\n const selectOptions = filterCurrenciesForQuery(this.props.currencies, this.state.searchQuery);\n\n const formattedOptions: SelectInputItem<CurrencyOptionItem>[] = [];\n let currentGroupOptions: SelectInputOptionItem<CurrencyOptionItem>[] | undefined;\n\n selectOptions.forEach((item) => {\n if (item.header != null) {\n currentGroupOptions = [];\n formattedOptions.push({\n type: 'group',\n label: item.header,\n options: currentGroupOptions,\n });\n } else {\n (currentGroupOptions ?? formattedOptions).push({\n type: 'option',\n value: item,\n filterMatchers: [item.value, item.label, item.note ?? '', item.searchable ?? ''],\n });\n }\n });\n\n return formattedOptions;\n }\n\n setAmount() {\n this.setState((previousState) => {\n const parsed = parseNumber({\n amount: previousState.formattedAmount,\n currency: this.props.selectedCurrency.currency,\n locale: previousState.locale,\n });\n if (!isNumberOrNull(parsed)) {\n return {\n formattedAmount: previousState.formattedAmount,\n };\n }\n return {\n formattedAmount: formatAmountIfSet({\n amount: parsed,\n currency: this.props.selectedCurrency.currency,\n locale: previousState.locale,\n }),\n };\n });\n }\n\n handleSelectChange = (value: CurrencyOptionItem) => {\n this.handleSearchChange('');\n this.props.onCurrencyChange?.(value);\n };\n\n handleCustomAction = () => {\n this.handleSearchChange('');\n this.props.onCustomAction?.();\n };\n\n handleSearchChange = (searchQuery: string) => {\n this.setState({ searchQuery });\n this.props.onSearchChange?.({\n searchQuery,\n filteredOptions: filterCurrenciesForQuery(this.props.currencies, searchQuery),\n });\n };\n\n style = (className: string) => this.props.classNames[className] || className;\n\n render() {\n const {\n inputAttributes,\n id: amountInputId,\n 'aria-labelledby': ariaLabelledByProp,\n selectedCurrency,\n onCurrencyChange,\n size,\n addon,\n selectProps,\n } = this.props;\n const ariaLabelledBy = ariaLabelledByProp ?? inputAttributes?.['aria-labelledby'];\n const selectOptions = this.getSelectOptions();\n\n const hasSingleCurrency = () => {\n if (selectOptions.length !== 0) {\n const firstItem = selectOptions[0];\n\n if (selectOptions.length === 1) {\n if (firstItem.type === 'option') {\n return firstItem.value.currency === selectedCurrency.currency;\n }\n if (firstItem.type === 'group') {\n return (\n firstItem.options.length === 1 &&\n !(this.props.onCustomAction && this.props.customActionLabel)\n );\n }\n }\n } else if (selectedCurrency?.currency) {\n return true;\n }\n\n return false;\n };\n\n const isFixedCurrency = (!this.state.searchQuery && hasSingleCurrency()) || !onCurrencyChange;\n const disabled = !this.props.onAmountChange;\n const selectedCurrencyElementId = `${inputAttributes?.id ?? amountInputId}SelectedCurrency`;\n\n return (\n <div\n role=\"group\"\n {...inputAttributes}\n aria-labelledby={ariaLabelledBy}\n className={clsx(\n this.style('tw-money-input'),\n this.style('input-group'),\n this.style(`input-group-${size}`),\n )}\n >\n <Input\n id={amountInputId}\n value={this.state.formattedAmount}\n inputMode=\"decimal\"\n disabled={disabled}\n placeholder={formatAmountIfSet({\n amount: this.props.placeholder,\n currency: this.props.selectedCurrency.currency,\n locale: this.state.locale,\n })}\n autoComplete=\"off\"\n aria-describedby={selectedCurrencyElementId}\n onKeyDown={this.handleKeyDown}\n onChange={this.onAmountChange}\n onFocus={this.onAmountFocus}\n onBlur={this.onAmountBlur}\n onPaste={this.handlePaste}\n />\n {addon && (\n <span\n className={clsx(\n this.style('input-group-addon'),\n this.style(`input-${size}`),\n disabled ? this.style('disabled') : '',\n )}\n >\n {addon}\n </span>\n )}\n {isFixedCurrency ? (\n <div\n className={clsx(\n this.style('input-group-addon'),\n this.style(`input-${size}`),\n this.style('tw-money-input__fixed-currency'),\n disabled ? this.style('disabled') : '',\n )}\n id={selectedCurrencyElementId}\n >\n {(size === 'lg' || size === 'md') && (\n <span className={clsx(this.style('money-input-currency-flag'), this.style('m-r-2'))}>\n <Flag code={selectedCurrency.currency.toLowerCase()} intrinsicSize={24} />\n </span>\n )}\n <Title\n as=\"span\"\n type={Typography.TITLE_SUBSECTION}\n className={size === 'lg' ? this.style('m-r-1') : ''}\n >\n {selectedCurrency.currency.toUpperCase()}\n </Title>\n </div>\n ) : (\n <div\n className={clsx(\n this.style('input-group-btn'),\n this.style('amount-currency-select-btn'),\n )}\n >\n <SelectInput\n UNSAFE_triggerButtonProps={{\n id: undefined,\n 'aria-labelledby': undefined,\n 'aria-describedby': undefined,\n 'aria-invalid': undefined,\n 'aria-label': this.props.intl.formatMessage(messages.selectCurrencyLabel),\n }}\n id={selectedCurrencyElementId}\n items={selectOptions}\n value={selectedCurrency}\n compareValues=\"currency\"\n renderValue={(currency, withinTrigger) => {\n return (\n <SelectInputOptionContent\n title={withinTrigger ? currency.currency.toUpperCase() : currency.label}\n note={withinTrigger ? undefined : currency.note}\n icon={<Flag code={currency.currency} intrinsicSize={24} />}\n />\n );\n }}\n renderFooter={\n this.props.onCustomAction\n ? () => (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <div role=\"button\" tabIndex={0} onClick={this.handleCustomAction}>\n {this.props.customActionLabel}\n </div>\n )\n : undefined\n }\n placeholder={this.props.intl.formatMessage(messages.selectPlaceholder)}\n filterable\n filterPlaceholder={this.props.searchPlaceholder}\n disabled={disabled}\n size={size}\n onChange={this.handleSelectChange}\n onFilterChange={({ queryNormalized }) => {\n this.handleSearchChange(queryNormalized ?? '');\n }}\n {...selectProps}\n />\n </div>\n )}\n </div>\n );\n }\n}\n\nfunction filterCurrenciesForQuery(\n currencies: readonly CurrencyItem[],\n query: string,\n): CurrencyItem[] {\n if (!query) {\n return [...currencies];\n }\n\n const options = currencies.filter(\n (option): option is CurrencyOptionItem => option.header == null,\n );\n const filteredOptions = removeDuplicateValueOptions(options).filter((option) =>\n currencyOptionFitsQuery(option, query),\n );\n\n return sortOptionsLabelsToFirst(filteredOptions, query);\n}\n\nfunction removeDuplicateValueOptions(options: readonly CurrencyOptionItem[]) {\n const uniqueValues = new Set<string>();\n return options.filter((option) => {\n if (!uniqueValues.has(option.value)) {\n uniqueValues.add(option.value);\n return true;\n }\n return false;\n });\n}\n\nfunction currencyOptionFitsQuery(option: CurrencyOptionItem, query: string) {\n if (!option.value) {\n return false;\n }\n\n return (\n contains(option.label, query) ||\n contains(option.searchable, query) ||\n contains(option.note, query)\n );\n}\n\nfunction contains(property: string | undefined, query: string) {\n return property?.toLowerCase().includes(query.toLowerCase());\n}\n\nfunction sortOptionsLabelsToFirst(options: readonly CurrencyOptionItem[], query: string) {\n return [...options].sort((first, second) => {\n const firstContains = contains(first.label, query);\n const secondContains = contains(second.label, query);\n\n if (firstContains && secondContains) {\n return 0;\n }\n if (firstContains) {\n return -1;\n }\n if (secondContains) {\n return 1;\n }\n return 0;\n });\n}\n\nexport default injectIntl(withId(withInputAttributes(MoneyInput, { nonLabelable: true })));\n"],"names":["isNumberOrNull","v","isNumber","isNull","formatAmountIfSet","amount","currency","locale","formatAmount","parseNumber","parseAmount","allowedInputKeys","Set","MoneyInput","Component","defaultProps","size","Size","LARGE","classNames","selectProps","amountFocused","constructor","props","state","searchQuery","formattedAmount","selectedCurrency","intl","UNSAFE_componentWillReceiveProps","nextProps","setState","isInputAllowedForKeyEvent","event","metaKey","key","ctrlKey","isNumberKey","Number","parseInt","has","handleKeyDown","preventDefault","handlePaste","paste","clipboardData","getData","parsed","isEmpty","onAmountChange","value","target","onAmountBlur","setAmount","onAmountFocus","getSelectOptions","selectOptions","filterCurrenciesForQuery","currencies","formattedOptions","currentGroupOptions","forEach","item","header","push","type","label","options","filterMatchers","note","searchable","previousState","handleSelectChange","handleSearchChange","onCurrencyChange","handleCustomAction","onCustomAction","onSearchChange","filteredOptions","style","className","render","inputAttributes","id","amountInputId","ariaLabelledByProp","addon","ariaLabelledBy","hasSingleCurrency","length","firstItem","customActionLabel","isFixedCurrency","disabled","selectedCurrencyElementId","_jsxs","role","clsx","children","_jsx","Input","inputMode","placeholder","autoComplete","onKeyDown","onChange","onFocus","onBlur","onPaste","Flag","code","toLowerCase","intrinsicSize","Title","as","Typography","TITLE_SUBSECTION","toUpperCase","SelectInput","UNSAFE_triggerButtonProps","undefined","formatMessage","messages","selectCurrencyLabel","items","compareValues","renderValue","withinTrigger","SelectInputOptionContent","title","icon","renderFooter","tabIndex","onClick","selectPlaceholder","filterable","filterPlaceholder","searchPlaceholder","onFilterChange","queryNormalized","query","filter","option","removeDuplicateValueOptions","currencyOptionFitsQuery","sortOptionsLabelsToFirst","uniqueValues","add","contains","property","includes","sort","first","second","firstContains","secondContains","injectIntl","withId","withInputAttributes","nonLabelable"],"mappings":";;;;;;;;;;;;;;;;;;;AAqCA,MAAMA,cAAc,GAAIC,CAAU,IAAyBC,0BAAQ,CAACD,CAAC,CAAC,IAAIE,wBAAM,CAACF,CAAC,CAAC,CAAA;AAEnF,MAAMG,iBAAiB,GAAGA,CAAC;EACzBC,MAAM;EACNC,QAAQ;AACRC,EAAAA,MAAAA;AAKD,CAAA,KAAI;AACH,EAAA,OAAO,OAAOF,MAAM,KAAK,QAAQ,GAAGG,uBAAY,CAACH,MAAM,EAAEC,QAAQ,EAAEC,MAAM,CAAC,GAAG,EAAE,CAAA;AACjF,CAAC,CAAA;AAED,MAAME,WAAW,GAAGA,CAAC;EACnBJ,MAAM;EACNC,QAAQ;AACRC,EAAAA,MAAAA;AAKD,CAAA,KAAI;AACH,EAAA,OAAOG,8BAAW,CAACL,MAAM,EAAEC,QAAQ,EAAEC,MAAM,CAAC,CAAA;AAC9C,CAAC,CAAA;AAED,MAAMI,gBAAgB,GAAG,IAAIC,GAAG,CAAC,CAC/B,WAAW,EACX,QAAQ,EACR,GAAG,EACH,GAAG,EACH,WAAW,EACX,SAAS,EACT,WAAW,EACX,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,KAAK,CACN,CAAC,CAAA;AAgCF,MAAMC,UAAW,SAAQC,eAA8D,CAAA;AAIrF,EAAA,OAAOC,YAAY,GAAG;IACpBC,IAAI,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IAAA,OAAO,CAAC,CAAA;AACV,GAAC,CAAC,CAAA;AACJ,CAAA;AAEA,mBAAeC,oBAAU,CAACC,MAAM,CAACC,4BAAmB,CAACjJ,UAAU,EAAE;AAAEkJ,EAAAA,YAAY,EAAE,IAAA;AAAI,CAAE,CAAC,CAAC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"MoneyInput.js","sources":["../../src/moneyInput/MoneyInput.tsx"],"sourcesContent":["import { isEmpty, isNumber, isNull } from '@transferwise/neptune-validation';\nimport { Flag } from '@wise/art';\nimport { clsx } from 'clsx';\nimport { Component } from 'react';\nimport { injectIntl, WrappedComponentProps } from 'react-intl';\n\nimport { Typography, Size, SizeLarge, SizeMedium, SizeSmall } from '../common';\nimport { withInputAttributes, WithInputAttributesProps } from '../inputs/contexts';\nimport { Input } from '../inputs/Input';\nimport {\n SelectInput,\n SelectInputItem,\n SelectInputOptionContent,\n SelectInputOptionItem,\n SelectInputProps,\n} from '../inputs/SelectInput';\nimport Title from '../title';\n\nimport messages from './MoneyInput.messages';\nimport { formatAmount, parseAmount } from './currencyFormatting';\nimport withId from '../withId';\n\nexport interface CurrencyOptionItem {\n header?: never;\n value: string;\n label: string;\n currency: string;\n note?: string;\n searchable?: string;\n}\n\nexport interface CurrencyHeaderItem {\n header: string;\n}\n\nexport type CurrencyItem = CurrencyOptionItem | CurrencyHeaderItem;\n\nconst isNumberOrNull = (v: unknown): v is number | null => isNumber(v) || isNull(v);\n\nconst formatAmountIfSet = ({\n amount,\n currency,\n locale,\n}: {\n amount: number | null | undefined;\n currency: string;\n locale: string;\n}) => {\n return typeof amount === 'number' ? formatAmount(amount, currency, locale) : '';\n};\n\nconst parseNumber = ({\n amount,\n currency,\n locale,\n}: {\n amount: string;\n currency: string;\n locale: string;\n}) => {\n return parseAmount(amount, currency, locale);\n};\n\nconst allowedInputKeys = new Set([\n 'Backspace',\n 'Delete',\n ',',\n '.',\n 'ArrowDown',\n 'ArrowUp',\n 'ArrowLeft',\n 'ArrowRight',\n 'Enter',\n 'Escape',\n 'Tab',\n]);\n\nexport interface MoneyInputProps extends WrappedComponentProps {\n id?: string;\n 'aria-labelledby'?: string;\n currencies: readonly CurrencyItem[];\n selectedCurrency: CurrencyOptionItem;\n onCurrencyChange?: (value: CurrencyOptionItem) => void;\n placeholder?: number;\n amount: number | null;\n size?: SizeSmall | SizeMedium | SizeLarge;\n onAmountChange?: (value: number | null) => void;\n addon?: React.ReactNode;\n searchPlaceholder?: string;\n /**\n * Allows the consumer to react to searching, while the search itself is handled internally.\n */\n onSearchChange?: (value: { searchQuery: string; filteredOptions: CurrencyItem[] }) => void;\n customActionLabel?: React.ReactNode;\n onCustomAction?: () => void;\n classNames?: Record<string, string>;\n selectProps?: Partial<SelectInputProps<CurrencyOptionItem>>;\n}\n\ntype MoneyInputPropsWithInputAttributes = MoneyInputProps & Partial<WithInputAttributesProps>;\n\ninterface MoneyInputState {\n searchQuery: string;\n formattedAmount: string;\n locale: string;\n}\n\nclass MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInputState> {\n declare props: MoneyInputPropsWithInputAttributes &\n Required<Pick<MoneyInputPropsWithInputAttributes, keyof typeof MoneyInput.defaultProps>>;\n\n static defaultProps = {\n size: Size.LARGE,\n classNames: {},\n selectProps: {},\n } satisfies Partial<MoneyInputPropsWithInputAttributes>;\n\n amountFocused = false;\n\n constructor(props: MoneyInputProps) {\n super(props);\n this.state = {\n searchQuery: '',\n formattedAmount: formatAmountIfSet({\n amount: props.amount,\n currency: props.selectedCurrency.currency,\n locale: props.intl.locale,\n }),\n locale: props.intl.locale,\n };\n }\n\n UNSAFE_componentWillReceiveProps(nextProps: MoneyInputProps) {\n this.setState({ locale: nextProps.intl.locale });\n\n if (!this.amountFocused) {\n this.setState({\n formattedAmount: formatAmountIfSet({\n amount: nextProps.amount,\n currency: nextProps.selectedCurrency.currency,\n locale: nextProps.intl.locale,\n }),\n });\n }\n }\n\n isInputAllowedForKeyEvent = (event: React.KeyboardEvent<HTMLInputElement>) => {\n const { metaKey, key, ctrlKey } = event;\n const isNumberKey = isNumber(Number.parseInt(key, 10));\n\n return isNumberKey || metaKey || ctrlKey || allowedInputKeys.has(key);\n };\n\n handleKeyDown: React.KeyboardEventHandler<HTMLInputElement> = (event) => {\n if (!this.isInputAllowedForKeyEvent(event)) {\n event.preventDefault();\n }\n };\n\n handlePaste: React.ClipboardEventHandler<HTMLInputElement> = (event) => {\n const paste = event.clipboardData.getData('text');\n const { locale } = this.state;\n const parsed = isEmpty(paste)\n ? null\n : parseNumber({\n amount: paste,\n currency: this.props.selectedCurrency.currency,\n locale,\n });\n\n if (isNumberOrNull(parsed)) {\n this.setState({\n formattedAmount: formatAmountIfSet({\n amount: parsed,\n currency: this.props.selectedCurrency.currency,\n locale,\n }),\n });\n this.props.onAmountChange?.(parsed);\n }\n\n event.preventDefault();\n };\n\n onAmountChange: React.ChangeEventHandler<HTMLInputElement> = (event) => {\n const { value } = event.target;\n this.setState({\n formattedAmount: value,\n });\n const parsed = isEmpty(value)\n ? null\n : parseNumber({\n amount: value,\n currency: this.props.selectedCurrency.currency,\n locale: this.state.locale,\n });\n if (isNumberOrNull(parsed)) {\n this.props.onAmountChange?.(parsed);\n }\n };\n\n onAmountBlur = () => {\n this.amountFocused = false;\n this.setAmount();\n };\n\n onAmountFocus = () => {\n this.amountFocused = true;\n };\n\n getSelectOptions() {\n const selectOptions = filterCurrenciesForQuery(this.props.currencies, this.state.searchQuery);\n\n const formattedOptions: SelectInputItem<CurrencyOptionItem>[] = [];\n let currentGroupOptions: SelectInputOptionItem<CurrencyOptionItem>[] | undefined;\n\n selectOptions.forEach((item) => {\n if (item.header != null) {\n currentGroupOptions = [];\n formattedOptions.push({\n type: 'group',\n label: item.header,\n options: currentGroupOptions,\n });\n } else {\n (currentGroupOptions ?? formattedOptions).push({\n type: 'option',\n value: item,\n filterMatchers: [item.value, item.label, item.note ?? '', item.searchable ?? ''],\n });\n }\n });\n\n return formattedOptions;\n }\n\n setAmount() {\n this.setState((previousState) => {\n const parsed = parseNumber({\n amount: previousState.formattedAmount,\n currency: this.props.selectedCurrency.currency,\n locale: previousState.locale,\n });\n if (!isNumberOrNull(parsed)) {\n return {\n formattedAmount: previousState.formattedAmount,\n };\n }\n return {\n formattedAmount: formatAmountIfSet({\n amount: parsed,\n currency: this.props.selectedCurrency.currency,\n locale: previousState.locale,\n }),\n };\n });\n }\n\n handleSelectChange = (value: CurrencyOptionItem) => {\n this.handleSearchChange('');\n this.props.onCurrencyChange?.(value);\n };\n\n handleCustomAction = () => {\n this.handleSearchChange('');\n this.props.onCustomAction?.();\n };\n\n handleSearchChange = (searchQuery: string) => {\n this.setState({ searchQuery });\n this.props.onSearchChange?.({\n searchQuery,\n filteredOptions: filterCurrenciesForQuery(this.props.currencies, searchQuery),\n });\n };\n\n style = (className: string) => this.props.classNames[className] || className;\n\n render() {\n const {\n inputAttributes,\n id: amountInputId,\n 'aria-labelledby': ariaLabelledByProp,\n selectedCurrency,\n onCurrencyChange,\n size,\n addon,\n selectProps,\n } = this.props;\n const ariaLabelledBy = ariaLabelledByProp ?? inputAttributes?.['aria-labelledby'];\n const selectOptions = this.getSelectOptions();\n\n const hasSingleCurrency = () => {\n if (selectOptions.length !== 0) {\n const firstItem = selectOptions[0];\n\n if (selectOptions.length === 1) {\n if (firstItem.type === 'option') {\n return firstItem.value.currency === selectedCurrency.currency;\n }\n if (firstItem.type === 'group') {\n return (\n firstItem.options.length === 1 &&\n !(this.props.onCustomAction && this.props.customActionLabel)\n );\n }\n }\n } else if (selectedCurrency?.currency) {\n return true;\n }\n\n return false;\n };\n\n const isFixedCurrency = (!this.state.searchQuery && hasSingleCurrency()) || !onCurrencyChange;\n const disabled = !this.props.onAmountChange;\n const selectedCurrencyElementId = `${inputAttributes?.id ?? amountInputId}SelectedCurrency`;\n\n return (\n <div\n role=\"group\"\n {...inputAttributes}\n aria-labelledby={ariaLabelledBy}\n className={clsx(\n this.style('tw-money-input'),\n this.style('input-group'),\n this.style(`input-group-${size}`),\n )}\n >\n <Input\n id={amountInputId}\n value={this.state.formattedAmount}\n inputMode=\"decimal\"\n disabled={disabled}\n placeholder={formatAmountIfSet({\n amount: this.props.placeholder,\n currency: this.props.selectedCurrency.currency,\n locale: this.state.locale,\n })}\n autoComplete=\"off\"\n aria-describedby={selectedCurrencyElementId}\n onKeyDown={this.handleKeyDown}\n onChange={this.onAmountChange}\n onFocus={this.onAmountFocus}\n onBlur={this.onAmountBlur}\n onPaste={this.handlePaste}\n />\n {addon && (\n <span\n className={clsx(\n this.style('input-group-addon'),\n this.style(`input-${size}`),\n disabled ? this.style('disabled') : '',\n )}\n >\n {addon}\n </span>\n )}\n {isFixedCurrency ? (\n <div\n className={clsx(\n this.style('input-group-addon'),\n this.style(`input-${size}`),\n this.style('tw-money-input__fixed-currency'),\n disabled ? this.style('disabled') : '',\n )}\n id={selectedCurrencyElementId}\n >\n {(size === 'lg' || size === 'md') && (\n <span className={clsx(this.style('money-input-currency-flag'), this.style('m-r-2'))}>\n <Flag code={selectedCurrency.currency.toLowerCase()} intrinsicSize={24} />\n </span>\n )}\n <Title\n as=\"span\"\n type={Typography.TITLE_SUBSECTION}\n className={size === 'lg' ? this.style('m-r-1') : ''}\n >\n {selectedCurrency.currency.toUpperCase()}\n </Title>\n </div>\n ) : (\n <div\n translate=\"no\"\n className={clsx(\n this.style('input-group-btn'),\n this.style('amount-currency-select-btn'),\n )}\n >\n <SelectInput\n UNSAFE_triggerButtonProps={{\n id: undefined,\n 'aria-labelledby': undefined,\n 'aria-describedby': undefined,\n 'aria-invalid': undefined,\n 'aria-label': this.props.intl.formatMessage(messages.selectCurrencyLabel),\n }}\n id={selectedCurrencyElementId}\n items={selectOptions}\n value={selectedCurrency}\n compareValues=\"currency\"\n renderValue={(currency, withinTrigger) => {\n return (\n <SelectInputOptionContent\n title={withinTrigger ? currency.currency.toUpperCase() : currency.label}\n note={withinTrigger ? undefined : currency.note}\n icon={<Flag code={currency.currency} intrinsicSize={24} />}\n />\n );\n }}\n renderFooter={\n this.props.onCustomAction\n ? () => (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <div role=\"button\" tabIndex={0} onClick={this.handleCustomAction}>\n {this.props.customActionLabel}\n </div>\n )\n : undefined\n }\n placeholder={this.props.intl.formatMessage(messages.selectPlaceholder)}\n filterable\n filterPlaceholder={this.props.searchPlaceholder}\n disabled={disabled}\n size={size}\n onChange={this.handleSelectChange}\n onFilterChange={({ queryNormalized }) => {\n this.handleSearchChange(queryNormalized ?? '');\n }}\n {...selectProps}\n />\n </div>\n )}\n </div>\n );\n }\n}\n\nfunction filterCurrenciesForQuery(\n currencies: readonly CurrencyItem[],\n query: string,\n): CurrencyItem[] {\n if (!query) {\n return [...currencies];\n }\n\n const options = currencies.filter(\n (option): option is CurrencyOptionItem => option.header == null,\n );\n const filteredOptions = removeDuplicateValueOptions(options).filter((option) =>\n currencyOptionFitsQuery(option, query),\n );\n\n return sortOptionsLabelsToFirst(filteredOptions, query);\n}\n\nfunction removeDuplicateValueOptions(options: readonly CurrencyOptionItem[]) {\n const uniqueValues = new Set<string>();\n return options.filter((option) => {\n if (!uniqueValues.has(option.value)) {\n uniqueValues.add(option.value);\n return true;\n }\n return false;\n });\n}\n\nfunction currencyOptionFitsQuery(option: CurrencyOptionItem, query: string) {\n if (!option.value) {\n return false;\n }\n\n return (\n contains(option.label, query) ||\n contains(option.searchable, query) ||\n contains(option.note, query)\n );\n}\n\nfunction contains(property: string | undefined, query: string) {\n return property?.toLowerCase().includes(query.toLowerCase());\n}\n\nfunction sortOptionsLabelsToFirst(options: readonly CurrencyOptionItem[], query: string) {\n return [...options].sort((first, second) => {\n const firstContains = contains(first.label, query);\n const secondContains = contains(second.label, query);\n\n if (firstContains && secondContains) {\n return 0;\n }\n if (firstContains) {\n return -1;\n }\n if (secondContains) {\n return 1;\n }\n return 0;\n });\n}\n\nexport default injectIntl(withId(withInputAttributes(MoneyInput, { nonLabelable: true })));\n"],"names":["isNumberOrNull","v","isNumber","isNull","formatAmountIfSet","amount","currency","locale","formatAmount","parseNumber","parseAmount","allowedInputKeys","Set","MoneyInput","Component","defaultProps","size","Size","LARGE","classNames","selectProps","amountFocused","constructor","props","state","searchQuery","formattedAmount","selectedCurrency","intl","UNSAFE_componentWillReceiveProps","nextProps","setState","isInputAllowedForKeyEvent","event","metaKey","key","ctrlKey","isNumberKey","Number","parseInt","has","handleKeyDown","preventDefault","handlePaste","paste","clipboardData","getData","parsed","isEmpty","onAmountChange","value","target","onAmountBlur","setAmount","onAmountFocus","getSelectOptions","selectOptions","filterCurrenciesForQuery","currencies","formattedOptions","currentGroupOptions","forEach","item","header","push","type","label","options","filterMatchers","note","searchable","previousState","handleSelectChange","handleSearchChange","onCurrencyChange","handleCustomAction","onCustomAction","onSearchChange","filteredOptions","style","className","render","inputAttributes","id","amountInputId","ariaLabelledByProp","addon","ariaLabelledBy","hasSingleCurrency","length","firstItem","customActionLabel","isFixedCurrency","disabled","selectedCurrencyElementId","_jsxs","role","clsx","children","_jsx","Input","inputMode","placeholder","autoComplete","onKeyDown","onChange","onFocus","onBlur","onPaste","Flag","code","toLowerCase","intrinsicSize","Title","as","Typography","TITLE_SUBSECTION","toUpperCase","translate","SelectInput","UNSAFE_triggerButtonProps","undefined","formatMessage","messages","selectCurrencyLabel","items","compareValues","renderValue","withinTrigger","SelectInputOptionContent","title","icon","renderFooter","tabIndex","onClick","selectPlaceholder","filterable","filterPlaceholder","searchPlaceholder","onFilterChange","queryNormalized","query","filter","option","removeDuplicateValueOptions","currencyOptionFitsQuery","sortOptionsLabelsToFirst","uniqueValues","add","contains","property","includes","sort","first","second","firstContains","secondContains","injectIntl","withId","withInputAttributes","nonLabelable"],"mappings":";;;;;;;;;;;;;;;;;;;AAqCA,MAAMA,cAAc,GAAIC,CAAU,IAAyBC,0BAAQ,CAACD,CAAC,CAAC,IAAIE,wBAAM,CAACF,CAAC,CAAC,CAAA;AAEnF,MAAMG,iBAAiB,GAAGA,CAAC;EACzBC,MAAM;EACNC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