@transferwise/components 46.111.0 → 46.112.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/build/avatarLayout/AvatarLayout.js.map +1 -1
  2. package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
  3. package/build/avatarView/AvatarView.js +27 -29
  4. package/build/avatarView/AvatarView.js.map +1 -1
  5. package/build/avatarView/AvatarView.mjs +27 -29
  6. package/build/avatarView/AvatarView.mjs.map +1 -1
  7. package/build/avatarView/{NotificationDot.js → Dot.js} +14 -12
  8. package/build/avatarView/Dot.js.map +1 -0
  9. package/build/avatarView/{NotificationDot.mjs → Dot.mjs} +14 -12
  10. package/build/avatarView/Dot.mjs.map +1 -0
  11. package/build/badge/BadgeAssets.js.map +1 -1
  12. package/build/badge/BadgeAssets.mjs.map +1 -1
  13. package/build/common/panel/Panel.js +1 -0
  14. package/build/common/panel/Panel.js.map +1 -1
  15. package/build/common/panel/Panel.mjs +1 -0
  16. package/build/common/panel/Panel.mjs.map +1 -1
  17. package/build/common/responsivePanel/ResponsivePanel.js +6 -1
  18. package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
  19. package/build/common/responsivePanel/ResponsivePanel.mjs +6 -1
  20. package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
  21. package/build/dateInput/DateInput.js +46 -24
  22. package/build/dateInput/DateInput.js.map +1 -1
  23. package/build/dateInput/DateInput.mjs +48 -26
  24. package/build/dateInput/DateInput.mjs.map +1 -1
  25. package/build/dateLookup/DateLookup.js +5 -2
  26. package/build/dateLookup/DateLookup.js.map +1 -1
  27. package/build/dateLookup/DateLookup.mjs +5 -2
  28. package/build/dateLookup/DateLookup.mjs.map +1 -1
  29. package/build/dateLookup/dateTrigger/DateTrigger.js +2 -0
  30. package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
  31. package/build/dateLookup/dateTrigger/DateTrigger.mjs +2 -0
  32. package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
  33. package/build/field/Field.js +7 -2
  34. package/build/field/Field.js.map +1 -1
  35. package/build/field/Field.mjs +13 -8
  36. package/build/field/Field.mjs.map +1 -1
  37. package/build/inputs/InputGroup.js +1 -1
  38. package/build/inputs/InputGroup.js.map +1 -1
  39. package/build/inputs/InputGroup.mjs +2 -2
  40. package/build/inputs/InputGroup.mjs.map +1 -1
  41. package/build/inputs/SelectInput.js +54 -5
  42. package/build/inputs/SelectInput.js.map +1 -1
  43. package/build/inputs/SelectInput.mjs +54 -5
  44. package/build/inputs/SelectInput.mjs.map +1 -1
  45. package/build/inputs/contexts.js +8 -4
  46. package/build/inputs/contexts.js.map +1 -1
  47. package/build/inputs/contexts.mjs +7 -4
  48. package/build/inputs/contexts.mjs.map +1 -1
  49. package/build/label/Label.js +14 -8
  50. package/build/label/Label.js.map +1 -1
  51. package/build/label/Label.mjs +14 -8
  52. package/build/label/Label.mjs.map +1 -1
  53. package/build/listItem/Prompt/ListItemPrompt.js +1 -1
  54. package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
  55. package/build/listItem/Prompt/ListItemPrompt.mjs +1 -1
  56. package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
  57. package/build/main.css +180 -164
  58. package/build/moneyInput/MoneyInput.js +6 -5
  59. package/build/moneyInput/MoneyInput.js.map +1 -1
  60. package/build/moneyInput/MoneyInput.mjs +6 -5
  61. package/build/moneyInput/MoneyInput.mjs.map +1 -1
  62. package/build/phoneNumberInput/PhoneNumberInput.js +25 -3
  63. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  64. package/build/phoneNumberInput/PhoneNumberInput.mjs +27 -5
  65. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  66. package/build/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.js +23 -23
  67. package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -0
  68. package/build/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.mjs +23 -23
  69. package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -0
  70. package/build/styles/avatarView/AvatarView.css +17 -11
  71. package/build/styles/avatarView/Dot.css +26 -0
  72. package/build/styles/inputs/Input.css +5 -0
  73. package/build/styles/inputs/TextArea.css +5 -0
  74. package/build/styles/listItem/ListItem.css +5 -153
  75. package/build/styles/listItem/Prompt/ListItemPrompt.css +0 -153
  76. package/build/styles/main.css +180 -164
  77. package/build/types/avatarLayout/AvatarLayout.d.ts +1 -1
  78. package/build/types/avatarLayout/AvatarLayout.d.ts.map +1 -1
  79. package/build/types/avatarView/AvatarView.d.ts +1 -2
  80. package/build/types/avatarView/AvatarView.d.ts.map +1 -1
  81. package/build/types/avatarView/Dot.d.ts +8 -0
  82. package/build/types/avatarView/Dot.d.ts.map +1 -0
  83. package/build/types/badge/BadgeAssets.d.ts +1 -1
  84. package/build/types/badge/BadgeAssets.d.ts.map +1 -1
  85. package/build/types/common/panel/Panel.d.ts +2 -0
  86. package/build/types/common/panel/Panel.d.ts.map +1 -1
  87. package/build/types/common/responsivePanel/ResponsivePanel.d.ts +1 -0
  88. package/build/types/common/responsivePanel/ResponsivePanel.d.ts.map +1 -1
  89. package/build/types/dateInput/DateInput.d.ts +2 -2
  90. package/build/types/dateInput/DateInput.d.ts.map +1 -1
  91. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  92. package/build/types/dateLookup/dateTrigger/DateTrigger.d.ts +1 -0
  93. package/build/types/dateLookup/dateTrigger/DateTrigger.d.ts.map +1 -1
  94. package/build/types/field/Field.d.ts.map +1 -1
  95. package/build/types/inputs/InputGroup.d.ts.map +1 -1
  96. package/build/types/inputs/SelectInput.d.ts +27 -1
  97. package/build/types/inputs/SelectInput.d.ts.map +1 -1
  98. package/build/types/inputs/contexts.d.ts +6 -1
  99. package/build/types/inputs/contexts.d.ts.map +1 -1
  100. package/build/types/label/Label.d.ts +5 -15
  101. package/build/types/label/Label.d.ts.map +1 -1
  102. package/build/types/listItem/Prompt/ListItemPrompt.d.ts +1 -1
  103. package/build/types/listItem/Prompt/ListItemPrompt.d.ts.map +1 -1
  104. package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
  105. package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
  106. package/build/types/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.d.ts +1 -1
  107. package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts.map +1 -0
  108. package/build/types/prompt/InlinePrompt/index.d.ts.map +1 -0
  109. package/build/types/prompt/index.d.ts +3 -0
  110. package/build/types/prompt/index.d.ts.map +1 -0
  111. package/package.json +1 -1
  112. package/src/DisabledComponents.story.tsx +156 -0
  113. package/src/avatarLayout/AvatarLayout.tsx +1 -1
  114. package/src/avatarView/AvatarView.css +17 -11
  115. package/src/avatarView/AvatarView.less +1 -1
  116. package/src/avatarView/AvatarView.story.tsx +92 -36
  117. package/src/avatarView/AvatarView.tsx +35 -30
  118. package/src/avatarView/Dot.css +26 -0
  119. package/src/avatarView/Dot.less +31 -0
  120. package/src/avatarView/Dot.tsx +42 -0
  121. package/src/badge/BadgeAssets.tsx +1 -1
  122. package/src/common/panel/Panel.tsx +2 -0
  123. package/src/common/responsivePanel/ResponsivePanel.tsx +7 -1
  124. package/src/dateInput/DateInput.spec.tsx +45 -7
  125. package/src/dateInput/DateInput.story.tsx +2 -0
  126. package/src/dateInput/DateInput.tsx +65 -30
  127. package/src/dateLookup/DateLookup.spec.tsx +16 -0
  128. package/src/dateLookup/DateLookup.tsx +6 -3
  129. package/src/dateLookup/dateTrigger/DateTrigger.tsx +3 -0
  130. package/src/field/Field.tsx +6 -5
  131. package/src/inputs/Input.css +5 -0
  132. package/src/inputs/InputGroup.tsx +3 -4
  133. package/src/inputs/SelectInput.story.tsx +101 -0
  134. package/src/inputs/SelectInput.tsx +113 -5
  135. package/src/inputs/TextArea.css +5 -0
  136. package/src/inputs/_common.less +5 -0
  137. package/src/inputs/contexts.tsx +12 -3
  138. package/src/label/Label.tsx +26 -20
  139. package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +89 -25
  140. package/src/listItem/ListItem.css +5 -153
  141. package/src/listItem/ListItem.less +5 -0
  142. package/src/listItem/Prompt/ListItemPrompt.css +0 -153
  143. package/src/listItem/Prompt/ListItemPrompt.less +0 -2
  144. package/src/listItem/Prompt/ListItemPrompt.tsx +1 -1
  145. package/src/main.css +180 -164
  146. package/src/main.less +1 -0
  147. package/src/moneyInput/MoneyInput.spec.tsx +16 -1
  148. package/src/moneyInput/MoneyInput.tsx +7 -6
  149. package/src/phoneNumberInput/PhoneNumberInput.spec.tsx +32 -0
  150. package/src/phoneNumberInput/PhoneNumberInput.tsx +32 -11
  151. package/src/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.spec.tsx +2 -2
  152. package/src/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.tsx +4 -4
  153. package/src/prompt/index.ts +6 -0
  154. package/build/avatarView/NotificationDot.js.map +0 -1
  155. package/build/avatarView/NotificationDot.mjs.map +0 -1
  156. package/build/listItem/Prompt/InlinePrompt/InlinePrompt.js.map +0 -1
  157. package/build/listItem/Prompt/InlinePrompt/InlinePrompt.mjs.map +0 -1
  158. package/build/styles/avatarView/NotificationDot.css +0 -20
  159. package/build/types/avatarView/NotificationDot.d.ts +0 -8
  160. package/build/types/avatarView/NotificationDot.d.ts.map +0 -1
  161. package/build/types/listItem/Prompt/InlinePrompt/InlinePrompt.d.ts.map +0 -1
  162. package/build/types/listItem/Prompt/InlinePrompt/index.d.ts.map +0 -1
  163. package/src/avatarView/NotificationDot.css +0 -20
  164. package/src/avatarView/NotificationDot.less +0 -24
  165. package/src/avatarView/NotificationDot.tsx +0 -35
  166. /package/build/styles/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.css +0 -0
  167. /package/build/types/{listItem/Prompt → prompt}/InlinePrompt/index.d.ts +0 -0
  168. /package/src/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.css +0 -0
  169. /package/src/{listItem/Prompt → prompt}/InlinePrompt/InlinePrompt.less +0 -0
  170. /package/src/{listItem/Prompt → prompt}/InlinePrompt/index.ts +0 -0
