@transferwise/components 46.136.0 → 46.137.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 (162) hide show
  1. package/build/common/hooks/useContainerSize.js +30 -0
  2. package/build/common/hooks/useContainerSize.js.map +1 -0
  3. package/build/common/hooks/useContainerSize.mjs +28 -0
  4. package/build/common/hooks/useContainerSize.mjs.map +1 -0
  5. package/build/common/hooks/useResizeObserver.js +3 -3
  6. package/build/common/hooks/useResizeObserver.js.map +1 -1
  7. package/build/common/hooks/useResizeObserver.mjs +3 -3
  8. package/build/common/hooks/useResizeObserver.mjs.map +1 -1
  9. package/build/criticalBanner/CriticalCommsBanner.js +3 -0
  10. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  11. package/build/criticalBanner/CriticalCommsBanner.mjs +3 -0
  12. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  13. package/build/field/Field.js +3 -2
  14. package/build/field/Field.js.map +1 -1
  15. package/build/field/Field.mjs +3 -2
  16. package/build/field/Field.mjs.map +1 -1
  17. package/build/i18n/en.json +2 -0
  18. package/build/i18n/en.json.js +2 -0
  19. package/build/i18n/en.json.js.map +1 -1
  20. package/build/i18n/en.json.mjs +2 -0
  21. package/build/i18n/en.json.mjs.map +1 -1
  22. package/build/index.js +2 -0
  23. package/build/index.js.map +1 -1
  24. package/build/index.mjs +1 -0
  25. package/build/index.mjs.map +1 -1
  26. package/build/listItem/Prompt/ListItemPrompt.js +3 -2
  27. package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
  28. package/build/listItem/Prompt/ListItemPrompt.mjs +3 -2
  29. package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
  30. package/build/logo/Logo.js +77 -25
  31. package/build/logo/Logo.js.map +1 -1
  32. package/build/logo/Logo.mjs +79 -27
  33. package/build/logo/Logo.mjs.map +1 -1
  34. package/build/logo/logo-assets.js +68 -97
  35. package/build/logo/logo-assets.js.map +1 -1
  36. package/build/logo/logo-assets.mjs +62 -90
  37. package/build/logo/logo-assets.mjs.map +1 -1
  38. package/build/main.css +225 -58
  39. package/build/prompt/ActionPrompt/ActionPrompt.js +8 -40
  40. package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
  41. package/build/prompt/ActionPrompt/ActionPrompt.mjs +8 -40
  42. package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
  43. package/build/prompt/CriticalBanner/CriticalBanner.js +143 -0
  44. package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -0
  45. package/build/prompt/CriticalBanner/CriticalBanner.mjs +141 -0
  46. package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -0
  47. package/build/prompt/CriticalBanner/helpers.js +29 -0
  48. package/build/prompt/CriticalBanner/helpers.js.map +1 -0
  49. package/build/prompt/CriticalBanner/helpers.mjs +26 -0
  50. package/build/prompt/CriticalBanner/helpers.mjs.map +1 -0
  51. package/build/prompt/InfoPrompt/InfoPrompt.js +3 -2
  52. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
  53. package/build/prompt/InfoPrompt/InfoPrompt.mjs +3 -2
  54. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
  55. package/build/prompt/PrimitivePrompt/PrimitivePrompt.js +11 -4
  56. package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
  57. package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs +11 -4
  58. package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
  59. package/build/prompt/common/Expander/Expander.js +35 -0
  60. package/build/prompt/common/Expander/Expander.js.map +1 -0
  61. package/build/prompt/common/Expander/Expander.messages.js +17 -0
  62. package/build/prompt/common/Expander/Expander.messages.js.map +1 -0
  63. package/build/prompt/common/Expander/Expander.messages.mjs +13 -0
  64. package/build/prompt/common/Expander/Expander.messages.mjs.map +1 -0
  65. package/build/prompt/common/Expander/Expander.mjs +33 -0
  66. package/build/prompt/common/Expander/Expander.mjs.map +1 -0
  67. package/build/prompt/helpers/promptMedia.js +52 -0
  68. package/build/prompt/helpers/promptMedia.js.map +1 -0
  69. package/build/prompt/helpers/promptMedia.mjs +50 -0
  70. package/build/prompt/helpers/promptMedia.mjs.map +1 -0
  71. package/build/styles/logo/Logo.css +3 -23
  72. package/build/styles/main.css +225 -58
  73. package/build/styles/prompt/CriticalBanner/CriticalBanner.css +134 -0
  74. package/build/styles/prompt/CriticalBanner/CriticalBanner.vars.css +0 -0
  75. package/build/styles/prompt/InfoPrompt/InfoPrompt.css +24 -0
  76. package/build/styles/prompt/common/Expander/Expander.css +8 -0
  77. package/build/table/Table.js +6 -5
  78. package/build/table/Table.js.map +1 -1
  79. package/build/table/Table.mjs +6 -5
  80. package/build/table/Table.mjs.map +1 -1
  81. package/build/typeahead/Typeahead.js +3 -2
  82. package/build/typeahead/Typeahead.js.map +1 -1
  83. package/build/typeahead/Typeahead.mjs +3 -2
  84. package/build/typeahead/Typeahead.mjs.map +1 -1
  85. package/build/types/common/hooks/useContainerSize.d.ts +14 -0
  86. package/build/types/common/hooks/useContainerSize.d.ts.map +1 -0
  87. package/build/types/common/hooks/useResizeObserver.d.ts +1 -1
  88. package/build/types/common/hooks/useResizeObserver.d.ts.map +1 -1
  89. package/build/types/criticalBanner/CriticalCommsBanner.d.ts +3 -0
  90. package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
  91. package/build/types/index.d.ts +2 -2
  92. package/build/types/index.d.ts.map +1 -1
  93. package/build/types/logo/Logo.d.ts +33 -1
  94. package/build/types/logo/Logo.d.ts.map +1 -1
  95. package/build/types/logo/logo-assets.d.ts +33 -9
  96. package/build/types/logo/logo-assets.d.ts.map +1 -1
  97. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +2 -11
  98. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
  99. package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts +39 -0
  100. package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +1 -0
  101. package/build/types/prompt/CriticalBanner/helpers.d.ts +18 -0
  102. package/build/types/prompt/CriticalBanner/helpers.d.ts.map +1 -0
  103. package/build/types/prompt/CriticalBanner/index.d.ts +3 -0
  104. package/build/types/prompt/CriticalBanner/index.d.ts.map +1 -0
  105. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -1
  106. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +35 -3
  107. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
  108. package/build/types/prompt/common/Expander/Expander.d.ts +20 -0
  109. package/build/types/prompt/common/Expander/Expander.d.ts.map +1 -0
  110. package/build/types/prompt/common/Expander/Expander.messages.d.ts +14 -0
  111. package/build/types/prompt/common/Expander/Expander.messages.d.ts.map +1 -0
  112. package/build/types/prompt/helpers/promptMedia.d.ts +22 -0
  113. package/build/types/prompt/helpers/promptMedia.d.ts.map +1 -0
  114. package/build/types/prompt/index.d.ts +2 -0
  115. package/build/types/prompt/index.d.ts.map +1 -1
  116. package/build/types/table/Table.d.ts.map +1 -1
  117. package/build/types/test-utils/index.d.ts +4 -0
  118. package/build/types/test-utils/index.d.ts.map +1 -1
  119. package/package.json +7 -7
  120. package/src/common/bottomSheet/BottomSheet.test.story.tsx +6 -5
  121. package/src/common/hooks/useContainerSize.test.tsx +125 -0
  122. package/src/common/hooks/useContainerSize.ts +32 -0
  123. package/src/common/hooks/useResizeObserver.ts +3 -2
  124. package/src/criticalBanner/CriticalCommsBanner.story.tsx +4 -0
  125. package/src/criticalBanner/CriticalCommsBanner.test.story.tsx +1 -1
  126. package/src/criticalBanner/CriticalCommsBanner.tsx +3 -0
  127. package/src/i18n/en.json +2 -0
  128. package/src/icons/Icons.story.tsx +43 -35
  129. package/src/index.ts +2 -2
  130. package/src/logo/Logo.css +3 -23
  131. package/src/logo/Logo.less +3 -29
  132. package/src/logo/Logo.story.tsx +117 -89
  133. package/src/logo/Logo.test.story.tsx +15 -24
  134. package/src/logo/Logo.tsx +90 -28
  135. package/src/logo/logo-assets.tsx +36 -92
  136. package/src/main.css +225 -58
  137. package/src/main.less +3 -1
  138. package/src/prompt/ActionPrompt/ActionPrompt.tsx +9 -62
  139. package/src/prompt/CriticalBanner/CriticalBanner.accessibility.docs.mdx +113 -0
  140. package/src/prompt/CriticalBanner/CriticalBanner.css +134 -0
  141. package/src/prompt/CriticalBanner/CriticalBanner.less +155 -0
  142. package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +635 -0
  143. package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +422 -0
  144. package/src/prompt/CriticalBanner/CriticalBanner.tsx +179 -0
  145. package/src/prompt/CriticalBanner/CriticalBanner.vars.css +0 -0
  146. package/src/prompt/CriticalBanner/CriticalBanner.vars.less +6 -0
  147. package/src/prompt/CriticalBanner/helpers.ts +39 -0
  148. package/src/prompt/CriticalBanner/index.ts +2 -0
  149. package/src/prompt/InfoPrompt/InfoPrompt.css +24 -0
  150. package/src/prompt/InfoPrompt/InfoPrompt.less +23 -0
  151. package/src/prompt/InfoPrompt/InfoPrompt.tsx +5 -1
  152. package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +56 -40
  153. package/src/prompt/common/Expander/Expander.css +8 -0
  154. package/src/prompt/common/Expander/Expander.less +9 -0
  155. package/src/prompt/common/Expander/Expander.messages.ts +14 -0
  156. package/src/prompt/common/Expander/Expander.test.tsx +167 -0
  157. package/src/prompt/common/Expander/Expander.tsx +83 -0
  158. package/src/prompt/helpers/promptMedia.tsx +79 -0
  159. package/src/prompt/index.ts +4 -0
  160. package/src/sentimentSurface/SentimentSurface.story.tsx +43 -17
  161. package/src/table/Table.story.tsx +1 -1
  162. package/src/table/Table.tsx +6 -5
