@transferwise/components 46.110.0 → 46.111.1
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/common/panel/Panel.js +1 -0
- package/build/common/panel/Panel.js.map +1 -1
- package/build/common/panel/Panel.mjs +1 -0
- package/build/common/panel/Panel.mjs.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.js +6 -1
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs +6 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
- package/build/dateInput/DateInput.js +46 -24
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.mjs +48 -26
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/dateLookup/DateLookup.js +5 -2
- package/build/dateLookup/DateLookup.js.map +1 -1
- package/build/dateLookup/DateLookup.mjs +5 -2
- package/build/dateLookup/DateLookup.mjs.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.js +2 -0
- package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.mjs +2 -0
- package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
- package/build/field/Field.js +7 -2
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +13 -8
- package/build/field/Field.mjs.map +1 -1
- package/build/inputs/InputGroup.js +1 -1
- package/build/inputs/InputGroup.js.map +1 -1
- package/build/inputs/InputGroup.mjs +2 -2
- package/build/inputs/InputGroup.mjs.map +1 -1
- package/build/inputs/SelectInput.js +19 -5
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.mjs +19 -5
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/inputs/contexts.js +8 -4
- package/build/inputs/contexts.js.map +1 -1
- package/build/inputs/contexts.mjs +7 -4
- package/build/inputs/contexts.mjs.map +1 -1
- package/build/label/Label.js +14 -8
- package/build/label/Label.js.map +1 -1
- package/build/label/Label.mjs +14 -8
- package/build/label/Label.mjs.map +1 -1
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
- package/build/main.css +163 -153
- package/build/moneyInput/MoneyInput.js +6 -5
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +6 -5
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +25 -3
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +27 -5
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.js +23 -23
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -0
- package/build/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.mjs +23 -23
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -0
- package/build/styles/inputs/Input.css +5 -0
- package/build/styles/inputs/TextArea.css +5 -0
- package/build/styles/listItem/ListItem.css +5 -153
- package/build/styles/listItem/Prompt/ListItemPrompt.css +0 -153
- package/build/styles/main.css +163 -153
- package/build/types/common/panel/Panel.d.ts +2 -0
- package/build/types/common/panel/Panel.d.ts.map +1 -1
- package/build/types/common/responsivePanel/ResponsivePanel.d.ts +1 -0
- package/build/types/common/responsivePanel/ResponsivePanel.d.ts.map +1 -1
- package/build/types/dateInput/DateInput.d.ts +2 -2
- package/build/types/dateInput/DateInput.d.ts.map +1 -1
- package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
- package/build/types/dateLookup/dateTrigger/DateTrigger.d.ts +1 -0
- package/build/types/dateLookup/dateTrigger/DateTrigger.d.ts.map +1 -1
- package/build/types/field/Field.d.ts.map +1 -1
- package/build/types/inputs/InputGroup.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts +9 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/inputs/contexts.d.ts +6 -1
- package/build/types/inputs/contexts.d.ts.map +1 -1
- package/build/types/label/Label.d.ts +5 -15
- package/build/types/label/Label.d.ts.map +1 -1
- package/build/types/listItem/ListItem.d.ts.map +1 -1
- package/build/types/listItem/Prompt/ListItemPrompt.d.ts +1 -1
- package/build/types/listItem/Prompt/ListItemPrompt.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.d.ts +1 -1
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts.map +1 -0
- package/build/types/prompt/InlinePrompt/index.d.ts.map +1 -0
- package/build/types/prompt/index.d.ts +3 -0
- package/build/types/prompt/index.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/DisabledComponents.story.tsx +156 -0
- package/src/common/panel/Panel.tsx +2 -0
- package/src/common/responsivePanel/ResponsivePanel.tsx +7 -1
- package/src/dateInput/DateInput.spec.tsx +45 -7
- package/src/dateInput/DateInput.story.tsx +2 -0
- package/src/dateInput/DateInput.tsx +65 -30
- package/src/dateLookup/DateLookup.spec.tsx +16 -0
- package/src/dateLookup/DateLookup.tsx +6 -3
- package/src/dateLookup/dateTrigger/DateTrigger.tsx +3 -0
- package/src/field/Field.tsx +6 -5
- package/src/inputs/Input.css +5 -0
- package/src/inputs/InputGroup.tsx +3 -4
- package/src/inputs/SelectInput.story.tsx +30 -10
- package/src/inputs/SelectInput.tsx +36 -6
- package/src/inputs/TextArea.css +5 -0
- package/src/inputs/_common.less +5 -0
- package/src/inputs/contexts.tsx +12 -3
- package/src/label/Label.tsx +26 -20
- package/src/listItem/ListItem.css +5 -153
- package/src/listItem/ListItem.less +5 -0
- package/src/listItem/ListItem.tsx +2 -1
- package/src/listItem/Prompt/ListItemPrompt.css +0 -153
- package/src/listItem/Prompt/ListItemPrompt.less +0 -2
- package/src/listItem/Prompt/ListItemPrompt.tsx +1 -1
- package/src/main.css +163 -153
- package/src/main.less +1 -0
- package/src/moneyInput/MoneyInput.spec.tsx +16 -1
- package/src/moneyInput/MoneyInput.tsx +7 -6
- package/src/neptune-css/NeptuneCSS.story.tsx +142 -0
- package/src/phoneNumberInput/PhoneNumberInput.spec.tsx +32 -0
- package/src/phoneNumberInput/PhoneNumberInput.tsx +32 -11
- package/src/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.spec.tsx +2 -2
- package/src/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.tsx +4 -4
- package/src/prompt/index.ts +6 -0
- package/build/listItem/Prompt/InlinePrompt/InlinePrompt.js.map +0 -1
- package/build/listItem/Prompt/InlinePrompt/InlinePrompt.mjs.map +0 -1
- package/build/types/listItem/Prompt/InlinePrompt/InlinePrompt.d.ts.map +0 -1
- package/build/types/listItem/Prompt/InlinePrompt/index.d.ts.map +0 -1
- /package/build/styles/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.css +0 -0
- /package/build/types/{listItem/Prompt → prompt}/InlinePrompt/index.d.ts +0 -0
- /package/src/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.css +0 -0
- /package/src/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.less +0 -0
- /package/src/{listItem/Prompt → prompt}/InlinePrompt/index.ts +0 -0
package/build/main.css
CHANGED
|
@@ -433,6 +433,159 @@
|
|
|
433
433
|
.np-theme-personal .tw-avatar--outlined:not(.disabled):not(:disabled):hover {
|
|
434
434
|
border-color: var(--color-interactive-primary-hover);
|
|
435
435
|
}
|
|
436
|
+
.wds-inline-prompt {
|
|
437
|
+
display: inline-flex;
|
|
438
|
+
text-align: left;
|
|
439
|
+
padding-top: calc(8px / 2);
|
|
440
|
+
padding-top: calc(var(--padding-x-small) / 2);
|
|
441
|
+
padding-bottom: calc(8px / 2);
|
|
442
|
+
padding-bottom: calc(var(--padding-x-small) / 2);
|
|
443
|
+
padding-left: calc(8px - 1px);
|
|
444
|
+
padding-left: calc(var(--padding-x-small) - 1px);
|
|
445
|
+
padding-right: 8px;
|
|
446
|
+
padding-right: var(--padding-x-small);
|
|
447
|
+
border-radius: 10px;
|
|
448
|
+
border-radius: var(--radius-small);
|
|
449
|
+
word-break: break-word;
|
|
450
|
+
word-wrap: break-word;
|
|
451
|
+
}
|
|
452
|
+
.wds-inline-prompt:has(a),
|
|
453
|
+
.wds-inline-prompt:has(button) {
|
|
454
|
+
position: relative;
|
|
455
|
+
z-index: 1;
|
|
456
|
+
}
|
|
457
|
+
.wds-inline-prompt--muted {
|
|
458
|
+
opacity: 0.93;
|
|
459
|
+
filter: grayscale(1);
|
|
460
|
+
}
|
|
461
|
+
.wds-inline-prompt a,
|
|
462
|
+
.wds-inline-prompt button {
|
|
463
|
+
text-underline-offset: calc(4px / 2);
|
|
464
|
+
text-underline-offset: calc(var(--size-4) / 2);
|
|
465
|
+
}
|
|
466
|
+
.wds-inline-prompt a:first-of-type:before,
|
|
467
|
+
.wds-inline-prompt button:first-of-type:before {
|
|
468
|
+
content: '';
|
|
469
|
+
position: absolute;
|
|
470
|
+
inset: 0;
|
|
471
|
+
}
|
|
472
|
+
.wds-inline-prompt__media-wrapper {
|
|
473
|
+
padding-right: calc(12px / 2);
|
|
474
|
+
padding-right: calc(var(--size-12) / 2);
|
|
475
|
+
padding-top: calc(4px - 1px);
|
|
476
|
+
padding-top: calc(var(--size-4) - 1px);
|
|
477
|
+
padding-bottom: calc(4px - 1px);
|
|
478
|
+
padding-bottom: calc(var(--size-4) - 1px);
|
|
479
|
+
}
|
|
480
|
+
.wds-inline-prompt__media-wrapper .tw-icon-tags,
|
|
481
|
+
.wds-inline-prompt__media-wrapper .tw-icon-confetti {
|
|
482
|
+
color: var(--color-sentiment-positive-primary);
|
|
483
|
+
}
|
|
484
|
+
.wds-inline-prompt--negative {
|
|
485
|
+
background-color: var(--color-sentiment-negative-secondary);
|
|
486
|
+
color: var(--color-sentiment-negative-primary);
|
|
487
|
+
}
|
|
488
|
+
.wds-inline-prompt--negative a,
|
|
489
|
+
.wds-inline-prompt--negative button {
|
|
490
|
+
color: var(--color-sentiment-negative-primary);
|
|
491
|
+
}
|
|
492
|
+
.wds-inline-prompt--negative a:hover,
|
|
493
|
+
.wds-inline-prompt--negative button:hover {
|
|
494
|
+
color: var(--color-sentiment-negative-primary-hover);
|
|
495
|
+
}
|
|
496
|
+
.wds-inline-prompt--negative a:active,
|
|
497
|
+
.wds-inline-prompt--negative button:active {
|
|
498
|
+
color: var(--color-sentiment-negative-primary-active);
|
|
499
|
+
}
|
|
500
|
+
.wds-inline-prompt.wds-inline-prompt--negative:has(a, button):hover {
|
|
501
|
+
background-color: var(--color-sentiment-negative-secondary-hover);
|
|
502
|
+
}
|
|
503
|
+
.wds-inline-prompt.wds-inline-prompt--negative:has(a, button):active {
|
|
504
|
+
background-color: var(--color-sentiment-negative-secondary-active);
|
|
505
|
+
}
|
|
506
|
+
.wds-inline-prompt--positive {
|
|
507
|
+
background-color: var(--color-sentiment-positive-secondary);
|
|
508
|
+
color: var(--color-sentiment-positive-primary);
|
|
509
|
+
}
|
|
510
|
+
.wds-inline-prompt--positive a,
|
|
511
|
+
.wds-inline-prompt--positive button {
|
|
512
|
+
color: var(--color-sentiment-positive-primary);
|
|
513
|
+
}
|
|
514
|
+
.wds-inline-prompt--positive a:hover,
|
|
515
|
+
.wds-inline-prompt--positive button:hover {
|
|
516
|
+
color: var(--color-sentiment-positive-primary-hover);
|
|
517
|
+
}
|
|
518
|
+
.wds-inline-prompt--positive a:active,
|
|
519
|
+
.wds-inline-prompt--positive button:active {
|
|
520
|
+
color: var(--color-sentiment-positive-primary-active);
|
|
521
|
+
}
|
|
522
|
+
.wds-inline-prompt.wds-inline-prompt--positive:has(a, button):hover {
|
|
523
|
+
background-color: var(--color-sentiment-positive-secondary-hover);
|
|
524
|
+
}
|
|
525
|
+
.wds-inline-prompt.wds-inline-prompt--positive:has(a, button):active {
|
|
526
|
+
background-color: var(--color-sentiment-positive-secondary-active);
|
|
527
|
+
}
|
|
528
|
+
.wds-inline-prompt--proposition {
|
|
529
|
+
background-color: var(--color-sentiment-positive-secondary);
|
|
530
|
+
color: var(--color-sentiment-positive-primary);
|
|
531
|
+
}
|
|
532
|
+
.wds-inline-prompt--proposition a,
|
|
533
|
+
.wds-inline-prompt--proposition button {
|
|
534
|
+
color: var(--color-sentiment-positive-primary);
|
|
535
|
+
}
|
|
536
|
+
.wds-inline-prompt--proposition a:hover,
|
|
537
|
+
.wds-inline-prompt--proposition button:hover {
|
|
538
|
+
color: var(--color-sentiment-positive-primary-hover);
|
|
539
|
+
}
|
|
540
|
+
.wds-inline-prompt--proposition a:active,
|
|
541
|
+
.wds-inline-prompt--proposition button:active {
|
|
542
|
+
color: var(--color-sentiment-positive-primary-active);
|
|
543
|
+
}
|
|
544
|
+
.wds-inline-prompt.wds-inline-prompt--proposition:has(a, button):hover {
|
|
545
|
+
background-color: var(--color-sentiment-positive-secondary-hover);
|
|
546
|
+
}
|
|
547
|
+
.wds-inline-prompt.wds-inline-prompt--proposition:has(a, button):active {
|
|
548
|
+
background-color: var(--color-sentiment-positive-secondary-active);
|
|
549
|
+
}
|
|
550
|
+
.wds-inline-prompt--neutral {
|
|
551
|
+
background-color: rgba(134,167,189,0.10196);
|
|
552
|
+
background-color: var(--color-background-neutral);
|
|
553
|
+
color: #37517e;
|
|
554
|
+
color: var(--color-content-primary);
|
|
555
|
+
}
|
|
556
|
+
.wds-inline-prompt--neutral a,
|
|
557
|
+
.wds-inline-prompt--neutral button {
|
|
558
|
+
color: #37517e;
|
|
559
|
+
color: var(--color-content-primary);
|
|
560
|
+
}
|
|
561
|
+
.wds-inline-prompt.wds-inline-prompt--neutral:has(a, button):hover {
|
|
562
|
+
background-color: var(--color-background-neutral-hover);
|
|
563
|
+
}
|
|
564
|
+
.wds-inline-prompt.wds-inline-prompt--neutral:has(a, button):active {
|
|
565
|
+
background-color: var(--color-background-neutral-active);
|
|
566
|
+
}
|
|
567
|
+
.wds-inline-prompt--warning {
|
|
568
|
+
background-color: var(--color-sentiment-warning-secondary);
|
|
569
|
+
color: var(--color-sentiment-warning-content);
|
|
570
|
+
}
|
|
571
|
+
.wds-inline-prompt--warning a,
|
|
572
|
+
.wds-inline-prompt--warning button {
|
|
573
|
+
color: var(--color-sentiment-warning-content);
|
|
574
|
+
}
|
|
575
|
+
.wds-inline-prompt--warning a:hover,
|
|
576
|
+
.wds-inline-prompt--warning button:hover {
|
|
577
|
+
color: var(--color-sentiment-warning-content-hover);
|
|
578
|
+
}
|
|
579
|
+
.wds-inline-prompt--warning a:active,
|
|
580
|
+
.wds-inline-prompt--warning button:active {
|
|
581
|
+
color: var(--color-sentiment-warning-content-active);
|
|
582
|
+
}
|
|
583
|
+
.wds-inline-prompt.wds-inline-prompt--warning:has(a, button):hover {
|
|
584
|
+
background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 92%, var(--color-sentiment-warning-primary));
|
|
585
|
+
}
|
|
586
|
+
.wds-inline-prompt.wds-inline-prompt--warning:has(a, button):active {
|
|
587
|
+
background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 84%, var(--color-sentiment-warning-primary));
|
|
588
|
+
}
|
|
436
589
|
.np-notification-dot {
|
|
437
590
|
--np-notification-dot-size: 14px;
|
|
438
591
|
position: relative;
|
|
@@ -2507,6 +2660,11 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2507
2660
|
transition-duration: 300ms;
|
|
2508
2661
|
/* TODO: Remove these overrides once `.form-control` isn’t used anymore */
|
|
2509
2662
|
}
|
|
2663
|
+
.disabled .np-form-control,
|
|
2664
|
+
:disabled .np-form-control {
|
|
2665
|
+
opacity: 1;
|
|
2666
|
+
opacity: initial;
|
|
2667
|
+
}
|
|
2510
2668
|
.np-form-control:focus-visible {
|
|
2511
2669
|
outline: none;
|
|
2512
2670
|
}
|
|
@@ -3026,159 +3184,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3026
3184
|
margin-top: var(--size-4);
|
|
3027
3185
|
}
|
|
3028
3186
|
}
|
|
3029
|
-
.wds-inline-prompt {
|
|
3030
|
-
display: inline-flex;
|
|
3031
|
-
text-align: left;
|
|
3032
|
-
padding-top: calc(8px / 2);
|
|
3033
|
-
padding-top: calc(var(--padding-x-small) / 2);
|
|
3034
|
-
padding-bottom: calc(8px / 2);
|
|
3035
|
-
padding-bottom: calc(var(--padding-x-small) / 2);
|
|
3036
|
-
padding-left: calc(8px - 1px);
|
|
3037
|
-
padding-left: calc(var(--padding-x-small) - 1px);
|
|
3038
|
-
padding-right: 8px;
|
|
3039
|
-
padding-right: var(--padding-x-small);
|
|
3040
|
-
border-radius: 10px;
|
|
3041
|
-
border-radius: var(--radius-small);
|
|
3042
|
-
word-break: break-word;
|
|
3043
|
-
word-wrap: break-word;
|
|
3044
|
-
}
|
|
3045
|
-
.wds-inline-prompt:has(a),
|
|
3046
|
-
.wds-inline-prompt:has(button) {
|
|
3047
|
-
position: relative;
|
|
3048
|
-
z-index: 1;
|
|
3049
|
-
}
|
|
3050
|
-
.wds-inline-prompt--muted {
|
|
3051
|
-
opacity: 0.93;
|
|
3052
|
-
filter: grayscale(1);
|
|
3053
|
-
}
|
|
3054
|
-
.wds-inline-prompt a,
|
|
3055
|
-
.wds-inline-prompt button {
|
|
3056
|
-
text-underline-offset: calc(4px / 2);
|
|
3057
|
-
text-underline-offset: calc(var(--size-4) / 2);
|
|
3058
|
-
}
|
|
3059
|
-
.wds-inline-prompt a:first-of-type:before,
|
|
3060
|
-
.wds-inline-prompt button:first-of-type:before {
|
|
3061
|
-
content: '';
|
|
3062
|
-
position: absolute;
|
|
3063
|
-
inset: 0;
|
|
3064
|
-
}
|
|
3065
|
-
.wds-inline-prompt__media-wrapper {
|
|
3066
|
-
padding-right: calc(12px / 2);
|
|
3067
|
-
padding-right: calc(var(--size-12) / 2);
|
|
3068
|
-
padding-top: calc(4px - 1px);
|
|
3069
|
-
padding-top: calc(var(--size-4) - 1px);
|
|
3070
|
-
padding-bottom: calc(4px - 1px);
|
|
3071
|
-
padding-bottom: calc(var(--size-4) - 1px);
|
|
3072
|
-
}
|
|
3073
|
-
.wds-inline-prompt__media-wrapper .tw-icon-tags,
|
|
3074
|
-
.wds-inline-prompt__media-wrapper .tw-icon-confetti {
|
|
3075
|
-
color: var(--color-sentiment-positive-primary);
|
|
3076
|
-
}
|
|
3077
|
-
.wds-inline-prompt--negative {
|
|
3078
|
-
background-color: var(--color-sentiment-negative-secondary);
|
|
3079
|
-
color: var(--color-sentiment-negative-primary);
|
|
3080
|
-
}
|
|
3081
|
-
.wds-inline-prompt--negative a,
|
|
3082
|
-
.wds-inline-prompt--negative button {
|
|
3083
|
-
color: var(--color-sentiment-negative-primary);
|
|
3084
|
-
}
|
|
3085
|
-
.wds-inline-prompt--negative a:hover,
|
|
3086
|
-
.wds-inline-prompt--negative button:hover {
|
|
3087
|
-
color: var(--color-sentiment-negative-primary-hover);
|
|
3088
|
-
}
|
|
3089
|
-
.wds-inline-prompt--negative a:active,
|
|
3090
|
-
.wds-inline-prompt--negative button:active {
|
|
3091
|
-
color: var(--color-sentiment-negative-primary-active);
|
|
3092
|
-
}
|
|
3093
|
-
.wds-inline-prompt.wds-inline-prompt--negative:has(a, button):hover {
|
|
3094
|
-
background-color: var(--color-sentiment-negative-secondary-hover);
|
|
3095
|
-
}
|
|
3096
|
-
.wds-inline-prompt.wds-inline-prompt--negative:has(a, button):active {
|
|
3097
|
-
background-color: var(--color-sentiment-negative-secondary-active);
|
|
3098
|
-
}
|
|
3099
|
-
.wds-inline-prompt--positive {
|
|
3100
|
-
background-color: var(--color-sentiment-positive-secondary);
|
|
3101
|
-
color: var(--color-sentiment-positive-primary);
|
|
3102
|
-
}
|
|
3103
|
-
.wds-inline-prompt--positive a,
|
|
3104
|
-
.wds-inline-prompt--positive button {
|
|
3105
|
-
color: var(--color-sentiment-positive-primary);
|
|
3106
|
-
}
|
|
3107
|
-
.wds-inline-prompt--positive a:hover,
|
|
3108
|
-
.wds-inline-prompt--positive button:hover {
|
|
3109
|
-
color: var(--color-sentiment-positive-primary-hover);
|
|
3110
|
-
}
|
|
3111
|
-
.wds-inline-prompt--positive a:active,
|
|
3112
|
-
.wds-inline-prompt--positive button:active {
|
|
3113
|
-
color: var(--color-sentiment-positive-primary-active);
|
|
3114
|
-
}
|
|
3115
|
-
.wds-inline-prompt.wds-inline-prompt--positive:has(a, button):hover {
|
|
3116
|
-
background-color: var(--color-sentiment-positive-secondary-hover);
|
|
3117
|
-
}
|
|
3118
|
-
.wds-inline-prompt.wds-inline-prompt--positive:has(a, button):active {
|
|
3119
|
-
background-color: var(--color-sentiment-positive-secondary-active);
|
|
3120
|
-
}
|
|
3121
|
-
.wds-inline-prompt--proposition {
|
|
3122
|
-
background-color: var(--color-sentiment-positive-secondary);
|
|
3123
|
-
color: var(--color-sentiment-positive-primary);
|
|
3124
|
-
}
|
|
3125
|
-
.wds-inline-prompt--proposition a,
|
|
3126
|
-
.wds-inline-prompt--proposition button {
|
|
3127
|
-
color: var(--color-sentiment-positive-primary);
|
|
3128
|
-
}
|
|
3129
|
-
.wds-inline-prompt--proposition a:hover,
|
|
3130
|
-
.wds-inline-prompt--proposition button:hover {
|
|
3131
|
-
color: var(--color-sentiment-positive-primary-hover);
|
|
3132
|
-
}
|
|
3133
|
-
.wds-inline-prompt--proposition a:active,
|
|
3134
|
-
.wds-inline-prompt--proposition button:active {
|
|
3135
|
-
color: var(--color-sentiment-positive-primary-active);
|
|
3136
|
-
}
|
|
3137
|
-
.wds-inline-prompt.wds-inline-prompt--proposition:has(a, button):hover {
|
|
3138
|
-
background-color: var(--color-sentiment-positive-secondary-hover);
|
|
3139
|
-
}
|
|
3140
|
-
.wds-inline-prompt.wds-inline-prompt--proposition:has(a, button):active {
|
|
3141
|
-
background-color: var(--color-sentiment-positive-secondary-active);
|
|
3142
|
-
}
|
|
3143
|
-
.wds-inline-prompt--neutral {
|
|
3144
|
-
background-color: rgba(134,167,189,0.10196);
|
|
3145
|
-
background-color: var(--color-background-neutral);
|
|
3146
|
-
color: #37517e;
|
|
3147
|
-
color: var(--color-content-primary);
|
|
3148
|
-
}
|
|
3149
|
-
.wds-inline-prompt--neutral a,
|
|
3150
|
-
.wds-inline-prompt--neutral button {
|
|
3151
|
-
color: #37517e;
|
|
3152
|
-
color: var(--color-content-primary);
|
|
3153
|
-
}
|
|
3154
|
-
.wds-inline-prompt.wds-inline-prompt--neutral:has(a, button):hover {
|
|
3155
|
-
background-color: var(--color-background-neutral-hover);
|
|
3156
|
-
}
|
|
3157
|
-
.wds-inline-prompt.wds-inline-prompt--neutral:has(a, button):active {
|
|
3158
|
-
background-color: var(--color-background-neutral-active);
|
|
3159
|
-
}
|
|
3160
|
-
.wds-inline-prompt--warning {
|
|
3161
|
-
background-color: var(--color-sentiment-warning-secondary);
|
|
3162
|
-
color: var(--color-sentiment-warning-content);
|
|
3163
|
-
}
|
|
3164
|
-
.wds-inline-prompt--warning a,
|
|
3165
|
-
.wds-inline-prompt--warning button {
|
|
3166
|
-
color: var(--color-sentiment-warning-content);
|
|
3167
|
-
}
|
|
3168
|
-
.wds-inline-prompt--warning a:hover,
|
|
3169
|
-
.wds-inline-prompt--warning button:hover {
|
|
3170
|
-
color: var(--color-sentiment-warning-content-hover);
|
|
3171
|
-
}
|
|
3172
|
-
.wds-inline-prompt--warning a:active,
|
|
3173
|
-
.wds-inline-prompt--warning button:active {
|
|
3174
|
-
color: var(--color-sentiment-warning-content-active);
|
|
3175
|
-
}
|
|
3176
|
-
.wds-inline-prompt.wds-inline-prompt--warning:has(a, button):hover {
|
|
3177
|
-
background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 92%, var(--color-sentiment-warning-primary));
|
|
3178
|
-
}
|
|
3179
|
-
.wds-inline-prompt.wds-inline-prompt--warning:has(a, button):active {
|
|
3180
|
-
background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 84%, var(--color-sentiment-warning-primary));
|
|
3181
|
-
}
|
|
3182
3187
|
.wds-list-item-prompt {
|
|
3183
3188
|
grid-area: prompt;
|
|
3184
3189
|
justify-self: start;
|
|
@@ -3220,6 +3225,11 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
3220
3225
|
text-underline-offset: calc(4px / 2);
|
|
3221
3226
|
text-underline-offset: calc(var(--size-4) / 2);
|
|
3222
3227
|
}
|
|
3228
|
+
.wds-list-item a .wds-list-item-subtitle,
|
|
3229
|
+
.wds-list-item a .wds-list-item-subtitle-value {
|
|
3230
|
+
color: #5d7079;
|
|
3231
|
+
color: var(--color-content-secondary);
|
|
3232
|
+
}
|
|
3223
3233
|
.wds-list-item-interactive .wds-list-item-control:focus-visible,
|
|
3224
3234
|
.wds-list-item-interactive .np-checkbox-button:has(input[type="checkbox"]:focus-visible) .tw-checkbox-button {
|
|
3225
3235
|
outline: none;
|
|
@@ -235,13 +235,14 @@ class MoneyInput extends React.Component {
|
|
|
235
235
|
const isFixedCurrency = !this.state.searchQuery && hasSingleCurrency() || !onCurrencyChange;
|
|
236
236
|
const disabled = !this.props.onAmountChange;
|
|
237
237
|
const selectedCurrencyElementId = `${inputAttributes?.id ?? amountInputId}SelectedCurrency`;
|
|
238
|
-
return /*#__PURE__*/jsxRuntime.jsxs("
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
"aria-labelledby":
|
|
238
|
+
return /*#__PURE__*/jsxRuntime.jsxs("fieldset", {
|
|
239
|
+
"aria-invalid": inputAttributes?.['aria-invalid'],
|
|
240
|
+
"aria-describedby": inputAttributes?.['aria-describedby'],
|
|
241
|
+
"aria-labelledby": inputAttributes?.id ?? amountInputId,
|
|
242
242
|
className: clsx.clsx(this.style('tw-money-input'), this.style('input-group'), this.style(`input-group-${size}`)),
|
|
243
243
|
children: [/*#__PURE__*/jsxRuntime.jsx(Input.Input, {
|
|
244
|
-
id: amountInputId,
|
|
244
|
+
id: inputAttributes?.id ?? amountInputId,
|
|
245
|
+
"aria-labelledby": ariaLabelledBy,
|
|
245
246
|
value: this.state.formattedAmount,
|
|
246
247
|
inputMode: "decimal",
|
|
247
248
|
disabled: disabled,
|
|
@@ -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\nexport type MoneyInputPropsWithInputAttributes = MoneyInputProps &\n 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 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': ariaLabelledBy,\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.props.onCustomAction}>\n {this.props.customActionLabel}\n </div>\n )\n : undefined\n }\n placeholder={this.props.intl.formatMessage(messages.selectPlaceholder)}\n filterable\n filterPlaceholder={\n this.props.searchPlaceholder ||\n this.props.intl.formatMessage(messages.searchPlaceholder)\n }\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","onSearchChange","filteredOptions","style","className","render","inputAttributes","id","amountInputId","ariaLabelledByProp","addon","ariaLabelledBy","hasSingleCurrency","length","firstItem","onCustomAction","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,C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AC;AACV,IAAA;AACA,IAAA,OAAO,CAAC;AACV,EAAA,CAAC,CAAC;AACJ;AAEA,mBAAeC,oBAAU,CAACC,cAAM,CAACC,4BAAmB,CAACjJ,UAAU,EAAE;AAAEkJ,EAAAA,YAAY,EAAE;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\nexport type MoneyInputPropsWithInputAttributes = MoneyInputProps &\n 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 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 <fieldset\n aria-invalid={inputAttributes?.['aria-invalid']}\n aria-describedby={inputAttributes?.['aria-describedby']}\n aria-labelledby={inputAttributes?.id ?? amountInputId}\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={inputAttributes?.id ?? amountInputId}\n aria-labelledby={ariaLabelledBy}\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': ariaLabelledBy,\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.props.onCustomAction}>\n {this.props.customActionLabel}\n </div>\n )\n : undefined\n }\n placeholder={this.props.intl.formatMessage(messages.selectPlaceholder)}\n filterable\n filterPlaceholder={\n this.props.searchPlaceholder ||\n this.props.intl.formatMessage(messages.searchPlaceholder)\n }\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 </fieldset>\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","onSearchChange","filteredOptions","style","className","render","inputAttributes","id","amountInputId","ariaLabelledByProp","addon","ariaLabelledBy","hasSingleCurrency","length","firstItem","onCustomAction","customActionLabel","isFixedCurrency","disabled","selectedCurrencyElementId","_jsxs","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","role","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,CAAC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ACV,IAAA;AACA,IAAA,IAAID,aAAa,EAAE;AACjB,MAAA,OAAO,EAAE;AACX,IAAA;AACA,IAAA,IAAIC,cAAc,EAAE;AAClB,MAAA,OAAO,CAAC;AACV,IAAA;AACA,IAAA,OAAO,CAAC;AACV,EAAA,CAAC,CAAC;AACJ;AAEA,mBAAeC,oBAAU,CAACC,cAAM,CAACC,4BAAmB,CAACjJ,UAAU,EAAE;AAAEkJ,EAAAA,YAAY,EAAE;AAAI,CAAE,CAAC,CAAC,CAAC;;;;"}
|
|
@@ -231,13 +231,14 @@ class MoneyInput extends Component {
|
|
|
231
231
|
const isFixedCurrency = !this.state.searchQuery && hasSingleCurrency() || !onCurrencyChange;
|
|
232
232
|
const disabled = !this.props.onAmountChange;
|
|
233
233
|
const selectedCurrencyElementId = `${inputAttributes?.id ?? amountInputId}SelectedCurrency`;
|
|
234
|
-
return /*#__PURE__*/jsxs("
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
"aria-labelledby":
|
|
234
|
+
return /*#__PURE__*/jsxs("fieldset", {
|
|
235
|
+
"aria-invalid": inputAttributes?.['aria-invalid'],
|
|
236
|
+
"aria-describedby": inputAttributes?.['aria-describedby'],
|
|
237
|
+
"aria-labelledby": inputAttributes?.id ?? amountInputId,
|
|
238
238
|
className: clsx(this.style('tw-money-input'), this.style('input-group'), this.style(`input-group-${size}`)),
|
|
239
239
|
children: [/*#__PURE__*/jsx(Input, {
|
|
240
|
-
id: amountInputId,
|
|
240
|
+
id: inputAttributes?.id ?? amountInputId,
|
|
241
|
+
"aria-labelledby": ariaLabelledBy,
|
|
241
242
|
value: this.state.formattedAmount,
|
|
242
243
|
inputMode: "decimal",
|
|
243
244
|
disabled: disabled,
|