package/src/main.css CHANGED
@@ -433,26 +433,185 @@
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
- .np-notification-dot {
437
- --np-notification-dot-size: 14px;
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
+ }
589
+ .np-dot {
590
+ --np-dot-size: 14px;
438
591
  position: relative;
439
592
  display: inline-block;
440
593
  }
441
- .np-notification-dot-mask {
442
- -webkit-mask-image: radial-gradient(circle at bottom calc(100% - (var(--np-notification-dot-size) / 2)) left calc(100% - (var(--np-notification-dot-size) / 2)), transparent 0, transparent calc(var(--np-notification-dot-size) / 2 + var(--np-notification-dot-offset)), black 0);
443
- mask-image: radial-gradient(circle at bottom calc(100% - (var(--np-notification-dot-size) / 2)) left calc(100% - (var(--np-notification-dot-size) / 2)), transparent 0, transparent calc(var(--np-notification-dot-size) / 2 + var(--np-notification-dot-offset)), black 0);
444
- -webkit-mask-image: radial-gradient(circle at bottom calc(100% - calc(var(--np-notification-dot-size) / 2)) left calc(100% - calc(var(--np-notification-dot-size) / 2)), transparent 0, transparent calc(var(--np-notification-dot-size) / 2 + var(--np-notification-dot-offset)), black 0);
445
- mask-image: radial-gradient(circle at bottom calc(100% - calc(var(--np-notification-dot-size) / 2)) left calc(100% - calc(var(--np-notification-dot-size) / 2)), transparent 0, transparent calc(var(--np-notification-dot-size) / 2 + var(--np-notification-dot-offset)), black 0);
594
+ .np-dot-mask {
595
+ -webkit-mask-image: radial-gradient(circle at bottom calc(100% - (var(--np-dot-size) / 2)) left calc(100% - (var(--np-dot-size) / 2)), transparent 0, transparent calc(var(--np-dot-size) / 2 + var(--np-dot-offset)), black 0);
596
+ mask-image: radial-gradient(circle at bottom calc(100% - (var(--np-dot-size) / 2)) left calc(100% - (var(--np-dot-size) / 2)), transparent 0, transparent calc(var(--np-dot-size) / 2 + var(--np-dot-offset)), black 0);
597
+ -webkit-mask-image: radial-gradient(circle at bottom calc(100% - calc(var(--np-dot-size) / 2)) left calc(100% - calc(var(--np-dot-size) / 2)), transparent 0, transparent calc(var(--np-dot-size) / 2 + var(--np-dot-offset)), black 0);
598
+ mask-image: radial-gradient(circle at bottom calc(100% - calc(var(--np-dot-size) / 2)) left calc(100% - calc(var(--np-dot-size) / 2)), transparent 0, transparent calc(var(--np-dot-size) / 2 + var(--np-dot-offset)), black 0);
446
599
  }
447
- .np-notification-dot-badge {
600
+ .np-dot-badge {
448
601
  position: absolute;
449
- width: var(--np-notification-dot-size);
450
- height: var(--np-notification-dot-size);
451
- background-color: var(--color-sentiment-negative);
602
+ width: var(--np-dot-size);
603
+ height: var(--np-dot-size);
452
604
  border-radius: 9999px;
453
605
  border-radius: var(--radius-full);
454
606
  right: 0;
455
607
  }
608
+ .np-dot-badge-notification {
609
+ background-color: var(--color-sentiment-negative);
610
+ }
611
+ .np-dot-badge-online {
612
+ background-color: #00a2dd;
613
+ background-color: var(--color-interactive-accent);
614
+ }
456
615
  .np-avatar-view .np-avatar-view-content {
457
616
  color: #37517e;
458
617
  color: var(--color-content-primary);
@@ -2507,6 +2666,11 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2507
2666
  transition-duration: 300ms;
2508
2667
  /* TODO: Remove these overrides once `.form-control` isn’t used anymore */
2509
2668
  }
2669
+ .disabled .np-form-control,
2670
+ :disabled .np-form-control {
2671
+ opacity: 1;
2672
+ opacity: initial;
2673
+ }
2510
2674
  .np-form-control:focus-visible {
2511
2675
  outline: none;
2512
2676
  }
@@ -3026,159 +3190,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3026
3190
  margin-top: var(--size-4);
3027
3191
  }
3028
3192
  }
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
3193
  .wds-list-item-prompt {
3183
3194
  grid-area: prompt;
3184
3195
  justify-self: start;
@@ -3220,6 +3231,11 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3220
3231
  text-underline-offset: calc(4px / 2);
3221
3232
  text-underline-offset: calc(var(--size-4) / 2);
3222
3233
  }