package/build/main.css CHANGED
@@ -31067,35 +31067,9 @@ button.np-link {
31067
31067
 
31068
31068
  .np-logo {
31069
31069
  display: inline-block;
31070
- }
31071
-
31072
- .np-theme-personal--forest-green .np-logo-svg path,
31073
- .np-theme-personal--bright-green .np-logo-svg path {
31074
- fill: var(--color-interactive-primary);
31075
- }
31076
-
31077
- .np-theme-personal--dark .np-logo-svg path {
31078
- fill: var(--color-white);
31079
- }
31080
-
31081
- .np-logo-svg--size-sm {
31082
- display: block;
31083
- }
31084
-
31085
- @media (min-width: 576px) {
31086
- .np-logo-svg--size-sm {
31087
- display: none;
31088
- }
31089
- }
31090
-
31091
- .np-logo-svg--size-md {
31092
- display: none;
31093
- }
31094
-
31095
- @media (min-width: 576px) {
31096
- .np-logo-svg--size-md {
31097
- display: block;
31098
- }
31070
+ color: var(--color-interactive-primary);
31071
+ width: var(--wds-logo-width);
31072
+ height: var(--wds-logo-height);
31099
31073
  }
31100
31074
 
31101
31075
  .tw-modal--scrollable {
@@ -32233,6 +32207,228 @@ html:not([dir="rtl"]) .np-navigation-option {
32233
32207
  padding: 0;
32234
32208
  }
32235
32209
 
32210
+ @media (max-width: 320px) {
32211
+ .wds-info-prompt .wds-prompt__media-wrapper {
32212
+ padding-top: 4px;
32213
+ padding-top: var(--size-4);
32214
+ }
32215
+ }
32216
+
32217
+ @media (max-width: 320px) {
32218
+ .wds-info-prompt .wds-prompt__media-wrapper:has(.wds-info-prompt__media > .tw-icon) {
32219
+ padding-top: 8px;
32220
+ padding-top: var(--size-8);
32221
+ }
32222
+ }
32223
+
32224
+ @media (max-width: 320px) {
32225
+ .wds-info-prompt .wds-prompt__media-wrapper:has(+ .wds-info-prompt__content .wds-info-prompt__title:first-child) {
32226
+ padding-top: 8px;
32227
+ padding-top: var(--size-8);
32228
+ }
32229
+ }
32230
+
32231
+ @media (max-width: 320px) {
32232
+ .wds-info-prompt .wds-prompt__media-wrapper:has(+ .wds-info-prompt__content .wds-info-prompt__title:first-child):has(.wds-info-prompt__media > .tw-icon) {
32233
+ padding-top: 12px;
32234
+ padding-top: var(--size-12);
32235
+ }
32236
+ }
32237
+
32238
+ .wds-action-prompt {
32239
+ --Prompt-padding: var(--size-16);
32240
+ --Prompt-actions-gap: var(--size-8);
32241
+ --Prompt-gap: var(--size-10) var(--size-16);
32242
+ --Prompt-border-radius: var(--radius-large);
32243
+ }
32244
+
32245
+ .wds-action-prompt--media-image {
32246
+ width: 48px;
32247
+ width: var(--size-48);
32248
+ height: 48px;
32249
+ height: var(--size-48);
32250
+ -o-object-fit: contain;
32251
+ object-fit: contain;
32252
+ }
32253
+
32254
+ @media (max-width: 767px) {
32255
+ .wds-action-prompt--with-two-actions .wds-prompt__actions-wrapper .wds-Button {
32256
+ flex: 1 1 calc(50% - (var(--Prompt-actions-gap) / 2));
32257
+ min-width: -moz-fit-content;
32258
+ min-width: fit-content;
32259
+ }
32260
+ }
32261
+
32262
+ .wds-action-prompt__content {
32263
+ max-width: calc(48px * 10);
32264
+ max-width: calc(var(--size-48) * 10);
32265
+ }
32266
+
32267
+ .wds-critical-banner {
32268
+ --Prompt-padding: var(--size-16);
32269
+ --Prompt-actions-gap: var(--size-8);
32270
+ --Prompt-gap: var(--size-10) var(--size-16);
32271
+ --Prompt-border-radius: 0;
32272
+ container-type: inline-size;
32273
+ --critical-banner-easing: cubic-bezier(0.9, 0, 0.7, 1);
32274
+ --critical-banner-duration: 150ms;
32275
+ /* Override PrimitivePrompt's --screen-sm-max actions behaviour:
32276
+ actions only go full-width below mobile-max token (container query) */
32277
+ }
32278
+
32279
+ .wds-critical-banner--media-image {
32280
+ width: 48px;
32281
+ width: var(--size-48);
32282
+ height: 48px;
32283
+ height: var(--size-48);
32284
+ -o-object-fit: contain;
32285
+ object-fit: contain;
32286
+ }
32287
+
32288
+ .wds-critical-banner__title {
32289
+ display: -webkit-box;
32290
+ -webkit-line-clamp: 8;
32291
+ line-clamp: 8;
32292
+ -webkit-box-orient: vertical;
32293
+ max-height: 192px;
32294
+ overflow: hidden;
32295
+ transition: max-height var(--critical-banner-duration) var(--critical-banner-easing);
32296
+ }
32297
+
32298
+ .wds-critical-banner--collapsed .wds-critical-banner__title {
32299
+ -webkit-line-clamp: 2;
32300
+ line-clamp: 2;
32301
+ max-height: 48px;
32302
+ }
32303
+
32304
+ .wds-critical-banner__description {
32305
+ max-height: 30vh;
32306
+ opacity: 1;
32307
+ overflow: hidden;
32308
+ transition: max-height var(--critical-banner-duration) var(--critical-banner-easing), opacity var(--critical-banner-duration) var(--critical-banner-easing);
32309
+ }
32310
+
32311
+ .wds-critical-banner--collapsed .wds-critical-banner__description--with-title {
32312
+ max-height: 0;
32313
+ opacity: 0;
32314
+ }
32315
+
32316
+ .wds-critical-banner--collapsed .wds-critical-banner__description:not(.wds-critical-banner__description--with-title) {
32317
+ display: -webkit-box;
32318
+ -webkit-line-clamp: 2;
32319
+ line-clamp: 2;
32320
+ -webkit-box-orient: vertical;
32321
+ overflow: hidden;
32322
+ }
32323
+
32324
+ .wds-critical-banner .wds-prompt__content-wrapper {
32325
+ grid-template-columns: auto 1fr auto;
32326
+ align-items: flex-start;
32327
+ transition: row-gap var(--critical-banner-duration) var(--critical-banner-easing);
32328
+ }
32329
+
32330
+ .wds-critical-banner--collapsed .wds-prompt__content-wrapper {
32331
+ row-gap: 0;
32332
+ }
32333
+
32334
+ .wds-critical-banner__text-wrapper {
32335
+ position: relative;
32336
+ display: flex;
32337
+ flex-direction: column;
32338
+ justify-content: center;
32339
+ align-items: flex-start;
32340
+ text-align: start;
32341
+ min-width: 0;
32342
+ max-width: 480px;
32343
+ height: 100%;
32344
+ padding-top: 3px;
32345
+ }
32346
+
32347
+ @media (max-width: 320px) {
32348
+ .wds-critical-banner__text-wrapper {
32349
+ padding-top: 0;
32350
+ }
32351
+ }
32352
+
32353
+ @container (max-width: 320px) {
32354
+ .wds-critical-banner__text-wrapper {
32355
+ padding-top: 0;
32356
+ }
32357
+ }
32358
+
32359
+ .wds-critical-banner--collapsed .wds-critical-banner__title,
32360
+ .wds-critical-banner--collapsed .wds-critical-banner__description {
32361
+ transform: translateY(0);
32362
+ }
32363
+
32364
+ .wds-critical-banner__toggle {
32365
+ flex-shrink: 0;
32366
+ transition: transform var(--critical-banner-duration) var(--critical-banner-easing);
32367
+ }
32368
+
32369
+ .wds-critical-banner__toggle--collapsed {
32370
+ transform: rotate(180deg);
32371
+ }
32372
+
32373
+ @container (min-width: 768px) {
32374
+ .wds-critical-banner__toggle {
32375
+ display: none;
32376
+ }
32377
+ }
32378
+
32379
+ .wds-critical-banner .wds-prompt__actions-wrapper {
32380
+ grid-column-start: 2;
32381
+ grid-column-end: 3;
32382
+ max-height: 200px;
32383
+ opacity: 1;
32384
+ overflow: visible;
32385
+ }
32386
+
32387
+ @container (max-width: 600px) {
32388
+ .wds-critical-banner .wds-prompt__actions-wrapper {
32389
+ grid-column: span 3;
32390
+ width: 100%;
32391
+ }
32392
+ .wds-critical-banner .wds-prompt__actions-wrapper .wds-Button {
32393
+ flex: 1 1 100%;
32394
+ width: 100%;
32395
+ }
32396
+ }
32397
+
32398
+ .wds-critical-banner--collapsed .wds-prompt__actions-wrapper {
32399
+ max-height: 0;
32400
+ opacity: 0;
32401
+ overflow: hidden;
32402
+ pointer-events: none;
32403
+ }
32404
+
32405
+ @container (max-width: 600px) {
32406
+ .wds-critical-banner--with-two-actions .wds-prompt__actions-wrapper .wds-Button {
32407
+ flex: 1 1 calc(50% - (var(--Prompt-actions-gap) / 2));
32408
+ min-width: -moz-fit-content;
32409
+ min-width: fit-content;
32410
+ }
32411
+ }
32412
+
32413
+ @media (prefers-reduced-motion: reduce) {
32414
+ .wds-critical-banner__description,
32415
+ .wds-critical-banner__title,
32416
+ .wds-critical-banner .wds-prompt__content-wrapper,
32417
+ .wds-critical-banner__toggle {
32418
+ transition: none !important;
32419
+ }
32420
+ }
32421
+
32422
+ .wds-expander-toggle {
32423
+ align-self: flex-start;
32424
+ flex-shrink: 0;
32425
+ transition: transform 0.2s ease-in-out;
32426
+ }
32427
+
32428
+ .wds-expander-toggle--collapsed {
32429
+ transform: rotate(180deg);
32430
+ }
32431
+
32236
32432
  .wds-radio-group .np-radio:last-child label {
32237
32433
  margin-bottom: 0;
32238
32434
  }
@@ -34658,32 +34854,3 @@ html:not([dir="rtl"]) .np-navigation-option {
34658
34854
  .np-list-item__action {
34659
34855
  flex-shrink: 0;
34660
34856
  }
34661
-
34662
- .wds-action-prompt {
34663
- --Prompt-padding: var(--size-16);
34664
- --Prompt-actions-gap: var(--size-8);
34665
- --Prompt-gap: var(--size-10) var(--size-16);
34666
- --Prompt-border-radius: var(--radius-large);
34667
- }
34668
-
34669
- .wds-action-prompt--media-image {
34670
- width: 48px;
34671
- width: var(--size-48);
34672
- height: 48px;
34673
- height: var(--size-48);
34674
- -o-object-fit: contain;
34675
- object-fit: contain;
34676
- }
34677
-
34678
- @media (max-width: 767px) {
34679
- .wds-action-prompt--with-two-actions .wds-prompt__actions-wrapper .wds-Button {
34680
- flex: 1 1 calc(50% - (var(--Prompt-actions-gap) / 2));
34681
- min-width: -moz-fit-content;
34682
- min-width: fit-content;
34683
- }
34684
- }
34685
-
34686
- .wds-action-prompt__content {
34687
- max-width: calc(48px * 10);
34688
- max-width: calc(var(--size-48) * 10);
34689
- }
@@ -2,7 +2,6 @@
2
2
 
3
3
  var React = require('react');
4
4
  var clsx = require('clsx');
5
- var StatusIcon = require('../../statusIcon/StatusIcon.js');
6
5
  var Body = require('../../body/Body.js');
7
6
  var Button_resolver = require('../../button/Button.resolver.js');
8
7
  require('../../common/theme.js');
@@ -25,14 +24,13 @@ require('../../common/propsValues/scroll.js');
25
24
  require('../../common/propsValues/markdownNodeType.js');
26
25
  require('../../common/fileType.js');
27
26
  require('@transferwise/formatting');
28
- var icons = require('@transferwise/icons');
27
+ require('@transferwise/icons');
29
28
  require('react-intl');
30
29
  require('../../common/closeButton/CloseButton.messages.js');
31
30
  var jsxRuntime = require('react/jsx-runtime');
32
- var AvatarView = require('../../avatarView/AvatarView.js');
33
- var Image = require('../../image/Image.js');
34
31
  var PrimitivePrompt = require('../PrimitivePrompt/PrimitivePrompt.js');
35
32
  var useScreenSize = require('../../common/hooks/useScreenSize.js');
33
+ var promptMedia = require('../helpers/promptMedia.js');
36
34
 
37
35
  const ActionPrompt = ({
38
36
  sentiment = 'neutral',
@@ -52,42 +50,12 @@ const ActionPrompt = ({
52
50
  const titleId = React.useId();
53
51
  const descId = React.useId();
54
52
  const ariaLabelledByIds = [media['aria-hidden'] ? undefined : mediaId, ariaLabel ? undefined : titleId].filter(Boolean).join(' ');
55
- const renderMedia = () => {
56
- if (media?.imgSrc) {
57
- return /*#__PURE__*/jsxRuntime.jsx(Image.default, {
58
- id: mediaId,
59
- src: media.imgSrc,
60
- className: "wds-action-prompt--media-image",
61
- alt: media['aria-label'] ?? ''
62
- });
63
- }
64
- if (media?.avatar) {
65
- const badge = media.avatar.badge ? media.avatar.badge : sentiment === 'proposition' ? {} : {
66
- status: sentiment
67
- };
68
- return /*#__PURE__*/jsxRuntime.jsx(AvatarView.default, {
69
- ...media.avatar,
70
- badge: badge,
71
- "aria-label": media['aria-label'],
72
- "aria-hidden": media['aria-hidden'],
73
- id: mediaId,
74
- size: 48,
75
- children: media.avatar.asset
76
- });
77
- }
78
- return sentiment === 'proposition' ? /*#__PURE__*/jsxRuntime.jsx(AvatarView.default, {
79
- id: mediaId,
80
- size: 48,
81
- "aria-label": media['aria-label'],
82
- "aria-hidden": media['aria-hidden'],
83
- children: /*#__PURE__*/jsxRuntime.jsx(icons.GiftBox, {})
84
- }) : /*#__PURE__*/jsxRuntime.jsx(StatusIcon.default, {
85
- id: mediaId,
86
- size: 48,
87
- sentiment: sentiment,
88
- iconLabel: media['aria-hidden'] ? null : media['aria-label']
89
- });
90
- };
53
+ const renderMedia = () => promptMedia.renderPromptMedia({
54
+ media,
55
+ sentiment,
56
+ mediaId,
57
+ imgClassName: 'wds-action-prompt--media-image'
58
+ });
91
59
  return /*#__PURE__*/jsxRuntime.jsx(PrimitivePrompt.PrimitivePrompt, {
92
60
  id: id,
93
61
  sentiment: sentiment,
@@ -1 +1 @@
1
- {"version":3,"file":"ActionPrompt.js","sources":["../../../src/prompt/ActionPrompt/ActionPrompt.tsx"],"sourcesContent":["import { AriaAttributes, ReactNode, useId } from 'react';\nimport { clsx } from 'clsx';\n\nimport StatusIcon from '../../statusIcon';\nimport Body from '../../body';\nimport Button from '../../button';\nimport { Breakpoint, Typography } from '../../common';\nimport AvatarView, { AvatarViewProps } from '../../avatarView';\nimport Image from '../../image';\nimport { ButtonProps } from '../../button/Button.types';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\nimport { BadgeAssetsProps } from '../../badge';\nimport { GiftBox } from '@transferwise/icons';\nimport { useScreenSize } from '../../common/hooks/useScreenSize';\n\nexport type ActionPromptProps = {\n title: ReactNode;\n description?: ReactNode;\n /** @default {} */\n media?: {\n imgSrc?: string;\n avatar?: Pick<AvatarViewProps, 'imgSrc' | 'profileName' | 'profileType'> & {\n asset?: AvatarViewProps['children'];\n badge?: Pick<BadgeAssetsProps, 'flagCode'>;\n };\n 'aria-label'?: string;\n 'aria-hidden'?: boolean;\n };\n action: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n 'aria-label'?: AriaAttributes['aria-label'];\n} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid' | 'onDismiss'> & {\n /**\n * The sentiment determines the colour scheme\n * @default 'neutral'\n */\n sentiment?: PrimitivePromptProps['sentiment'];\n };\n\n/**\n * Use an action prompt for optional feedback that doesn't require immediate action, such as feature upsells, warnings, or suggestions. These prompts are typically used outside of core product flows (e.g., Launchpad, Recipient, or Transaction screens) and can be addressed at the user's convenience.\n *\n * If your message is about immediate user feedback (e.g., form submission errors, download failures, missing data warnings), use an [info prompt](https://storybook.wise.design/?path=/docs/prompts-infoprompt--docs) instead.\n *\n * Guidance can be found in the [design system](https://wise.design/components/action-prompt).\n */\nexport const ActionPrompt = ({\n sentiment = 'neutral',\n title,\n description,\n onDismiss,\n media = {},\n action,\n actionSecondary,\n id,\n className,\n 'data-testid': testId,\n 'aria-label': ariaLabel,\n}: ActionPromptProps) => {\n const isMobile = !useScreenSize(Breakpoint.MEDIUM);\n\n const mediaId = useId();\n const titleId = useId();\n const descId = useId();\n\n const ariaLabelledByIds = [\n media['aria-hidden'] ? undefined : mediaId,\n ariaLabel ? undefined : titleId,\n ]\n .filter(Boolean)\n .join(' ');\n\n const renderMedia = () => {\n if (media?.imgSrc) {\n return (\n <Image\n id={mediaId}\n src={media.imgSrc}\n className=\"wds-action-prompt--media-image\"\n alt={media['aria-label'] ?? ''}\n />\n );\n }\n if (media?.avatar) {\n const badge = media.avatar.badge\n ? media.avatar.badge\n : sentiment === 'proposition'\n ? {}\n : { status: sentiment };\n return (\n <AvatarView\n {...media.avatar}\n badge={badge}\n aria-label={media['aria-label']}\n aria-hidden={media['aria-hidden']}\n id={mediaId}\n size={48}\n >\n {media.avatar.asset}\n </AvatarView>\n );\n }\n return sentiment === 'proposition' ? (\n <AvatarView\n id={mediaId}\n size={48}\n aria-label={media['aria-label']}\n aria-hidden={media['aria-hidden']}\n >\n <GiftBox />\n </AvatarView>\n ) : (\n <StatusIcon\n id={mediaId}\n size={48}\n sentiment={sentiment}\n iconLabel={media['aria-hidden'] ? null : media['aria-label']}\n />\n );\n };\n\n return (\n <PrimitivePrompt\n id={id}\n sentiment={sentiment}\n data-testid={testId}\n className={clsx(\n 'wds-action-prompt',\n { 'wds-action-prompt--with-two-actions': !!actionSecondary },\n className,\n )}\n media={renderMedia()}\n actions={\n <>\n {actionSecondary && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"secondary\"\n href={actionSecondary.href}\n block={isMobile}\n onClick={actionSecondary?.onClick}\n >\n {actionSecondary.label}\n </Button>\n )}\n {/* @ts-expect-error onClick type mismatch */}\n <Button\n v2\n size=\"md\"\n priority=\"primary\"\n href={action.href}\n block={isMobile}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n </>\n }\n role=\"region\"\n onDismiss={onDismiss}\n {...(ariaLabel\n ? { 'aria-label': ariaLabel }\n : {\n 'aria-labelledby': ariaLabelledByIds,\n 'aria-describedby': descId,\n })}\n >\n <div className={clsx('d-flex', 'flex-column', 'justify-content-center')}>\n <Body id={titleId} type={Typography.BODY_LARGE_BOLD} className=\"wds-action-prompt__content\">\n {title}\n </Body>\n {description && (\n <Body id={descId} className=\"wds-action-prompt__content\">\n {description}\n </Body>\n )}\n </div>\n </PrimitivePrompt>\n );\n};\n\nexport default ActionPrompt;\n"],"names":["ActionPrompt","sentiment","title","description","onDismiss","media","action","actionSecondary","id","className","testId","ariaLabel","isMobile","useScreenSize","Breakpoint","MEDIUM","mediaId","useId","titleId","descId","ariaLabelledByIds","undefined","filter","Boolean","join","renderMedia","imgSrc","_jsx","Image","src","alt","avatar","badge","status","AvatarView","size","children","asset","GiftBox","StatusIcon","iconLabel","PrimitivePrompt","clsx","actions","_jsxs","_Fragment","Button","v2","priority","href","block","onClick","label","role","Body","type","Typography","BODY_LARGE_BOLD"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDO,MAAMA,YAAY,GAAGA,CAAC;AAC3BC,EAAAA,SAAS,GAAG,SAAS;EACrBC,KAAK;EACLC,WAAW;EACXC,SAAS;EACTC,KAAK,GAAG,EAAE;EACVC,MAAM;EACNC,eAAe;EACfC,EAAE;EACFC,SAAS;AACT,EAAA,aAAa,EAAEC,MAAM;AACrB,EAAA,YAAY,EAAEC;AAAS,CACL,KAAI;EACtB,MAAMC,QAAQ,GAAG,CAACC,2BAAa,CAACC,qBAAU,CAACC,MAAM,CAAC;AAElD,EAAA,MAAMC,OAAO,GAAGC,WAAK,EAAE;AACvB,EAAA,MAAMC,OAAO,GAAGD,WAAK,EAAE;AACvB,EAAA,MAAME,MAAM,GAAGF,WAAK,EAAE;EAEtB,MAAMG,iBAAiB,GAAG,CACxBf,KAAK,CAAC,aAAa,CAAC,GAAGgB,SAAS,GAAGL,OAAO,EAC1CL,SAAS,GAAGU,SAAS,GAAGH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M,CAAC8C;AAAK,OACP,CACV;AAAA,KAAA,CACD;AACDC,IAAAA,IAAI,EAAC,QAAQ;AACbjD,IAAAA,SAAS,EAAEA,SAAU;AAAA,IAAA,IAChBO,SAAS,GACV;AAAE,MAAA,YAAY,EAAEA;AAAS,KAAE,GAC3B;AACE,MAAA,iBAAiB,EAAES,iBAAiB;AACpC,MAAA,kBAAkB,EAAED;KACrB,CAAA;AAAAiB,IAAAA,QAAA,eAELQ,eAAA,CAAA,KAAA,EAAA;MAAKnC,SAAS,EAAEiC,SAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,wBAAwB,CAAE;MAAAN,QAAA,EAAA,cACtET,cAAA,CAAC2B,YAAI,EAAA;AAAC9C,QAAAA,EAAE,EAAEU,OAAQ;QAACqC,IAAI,EAAEC,qBAAU,CAACC,eAAgB;AAAChD,QAAAA,SAAS,EAAC,4BAA4B;AAAA2B,QAAAA,QAAA,EACxFlC;AAAK,OACF,CACN,EAACC,WAAW,iBACVwB,cAAA,CAAC2B,YAAI,EAAA;AAAC9C,QAAAA,EAAE,EAAEW,MAAO;AAACV,QAAAA,SAAS,EAAC,4BAA4B;AAAA2B,QAAAA,QAAA,EACrDjC;AAAW,OACR,CACP;KACE;AACP,GAAiB,CAAC;AAEtB;;;;"}
1
+ {"version":3,"file":"ActionPrompt.js","sources":["../../../src/prompt/ActionPrompt/ActionPrompt.tsx"],"sourcesContent":["import { AriaAttributes, ReactNode, useId } from 'react';\nimport { clsx } from 'clsx';\n\nimport Body from '../../body';\nimport Button from '../../button';\nimport { Breakpoint, Typography } from '../../common';\nimport { ButtonProps } from '../../button/Button.types';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\nimport { useScreenSize } from '../../common/hooks/useScreenSize';\nimport { renderPromptMedia, PromptMedia } from '../helpers/promptMedia';\n\nexport type ActionPromptProps = {\n title: ReactNode;\n description?: ReactNode;\n /** @default {} */\n media?: PromptMedia;\n action: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n 'aria-label'?: AriaAttributes['aria-label'];\n} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid' | 'onDismiss'> & {\n /**\n * The sentiment determines the colour scheme\n * @default 'neutral'\n */\n sentiment?: PrimitivePromptProps['sentiment'];\n };\n\n/**\n * Use an action prompt for optional feedback that doesn't require immediate action, such as feature upsells, warnings, or suggestions. These prompts are typically used outside of core product flows (e.g., Launchpad, Recipient, or Transaction screens) and can be addressed at the user's convenience.\n *\n * If your message is about immediate user feedback (e.g., form submission errors, download failures, missing data warnings), use an [info prompt](https://storybook.wise.design/?path=/docs/prompts-infoprompt--docs) instead.\n *\n * Guidance can be found in the [design system](https://wise.design/components/action-prompt).\n */\nexport const ActionPrompt = ({\n sentiment = 'neutral',\n title,\n description,\n onDismiss,\n media = {},\n action,\n actionSecondary,\n id,\n className,\n 'data-testid': testId,\n 'aria-label': ariaLabel,\n}: ActionPromptProps) => {\n const isMobile = !useScreenSize(Breakpoint.MEDIUM);\n\n const mediaId = useId();\n const titleId = useId();\n const descId = useId();\n\n const ariaLabelledByIds = [\n media['aria-hidden'] ? undefined : mediaId,\n ariaLabel ? undefined : titleId,\n ]\n .filter(Boolean)\n .join(' ');\n\n const renderMedia = () =>\n renderPromptMedia({\n media,\n sentiment,\n mediaId,\n imgClassName: 'wds-action-prompt--media-image',\n });\n\n return (\n <PrimitivePrompt\n id={id}\n sentiment={sentiment}\n data-testid={testId}\n className={clsx(\n 'wds-action-prompt',\n { 'wds-action-prompt--with-two-actions': !!actionSecondary },\n className,\n )}\n media={renderMedia()}\n actions={\n <>\n {actionSecondary && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"secondary\"\n href={actionSecondary.href}\n block={isMobile}\n onClick={actionSecondary?.onClick}\n >\n {actionSecondary.label}\n </Button>\n )}\n {/* @ts-expect-error onClick type mismatch */}\n <Button\n v2\n size=\"md\"\n priority=\"primary\"\n href={action.href}\n block={isMobile}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n </>\n }\n role=\"region\"\n onDismiss={onDismiss}\n {...(ariaLabel\n ? { 'aria-label': ariaLabel }\n : {\n 'aria-labelledby': ariaLabelledByIds,\n 'aria-describedby': descId,\n })}\n >\n <div className={clsx('d-flex', 'flex-column', 'justify-content-center')}>\n <Body id={titleId} type={Typography.BODY_LARGE_BOLD} className=\"wds-action-prompt__content\">\n {title}\n </Body>\n {description && (\n <Body id={descId} className=\"wds-action-prompt__content\">\n {description}\n </Body>\n )}\n </div>\n </PrimitivePrompt>\n );\n};\n\nexport default ActionPrompt;\n"],"names":["ActionPrompt","sentiment","title","description","onDismiss","media","action","actionSecondary","id","className","testId","ariaLabel","isMobile","useScreenSize","Breakpoint","MEDIUM","mediaId","useId","titleId","descId","ariaLabelledByIds","undefined","filter","Boolean","join","renderMedia","renderPromptMedia","imgClassName","_jsx","PrimitivePrompt","clsx","actions","_jsxs","_Fragment","children","Button","v2","size","priority","href","block","onClick","label","role","Body","type","Typography","BODY_LARGE_BOLD"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCO,MAAMA,YAAY,GAAGA,CAAC;AAC3BC,EAAAA,SAAS,GAAG,SAAS;EACrBC,KAAK;EACLC,WAAW;EACXC,SAAS;EACTC,KAAK,GAAG,EAAE;EACVC,MAAM;EACNC,eAAe;EACfC,EAAE;EACFC,SAAS;AACT,EAAA,aAAa,EAAEC,MAAM;AACrB,EAAA,YAAY,EAAEC;AAAS,CACL,KAAI;EACtB,MAAMC,QAAQ,GAAG,CAACC,2BAAa,CAACC,qBAAU,CAACC,MAAM,CAAC;AAElD,EAAA,MAAMC,OAAO,GAAGC,WAAK,EAAE;AACvB,EAAA,MAAMC,OAAO,GAAGD,WAAK,EAAE;AACvB,EAAA,MAAME,MAAM,GAAGF,WAAK,EAAE;EAEtB,MAAM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Q;QAAAP,QAAA,EAEvB5B,MAAM,CAACoC;AAAK,OACP,CACV;AAAA,KAAA,CACD;AACDC,IAAAA,IAAI,EAAC,QAAQ;AACbvC,IAAAA,SAAS,EAAEA,SAAU;AAAA,IAAA,IAChBO,SAAS,GACV;AAAE,MAAA,YAAY,EAAEA;AAAS,KAAE,GAC3B;AACE,MAAA,iBAAiB,EAAES,iBAAiB;AACpC,MAAA,kBAAkB,EAAED;KACrB,CAAA;AAAAe,IAAAA,QAAA,eAELF,eAAA,CAAA,KAAA,EAAA;MAAKvB,SAAS,EAAEqB,SAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,wBAAwB,CAAE;MAAAI,QAAA,EAAA,cACtEN,cAAA,CAACgB,YAAI,EAAA;AAACpC,QAAAA,EAAE,EAAEU,OAAQ;QAAC2B,IAAI,EAAEC,qBAAU,CAACC,eAAgB;AAACtC,QAAAA,SAAS,EAAC,4BAA4B;AAAAyB,QAAAA,QAAA,EACxFhC;AAAK,OACF,CACN,EAACC,WAAW,iBACVyB,cAAA,CAACgB,YAAI,EAAA;AAACpC,QAAAA,EAAE,EAAEW,MAAO;AAACV,QAAAA,SAAS,EAAC,4BAA4B;AAAAyB,QAAAA,QAAA,EACrD/B;AAAW,OACR,CACP;KACE;AACP,GAAiB,CAAC;AAEtB;;;;"}
@@ -1,6 +1,5 @@
1
1
  import { useId } from 'react';
2
2
  import { clsx } from 'clsx';
3
- import StatusIcon from '../../statusIcon/StatusIcon.mjs';
4
3
  import Body from '../../body/Body.mjs';
5
4
  import Button from '../../button/Button.resolver.mjs';
6
5
  import '../../common/theme.mjs';
@@ -23,14 +22,13 @@ import '../../common/propsValues/scroll.mjs';
23
22
  import '../../common/propsValues/markdownNodeType.mjs';
24
23
  import '../../common/fileType.mjs';
25
24
  import '@transferwise/formatting';
26
- import { GiftBox } from '@transferwise/icons';
25
+ import '@transferwise/icons';
27
26
  import 'react-intl';
28
27
  import '../../common/closeButton/CloseButton.messages.mjs';
29
28
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
30
- import AvatarView from '../../avatarView/AvatarView.mjs';
31
- import Image from '../../image/Image.mjs';
32
29
  import { PrimitivePrompt } from '../PrimitivePrompt/PrimitivePrompt.mjs';
33
30
  import { useScreenSize } from '../../common/hooks/useScreenSize.mjs';
31
+ import { renderPromptMedia } from '../helpers/promptMedia.mjs';
34
32
 
35
33
  const ActionPrompt = ({
36
34
  sentiment = 'neutral',
@@ -50,42 +48,12 @@ const ActionPrompt = ({
50
48
  const titleId = useId();
51
49
  const descId = useId();
52
50
  const ariaLabelledByIds = [media['aria-hidden'] ? undefined : mediaId, ariaLabel ? undefined : titleId].filter(Boolean).join(' ');
53
- const renderMedia = () => {
54
- if (media?.imgSrc) {
55
- return /*#__PURE__*/jsx(Image, {
56
- id: mediaId,
57
- src: media.imgSrc,
58
- className: "wds-action-prompt--media-image",
59
- alt: media['aria-label'] ?? ''
60
- });
61
- }
62
- if (media?.avatar) {
63
- const badge = media.avatar.badge ? media.avatar.badge : sentiment === 'proposition' ? {} : {
64
- status: sentiment
65
- };
66
- return /*#__PURE__*/jsx(AvatarView, {
67
- ...media.avatar,
68
- badge: badge,
69
- "aria-label": media['aria-label'],
70
- "aria-hidden": media['aria-hidden'],
71
- id: mediaId,
72
- size: 48,
73
- children: media.avatar.asset
74
- });
75
- }
76
- return sentiment === 'proposition' ? /*#__PURE__*/jsx(AvatarView, {
77
- id: mediaId,
78
- size: 48,
79
- "aria-label": media['aria-label'],
80
- "aria-hidden": media['aria-hidden'],
81
- children: /*#__PURE__*/jsx(GiftBox, {})
82
- }) : /*#__PURE__*/jsx(StatusIcon, {
83
- id: mediaId,
84
- size: 48,
85
- sentiment: sentiment,
86
- iconLabel: media['aria-hidden'] ? null : media['aria-label']
87
- });
88
- };
51
+ const renderMedia = () => renderPromptMedia({
52
+ media,
53
+ sentiment,
54
+ mediaId,
55
+ imgClassName: 'wds-action-prompt--media-image'
56
+ });
89
57
  return /*#__PURE__*/jsx(PrimitivePrompt, {
90
58
  id: id,
91
59
  sentiment: sentiment,
@@ -1 +1 @@
1
- {"version":3,"file":"ActionPrompt.mjs","sources":["../../../src/prompt/ActionPrompt/ActionPrompt.tsx"],"sourcesContent":["import { AriaAttributes, ReactNode, useId } from 'react';\nimport { clsx } from 'clsx';\n\nimport StatusIcon from '../../statusIcon';\nimport Body from '../../body';\nimport Button from '../../button';\nimport { Breakpoint, Typography } from '../../common';\nimport AvatarView, { AvatarViewProps } from '../../avatarView';\nimport Image from '../../image';\nimport { ButtonProps } from '../../button/Button.types';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\nimport { BadgeAssetsProps } from '../../badge';\nimport { GiftBox } from '@transferwise/icons';\nimport { useScreenSize } from '../../common/hooks/useScreenSize';\n\nexport type ActionPromptProps = {\n title: ReactNode;\n description?: ReactNode;\n /** @default {} */\n media?: {\n imgSrc?: string;\n avatar?: Pick<AvatarViewProps, 'imgSrc' | 'profileName' | 'profileType'> & {\n asset?: AvatarViewProps['children'];\n badge?: Pick<BadgeAssetsProps, 'flagCode'>;\n };\n 'aria-label'?: string;\n 'aria-hidden'?: boolean;\n };\n action: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n 'aria-label'?: AriaAttributes['aria-label'];\n} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid' | 'onDismiss'> & {\n /**\n * The sentiment determines the colour scheme\n * @default 'neutral'\n */\n sentiment?: PrimitivePromptProps['sentiment'];\n };\n\n/**\n * Use an action prompt for optional feedback that doesn't require immediate action, such as feature upsells, warnings, or suggestions. These prompts are typically used outside of core product flows (e.g., Launchpad, Recipient, or Transaction screens) and can be addressed at the user's convenience.\n *\n * If your message is about immediate user feedback (e.g., form submission errors, download failures, missing data warnings), use an [info prompt](https://storybook.wise.design/?path=/docs/prompts-infoprompt--docs) instead.\n *\n * Guidance can be found in the [design system](https://wise.design/components/action-prompt).\n */\nexport const ActionPrompt = ({\n sentiment = 'neutral',\n title,\n description,\n onDismiss,\n media = {},\n action,\n actionSecondary,\n id,\n className,\n 'data-testid': testId,\n 'aria-label': ariaLabel,\n}: ActionPromptProps) => {\n const isMobile = !useScreenSize(Breakpoint.MEDIUM);\n\n const mediaId = useId();\n const titleId = useId();\n const descId = useId();\n\n const ariaLabelledByIds = [\n media['aria-hidden'] ? undefined : mediaId,\n ariaLabel ? undefined : titleId,\n ]\n .filter(Boolean)\n .join(' ');\n\n const renderMedia = () => {\n if (media?.imgSrc) {\n return (\n <Image\n id={mediaId}\n src={media.imgSrc}\n className=\"wds-action-prompt--media-image\"\n alt={media['aria-label'] ?? ''}\n />\n );\n }\n if (media?.avatar) {\n const badge = media.avatar.badge\n ? media.avatar.badge\n : sentiment === 'proposition'\n ? {}\n : { status: sentiment };\n return (\n <AvatarView\n {...media.avatar}\n badge={badge}\n aria-label={media['aria-label']}\n aria-hidden={media['aria-hidden']}\n id={mediaId}\n size={48}\n >\n {media.avatar.asset}\n </AvatarView>\n );\n }\n return sentiment === 'proposition' ? (\n <AvatarView\n id={mediaId}\n size={48}\n aria-label={media['aria-label']}\n aria-hidden={media['aria-hidden']}\n >\n <GiftBox />\n </AvatarView>\n ) : (\n <StatusIcon\n id={mediaId}\n size={48}\n sentiment={sentiment}\n iconLabel={media['aria-hidden'] ? null : media['aria-label']}\n />\n );\n };\n\n return (\n <PrimitivePrompt\n id={id}\n sentiment={sentiment}\n data-testid={testId}\n className={clsx(\n 'wds-action-prompt',\n { 'wds-action-prompt--with-two-actions': !!actionSecondary },\n className,\n )}\n media={renderMedia()}\n actions={\n <>\n {actionSecondary && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"secondary\"\n href={actionSecondary.href}\n block={isMobile}\n onClick={actionSecondary?.onClick}\n >\n {actionSecondary.label}\n </Button>\n )}\n {/* @ts-expect-error onClick type mismatch */}\n <Button\n v2\n size=\"md\"\n priority=\"primary\"\n href={action.href}\n block={isMobile}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n </>\n }\n role=\"region\"\n onDismiss={onDismiss}\n {...(ariaLabel\n ? { 'aria-label': ariaLabel }\n : {\n 'aria-labelledby': ariaLabelledByIds,\n 'aria-describedby': descId,\n })}\n >\n <div className={clsx('d-flex', 'flex-column', 'justify-content-center')}>\n <Body id={titleId} type={Typography.BODY_LARGE_BOLD} className=\"wds-action-prompt__content\">\n {title}\n </Body>\n {description && (\n <Body id={descId} className=\"wds-action-prompt__content\">\n {description}\n </Body>\n )}\n </div>\n </PrimitivePrompt>\n );\n};\n\nexport default ActionPrompt;\n"],"names":["ActionPrompt","sentiment","title","description","onDismiss","media","action","actionSecondary","id","className","testId","ariaLabel","isMobile","useScreenSize","Breakpoint","MEDIUM","mediaId","useId","titleId","descId","ariaLabelledByIds","undefined","filter","Boolean","join","renderMedia","imgSrc","_jsx","Image","src","alt","avatar","badge","status","AvatarView","size","children","asset","GiftBox","StatusIcon","iconLabel","PrimitivePrompt","clsx","actions","_jsxs","_Fragment","Button","v2","priority","href","block","onClick","label","role","Body","type","Typography","BODY_LARGE_BOLD"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDO,MAAMA,YAAY,GAAGA,CAAC;AAC3BC,EAAAA,SAAS,GAAG,SAAS;EACrBC,KAAK;EACLC,WAAW;EACXC,SAAS;EACTC,KAAK,GAAG,EAAE;EACVC,MAAM;EACNC,eAAe;EACfC,EAAE;EACFC,SAAS;AACT,EAAA,aAAa,EAAEC,MAAM;AACrB,EAAA,YAAY,EAAEC;AAAS,CACL,KAAI;EACtB,MAAMC,QAAQ,GAAG,CAACC,aAAa,CAACC,UAAU,CAACC,MAAM,CAAC;AAElD,EAAA,MAAMC,OAAO,GAAGC,KAAK,EAAE;AACvB,EAAA,MAAMC,OAAO,GAAGD,KAAK,EAAE;AACvB,EAAA,MAAME,MAAM,GAAGF,KA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M,CAAC2C,IAAK;AAClBC,QAAAA,KAAK,EAAEtC,QAAS;QAChBuC,OAAO,EAAE7C,MAAM,CAAC6C,OAAQ;QAAAf,QAAA,EAEvB9B,MAAM,CAAC8C;AAAK,OACP,CACV;AAAA,KAAA,CACD;AACDC,IAAAA,IAAI,EAAC,QAAQ;AACbjD,IAAAA,SAAS,EAAEA,SAAU;AAAA,IAAA,IAChBO,SAAS,GACV;AAAE,MAAA,YAAY,EAAEA;AAAS,KAAE,GAC3B;AACE,MAAA,iBAAiB,EAAES,iBAAiB;AACpC,MAAA,kBAAkB,EAAED;KACrB,CAAA;AAAAiB,IAAAA,QAAA,eAELQ,IAAA,CAAA,KAAA,EAAA;MAAKnC,SAAS,EAAEiC,IAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,wBAAwB,CAAE;MAAAN,QAAA,EAAA,cACtET,GAAA,CAAC2B,IAAI,EAAA;AAAC9C,QAAAA,EAAE,EAAEU,OAAQ;QAACqC,IAAI,EAAEC,UAAU,CAACC,eAAgB;AAAChD,QAAAA,SAAS,EAAC,4BAA4B;AAAA2B,QAAAA,QAAA,EACxFlC;AAAK,OACF,CACN,EAACC,WAAW,iBACVwB,GAAA,CAAC2B,IAAI,EAAA;AAAC9C,QAAAA,EAAE,EAAEW,MAAO;AAACV,QAAAA,SAAS,EAAC,4BAA4B;AAAA2B,QAAAA,QAAA,EACrDjC;AAAW,OACR,CACP;KACE;AACP,GAAiB,CAAC;AAEtB;;;;"}
1
+ {"version":3,"file":"ActionPrompt.mjs","sources":["../../../src/prompt/ActionPrompt/ActionPrompt.tsx"],"sourcesContent":["import { AriaAttributes, ReactNode, useId } from 'react';\nimport { clsx } from 'clsx';\n\nimport Body from '../../body';\nimport Button from '../../button';\nimport { Breakpoint, Typography } from '../../common';\nimport { ButtonProps } from '../../button/Button.types';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\nimport { useScreenSize } from '../../common/hooks/useScreenSize';\nimport { renderPromptMedia, PromptMedia } from '../helpers/promptMedia';\n\nexport type ActionPromptProps = {\n title: ReactNode;\n description?: ReactNode;\n /** @default {} */\n media?: PromptMedia;\n action: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n 'aria-label'?: AriaAttributes['aria-label'];\n} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid' | 'onDismiss'> & {\n /**\n * The sentiment determines the colour scheme\n * @default 'neutral'\n */\n sentiment?: PrimitivePromptProps['sentiment'];\n };\n\n/**\n * Use an action prompt for optional feedback that doesn't require immediate action, such as feature upsells, warnings, or suggestions. These prompts are typically used outside of core product flows (e.g., Launchpad, Recipient, or Transaction screens) and can be addressed at the user's convenience.\n *\n * If your message is about immediate user feedback (e.g., form submission errors, download failures, missing data warnings), use an [info prompt](https://storybook.wise.design/?path=/docs/prompts-infoprompt--docs) instead.\n *\n * Guidance can be found in the [design system](https://wise.design/components/action-prompt).\n */\nexport const ActionPrompt = ({\n sentiment = 'neutral',\n title,\n description,\n onDismiss,\n media = {},\n action,\n actionSecondary,\n id,\n className,\n 'data-testid': testId,\n 'aria-label': ariaLabel,\n}: ActionPromptProps) => {\n const isMobile = !useScreenSize(Breakpoint.MEDIUM);\n\n const mediaId = useId();\n const titleId = useId();\n const descId = useId();\n\n const ariaLabelledByIds = [\n media['aria-hidden'] ? undefined : mediaId,\n ariaLabel ? undefined : titleId,\n ]\n .filter(Boolean)\n .join(' ');\n\n const renderMedia = () =>\n renderPromptMedia({\n media,\n sentiment,\n mediaId,\n imgClassName: 'wds-action-prompt--media-image',\n });\n\n return (\n <PrimitivePrompt\n id={id}\n sentiment={sentiment}\n data-testid={testId}\n className={clsx(\n 'wds-action-prompt',\n { 'wds-action-prompt--with-two-actions': !!actionSecondary },\n className,\n )}\n media={renderMedia()}\n actions={\n <>\n {actionSecondary && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"secondary\"\n href={actionSecondary.href}\n block={isMobile}\n onClick={actionSecondary?.onClick}\n >\n {actionSecondary.label}\n </Button>\n )}\n {/* @ts-expect-error onClick type mismatch */}\n <Button\n v2\n size=\"md\"\n priority=\"primary\"\n href={action.href}\n block={isMobile}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n </>\n }\n role=\"region\"\n onDismiss={onDismiss}\n {...(ariaLabel\n ? { 'aria-label': ariaLabel }\n : {\n 'aria-labelledby': ariaLabelledByIds,\n 'aria-describedby': descId,\n })}\n >\n <div className={clsx('d-flex', 'flex-column', 'justify-content-center')}>\n <Body id={titleId} type={Typography.BODY_LARGE_BOLD} className=\"wds-action-prompt__content\">\n {title}\n </Body>\n {description && (\n <Body id={descId} className=\"wds-action-prompt__content\">\n {description}\n </Body>\n )}\n </div>\n </PrimitivePrompt>\n );\n};\n\nexport default ActionPrompt;\n"],"names":["ActionPrompt","sentiment","title","description","onDismiss","media","action","actionSecondary","id","className","testId","ariaLabel","isMobile","useScreenSize","Breakpoint","MEDIUM","mediaId","useId","titleId","descId","ariaLabelledByIds","undefined","filter","Boolean","join","renderMedia","renderPromptMedia","imgClassName","_jsx","PrimitivePrompt","clsx","actions","_jsxs","_Fragment","children","Button","v2","size","priority","href","block","onClick","label","role","Body","type","Typography","BODY_LARGE_BOLD"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCO,MAAMA,YAAY,GAAGA,CAAC;AAC3BC,EAAAA,SAAS,GAAG,SAAS;EACrBC,KAAK;EACLC,WAAW;EACXC,SAAS;EACTC,KAAK,GAAG,EAAE;EACVC,MAAM;EACNC,eAAe;EACfC,EAAE;EACFC,SAAS;AACT,EAAA,aAAa,EAAEC,MAAM;AACrB,EAAA,YAAY,EAAEC;AAAS,CACL,KAAI;EACtB,MAAMC,QAAQ,GAAG,CAACC,aAAa,CAACC,UAAU,CAACC,MAAM,CAAC;AAElD,EAAA,MAAMC,OAAO,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