@transferwise/components 0.0.0-experimental-4ba8514 → 0.0.0-experimental-2ea09db
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/i18n/en.json +0 -1
- package/build/i18n/en.json.js +0 -1
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +0 -1
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/inputs/SelectInput.js +0 -4
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.mjs +0 -4
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/main.css +210 -210
- package/build/moneyInput/MoneyInput.js +1 -8
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.js +0 -3
- package/build/moneyInput/MoneyInput.messages.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.mjs +0 -3
- package/build/moneyInput/MoneyInput.messages.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +1 -8
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/styles/main.css +210 -210
- package/build/styles/uploadInput/UploadInput.css +13 -81
- package/build/styles/uploadInput/uploadButton/UploadButton.css +78 -31
- package/build/styles/uploadInput/uploadItem/UploadItem.css +130 -109
- package/build/types/inputs/SelectInput.d.ts +1 -3
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.messages.d.ts +0 -5
- package/build/types/moneyInput/MoneyInput.messages.d.ts.map +1 -1
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/types/uploadInput/uploadButton/UploadButton.d.ts +5 -0
- 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 +30 -20
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +30 -20
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js +25 -32
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs +25 -32
- package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +32 -38
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +33 -39
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItemLink.js +2 -1
- package/build/uploadInput/uploadItem/UploadItemLink.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItemLink.mjs +2 -1
- package/build/uploadInput/uploadItem/UploadItemLink.mjs.map +1 -1
- package/package.json +2 -2
- package/src/i18n/en.json +0 -1
- package/src/inputs/SelectInput.tsx +3 -8
- package/src/main.css +210 -210
- package/src/moneyInput/MoneyInput.messages.ts +0 -5
- package/src/moneyInput/MoneyInput.rtl.spec.tsx +0 -47
- package/src/moneyInput/MoneyInput.spec.js +11 -0
- package/src/moneyInput/MoneyInput.story.tsx +7 -10
- package/src/moneyInput/MoneyInput.tsx +1 -8
- package/src/uploadInput/UploadInput.css +13 -81
- package/src/uploadInput/UploadInput.less +18 -80
- package/src/uploadInput/UploadInput.tests.story.tsx +5 -5
- package/src/uploadInput/UploadInput.tsx +43 -32
- package/src/uploadInput/uploadButton/UploadButton.css +78 -31
- package/src/uploadInput/uploadButton/UploadButton.less +78 -35
- package/src/uploadInput/uploadButton/UploadButton.tsx +37 -26
- package/src/uploadInput/uploadItem/UploadItem.css +130 -109
- package/src/uploadInput/uploadItem/UploadItem.less +130 -118
- package/src/uploadInput/uploadItem/UploadItem.tsx +26 -28
- package/src/uploadInput/uploadItem/UploadItemLink.tsx +3 -3
- package/src/withId/withId.story.tsx +0 -1
- package/src/moneyInput/MoneyInput.docs.mdx +0 -34
package/src/main.css
CHANGED
|
@@ -5478,280 +5478,280 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5478
5478
|
.upload-error-message .alert {
|
|
5479
5479
|
min-width: 100px;
|
|
5480
5480
|
}
|
|
5481
|
-
.np-upload-button
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5481
|
+
.np-upload-input__upload-button {
|
|
5482
|
+
position: relative;
|
|
5483
|
+
padding: 16px;
|
|
5484
|
+
padding: var(--size-16);
|
|
5485
5485
|
display: flex;
|
|
5486
|
+
align-items: center;
|
|
5487
|
+
margin: 0;
|
|
5488
|
+
border-bottom-left-radius: 10px;
|
|
5489
|
+
border-bottom-left-radius: var(--radius-small);
|
|
5490
|
+
border-bottom-right-radius: 10px;
|
|
5491
|
+
border-bottom-right-radius: var(--radius-small);
|
|
5492
|
+
border: var(--outerBorder);
|
|
5493
|
+
cursor: pointer;
|
|
5486
5494
|
}
|
|
5487
|
-
.np-upload-button
|
|
5488
|
-
|
|
5489
|
-
|
|
5495
|
+
.np-upload-input__upload-button .np-upload-input__title {
|
|
5496
|
+
color: var(--color-content-link);
|
|
5497
|
+
-webkit-text-decoration: underline;
|
|
5498
|
+
text-decoration: underline;
|
|
5499
|
+
text-underline-offset: 0.3em;
|
|
5490
5500
|
}
|
|
5491
|
-
.np-upload-button-
|
|
5492
|
-
|
|
5501
|
+
.np-upload-input__upload-button .np-upload-input__title + .np-upload-input__text {
|
|
5502
|
+
margin-top: 4px;
|
|
5503
|
+
margin-top: var(--size-4);
|
|
5504
|
+
line-height: 22px;
|
|
5505
|
+
}
|
|
5506
|
+
.np-upload-input__upload-button .np-upload-input__icon {
|
|
5507
|
+
padding-right: 16px;
|
|
5508
|
+
padding-right: var(--size-16);
|
|
5509
|
+
color: var(--color-interactive-primary);
|
|
5510
|
+
}
|
|
5511
|
+
.np-upload-input__upload-button.is-dropping .np-upload-input__icon,
|
|
5512
|
+
.np-upload-input__upload-button.is-dropping .np-upload-input__item-content {
|
|
5513
|
+
display: none;
|
|
5514
|
+
}
|
|
5515
|
+
.np-upload-input__upload-button:focus-within,
|
|
5516
|
+
.np-upload-input__upload-button:focus-visible {
|
|
5517
|
+
outline: var(--ring-outline-color) solid 3px;
|
|
5518
|
+
outline-offset: -3px;
|
|
5493
5519
|
}
|
|
5494
|
-
.np-upload-button-
|
|
5520
|
+
.np-upload-input__upload-button-input {
|
|
5521
|
+
position: absolute;
|
|
5495
5522
|
opacity: 0;
|
|
5496
5523
|
z-index: -1;
|
|
5524
|
+
}
|
|
5525
|
+
.np-upload-input__upload-button-input:focus {
|
|
5526
|
+
outline: none;
|
|
5527
|
+
}
|
|
5528
|
+
.np-upload-input__upload-button .np-upload-input__drop-file-overlay {
|
|
5529
|
+
display: flex;
|
|
5530
|
+
flex: 1;
|
|
5531
|
+
padding: 13px 0 !important;
|
|
5532
|
+
background-color: transparent;
|
|
5533
|
+
transition: transform 0.3s ease;
|
|
5534
|
+
position: relative;
|
|
5535
|
+
}
|
|
5536
|
+
.np-upload-input__upload-button--with-entries {
|
|
5537
|
+
border-top-width: 0;
|
|
5538
|
+
}
|
|
5539
|
+
.np-upload-input__upload-button--with-entries:before {
|
|
5540
|
+
display: block;
|
|
5497
5541
|
position: absolute;
|
|
5542
|
+
height: 1px;
|
|
5543
|
+
background-color: rgba(0,0,0,0.10196);
|
|
5544
|
+
background-color: var(--color-border-neutral);
|
|
5545
|
+
content: " ";
|
|
5546
|
+
left: 16px;
|
|
5547
|
+
left: var(--size-16);
|
|
5548
|
+
width: calc(100% - 2 * 16px);
|
|
5549
|
+
width: calc(100% - 2 * var(--size-16));
|
|
5550
|
+
top: 0;
|
|
5498
5551
|
}
|
|
5499
|
-
.np-upload-button-
|
|
5500
|
-
border:
|
|
5552
|
+
.np-upload-input__upload-button--without-entries {
|
|
5553
|
+
border-top: var(--outerBorder);
|
|
5554
|
+
border-radius: 10px;
|
|
5555
|
+
border-radius: var(--radius-small);
|
|
5556
|
+
}
|
|
5557
|
+
.np-upload-input__upload-button--enabled.is-dropping,
|
|
5558
|
+
.np-upload-input__upload-button--enabled:hover,
|
|
5559
|
+
.np-upload-input__upload-button--enabled:active {
|
|
5560
|
+
background: rgba(134,167,189,0.10196);
|
|
5561
|
+
background: var(--color-background-neutral);
|
|
5501
5562
|
}
|
|
5502
|
-
.np-upload-button
|
|
5563
|
+
.np-upload-input__upload-button--enabled.is-dropping:before,
|
|
5564
|
+
.np-upload-input__upload-button--enabled:hover:before,
|
|
5565
|
+
.np-upload-input__upload-button--enabled:active:before {
|
|
5503
5566
|
width: 100%;
|
|
5504
|
-
|
|
5505
|
-
padding: 16px;
|
|
5506
|
-
padding: var(--padding-small);
|
|
5507
|
-
border-radius: 0;
|
|
5567
|
+
left: 0;
|
|
5508
5568
|
}
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
background-color: var(--color-background-screen-hover);
|
|
5569
|
+
.np-upload-input__upload-button--disabled {
|
|
5570
|
+
cursor: inherit;
|
|
5512
5571
|
}
|
|
5513
|
-
.
|
|
5514
|
-
|
|
5515
|
-
|
|
5572
|
+
.np-upload-input {
|
|
5573
|
+
--outerBorder: 1px solid var(--color-interactive-secondary);
|
|
5574
|
+
border-radius: 10px;
|
|
5575
|
+
border-radius: var(--radius-small);
|
|
5516
5576
|
}
|
|
5517
|
-
.np-upload-
|
|
5518
|
-
|
|
5577
|
+
.np-upload-input .np-upload-input__section {
|
|
5578
|
+
margin: 0;
|
|
5519
5579
|
}
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5580
|
+
.np-upload-input .np-upload-input__section:only-child .np-upload-input__item {
|
|
5581
|
+
border-radius: 10px;
|
|
5582
|
+
border-radius: var(--radius-small);
|
|
5583
|
+
border-bottom: var(--outerBorder);
|
|
5524
5584
|
}
|
|
5525
|
-
.np-upload-input.
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5585
|
+
.np-upload-input .np-upload-input__section:has(.np-upload-input__item:last-child.is-interactive:hover):not(:has(.np-upload-input__item-button:hover)) + .np-upload-input__section--uploader .np-upload-input__upload-button::before {
|
|
5586
|
+
left: 0;
|
|
5587
|
+
width: 100%;
|
|
5588
|
+
top: 0;
|
|
5529
5589
|
}
|
|
5530
|
-
.np-upload-
|
|
5531
|
-
|
|
5532
|
-
|
|
5590
|
+
.np-upload-input__item {
|
|
5591
|
+
position: relative;
|
|
5592
|
+
padding: 16px;
|
|
5593
|
+
padding: var(--size-16);
|
|
5594
|
+
display: flex;
|
|
5595
|
+
align-items: flex-start;
|
|
5596
|
+
border-left: var(--outerBorder);
|
|
5597
|
+
border-right: var(--outerBorder);
|
|
5598
|
+
}
|
|
5599
|
+
.np-upload-input__item:first-child {
|
|
5600
|
+
border-top: var(--outerBorder);
|
|
5533
5601
|
border-top-left-radius: 10px;
|
|
5534
5602
|
border-top-left-radius: var(--radius-small);
|
|
5535
5603
|
border-top-right-radius: 10px;
|
|
5536
5604
|
border-top-right-radius: var(--radius-small);
|
|
5537
5605
|
}
|
|
5538
|
-
.np-upload-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5606
|
+
.np-upload-input__item + .np-upload-input__item:before {
|
|
5607
|
+
content: " ";
|
|
5608
|
+
display: block;
|
|
5609
|
+
position: absolute;
|
|
5610
|
+
height: 1px;
|
|
5611
|
+
left: 16px;
|
|
5612
|
+
left: var(--size-16);
|
|
5613
|
+
width: calc(100% - 2 * 16px);
|
|
5614
|
+
width: calc(100% - 2 * var(--size-16));
|
|
5615
|
+
top: 0;
|
|
5616
|
+
background: rgba(0,0,0,0.10196);
|
|
5617
|
+
background: var(--color-border-neutral);
|
|
5549
5618
|
}
|
|
5550
|
-
.np-
|
|
5619
|
+
.np-upload-input__item .np-upload-input__item-content {
|
|
5551
5620
|
padding-right: 32px;
|
|
5552
5621
|
padding-right: var(--size-32);
|
|
5553
|
-
|
|
5554
|
-
white-space: break-spaces;
|
|
5622
|
+
flex: 1;
|
|
5555
5623
|
}
|
|
5556
5624
|
@media (max-width: 320px) {
|
|
5557
|
-
.np-
|
|
5625
|
+
.np-upload-input__item .np-upload-input__item-content {
|
|
5558
5626
|
padding-right: 64px;
|
|
5559
5627
|
padding-right: var(--size-64);
|
|
5560
5628
|
}
|
|
5561
5629
|
}
|
|
5562
|
-
.np-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
text-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
.np-theme-personal .np-upload-input .media-body .text-positive {
|
|
5570
|
-
color: #5d7079 !important;
|
|
5571
|
-
color: var(--color-content-secondary) !important;
|
|
5572
|
-
}
|
|
5573
|
-
.np-theme-personal .np-upload-input .media-body .text-negative {
|
|
5574
|
-
color: var(--color-sentiment-negative) !important;
|
|
5630
|
+
.np-upload-input__item .np-upload-input__title,
|
|
5631
|
+
.np-upload-input__item .np-upload-input__text {
|
|
5632
|
+
margin: 0;
|
|
5633
|
+
-moz-text-align-last: left;
|
|
5634
|
+
text-align-last: left;
|
|
5635
|
+
color: #5d7079;
|
|
5636
|
+
color: var(--color-content-secondary);
|
|
5575
5637
|
}
|
|
5576
|
-
.np-
|
|
5577
|
-
|
|
5578
|
-
|
|
5638
|
+
.np-upload-input__item .np-upload-input__title + .np-upload-input__text {
|
|
5639
|
+
margin-top: 4px;
|
|
5640
|
+
margin-top: var(--size-4);
|
|
5579
5641
|
}
|
|
5580
|
-
.np-
|
|
5581
|
-
|
|
5582
|
-
padding-
|
|
5583
|
-
padding-left: var(--size-16);
|
|
5642
|
+
.np-upload-input__item .np-upload-input__icon {
|
|
5643
|
+
padding-right: 16px;
|
|
5644
|
+
padding-right: var(--size-16);
|
|
5584
5645
|
}
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5646
|
+
.np-upload-input__item .np-upload-input__item-link,
|
|
5647
|
+
.np-upload-input__item .np-upload-input__item-container {
|
|
5648
|
+
align-items: flex-start;
|
|
5649
|
+
display: flex;
|
|
5650
|
+
width: 100%;
|
|
5590
5651
|
}
|
|
5591
|
-
.np-
|
|
5592
|
-
|
|
5652
|
+
.np-upload-input__item .np-upload-input__item-action {
|
|
5653
|
+
--iconSize: var(--size-24);
|
|
5654
|
+
--clickAreaSize: 44px;
|
|
5655
|
+
--buttonTopRightOffset: var(--size-16);
|
|
5656
|
+
--clickAreaTopRightOffset: calc((var(--clickAreaSize) - var(--iconSize)) * -0.5);
|
|
5593
5657
|
position: absolute;
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
width: 24px;
|
|
5599
|
-
width: var(--size-x-small);
|
|
5600
|
-
height: 24px;
|
|
5601
|
-
height: var(--size-x-small);
|
|
5658
|
+
right: 16px;
|
|
5659
|
+
right: var(--buttonTopRightOffset);
|
|
5660
|
+
top: 16px;
|
|
5661
|
+
top: var(--buttonTopRightOffset);
|
|
5602
5662
|
}
|
|
5603
5663
|
@media (max-width: 320px) {
|
|
5604
|
-
.np-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
height: 48px;
|
|
5608
|
-
height: var(--size-large);
|
|
5664
|
+
.np-upload-input__item .np-upload-input__item-action {
|
|
5665
|
+
--iconSize: var(--size-48);
|
|
5666
|
+
--clickAreaTopRightOffset: calc(-1 * var(--buttonTopRightOffset));
|
|
5609
5667
|
}
|
|
5610
5668
|
}
|
|
5611
|
-
.np-upload-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5669
|
+
.np-upload-input__item .np-upload-input__item-action .np-upload-input__item-button {
|
|
5670
|
+
-webkit-appearance: none;
|
|
5671
|
+
-moz-appearance: none;
|
|
5672
|
+
appearance: none;
|
|
5673
|
+
height: var(--iconSize);
|
|
5674
|
+
width: var(--iconSize);
|
|
5675
|
+
padding: 0 4px;
|
|
5676
|
+
padding: 0 var(--size-4);
|
|
5677
|
+
border-radius: 50%;
|
|
5678
|
+
border: 0;
|
|
5679
|
+
background-color: rgba(134,167,189,0.10196);
|
|
5680
|
+
background-color: var(--color-background-neutral);
|
|
5681
|
+
color: var(--color-interactive-primary);
|
|
5682
|
+
transition: color, background-color 0.15s ease-in-out;
|
|
5683
|
+
outline-offset: 0;
|
|
5684
|
+
display: flex;
|
|
5685
|
+
align-items: center;
|
|
5686
|
+
justify-content: center;
|
|
5615
5687
|
}
|
|
5616
|
-
.np-upload-
|
|
5617
|
-
|
|
5618
|
-
.np-upload-item.np-upload-item--link:hover .np-upload-item__link:after {
|
|
5688
|
+
.np-upload-input__item .np-upload-input__item-action .np-upload-input__item-button:before {
|
|
5689
|
+
content: '';
|
|
5619
5690
|
display: block;
|
|
5691
|
+
width: var(--clickAreaSize);
|
|
5692
|
+
height: var(--clickAreaSize);
|
|
5693
|
+
border-radius: 50%;
|
|
5620
5694
|
position: absolute;
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
background-color: var(--color-border-neutral);
|
|
5624
|
-
content: " ";
|
|
5625
|
-
left: 16px;
|
|
5626
|
-
left: var(--size-16);
|
|
5627
|
-
width: calc(100% - 2 * 16px);
|
|
5628
|
-
width: calc(100% - 2 * var(--size-16));
|
|
5695
|
+
top: var(--clickAreaTopRightOffset);
|
|
5696
|
+
right: var(--clickAreaTopRightOffset);
|
|
5629
5697
|
}
|
|
5630
|
-
.np-upload-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
}
|
|
5634
|
-
.np-upload-item.np-upload-item--link:hover .np-upload-item__link:after {
|
|
5635
|
-
bottom: -1px;
|
|
5636
|
-
}
|
|
5637
|
-
.np-upload-item:first-child ~ div {
|
|
5638
|
-
border-top: 1px;
|
|
5639
|
-
}
|
|
5640
|
-
.np-upload-item:not(:first-child) .np-upload-item__link:hover {
|
|
5641
|
-
border-top-color: rgba(0,0,0,0.10196);
|
|
5642
|
-
border-top-color: var(--color-border-neutral);
|
|
5643
|
-
}
|
|
5644
|
-
.np-upload-item:not(:last-child) {
|
|
5645
|
-
border-bottom: 0;
|
|
5646
|
-
}
|
|
5647
|
-
.np-upload-item.np-upload-item--link:hover + .np-upload-item:before,
|
|
5648
|
-
.np-upload-item.np-upload-item--link:hover + .np-upload-button-container:before,
|
|
5649
|
-
.np-upload-item.np-upload-item--link:hover + .np-upload-item .np-upload-item__link:before,
|
|
5650
|
-
.np-upload-item.np-upload-item--link:hover + .np-upload-button-container .np-upload-item__link:before {
|
|
5651
|
-
display: none;
|
|
5698
|
+
.np-upload-input__item .np-upload-input__item-action .np-upload-input__item-button:hover {
|
|
5699
|
+
background-color: var(--color-sentiment-negative);
|
|
5700
|
+
color: var(--color-contrast-overlay) !important;
|
|
5652
5701
|
}
|
|
5653
|
-
.np-upload-button
|
|
5654
|
-
|
|
5655
|
-
left: 0 !important;
|
|
5656
|
-
width: 100% !important;
|
|
5702
|
+
.np-upload-input__item .np-upload-input__item-action .np-upload-input__item-button:active {
|
|
5703
|
+
background-color: var(--color-background-neutral-active);
|
|
5657
5704
|
}
|
|
5658
|
-
.np-upload-
|
|
5659
|
-
|
|
5660
|
-
outline-offset: var(--ring-outline-offset);
|
|
5661
|
-
border-color: transparent;
|
|
5662
|
-
outline-offset: -3px;
|
|
5705
|
+
.np-upload-input__item.is-interactive {
|
|
5706
|
+
padding: 0;
|
|
5663
5707
|
}
|
|
5664
|
-
.np-upload-
|
|
5665
|
-
.np-upload-
|
|
5666
|
-
|
|
5667
|
-
|
|
5708
|
+
.np-upload-input__item.is-interactive:hover:not(:has(.np-upload-input__item-button:hover)):before,
|
|
5709
|
+
.np-upload-input__item.is-interactive:hover:not(:has(.np-upload-input__item-button:hover)) + .np-upload-input__item:before {
|
|
5710
|
+
width: 100%;
|
|
5711
|
+
left: 0;
|
|
5668
5712
|
}
|
|
5669
|
-
.np-upload-
|
|
5670
|
-
|
|
5713
|
+
.np-upload-input__item.is-interactive .np-upload-input__item-link {
|
|
5714
|
+
padding: 16px;
|
|
5715
|
+
padding: var(--size-16);
|
|
5671
5716
|
-webkit-text-decoration: none;
|
|
5672
5717
|
text-decoration: none;
|
|
5673
|
-
border-top: 1px solid transparent;
|
|
5674
5718
|
border-radius: inherit;
|
|
5719
|
+
border-top: 1px solid transparent;
|
|
5720
|
+
background-clip: padding-box;
|
|
5675
5721
|
}
|
|
5676
|
-
.np-upload-
|
|
5722
|
+
.np-upload-input__item.is-interactive .np-upload-input__item-link:focus-visible {
|
|
5677
5723
|
outline-offset: -2px;
|
|
5724
|
+
outline-width: 3px;
|
|
5678
5725
|
}
|
|
5679
|
-
.np-upload-
|
|
5680
|
-
|
|
5681
|
-
}
|
|
5682
|
-
.np-upload-item--link a:hover:after {
|
|
5683
|
-
left: 0 !important;
|
|
5684
|
-
width: 100% !important;
|
|
5685
|
-
}
|
|
5686
|
-
.np-upload-item--link a:hover,
|
|
5687
|
-
.np-upload-item--link a:active {
|
|
5688
|
-
-webkit-text-decoration: none;
|
|
5689
|
-
text-decoration: none;
|
|
5690
|
-
}
|
|
5691
|
-
.np-upload-item--link a:hover .np-upload-button,
|
|
5692
|
-
.np-upload-item--link a:active .np-upload-button {
|
|
5726
|
+
.np-upload-input__item.is-interactive .np-upload-input__item-link:hover,
|
|
5727
|
+
.np-upload-input__item.is-interactive .np-upload-input__item-link:active {
|
|
5693
5728
|
background-color: rgba(134,167,189,0.10196);
|
|
5694
5729
|
background-color: var(--color-background-neutral);
|
|
5695
|
-
border-radius: inherit;
|
|
5696
5730
|
}
|
|
5697
|
-
.np-upload-
|
|
5698
|
-
border-top: 0;
|
|
5731
|
+
.np-upload-input__item.is-interactive:first-child .np-upload-input__item-link {
|
|
5732
|
+
border-top-width: 0;
|
|
5699
5733
|
}
|
|
5700
|
-
.np-upload-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5734
|
+
.np-upload-input__item .np-upload-input-errors {
|
|
5735
|
+
padding-left: 0;
|
|
5736
|
+
list-style-type: "";
|
|
5737
|
+
}
|
|
5738
|
+
.np-upload-input__item .np-upload-input-errors > li {
|
|
5704
5739
|
position: relative;
|
|
5705
|
-
|
|
5740
|
+
padding-left: 16px;
|
|
5741
|
+
padding-left: var(--size-16);
|
|
5706
5742
|
}
|
|
5707
|
-
.np-upload-
|
|
5708
|
-
|
|
5709
|
-
align-items: center;
|
|
5710
|
-
justify-content: center;
|
|
5711
|
-
align-self: flex-start;
|
|
5743
|
+
.np-upload-input__item .np-upload-input-errors > li::before {
|
|
5744
|
+
content: '•';
|
|
5712
5745
|
position: absolute;
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
min-height: 0;
|
|
5716
|
-
width: 24px;
|
|
5717
|
-
width: var(--size-24);
|
|
5718
|
-
padding: 0;
|
|
5719
|
-
border-radius: 50% !important;
|
|
5720
|
-
outline-offset: 0 !important;
|
|
5721
|
-
background-color: rgba(134,167,189,0.10196);
|
|
5722
|
-
background-color: var(--color-background-neutral);
|
|
5723
|
-
border: none;
|
|
5724
|
-
color: var(--color-interactive-primary);
|
|
5725
|
-
right: 16px;
|
|
5726
|
-
right: var(--size-16);
|
|
5727
|
-
top: 16px;
|
|
5728
|
-
top: var(--size-16);
|
|
5729
|
-
transition: color, background-color 0.15s ease-in-out;
|
|
5746
|
+
display: block;
|
|
5747
|
+
left: 0;
|
|
5730
5748
|
}
|
|
5731
5749
|
@media (max-width: 320px) {
|
|
5732
|
-
.np-upload-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
right: 16px;
|
|
5736
|
-
right: var(--size-16);
|
|
5737
|
-
height: 48px;
|
|
5738
|
-
height: var(--size-48);
|
|
5739
|
-
width: 48px;
|
|
5740
|
-
width: var(--size-48);
|
|
5750
|
+
.np-upload-input__item .np-upload-input-errors > li {
|
|
5751
|
+
padding-left: 32px;
|
|
5752
|
+
padding-left: var(--size-32);
|
|
5741
5753
|
}
|
|
5742
5754
|
}
|
|
5743
|
-
.np-upload-item__remove-button:hover {
|
|
5744
|
-
background-color: var(--color-sentiment-negative);
|
|
5745
|
-
color: var(--color-contrast-overlay) !important;
|
|
5746
|
-
}
|
|
5747
|
-
.np-upload-item__remove-button:before {
|
|
5748
|
-
display: block;
|
|
5749
|
-
width: 44px;
|
|
5750
|
-
height: 44px;
|
|
5751
|
-
content: '';
|
|
5752
|
-
border-radius: 50%;
|
|
5753
|
-
position: absolute;
|
|
5754
|
-
}
|
|
5755
5755
|
.np-progress {
|
|
5756
5756
|
border-radius: 10px;
|
|
5757
5757
|
border-radius: var(--radius-small);
|
|
@@ -5,9 +5,4 @@ export default defineMessages({
|
|
|
5
5
|
id: 'neptune.MoneyInput.Select.placeholder',
|
|
6
6
|
defaultMessage: 'Select an option...',
|
|
7
7
|
},
|
|
8
|
-
selectCurrencyLabel: {
|
|
9
|
-
id: 'neptune.MoneyInput.Select.selectCurrencyLabel',
|
|
10
|
-
defaultMessage: 'Select currency',
|
|
11
|
-
description: 'Visually hidden label for the currency selector input.',
|
|
12
|
-
},
|
|
13
8
|
});
|
|
@@ -2,7 +2,6 @@ import { Field } from '../field/Field';
|
|
|
2
2
|
import { mockMatchMedia, mockResizeObserver, render, screen, userEvent } from '../test-utils';
|
|
3
3
|
|
|
4
4
|
import MoneyInput from './MoneyInput';
|
|
5
|
-
import messages from './MoneyInput.messages';
|
|
6
5
|
|
|
7
6
|
mockMatchMedia();
|
|
8
7
|
mockResizeObserver();
|
|
@@ -52,7 +51,6 @@ describe('MoneyInput', () => {
|
|
|
52
51
|
const props = {
|
|
53
52
|
currencies,
|
|
54
53
|
selectedCurrency: currencies[1],
|
|
55
|
-
searchPlaceholder: 'Type a currency / country',
|
|
56
54
|
amount: 1000,
|
|
57
55
|
onAmountChange: jest.fn(),
|
|
58
56
|
onCurrencyChange: jest.fn(),
|
|
@@ -92,49 +90,4 @@ describe('MoneyInput', () => {
|
|
|
92
90
|
);
|
|
93
91
|
expect(screen.getAllByRole('group')[0]).toHaveAccessibleName(/^Recipient gets/);
|
|
94
92
|
});
|
|
95
|
-
|
|
96
|
-
describe('ids', () => {
|
|
97
|
-
it('should guarantee id and connect the input with the selected currency via withId HoC', () => {
|
|
98
|
-
render(<MoneyInput {...props} />);
|
|
99
|
-
const input = screen.getByRole('textbox');
|
|
100
|
-
const button = screen.getByRole('combobox');
|
|
101
|
-
expect(input.getAttribute('id')).toBeTruthy();
|
|
102
|
-
expect(input).toHaveAttribute('aria-describedby', button.getAttribute('id'));
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it('should have unique id for the select filter with predefined id', async () => {
|
|
106
|
-
const fieldId = 'myFieldId';
|
|
107
|
-
render(
|
|
108
|
-
<Field label="Multiple currencies" id={fieldId}>
|
|
109
|
-
<MoneyInput {...props} />
|
|
110
|
-
</Field>,
|
|
111
|
-
);
|
|
112
|
-
await userEvent.click(screen.getByRole('combobox'));
|
|
113
|
-
expect(screen.getByLabelText(props.searchPlaceholder)).toHaveAttribute(
|
|
114
|
-
'id',
|
|
115
|
-
`${fieldId}SelectedCurrencySearch`,
|
|
116
|
-
);
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
it('should have unique id for the select filter without predefined id', async () => {
|
|
120
|
-
render(
|
|
121
|
-
<Field label="Multiple currencies">
|
|
122
|
-
<MoneyInput {...props} />
|
|
123
|
-
</Field>,
|
|
124
|
-
);
|
|
125
|
-
await userEvent.click(screen.getByRole('combobox'));
|
|
126
|
-
expect(screen.getByLabelText(props.searchPlaceholder)).toHaveAttribute(
|
|
127
|
-
'id',
|
|
128
|
-
expect.stringMatching(/^:.*?:SelectedCurrencySearch$/),
|
|
129
|
-
);
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
it('should have AT label for the currency dropdown', () => {
|
|
134
|
-
render(<MoneyInput {...props} />);
|
|
135
|
-
expect(screen.getByRole('combobox')).toHaveAttribute(
|
|
136
|
-
'aria-label',
|
|
137
|
-
messages.selectCurrencyLabel.defaultMessage,
|
|
138
|
-
);
|
|
139
|
-
});
|
|
140
93
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { shallow } from 'enzyme';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
2
3
|
|
|
3
4
|
import { MoneyInput, Title, Input, SelectInput } from '..';
|
|
4
5
|
import { mockMatchMedia, mockResizeObserver } from '../test-utils';
|
|
@@ -817,4 +818,14 @@ describe('Money Input', () => {
|
|
|
817
818
|
});
|
|
818
819
|
});
|
|
819
820
|
});
|
|
821
|
+
|
|
822
|
+
describe('withId', () => {
|
|
823
|
+
it('should guarantee id and connect the input with the selected currency', () => {
|
|
824
|
+
render(<MoneyInput {...props} />);
|
|
825
|
+
const input = screen.getByRole('textbox');
|
|
826
|
+
const button = screen.getByRole('combobox');
|
|
827
|
+
expect(input.getAttribute('id')).toBeTruthy();
|
|
828
|
+
expect(input).toHaveAttribute('aria-describedby', button.getAttribute('id'));
|
|
829
|
+
});
|
|
830
|
+
});
|
|
820
831
|
});
|
|
@@ -9,13 +9,13 @@ import { Field } from '../field/Field';
|
|
|
9
9
|
export default {
|
|
10
10
|
component: MoneyInput,
|
|
11
11
|
title: 'Forms/MoneyInput',
|
|
12
|
-
render: function Render(
|
|
12
|
+
render: function Render(args) {
|
|
13
13
|
const [selectedCurrency, setSelectedCurrency] = useState(args.selectedCurrency);
|
|
14
14
|
|
|
15
15
|
const handleOnCurrencyChange = (value: CurrencyOptionItem) => setSelectedCurrency(value);
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
|
-
<Field label="Editable money input label" required
|
|
18
|
+
<Field label="Editable money input label" required>
|
|
19
19
|
<MoneyInput
|
|
20
20
|
{...args}
|
|
21
21
|
selectedCurrency={selectedCurrency}
|
|
@@ -129,7 +129,6 @@ export const MultipleCurrencies: Story = {
|
|
|
129
129
|
},
|
|
130
130
|
selectedCurrency: exampleCurrency.usd,
|
|
131
131
|
searchPlaceholder: 'Type a currency / country',
|
|
132
|
-
id: 'moneyInput',
|
|
133
132
|
},
|
|
134
133
|
};
|
|
135
134
|
|
|
@@ -156,22 +155,20 @@ export const OpenedInput: Story = {
|
|
|
156
155
|
};
|
|
157
156
|
|
|
158
157
|
export const SmallInput: Story = {
|
|
159
|
-
render: (
|
|
158
|
+
render: (args) => {
|
|
160
159
|
return (
|
|
161
160
|
<>
|
|
162
|
-
<Field label="Money inputs" required>
|
|
161
|
+
<Field id={args.id} label="Money inputs" required>
|
|
163
162
|
<MoneyInput {...args} {...SingleCurrency.args} />
|
|
164
163
|
</Field>
|
|
165
164
|
<br />
|
|
166
|
-
<
|
|
167
|
-
<MoneyInput {...args} {...MultipleCurrencies.args} />
|
|
168
|
-
</Field>
|
|
165
|
+
<MoneyInput {...args} {...MultipleCurrencies.args} />
|
|
169
166
|
<hr />
|
|
170
|
-
<Field label="Error
|
|
167
|
+
<Field id={args.id} label="Error states" sentiment="negative" required>
|
|
171
168
|
<MoneyInput {...args} {...SingleCurrency.args} />
|
|
172
169
|
</Field>
|
|
173
170
|
<br />
|
|
174
|
-
<Field
|
|
171
|
+
<Field sentiment="negative">
|
|
175
172
|
<MoneyInput {...args} {...MultipleCurrencies.args} />
|
|
176
173
|
</Field>
|
|
177
174
|
</>
|
|
@@ -314,7 +314,7 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
|
|
|
314
314
|
|
|
315
315
|
const isFixedCurrency = (!this.state.searchQuery && hasSingleCurrency()) || !onCurrencyChange;
|
|
316
316
|
const disabled = !this.props.onAmountChange;
|
|
317
|
-
const selectedCurrencyElementId = `${
|
|
317
|
+
const selectedCurrencyElementId = `${amountInputId}SelectedCurrency`;
|
|
318
318
|
|
|
319
319
|
return (
|
|
320
320
|
<div
|
|
@@ -387,13 +387,6 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
|
|
|
387
387
|
)}
|
|
388
388
|
>
|
|
389
389
|
<SelectInput
|
|
390
|
-
UNSAFE_triggerButtonProps={{
|
|
391
|
-
id: undefined,
|
|
392
|
-
'aria-labelledby': undefined,
|
|
393
|
-
'aria-describedby': undefined,
|
|
394
|
-
'aria-invalid': undefined,
|
|
395
|
-
'aria-label': this.props.intl.formatMessage(messages.selectCurrencyLabel),
|
|
396
|
-
}}
|
|
397
390
|
id={selectedCurrencyElementId}
|
|
398
391
|
items={selectOptions}
|
|
399
392
|
value={selectedCurrency}
|