3234
+ .wds-list-item a .wds-list-item-subtitle,
3235
+ .wds-list-item a .wds-list-item-subtitle-value {
3236
+ color: #5d7079;
3237
+ color: var(--color-content-secondary);
3238
+ }
3223
3239
  .wds-list-item-interactive .wds-list-item-control:focus-visible,
3224
3240
  .wds-list-item-interactive .np-checkbox-button:has(input[type="checkbox"]:focus-visible) .tw-checkbox-button {
3225
3241
  outline: none;
package/src/main.less CHANGED
@@ -4,6 +4,7 @@
4
4
  @import "./actionOption/ActionOption.less";
5
5
  @import "./alert/Alert.less";
6
6
  @import "./avatar/Avatar.less";
7
+ @import "./prompt/InlinePrompt/InlinePrompt.less";
7
8
  @import "./avatarView/AvatarView.less";
8
9
  @import "./avatarLayout/AvatarLayout.less";
9
10
  @import "./iconButton/IconButton.less";
@@ -406,7 +406,7 @@ describe('Money Input', () => {
406
406
  </>,
407
407
  );
408
408
 
409
- expect(screen.getAllByLabelText('Prioritized label')[0]).toHaveClass('input-group');
409
+ expect(screen.getAllByLabelText('Prioritized label')[0]).toHaveClass('np-form-control');
410
410
  });
411
411
 
412
412
  it('supports `Field` for labeling', () => {
@@ -415,9 +415,24 @@ describe('Money Input', () => {
415
415
  <MoneyInput {...initialProps} />
416
416
  </Field>,
417
417
  );
418
+
418
419
  expect(screen.getAllByRole('group')[0]).toHaveAccessibleName(/^Recipient gets/);
419
420
  });
420
421
 
422
+ it('focuses money input when `Field` label is clicked', async () => {
423
+ const label = 'Recipient gets';
424
+
425
+ render(
426
+ <Field label={label}>
427
+ <MoneyInput {...initialProps} />
428
+ </Field>,
429
+ );
430
+
431
+ const input = screen.getByRole('textbox');
432
+ await userEvent.click(screen.getByLabelText(label));
433
+ expect(input).toHaveFocus();
434
+ });
435
+
421
436
  describe('ids', () => {
422
437
  it('renders Select component with generated id when id is not provided', () => {
423
438
  customRender();
@@ -313,10 +313,10 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
313
313
  const selectedCurrencyElementId = `${inputAttributes?.id ?? amountInputId}SelectedCurrency`;
314
314
 
315
315
  return (
316
- <div
317
- role="group"
318
- {...inputAttributes}
319
- aria-labelledby={ariaLabelledBy}
316
+ <fieldset
317
+ aria-invalid={inputAttributes?.['aria-invalid']}
318
+ aria-describedby={inputAttributes?.['aria-describedby']}
319
+ aria-labelledby={inputAttributes?.id ?? amountInputId}
320
320
  className={clsx(
321
321
  this.style('tw-money-input'),
322
322
  this.style('input-group'),
@@ -324,7 +324,8 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
324
324
  )}
325
325
  >
326
326
  <Input
327
- id={amountInputId}
327
+ id={inputAttributes?.id ?? amountInputId}
328
+ aria-labelledby={ariaLabelledBy}
328
329
  value={this.state.formattedAmount}
329
330
  inputMode="decimal"
330
331
  disabled={disabled}
@@ -430,7 +431,7 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
430
431
  />
431
432
  </div>
432
433
  )}
433
- </div>
434
+ </fieldset>
434
435
  );
435
436
  }
436
437
  }
@@ -314,4 +314,36 @@ describe('PhoneNumberInput', () => {
314
314
  );
315
315
  expect(screen.getAllByRole('group')[0]).toHaveAccessibleName(/^Phone number/);
316
316
  });
317
+
318
+ it('focuses country code input when `Field` label is clicked', async () => {
319
+ const label = 'Phone number';
320
+
321
+ render(
322
+ <Field label={label}>
323
+ <PhoneNumberInput initialValue="+12345678" onChange={() => {}} />
324
+ </Field>,
325
+ );
326
+
327
+ await userEvent.click(screen.getByText(label, { selector: 'label:not(.sr-only)' })); // Have to use `getByText` due to the way `Field` handles group labelling
328
+ const countryCodeFilterInput = screen.getByRole('combobox');
329
+ expect(countryCodeFilterInput).toHaveFocus();
330
+ });
331
+
332
+ it('focuses number input when `Field` label is clicked and country code is disabled', async () => {
333
+ const label = 'Phone number';
334
+
335
+ render(
336
+ <Field label={label}>
337
+ <PhoneNumberInput
338
+ initialValue="+12345678"
339
+ selectProps={{ disabled: true }}
340
+ onChange={() => {}}
341
+ />
342
+ </Field>,
343
+ );
344
+
345
+ const phoneNumberInput = screen.getByRole('textbox');
346
+ await userEvent.click(screen.getByText(label, { selector: 'label:not(.sr-only)' })); // Have to use `getByText` due to the way `Field` handles group labelling
347
+ expect(phoneNumberInput).toHaveFocus();
348
+ });
317
349
  });
@@ -1,8 +1,8 @@
1
- import { useState, useEffect, useMemo } from 'react';
1
+ import { useState, useEffect, useMemo, useRef } from 'react';
2
2
  import { useIntl } from 'react-intl';
3
3
 
4
4
  import { Size, SizeLarge, SizeMedium, SizeSmall } from '../common';
5
- import { useInputAttributes } from '../inputs/contexts';
5
+ import { useFieldLabelRef, useInputAttributes } from '../inputs/contexts';
6
6
  import { SelectInput, SelectInputOptionContent, SelectInputProps } from '../inputs/SelectInput';
7
7
  import messages from './PhoneNumberInput.messages';
8
8
  import countries from './data/countries';
@@ -58,7 +58,10 @@ const PhoneNumberInput = ({
58
58
  selectProps = defaultSelectProps,
59
59
  disabledCountries = defaultDisabledCountries,
60
60
  }: PhoneNumberInputProps) => {
61
+ const countryCodeSelectRef = useRef<HTMLButtonElement>(null);
62
+ const phoneNumberInputRef = useRef<HTMLInputElement>(null);
61
63
  const inputAttributes = useInputAttributes({ nonLabelable: true });
64
+ const fieldLabelRef = useFieldLabelRef();
62
65
  const ariaLabelledBy = ariaLabelledByProp ?? inputAttributes['aria-labelledby'];
63
66
 
64
67
  const { locale, formatMessage } = useIntl();
@@ -71,6 +74,7 @@ const PhoneNumberInput = ({
71
74
  return `${backup}-${random}`;
72
75
  };
73
76
 
77
+ // Link the first non-disabled input to the the Field label, if present
74
78
  const ids = {
75
79
  countryCode: {
76
80
  label: createId(id, 'country-code-label'),
@@ -162,18 +166,34 @@ const PhoneNumberInput = ({
162
166
  setBroadcastedValue(internalValue);
163
167
  }, [onChange, broadcastedValue, internalValue]);
164
168
 
169
+ useEffect(() => {
170
+ const labelRef = fieldLabelRef?.current;
171
+
172
+ if (labelRef) {
173
+ const handleLabelClick = () => {
174
+ if (!selectProps.disabled) {
175
+ countryCodeSelectRef.current?.click();
176
+ } else {
177
+ phoneNumberInputRef.current?.focus();
178
+ }
179
+ };
180
+
181
+ labelRef.addEventListener('click', handleLabelClick);
182
+
183
+ return () => {
184
+ labelRef?.removeEventListener('click', handleLabelClick);
185
+ };
186
+ }
187
+ }, [fieldLabelRef, selectProps.disabled]);
188
+
165
189
  return (
166
- <div
167
- role="group"
168
- {...inputAttributes}
169
- aria-labelledby={ariaLabelledBy}
170
- className="tw-telephone"
171
- >
172
- <label className="sr-only" id={ids.countryCode.label}>
190
+ <fieldset {...inputAttributes} aria-labelledby={ariaLabelledBy} className="tw-telephone">
191
+ <label className="sr-only" id={ids.countryCode.label} htmlFor={ids.countryCode.select}>
173
192
  {formatMessage(messages.countryCodeLabel)}
174
193
  </label>
175
194
  <div className="tw-telephone__country-select">
176
195
  <SelectInput
196
+ triggerRef={countryCodeSelectRef}
177
197
  placeholder={formatMessage(messages.selectInputPlaceholder)}
178
198
  items={[...countriesByPrefix].map(([prefix, countries]) => ({
179
199
  type: 'option',
@@ -225,8 +245,9 @@ const PhoneNumberInput = ({
225
245
  {formatMessage(messages.phoneNumberLabel)}
226
246
  </label>
227
247
  <div className="tw-telephone__number-input">
228
- <div className={`input-group input-group-${size}`}>
248
+ <div className={`input-group input-group-${size} ${disabled ? 'disabled' : ''}`}>
229
249
  <Input
250
+ ref={phoneNumberInputRef}
230
251
  id={ids.phoneNumber.input}
231
252
  autoComplete="tel-national"
232
253
  name="phoneNumber"
@@ -243,7 +264,7 @@ const PhoneNumberInput = ({
243
264
  />
244
265
  </div>
245
266
  </div>
246
- </div>
267
+ </fieldset>
247
268
  );
248
269
  };
249
270
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { mockMatchMedia, render, screen } from '../../../test-utils';
2
+ import { mockMatchMedia, render, screen } from '../../test-utils';
3
3
  import { InlinePrompt, InlinePromptProps } from './InlinePrompt';
4
- import { Sentiment } from '../../../common';
4
+ import { Sentiment } from '../../common';
5
5
 
6
6
  mockMatchMedia();
7
7
 
@@ -1,9 +1,9 @@
1
- import { Sentiment } from '../../../common';
1
+ import { Sentiment } from '../../common';
2
2
  import { BackslashCircle } from '@transferwise/icons';
3
- import ProcessIndicator from '../../../processIndicator';
4
- import StatusIcon from '../../../statusIcon';
3
+ import ProcessIndicator from '../../processIndicator';
4
+ import StatusIcon from '../../statusIcon';
5
5
  import { clsx } from 'clsx';
6
- import Body from '../../../body';
6
+ import Body from '../../body';
7
7
 
8
8
  export type InlinePromptProps = {
9
9
  sentiment?: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`;
@@ -0,0 +1,6 @@
1
+ // Prompt
2
+ // ..
3
+
4
+ // InlinePrompt
5
+ export type { InlinePromptProps } from './InlinePrompt';
6
+ export { InlinePrompt } from './InlinePrompt';
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationDot.js","sources":["../../src/avatarView/NotificationDot.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\nimport { Props as AvatarViewProps } from './AvatarView';\n\ntype Props = Pick<HTMLAttributes<HTMLDivElement>, 'children'> & {\n avatarSize?: AvatarViewProps['size'];\n};\n\n/**\n * Depending on avatar size, notifcation dot size and offset are different\n */\nconst MAP_STYLE_CONFIG = {\n 16: { size: 6, offset: 1 },\n 24: { size: 8, offset: 2 },\n 32: { size: 10, offset: 2 },\n 40: { size: 10, offset: 2 },\n 48: { size: 14, offset: 2 },\n 56: { size: 16, offset: 3 },\n 72: { size: 20, offset: 3 },\n};\n\nexport default function NotificationDot({ children, avatarSize = 48 }: Props) {\n return (\n <div\n className=\"np-notification-dot\"\n style={{\n // @ts-expect-error CSS custom props allowed\n '--np-notification-dot-size': `${MAP_STYLE_CONFIG[avatarSize].size}px`,\n '--np-notification-dot-offset': `${MAP_STYLE_CONFIG[avatarSize].offset}px`,\n }}\n >\n <div className=\"np-notification-dot-badge\" />\n <div className=\"np-notification-dot-mask\">{children}</div>\n </div>\n );\n}\n"],"names":["MAP_STYLE_CONFIG","size","offset","NotificationDot","children","avatarSize","_jsxs","className","style","_jsx"],"mappings":";;;;;;AAOA;;AAEG;AACH,MAAMA,gBAAgB,GAAG;AACvB,EAAA,EAAE,EAAE;AAAEC,IAAAA,IAAI,EAAE,CAAC;AAAEC,IAAAA,MAAM,EAAE;GAAG;AAC1B,EAAA,EAAE,EAAE;AAAED,IAAAA,IAAI,EAAE,CAAC;AAAEC,IAAAA,MAAM,EAAE;GAAG;AAC1B,EAAA,EAAE,EAAE;AAAED,IAAAA,IAAI,EAAE,EAAE;AAAEC,IAAAA,MAAM,EAAE;GAAG;AAC3B,EAAA,EAAE,EAAE;AAAED,IAAAA,IAAI,EAAE,EAAE;AAAEC,IAAAA,MAAM,EAAE;GAAG;AAC3B,EAAA,EAAE,EAAE;AAAED,IAAAA,IAAI,EAAE,EAAE;AAAEC,IAAAA,MAAM,EAAE;GAAG;AAC3B,EAAA,EAAE,EAAE;AAAED,IAAAA,IAAI,EAAE,EAAE;AAAEC,IAAAA,MAAM,EAAE;GAAG;AAC3B,EAAA,EAAE,EAAE;AAAED,IAAAA,IAAI,EAAE,EAAE;AAAEC,IAAAA,MAAM,EAAE;AAAC;CAC1B;AAEa,SAAUC,eAAeA,CAAC;EAAEC,QAAQ;AAAEC,EAAAA,UAAU,GAAG;AAAE,CAAS,EAAA;AAC1E,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAC,qBAAqB;AAC/BC,IAAAA,KAAK,EAAE;AACL;MACA,4BAA4B,EAAE,GAAGR,gBAAgB,CAACK,UAAU,CAAC,CAACJ,IAAI,CAAA,EAAA,CAAI;AACtE,MAAA,8BAA8B,EAAE,CAAA,EAAGD,gBAAgB,CAACK,UAAU,CAAC,CAACH,MAAM,CAAA,EAAA;KACtE;AAAAE,IAAAA,QAAA,gBAEFK,cAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC;KAA2B,CAC1C,eAAAE,cAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC,0BAA0B;AAAAH,MAAAA,QAAA,EAAEA;AAAQ,KAAM,CAC3D;AAAA,GAAK,CAAC;AAEV;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NotificationDot.mjs","sources":["../../src/avatarView/NotificationDot.tsx"],"sourcesContent":["import { HTMLAttributes } from 'react';\nimport { Props as AvatarViewProps } from './AvatarView';\n\ntype Props = Pick<HTMLAttributes<HTMLDivElement>, 'children'> & {\n avatarSize?: AvatarViewProps['size'];\n};\n\n/**\n * Depending on avatar size, notifcation dot size and offset are different\n */\nconst MAP_STYLE_CONFIG = {\n 16: { size: 6, offset: 1 },\n 24: { size: 8, offset: 2 },\n 32: { size: 10, offset: 2 },\n 40: { size: 10, offset: 2 },\n 48: { size: 14, offset: 2 },\n 56: { size: 16, offset: 3 },\n 72: { size: 20, offset: 3 },\n};\n\nexport default function NotificationDot({ children, avatarSize = 48 }: Props) {\n return (\n <div\n className=\"np-notification-dot\"\n style={{\n // @ts-expect-error CSS custom props allowed\n '--np-notification-dot-size': `${MAP_STYLE_CONFIG[avatarSize].size}px`,\n '--np-notification-dot-offset': `${MAP_STYLE_CONFIG[avatarSize].offset}px`,\n }}\n >\n <div className=\"np-notification-dot-badge\" />\n <div className=\"np-notification-dot-mask\">{children}</div>\n </div>\n );\n}\n"],"names":["MAP_STYLE_CONFIG","size","offset","NotificationDot","children","avatarSize","_jsxs","className","style","_jsx"],"mappings":";;AAOA;;AAEG;AACH,MAAMA,gBAAgB,GAAG;AACvB,EAAA,EAAE,EAAE;AAAEC,IAAAA,IAAI,EAAE,CAAC;AAAEC,IAAAA,MAAM,EAAE;GAAG;AAC1B,EAAA,EAAE,EAAE;AAAED,IAAAA,IAAI,EAAE,CAAC;AAAEC,IAAAA,MAAM,EAAE;GAAG;AAC1B,EAAA,EAAE,EAAE;AAAED,IAAAA,IAAI,EAAE,EAAE;AAAEC,IAAAA,MAAM,EAAE;GAAG;AAC3B,EAAA,EAAE,EAAE;AAAED,IAAAA,IAAI,EAAE,EAAE;AAAEC,IAAAA,MAAM,EAAE;GAAG;AAC3B,EAAA,EAAE,EAAE;AAAED,IAAAA,IAAI,EAAE,EAAE;AAAEC,IAAAA,MAAM,EAAE;GAAG;AAC3B,EAAA,EAAE,EAAE;AAAED,IAAAA,IAAI,EAAE,EAAE;AAAEC,IAAAA,MAAM,EAAE;GAAG;AAC3B,EAAA,EAAE,EAAE;AAAED,IAAAA,IAAI,EAAE,EAAE;AAAEC,IAAAA,MAAM,EAAE;AAAC;CAC1B;AAEa,SAAUC,eAAeA,CAAC;EAAEC,QAAQ;AAAEC,EAAAA,UAAU,GAAG;AAAE,CAAS,EAAA;AAC1E,EAAA,oBACEC,IAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAC,qBAAqB;AAC/BC,IAAAA,KAAK,EAAE;AACL;MACA,4BAA4B,EAAE,GAAGR,gBAAgB,CAACK,UAAU,CAAC,CAACJ,IAAI,CAAA,EAAA,CAAI;AACtE,MAAA,8BAA8B,EAAE,CAAA,EAAGD,gBAAgB,CAACK,UAAU,CAAC,CAACH,MAAM,CAAA,EAAA;KACtE;AAAAE,IAAAA,QAAA,gBAEFK,GAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC;KAA2B,CAC1C,eAAAE,GAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC,0BAA0B;AAAAH,MAAAA,QAAA,EAAEA;AAAQ,KAAM,CAC3D;AAAA,GAAK,CAAC;AAEV;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"InlinePrompt.js","sources":["../../../../src/listItem/Prompt/InlinePrompt/InlinePrompt.tsx"],"sourcesContent":["import { Sentiment } from '../../../common';\nimport { BackslashCircle } from '@transferwise/icons';\nimport ProcessIndicator from '../../../processIndicator';\nimport StatusIcon from '../../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../../body';\n\nexport type InlinePromptProps = {\n sentiment?: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`;\n loading?: boolean;\n /**\n * Use for short-lived inline prompts to avoid swap of the icon (which is bad UX for short-lived prompts, e.g. when submit form)\n */\n muted?: boolean;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n children: React.ReactNode;\n};\n\nexport const InlinePrompt = ({\n sentiment = Sentiment.POSITIVE,\n muted = false,\n loading = false,\n className,\n children,\n ...rest\n}: InlinePromptProps) => {\n const renderMedia = () => {\n if (muted) {\n return <BackslashCircle size={16} data-testid=\"InlinePrompt_Muted\" />;\n }\n if (loading) {\n return <ProcessIndicator data-testid=\"InlinePrompt_ProcessIndicator\" size=\"xxs\" />;\n }\n return <StatusIcon size={16} sentiment={sentiment} />;\n };\n\n return (\n <div\n className={clsx(\n 'wds-inline-prompt',\n `wds-inline-prompt--${sentiment}`,\n {\n 'wds-inline-prompt--muted': muted,\n 'wds-inline-prompt--loading': loading,\n },\n className,\n )}\n {...rest}\n >\n <div className=\"wds-inline-prompt__media-wrapper\">{renderMedia()}</div>\n <Body>{children}</Body>\n </div>\n );\n};\n"],"names":["InlinePrompt","sentiment","Sentiment","POSITIVE","muted","loading","className","children","rest","renderMedia","_jsx","BackslashCircle","size","ProcessIndicator","StatusIcon","_jsxs","clsx","Body"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBO,MAAMA,YAAY,GAAGA,CAAC;aAC3BC,WAAS,GAAGC,mBAAS,CAACC,QAAQ;AAC9BC,EAAAA,KAAK,GAAG,KAAK;AACbC,EAAAA,OAAO,GAAG,KAAK;EACfC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAI,CACW,KAAI;EACtB,MAAMC,WAAW,GAAGA,MAAK;AACvB,IAAA,IAAIL,KAAK,EAAE;MACT,oBAAOM,cAAA,CAACC,qBAAe,EAAA;AAACC,QAAAA,IAAI,EAAE,EAAG;QAAC,aAAA,EAAY;AAAoB,QAAG;AACvE,IAAA;AACA,IAAA,IAAIP,OAAO,EAAE;MACX,oBAAOK,cAAA,CAACG,wBAAgB,EAAA;AAAC,QAAA,aAAA,EAAY,+BAA+B;AAACD,QAAAA,IAAI,EAAC;AAAK,OAAA,CAAG;AACpF,IAAA;IACA,oBAAOF,cAAA,CAACI,kBAAU,EAAA;AAACF,MAAAA,IAAI,EAAE,EAAG;AAACX,MAAAA,SAAS,EAAEA;AAAU,MAAG;EACvD,CAAC;AAED,EAAA,oBACEc,eAAA,CAAA,KAAA,EAAA;IACET,SAAS,EAAEU,SAAI,CACb,mBAAmB,EACnB,CAAA,mBAAA,EAAsBf,WAAS,EAAE,EACjC;AACE,MAAA,0BAA0B,EAAEG,KAAK;AACjC,MAAA,4BAA4B,EAAEC;KAC/B,EACDC,SAAS,CACT;AAAA,IAAA,GACEE,IAAI;AAAAD,IAAAA,QAAA,gBAERG,cAAA,CAAA,KAAA,EAAA;AAAKJ,MAAAA,SAAS,EAAC,kCAAkC;MAAAC,QAAA,EAAEE,WAAW;AAAE,KAAM,CACtE,eAAAC,cAAA,CAACO,YAAI,EAAA;AAAAV,MAAAA,QAAA,EAAEA;AAAQ,KAAO,CACxB;AAAA,GAAK,CAAC;AAEV;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"InlinePrompt.mjs","sources":["../../../../src/listItem/Prompt/InlinePrompt/InlinePrompt.tsx"],"sourcesContent":["import { Sentiment } from '../../../common';\nimport { BackslashCircle } from '@transferwise/icons';\nimport ProcessIndicator from '../../../processIndicator';\nimport StatusIcon from '../../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../../body';\n\nexport type InlinePromptProps = {\n sentiment?: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`;\n loading?: boolean;\n /**\n * Use for short-lived inline prompts to avoid swap of the icon (which is bad UX for short-lived prompts, e.g. when submit form)\n */\n muted?: boolean;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n children: React.ReactNode;\n};\n\nexport const InlinePrompt = ({\n sentiment = Sentiment.POSITIVE,\n muted = false,\n loading = false,\n className,\n children,\n ...rest\n}: InlinePromptProps) => {\n const renderMedia = () => {\n if (muted) {\n return <BackslashCircle size={16} data-testid=\"InlinePrompt_Muted\" />;\n }\n if (loading) {\n return <ProcessIndicator data-testid=\"InlinePrompt_ProcessIndicator\" size=\"xxs\" />;\n }\n return <StatusIcon size={16} sentiment={sentiment} />;\n };\n\n return (\n <div\n className={clsx(\n 'wds-inline-prompt',\n `wds-inline-prompt--${sentiment}`,\n {\n 'wds-inline-prompt--muted': muted,\n 'wds-inline-prompt--loading': loading,\n },\n className,\n )}\n {...rest}\n >\n <div className=\"wds-inline-prompt__media-wrapper\">{renderMedia()}</div>\n <Body>{children}</Body>\n </div>\n );\n};\n"],"names":["InlinePrompt","sentiment","Sentiment","POSITIVE","muted","loading","className","children","rest","renderMedia","_jsx","BackslashCircle","size","ProcessIndicator","StatusIcon","_jsxs","clsx","Body"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBO,MAAMA,YAAY,GAAGA,CAAC;EAC3BC,SAAS,GAAGC,SAAS,CAACC,QAAQ;AAC9BC,EAAAA,KAAK,GAAG,KAAK;AACbC,EAAAA,OAAO,GAAG,KAAK;EACfC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAI,CACW,KAAI;EACtB,MAAMC,WAAW,GAAGA,MAAK;AACvB,IAAA,IAAIL,KAAK,EAAE;MACT,oBAAOM,GAAA,CAACC,eAAe,EAAA;AAACC,QAAAA,IAAI,EAAE,EAAG;QAAC,aAAA,EAAY;AAAoB,QAAG;AACvE,IAAA;AACA,IAAA,IAAIP,OAAO,EAAE;MACX,oBAAOK,GAAA,CAACG,gBAAgB,EAAA;AAAC,QAAA,aAAA,EAAY,+BAA+B;AAACD,QAAAA,IAAI,EAAC;AAAK,OAAA,CAAG;AACpF,IAAA;IACA,oBAAOF,GAAA,CAACI,UAAU,EAAA;AAACF,MAAAA,IAAI,EAAE,EAAG;AAACX,MAAAA,SAAS,EAAEA;AAAU,MAAG;EACvD,CAAC;AAED,EAAA,oBACEc,IAAA,CAAA,KAAA,EAAA;IACET,SAAS,EAAEU,IAAI,CACb,mBAAmB,EACnB,CAAA,mBAAA,EAAsBf,SAAS,EAAE,EACjC;AACE,MAAA,0BAA0B,EAAEG,KAAK;AACjC,MAAA,4BAA4B,EAAEC;KAC/B,EACDC,SAAS,CACT;AAAA,IAAA,GACEE,IAAI;AAAAD,IAAAA,QAAA,gBAERG,GAAA,CAAA,KAAA,EAAA;AAAKJ,MAAAA,SAAS,EAAC,kCAAkC;MAAAC,QAAA,EAAEE,WAAW;AAAE,KAAM,CACtE,eAAAC,GAAA,CAACO,IAAI,EAAA;AAAAV,MAAAA,QAAA,EAAEA;AAAQ,KAAO,CACxB;AAAA,GAAK,CAAC;AAEV;;;;"}