@transferwise/components 46.116.1 → 46.117.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main.css +145 -156
- package/build/prompt/InlinePrompt/InlinePrompt.js +14 -8
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +15 -9
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/sentimentSurface/SentimentSurface.js +6 -5
- package/build/sentimentSurface/SentimentSurface.js.map +1 -1
- package/build/sentimentSurface/SentimentSurface.mjs +6 -5
- package/build/sentimentSurface/SentimentSurface.mjs.map +1 -1
- package/build/styles/button/Button.css +22 -22
- package/build/styles/button/Button.vars.css +21 -21
- package/build/styles/iconButton/IconButton.css +8 -8
- package/build/styles/link/Link.css +1 -0
- package/build/styles/main.css +145 -156
- package/build/styles/prompt/InlinePrompt/InlinePrompt.css +26 -105
- package/build/styles/sentimentSurface/SentimentSurface.css +88 -21
- package/build/types/button/_stories/helpers.d.ts +11 -0
- package/build/types/button/_stories/helpers.d.ts.map +1 -0
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts +19 -3
- package/build/types/prompt/InlinePrompt/InlinePrompt.d.ts.map +1 -1
- package/build/types/sentimentSurface/SentimentSurface.d.ts +5 -4
- package/build/types/sentimentSurface/SentimentSurface.d.ts.map +1 -1
- package/build/types/sentimentSurface/SentimentSurface.types.d.ts +4 -16
- package/build/types/sentimentSurface/SentimentSurface.types.d.ts.map +1 -1
- package/build/types/test-utils/story-config.d.ts +25 -1
- package/build/types/test-utils/story-config.d.ts.map +1 -1
- package/package.json +13 -12
- package/src/button/Button.css +22 -22
- package/src/button/Button.less +1 -1
- package/src/button/Button.vars.css +21 -21
- package/src/button/Button.vars.less +63 -23
- package/src/button/{Button.accessibility.docs.mdx → _stories/Button.accessibility.docs.mdx} +1 -1
- package/src/button/_stories/Button.brightGreen.tests.story.tsx +31 -0
- package/src/button/_stories/Button.dark.tests.story.tsx +25 -0
- package/src/button/_stories/Button.default.tests.story.tsx +25 -0
- package/src/button/_stories/Button.forestGreen.tests.story.tsx +28 -0
- package/src/button/{Button.story.tsx → _stories/Button.story.tsx} +78 -113
- package/src/button/_stories/Button.tests.story.tsx +139 -0
- package/src/button/_stories/helpers.tsx +118 -0
- package/src/iconButton/IconButton.css +8 -8
- package/src/iconButton/IconButton.less +35 -4
- package/src/iconButton/IconButton.story.tsx +72 -3
- package/src/link/Link.css +1 -0
- package/src/link/Link.less +1 -0
- package/src/link/Link.story.tsx +28 -0
- package/src/main.css +145 -156
- package/src/prompt/InlinePrompt/InlinePrompt.css +26 -105
- package/src/prompt/InlinePrompt/InlinePrompt.less +31 -119
- package/src/prompt/InlinePrompt/InlinePrompt.spec.tsx +87 -29
- package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +223 -31
- package/src/prompt/InlinePrompt/InlinePrompt.tsx +42 -11
- package/src/sentimentSurface/SentimentSurface.css +88 -21
- package/src/sentimentSurface/SentimentSurface.docs.mdx +32 -495
- package/src/sentimentSurface/SentimentSurface.less +151 -114
- package/src/sentimentSurface/SentimentSurface.spec.tsx +31 -11
- package/src/sentimentSurface/SentimentSurface.story.tsx +323 -108
- package/src/sentimentSurface/SentimentSurface.tests.story.tsx +90 -40
- package/src/sentimentSurface/SentimentSurface.tsx +16 -9
- package/src/sentimentSurface/SentimentSurface.types.ts +5 -20
- package/src/test-utils/story-config.ts +5 -1
- package/build/sentimentSurface/classMap.js +0 -17
- package/build/sentimentSurface/classMap.js.map +0 -1
- package/build/sentimentSurface/classMap.mjs +0 -14
- package/build/sentimentSurface/classMap.mjs.map +0 -1
- package/build/types/sentimentSurface/classMap.d.ts +0 -4
- package/build/types/sentimentSurface/classMap.d.ts.map +0 -1
- package/src/button/Button.tests.story.tsx +0 -27
- package/src/sentimentSurface/classMap.ts +0 -15
package/build/main.css
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
.wds-sentiment-surface {
|
|
2
|
+
--ring-outline-color: var(--color-sentiment-content-primary, var(--color-content-primary));
|
|
3
|
+
}
|
|
4
|
+
.wds-sentiment-surface--hasBaseStyles {
|
|
5
|
+
background-color: var(--color-sentiment-background-surface);
|
|
6
|
+
color: var(--color-sentiment-content-primary);
|
|
7
|
+
}
|
|
1
8
|
.np-theme-personal .wds-sentiment-surface-negative-base,
|
|
2
|
-
.np-theme-
|
|
9
|
+
.np-theme-business .wds-sentiment-surface-negative-base,
|
|
10
|
+
.np-theme-platform .wds-sentiment-surface-negative-base,
|
|
11
|
+
.np-theme-personal--bright-green .wds-sentiment-surface-negative-base,
|
|
12
|
+
.np-theme-business--bright-green .wds-sentiment-surface-negative-base {
|
|
3
13
|
--color-sentiment-content-primary: #CB272F;
|
|
4
14
|
--color-sentiment-content-primary-hover: #B8232B;
|
|
5
15
|
--color-sentiment-content-primary-active: #A72027;
|
|
@@ -20,7 +30,10 @@
|
|
|
20
30
|
--color-sentiment-background-surface-active: #F8D8D8;
|
|
21
31
|
}
|
|
22
32
|
.np-theme-personal .wds-sentiment-surface-negative-elevated,
|
|
23
|
-
.np-theme-
|
|
33
|
+
.np-theme-business .wds-sentiment-surface-negative-elevated,
|
|
34
|
+
.np-theme-platform .wds-sentiment-surface-negative-elevated,
|
|
35
|
+
.np-theme-personal--bright-green .wds-sentiment-surface-negative-elevated,
|
|
36
|
+
.np-theme-business--bright-green .wds-sentiment-surface-negative-elevated {
|
|
24
37
|
--color-sentiment-content-primary: #FFFFFF;
|
|
25
38
|
--color-sentiment-content-primary-hover: #F5CCCC;
|
|
26
39
|
--color-sentiment-content-primary-active: #F1B7B7;
|
|
@@ -32,7 +45,7 @@
|
|
|
32
45
|
--color-sentiment-interactive-secondary-active: #A72027;
|
|
33
46
|
--color-sentiment-interactive-secondary-neutral: #9B141B;
|
|
34
47
|
--color-sentiment-interactive-secondary-neutral-hover: #831116;
|
|
35
|
-
--color-sentiment-interactive-secondary-neutral-active: #
|
|
48
|
+
--color-sentiment-interactive-secondary-neutral-active: #6D0e13;
|
|
36
49
|
--color-sentiment-interactive-control: #CB272F;
|
|
37
50
|
--color-sentiment-interactive-control-hover: #B8232B;
|
|
38
51
|
--color-sentiment-interactive-control-active: #A72027;
|
|
@@ -41,7 +54,10 @@
|
|
|
41
54
|
--color-sentiment-background-surface-active: #A72027;
|
|
42
55
|
}
|
|
43
56
|
.np-theme-personal--dark .wds-sentiment-surface-negative-base,
|
|
44
|
-
.np-theme-
|
|
57
|
+
.np-theme-business--dark .wds-sentiment-surface-negative-base,
|
|
58
|
+
.np-theme-personal--forest-green .wds-sentiment-surface-negative-base,
|
|
59
|
+
.np-theme-business--forest-green .wds-sentiment-surface-negative-base,
|
|
60
|
+
.np-theme-platform--forest-green .wds-sentiment-surface-negative-base {
|
|
45
61
|
--color-sentiment-content-primary: #FFA8AD;
|
|
46
62
|
--color-sentiment-content-primary-hover: #FFBDC0;
|
|
47
63
|
--color-sentiment-content-primary-active: #FFD1D3;
|
|
@@ -62,7 +78,10 @@
|
|
|
62
78
|
--color-sentiment-background-surface-active: #761418;
|
|
63
79
|
}
|
|
64
80
|
.np-theme-personal--dark .wds-sentiment-surface-negative-elevated,
|
|
65
|
-
.np-theme-
|
|
81
|
+
.np-theme-business--dark .wds-sentiment-surface-negative-elevated,
|
|
82
|
+
.np-theme-personal--forest-green .wds-sentiment-surface-negative-elevated,
|
|
83
|
+
.np-theme-business--forest-green .wds-sentiment-surface-negative-elevated,
|
|
84
|
+
.np-theme-platform--forest-green .wds-sentiment-surface-negative-elevated {
|
|
66
85
|
--color-sentiment-content-primary: #410B0D;
|
|
67
86
|
--color-sentiment-content-primary-hover: #641115;
|
|
68
87
|
--color-sentiment-content-primary-active: #761418;
|
|
@@ -83,7 +102,10 @@
|
|
|
83
102
|
--color-sentiment-background-surface-active: #FFD1D3;
|
|
84
103
|
}
|
|
85
104
|
.np-theme-personal .wds-sentiment-surface-warning-base,
|
|
86
|
-
.np-theme-
|
|
105
|
+
.np-theme-business .wds-sentiment-surface-warning-base,
|
|
106
|
+
.np-theme-platform .wds-sentiment-surface-warning-base,
|
|
107
|
+
.np-theme-personal--bright-green .wds-sentiment-surface-warning-base,
|
|
108
|
+
.np-theme-business--bright-green .wds-sentiment-surface-warning-base {
|
|
87
109
|
--color-sentiment-content-primary: #4A3B1C;
|
|
88
110
|
--color-sentiment-content-primary-hover: #302612;
|
|
89
111
|
--color-sentiment-content-primary-active: #2C2311;
|
|
@@ -104,7 +126,10 @@
|
|
|
104
126
|
--color-sentiment-background-surface-active: #FFE98F;
|
|
105
127
|
}
|
|
106
128
|
.np-theme-personal .wds-sentiment-surface-warning-elevated,
|
|
107
|
-
.np-theme-
|
|
129
|
+
.np-theme-business .wds-sentiment-surface-warning-elevated,
|
|
130
|
+
.np-theme-platform .wds-sentiment-surface-warning-elevated,
|
|
131
|
+
.np-theme-personal--bright-green .wds-sentiment-surface-warning-elevated,
|
|
132
|
+
.np-theme-business--bright-green .wds-sentiment-surface-warning-elevated {
|
|
108
133
|
--color-sentiment-content-primary: #4A3B1C;
|
|
109
134
|
--color-sentiment-content-primary-hover: #302612;
|
|
110
135
|
--color-sentiment-content-primary-active: #2C2311;
|
|
@@ -125,7 +150,10 @@
|
|
|
125
150
|
--color-sentiment-background-surface-active: #FFBB00;
|
|
126
151
|
}
|
|
127
152
|
.np-theme-personal--dark .wds-sentiment-surface-warning-base,
|
|
128
|
-
.np-theme-
|
|
153
|
+
.np-theme-business--dark .wds-sentiment-surface-warning-base,
|
|
154
|
+
.np-theme-personal--forest-green .wds-sentiment-surface-warning-base,
|
|
155
|
+
.np-theme-business--forest-green .wds-sentiment-surface-warning-base,
|
|
156
|
+
.np-theme-platform--forest-green .wds-sentiment-surface-warning-base {
|
|
129
157
|
--color-sentiment-content-primary: #FADC65;
|
|
130
158
|
--color-sentiment-content-primary-hover: #F9D648;
|
|
131
159
|
--color-sentiment-content-primary-active: #F8CD20;
|
|
@@ -146,7 +174,10 @@
|
|
|
146
174
|
--color-sentiment-background-surface-active: #665D3D;
|
|
147
175
|
}
|
|
148
176
|
.np-theme-personal--dark .wds-sentiment-surface-warning-elevated,
|
|
149
|
-
.np-theme-
|
|
177
|
+
.np-theme-business--dark .wds-sentiment-surface-warning-elevated,
|
|
178
|
+
.np-theme-personal--forest-green .wds-sentiment-surface-warning-elevated,
|
|
179
|
+
.np-theme-business--forest-green .wds-sentiment-surface-warning-elevated,
|
|
180
|
+
.np-theme-platform--forest-green .wds-sentiment-surface-warning-elevated {
|
|
150
181
|
--color-sentiment-content-primary: #3A3523;
|
|
151
182
|
--color-sentiment-content-primary-hover: #504930;
|
|
152
183
|
--color-sentiment-content-primary-active: #665D3D;
|
|
@@ -167,7 +198,10 @@
|
|
|
167
198
|
--color-sentiment-background-surface-active: #F8CD20;
|
|
168
199
|
}
|
|
169
200
|
.np-theme-personal .wds-sentiment-surface-success-base,
|
|
170
|
-
.np-theme-
|
|
201
|
+
.np-theme-business .wds-sentiment-surface-success-base,
|
|
202
|
+
.np-theme-platform .wds-sentiment-surface-success-base,
|
|
203
|
+
.np-theme-personal--bright-green .wds-sentiment-surface-success-base,
|
|
204
|
+
.np-theme-business--bright-green .wds-sentiment-surface-success-base {
|
|
171
205
|
--color-sentiment-content-primary: #054D28;
|
|
172
206
|
--color-sentiment-content-primary-hover: #043A1E;
|
|
173
207
|
--color-sentiment-content-primary-active: #022614;
|
|
@@ -188,7 +222,10 @@
|
|
|
188
222
|
--color-sentiment-background-surface-active: #C5EDAB;
|
|
189
223
|
}
|
|
190
224
|
.np-theme-personal .wds-sentiment-surface-success-elevated,
|
|
191
|
-
.np-theme-
|
|
225
|
+
.np-theme-business .wds-sentiment-surface-success-elevated,
|
|
226
|
+
.np-theme-platform .wds-sentiment-surface-success-elevated,
|
|
227
|
+
.np-theme-personal--bright-green .wds-sentiment-surface-success-elevated,
|
|
228
|
+
.np-theme-business--bright-green .wds-sentiment-surface-success-elevated {
|
|
192
229
|
--color-sentiment-content-primary: #E2F6D5;
|
|
193
230
|
--color-sentiment-content-primary-hover: #D3F2C0;
|
|
194
231
|
--color-sentiment-content-primary-active: #C5EDAB;
|
|
@@ -209,7 +246,10 @@
|
|
|
209
246
|
--color-sentiment-background-surface-active: #022614;
|
|
210
247
|
}
|
|
211
248
|
.np-theme-personal--dark .wds-sentiment-surface-success-base,
|
|
212
|
-
.np-theme-
|
|
249
|
+
.np-theme-business--dark .wds-sentiment-surface-success-base,
|
|
250
|
+
.np-theme-personal--forest-green .wds-sentiment-surface-success-base,
|
|
251
|
+
.np-theme-business--forest-green .wds-sentiment-surface-success-base,
|
|
252
|
+
.np-theme-platform--forest-green .wds-sentiment-surface-success-base {
|
|
213
253
|
--color-sentiment-content-primary: #BAE5A0;
|
|
214
254
|
--color-sentiment-content-primary-hover: #C8EAB3;
|
|
215
255
|
--color-sentiment-content-primary-active: #D6F0C7;
|
|
@@ -230,7 +270,10 @@
|
|
|
230
270
|
--color-sentiment-background-surface-active: #3E4A36;
|
|
231
271
|
}
|
|
232
272
|
.np-theme-personal--dark .wds-sentiment-surface-success-elevated,
|
|
233
|
-
.np-theme-
|
|
273
|
+
.np-theme-business--dark .wds-sentiment-surface-success-elevated,
|
|
274
|
+
.np-theme-personal--forest-green .wds-sentiment-surface-success-elevated,
|
|
275
|
+
.np-theme-business--forest-green .wds-sentiment-surface-success-elevated,
|
|
276
|
+
.np-theme-platform--forest-green .wds-sentiment-surface-success-elevated {
|
|
234
277
|
--color-sentiment-content-primary: #252C20;
|
|
235
278
|
--color-sentiment-content-primary-hover: #323B2B;
|
|
236
279
|
--color-sentiment-content-primary-active: #3E4A36;
|
|
@@ -251,7 +294,10 @@
|
|
|
251
294
|
--color-sentiment-background-surface-active: #D6F0C7;
|
|
252
295
|
}
|
|
253
296
|
.np-theme-personal .wds-sentiment-surface-neutral-base,
|
|
254
|
-
.np-theme-
|
|
297
|
+
.np-theme-business .wds-sentiment-surface-neutral-base,
|
|
298
|
+
.np-theme-platform .wds-sentiment-surface-neutral-base,
|
|
299
|
+
.np-theme-personal--bright-green .wds-sentiment-surface-neutral-base,
|
|
300
|
+
.np-theme-business--bright-green .wds-sentiment-surface-neutral-base {
|
|
255
301
|
--color-sentiment-content-primary: #454745;
|
|
256
302
|
--color-sentiment-content-primary-hover: #353635;
|
|
257
303
|
--color-sentiment-content-primary-active: #232423;
|
|
@@ -272,7 +318,10 @@
|
|
|
272
318
|
--color-sentiment-background-surface-active: #DFDED5;
|
|
273
319
|
}
|
|
274
320
|
.np-theme-personal .wds-sentiment-surface-neutral-elevated,
|
|
275
|
-
.np-theme-
|
|
321
|
+
.np-theme-business .wds-sentiment-surface-neutral-elevated,
|
|
322
|
+
.np-theme-platform .wds-sentiment-surface-neutral-elevated,
|
|
323
|
+
.np-theme-personal--bright-green .wds-sentiment-surface-neutral-elevated,
|
|
324
|
+
.np-theme-business--bright-green .wds-sentiment-surface-neutral-elevated {
|
|
276
325
|
--color-sentiment-content-primary: #F1F1ED;
|
|
277
326
|
--color-sentiment-content-primary-hover: #E7E7E1;
|
|
278
327
|
--color-sentiment-content-primary-active: #DFDED5;
|
|
@@ -293,7 +342,10 @@
|
|
|
293
342
|
--color-sentiment-background-surface-active: #232423;
|
|
294
343
|
}
|
|
295
344
|
.np-theme-personal--dark .wds-sentiment-surface-neutral-base,
|
|
296
|
-
.np-theme-
|
|
345
|
+
.np-theme-business--dark .wds-sentiment-surface-neutral-base,
|
|
346
|
+
.np-theme-personal--forest-green .wds-sentiment-surface-neutral-base,
|
|
347
|
+
.np-theme-business--forest-green .wds-sentiment-surface-neutral-base,
|
|
348
|
+
.np-theme-platform--forest-green .wds-sentiment-surface-neutral-base {
|
|
297
349
|
--color-sentiment-content-primary: #F1F1ED;
|
|
298
350
|
--color-sentiment-content-primary-hover: #E7E7E1;
|
|
299
351
|
--color-sentiment-content-primary-active: #DFDED5;
|
|
@@ -314,7 +366,10 @@
|
|
|
314
366
|
--color-sentiment-background-surface-active: #595B58;
|
|
315
367
|
}
|
|
316
368
|
.np-theme-personal--dark .wds-sentiment-surface-neutral-elevated,
|
|
317
|
-
.np-theme-
|
|
369
|
+
.np-theme-business--dark .wds-sentiment-surface-neutral-elevated,
|
|
370
|
+
.np-theme-personal--forest-green .wds-sentiment-surface-neutral-elevated,
|
|
371
|
+
.np-theme-business--forest-green .wds-sentiment-surface-neutral-elevated,
|
|
372
|
+
.np-theme-platform--forest-green .wds-sentiment-surface-neutral-elevated {
|
|
318
373
|
--color-sentiment-content-primary: #2A2C29;
|
|
319
374
|
--color-sentiment-content-primary-hover: #414441;
|
|
320
375
|
--color-sentiment-content-primary-active: #595B58;
|
|
@@ -335,7 +390,10 @@
|
|
|
335
390
|
--color-sentiment-background-surface-active: #DFDED5;
|
|
336
391
|
}
|
|
337
392
|
.np-theme-personal .wds-sentiment-surface-proposition-base,
|
|
338
|
-
.np-theme-
|
|
393
|
+
.np-theme-business .wds-sentiment-surface-proposition-base,
|
|
394
|
+
.np-theme-platform .wds-sentiment-surface-proposition-base,
|
|
395
|
+
.np-theme-personal--bright-green .wds-sentiment-surface-proposition-base,
|
|
396
|
+
.np-theme-business--bright-green .wds-sentiment-surface-proposition-base {
|
|
339
397
|
--color-sentiment-content-primary: #0E0F0C;
|
|
340
398
|
--color-sentiment-content-primary-hover: #0A2826;
|
|
341
399
|
--color-sentiment-content-primary-active: #074140;
|
|
@@ -356,7 +414,10 @@
|
|
|
356
414
|
--color-sentiment-background-surface-active: #B6ECEC;
|
|
357
415
|
}
|
|
358
416
|
.np-theme-personal .wds-sentiment-surface-proposition-elevated,
|
|
359
|
-
.np-theme-
|
|
417
|
+
.np-theme-business .wds-sentiment-surface-proposition-elevated,
|
|
418
|
+
.np-theme-platform .wds-sentiment-surface-proposition-elevated,
|
|
419
|
+
.np-theme-personal--bright-green .wds-sentiment-surface-proposition-elevated,
|
|
420
|
+
.np-theme-business--bright-green .wds-sentiment-surface-proposition-elevated {
|
|
360
421
|
--color-sentiment-content-primary: #FFFFFF;
|
|
361
422
|
--color-sentiment-content-primary-hover: #EAF9F9;
|
|
362
423
|
--color-sentiment-content-primary-active: #D5F4F4;
|
|
@@ -377,7 +438,10 @@
|
|
|
377
438
|
--color-sentiment-background-surface-active: #022626;
|
|
378
439
|
}
|
|
379
440
|
.np-theme-personal--dark .wds-sentiment-surface-proposition-base,
|
|
380
|
-
.np-theme-
|
|
441
|
+
.np-theme-business--dark .wds-sentiment-surface-proposition-base,
|
|
442
|
+
.np-theme-personal--forest-green .wds-sentiment-surface-proposition-base,
|
|
443
|
+
.np-theme-business--forest-green .wds-sentiment-surface-proposition-base,
|
|
444
|
+
.np-theme-platform--forest-green .wds-sentiment-surface-proposition-base {
|
|
381
445
|
--color-sentiment-content-primary: #FFFFFF;
|
|
382
446
|
--color-sentiment-content-primary-hover: #EAF9F9;
|
|
383
447
|
--color-sentiment-content-primary-active: #D5F4F4;
|
|
@@ -398,7 +462,10 @@
|
|
|
398
462
|
--color-sentiment-background-surface-active: #176460;
|
|
399
463
|
}
|
|
400
464
|
.np-theme-personal--dark .wds-sentiment-surface-proposition-elevated,
|
|
401
|
-
.np-theme-
|
|
465
|
+
.np-theme-business--dark .wds-sentiment-surface-proposition-elevated,
|
|
466
|
+
.np-theme-personal--forest-green .wds-sentiment-surface-proposition-elevated,
|
|
467
|
+
.np-theme-business--forest-green .wds-sentiment-surface-proposition-elevated,
|
|
468
|
+
.np-theme-platform--forest-green .wds-sentiment-surface-proposition-elevated {
|
|
402
469
|
--color-sentiment-content-primary: #0E0F0C;
|
|
403
470
|
--color-sentiment-content-primary-hover: #0A2826;
|
|
404
471
|
--color-sentiment-content-primary-active: #074140;
|
|
@@ -874,18 +941,35 @@
|
|
|
874
941
|
position: relative;
|
|
875
942
|
z-index: 1;
|
|
876
943
|
}
|
|
944
|
+
.wds-inline-prompt:has(a):hover,
|
|
945
|
+
.wds-inline-prompt:has(button):hover {
|
|
946
|
+
background-color: var(--color-sentiment-background-surface-hover);
|
|
947
|
+
}
|
|
948
|
+
.wds-inline-prompt:has(a):active,
|
|
949
|
+
.wds-inline-prompt:has(button):active {
|
|
950
|
+
background-color: var(--color-sentiment-background-surface-active);
|
|
951
|
+
}
|
|
877
952
|
.wds-inline-prompt--muted {
|
|
878
953
|
opacity: 0.93;
|
|
879
954
|
filter: grayscale(1);
|
|
880
955
|
}
|
|
881
956
|
.wds-inline-prompt a,
|
|
882
957
|
.wds-inline-prompt button {
|
|
958
|
+
color: var(--color-sentiment-content-primary);
|
|
883
959
|
text-underline-offset: calc(4px / 2);
|
|
884
960
|
text-underline-offset: calc(var(--size-4) / 2);
|
|
885
961
|
}
|
|
962
|
+
.wds-inline-prompt a:hover,
|
|
963
|
+
.wds-inline-prompt button:hover {
|
|
964
|
+
color: var(--color-sentiment-content-primary-hover);
|
|
965
|
+
}
|
|
966
|
+
.wds-inline-prompt a:active,
|
|
967
|
+
.wds-inline-prompt button:active {
|
|
968
|
+
color: var(--color-sentiment-content-primary-active);
|
|
969
|
+
}
|
|
886
970
|
.wds-inline-prompt a:first-of-type:before,
|
|
887
971
|
.wds-inline-prompt button:first-of-type:before {
|
|
888
|
-
content:
|
|
972
|
+
content: "";
|
|
889
973
|
position: absolute;
|
|
890
974
|
inset: 0;
|
|
891
975
|
}
|
|
@@ -899,112 +983,16 @@
|
|
|
899
983
|
}
|
|
900
984
|
.wds-inline-prompt__media-wrapper .tw-icon-tags,
|
|
901
985
|
.wds-inline-prompt__media-wrapper .tw-icon-confetti {
|
|
902
|
-
color: var(--color-sentiment-
|
|
903
|
-
}
|
|
904
|
-
.wds-inline-prompt--negative {
|
|
905
|
-
background-color: var(--color-sentiment-negative-secondary);
|
|
906
|
-
color: var(--color-sentiment-negative-primary);
|
|
907
|
-
}
|
|
908
|
-
.wds-inline-prompt--negative a,
|
|
909
|
-
.wds-inline-prompt--negative button {
|
|
910
|
-
color: var(--color-sentiment-negative-primary);
|
|
911
|
-
}
|
|
912
|
-
.wds-inline-prompt--negative a:hover,
|
|
913
|
-
.wds-inline-prompt--negative button:hover {
|
|
914
|
-
color: var(--color-sentiment-negative-primary-hover);
|
|
915
|
-
}
|
|
916
|
-
.wds-inline-prompt--negative a:active,
|
|
917
|
-
.wds-inline-prompt--negative button:active {
|
|
918
|
-
color: var(--color-sentiment-negative-primary-active);
|
|
919
|
-
}
|
|
920
|
-
.wds-inline-prompt.wds-inline-prompt--negative:has(a, button):hover {
|
|
921
|
-
background-color: var(--color-sentiment-negative-secondary-hover);
|
|
922
|
-
}
|
|
923
|
-
.wds-inline-prompt.wds-inline-prompt--negative:has(a, button):active {
|
|
924
|
-
background-color: var(--color-sentiment-negative-secondary-active);
|
|
925
|
-
}
|
|
926
|
-
.wds-inline-prompt--positive {
|
|
927
|
-
background-color: var(--color-sentiment-positive-secondary);
|
|
928
|
-
color: var(--color-sentiment-positive-primary);
|
|
929
|
-
}
|
|
930
|
-
.wds-inline-prompt--positive a,
|
|
931
|
-
.wds-inline-prompt--positive button {
|
|
932
|
-
color: var(--color-sentiment-positive-primary);
|
|
933
|
-
}
|
|
934
|
-
.wds-inline-prompt--positive a:hover,
|
|
935
|
-
.wds-inline-prompt--positive button:hover {
|
|
936
|
-
color: var(--color-sentiment-positive-primary-hover);
|
|
986
|
+
color: var(--color-sentiment-content-primary);
|
|
937
987
|
}
|
|
938
|
-
.wds-inline-prompt
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
background-color: var(--color-sentiment-positive-secondary-hover);
|
|
944
|
-
}
|
|
945
|
-
.wds-inline-prompt.wds-inline-prompt--positive:has(a, button):active {
|
|
946
|
-
background-color: var(--color-sentiment-positive-secondary-active);
|
|
947
|
-
}
|
|
948
|
-
.wds-inline-prompt--proposition {
|
|
949
|
-
background-color: #D2F9F7;
|
|
950
|
-
color: var(--color-interactive-primary);
|
|
951
|
-
}
|
|
952
|
-
.wds-inline-prompt--proposition a,
|
|
953
|
-
.wds-inline-prompt--proposition button {
|
|
954
|
-
color: var(--color-interactive-primary);
|
|
955
|
-
}
|
|
956
|
-
.wds-inline-prompt--proposition a:hover,
|
|
957
|
-
.wds-inline-prompt--proposition button:hover {
|
|
958
|
-
color: var(--color-interactive-primary-hover);
|
|
959
|
-
}
|
|
960
|
-
.wds-inline-prompt--proposition a:active,
|
|
961
|
-
.wds-inline-prompt--proposition button:active {
|
|
962
|
-
color: var(--color-interactive-primary-active);
|
|
963
|
-
}
|
|
964
|
-
.wds-inline-prompt.wds-inline-prompt--proposition:has(a, button):hover {
|
|
965
|
-
background-color: #B2F4F3;
|
|
966
|
-
}
|
|
967
|
-
.wds-inline-prompt.wds-inline-prompt--proposition:has(a, button):active {
|
|
968
|
-
background-color: #91F0EE;
|
|
969
|
-
}
|
|
970
|
-
.wds-inline-prompt--neutral {
|
|
971
|
-
background-color: rgba(134,167,189,0.10196);
|
|
972
|
-
background-color: var(--color-background-neutral);
|
|
973
|
-
color: #37517e;
|
|
974
|
-
color: var(--color-content-primary);
|
|
975
|
-
}
|
|
976
|
-
.wds-inline-prompt--neutral a,
|
|
977
|
-
.wds-inline-prompt--neutral button {
|
|
978
|
-
color: #37517e;
|
|
979
|
-
color: var(--color-content-primary);
|
|
980
|
-
}
|
|
981
|
-
.wds-inline-prompt.wds-inline-prompt--neutral:has(a, button):hover {
|
|
982
|
-
background-color: var(--color-background-neutral-hover);
|
|
983
|
-
}
|
|
984
|
-
.wds-inline-prompt.wds-inline-prompt--neutral:has(a, button):active {
|
|
985
|
-
background-color: var(--color-background-neutral-active);
|
|
986
|
-
}
|
|
987
|
-
.wds-inline-prompt--warning {
|
|
988
|
-
background-color: var(--color-sentiment-warning-secondary);
|
|
989
|
-
color: var(--color-sentiment-warning-content);
|
|
990
|
-
}
|
|
991
|
-
.wds-inline-prompt--warning a,
|
|
992
|
-
.wds-inline-prompt--warning button {
|
|
993
|
-
color: var(--color-sentiment-warning-content);
|
|
994
|
-
}
|
|
995
|
-
.wds-inline-prompt--warning a:hover,
|
|
996
|
-
.wds-inline-prompt--warning button:hover {
|
|
997
|
-
color: var(--color-sentiment-warning-content-hover);
|
|
998
|
-
}
|
|
999
|
-
.wds-inline-prompt--warning a:active,
|
|
1000
|
-
.wds-inline-prompt--warning button:active {
|
|
1001
|
-
color: var(--color-sentiment-warning-content-active);
|
|
1002
|
-
}
|
|
1003
|
-
.wds-inline-prompt.wds-inline-prompt--warning:has(a, button):hover {
|
|
1004
|
-
background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 92%, var(--color-sentiment-warning-primary));
|
|
988
|
+
.wds-inline-prompt .wds-inline-prompt-process-indicator {
|
|
989
|
+
width: 16px;
|
|
990
|
+
width: var(--size-16);
|
|
991
|
+
height: 16px;
|
|
992
|
+
height: var(--size-16);
|
|
1005
993
|
}
|
|
1006
|
-
.wds-inline-prompt.wds-inline-prompt
|
|
1007
|
-
|
|
994
|
+
.wds-inline-prompt .wds-inline-prompt-process-indicator .process-circle {
|
|
995
|
+
stroke: currentColor;
|
|
1008
996
|
}
|
|
1009
997
|
.np-dot {
|
|
1010
998
|
--np-dot-size: 14px;
|
|
@@ -1107,17 +1095,17 @@
|
|
|
1107
1095
|
background-color: var(--color-background-neutral-active);
|
|
1108
1096
|
}
|
|
1109
1097
|
.np-icon-button-primary-default {
|
|
1110
|
-
color: var(--color-interactive-control);
|
|
1098
|
+
color: var(--color-sentiment-interactive-control, var(--color-interactive-control));
|
|
1111
1099
|
background-color: #00a2dd;
|
|
1112
|
-
background-color: var(--color-interactive-accent);
|
|
1100
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-interactive-accent));
|
|
1113
1101
|
}
|
|
1114
1102
|
.np-icon-button-primary-default:not(.disabled):not(:disabled):hover {
|
|
1115
1103
|
background-color: #008fc9;
|
|
1116
|
-
background-color: var(--color-interactive-accent-hover);
|
|
1104
|
+
background-color: var(--color-sentiment-interactive-primary-hover, var(--color-interactive-accent-hover));
|
|
1117
1105
|
}
|
|
1118
1106
|
.np-icon-button-primary-default:not(.disabled):not(:disabled):active {
|
|
1119
1107
|
background-color: #0081ba;
|
|
1120
|
-
background-color: var(--color-interactive-accent-active);
|
|
1108
|
+
background-color: var(--color-sentiment-interactive-primary-active, var(--color-interactive-accent-active));
|
|
1121
1109
|
}
|
|
1122
1110
|
.np-icon-button-primary-negative {
|
|
1123
1111
|
color: var(--color-contrast-overlay);
|
|
@@ -1145,14 +1133,14 @@
|
|
|
1145
1133
|
background-color: var(--color-background-screen-active);
|
|
1146
1134
|
}
|
|
1147
1135
|
.np-icon-button-secondary-default {
|
|
1148
|
-
color: var(--color-interactive-primary);
|
|
1149
|
-
background-color: var(--color-interactive-neutral);
|
|
1136
|
+
color: var(--color-sentiment-content-primary, var(--color-interactive-primary));
|
|
1137
|
+
background-color: var(--color-sentiment-interactive-secondary-neutral, var(--color-interactive-neutral));
|
|
1150
1138
|
}
|
|
1151
1139
|
.np-icon-button-secondary-default:not(.disabled):not(:disabled):hover {
|
|
1152
|
-
background-color: var(--color-interactive-neutral-hover);
|
|
1140
|
+
background-color: var(--color-sentiment-interactive-secondary-neutral-hover, var(--color-interactive-neutral-hover));
|
|
1153
1141
|
}
|
|
1154
1142
|
.np-icon-button-secondary-default:not(.disabled):not(:disabled):active {
|
|
1155
|
-
background-color: var(--color-interactive-neutral-active);
|
|
1143
|
+
background-color: var(--color-sentiment-interactive-secondary-neutral-active, var(--color-interactive-neutral-active));
|
|
1156
1144
|
}
|
|
1157
1145
|
.np-theme-personal--bright-green .np-icon-button-secondary-default,
|
|
1158
1146
|
.np-theme-personal--forest-green .np-icon-button-secondary-default {
|
|
@@ -1266,12 +1254,12 @@
|
|
|
1266
1254
|
pointer-events: auto;
|
|
1267
1255
|
}
|
|
1268
1256
|
.wds-Button {
|
|
1269
|
-
--Button-background: var(--color-interactive-accent);
|
|
1270
|
-
--Button-background-hover: var(--color-interactive-accent-hover);
|
|
1271
|
-
--Button-background-active: var(--color-interactive-accent-active);
|
|
1272
|
-
--Button-color: var(--color-interactive-control);
|
|
1273
|
-
--Button-color-hover: var(--color-interactive-control-hover);
|
|
1274
|
-
--Button-color-active: var(--color-interactive-control-active);
|
|
1257
|
+
--Button-background: var(--color-sentiment-interactive-primary, var(--color-interactive-accent));
|
|
1258
|
+
--Button-background-hover: var(--color-sentiment-interactive-primary-hover, var(--color-interactive-accent-hover));
|
|
1259
|
+
--Button-background-active: var(--color-sentiment-interactive-primary-active, var(--color-interactive-accent-active));
|
|
1260
|
+
--Button-color: var(--color-sentiment-interactive-control, var(--color-interactive-control));
|
|
1261
|
+
--Button-color-hover: var(--color-sentiment-interactive-control-hover, var(--color-interactive-control-hover));
|
|
1262
|
+
--Button-color-active: var(--color-sentiment-interactive-control-active, var(--color-interactive-control-active));
|
|
1275
1263
|
--Button-border-radius: var(--radius-full);
|
|
1276
1264
|
--Button-label-gap: var(--size-4);
|
|
1277
1265
|
--Button-large-padding: var(--size-12) var(--size-16);
|
|
@@ -1280,22 +1268,22 @@
|
|
|
1280
1268
|
--Button-avatar-border-color: var(--color-border-neutral);
|
|
1281
1269
|
--Button-transition-duration: 150ms;
|
|
1282
1270
|
--Button-transition-easing: ease-in-out;
|
|
1283
|
-
--Button-secondary-background: var(--color-interactive-neutral);
|
|
1284
|
-
--Button-secondary-background-hover: var(--color-interactive-neutral-hover);
|
|
1285
|
-
--Button-secondary-background-active: var(--color-interactive-neutral-active);
|
|
1286
|
-
--Button-secondary-color: var(--color-interactive-primary);
|
|
1287
|
-
--Button-secondary-color-hover: var(--color-interactive-primary-hover);
|
|
1288
|
-
--Button-secondary-color-active: var(--color-interactive-primary-active);
|
|
1289
|
-
--Button-secondary-neutral-background: var(--color-background-neutral);
|
|
1290
|
-
--Button-secondary-neutral-background-hover: var(--color-background-neutral-hover);
|
|
1291
|
-
--Button-secondary-neutral-background-active: var(--color-background-neutral-active);
|
|
1292
|
-
--Button-secondary-neutral-color: var(--color-content-primary);
|
|
1271
|
+
--Button-secondary-background: var(--color-sentiment-interactive-secondary-neutral, var(--color-interactive-neutral));
|
|
1272
|
+
--Button-secondary-background-hover: var(--color-sentiment-interactive-secondary-neutral-hover, var(--color-interactive-neutral-hover));
|
|
1273
|
+
--Button-secondary-background-active: var(--color-sentiment-interactive-secondary-neutral-active, var(--color-interactive-neutral-active));
|
|
1274
|
+
--Button-secondary-color: var(--color-sentiment-content-primary, var(--color-interactive-primary));
|
|
1275
|
+
--Button-secondary-color-hover: var(--color-sentiment-content-primary-hover, var(--color-interactive-primary-hover));
|
|
1276
|
+
--Button-secondary-color-active: var(--color-sentiment-content-primary-active, var(--color-interactive-primary-active));
|
|
1277
|
+
--Button-secondary-neutral-background: var(--color-sentiment-interactive-secondary-neutral, var(--color-background-neutral));
|
|
1278
|
+
--Button-secondary-neutral-background-hover: var(--color-sentiment-interactive-secondary-neutral-hover, var(--color-background-neutral-hover));
|
|
1279
|
+
--Button-secondary-neutral-background-active: var(--color-sentiment-interactive-secondary-neutral-active, var(--color-background-neutral-active));
|
|
1280
|
+
--Button-secondary-neutral-color: var(--color-sentiment-content-primary, var(--color-content-primary));
|
|
1293
1281
|
--Button-tertiary-background: transparent;
|
|
1294
|
-
--Button-tertiary-background-hover: var(--color-background-screen-hover);
|
|
1295
|
-
--Button-tertiary-background-active: var(--color-background-screen-active);
|
|
1296
|
-
--Button-tertiary-color: var(--color-interactive-primary);
|
|
1297
|
-
--Button-tertiary-color-hover: var(--color-interactive-primary-hover);
|
|
1298
|
-
--Button-tertiary-color-active: var(--color-interactive-primary-active);
|
|
1282
|
+
--Button-tertiary-background-hover: var(--color-sentiment-interactive-secondary-neutral, var(--color-background-screen-hover));
|
|
1283
|
+
--Button-tertiary-background-active: var(--color-sentiment-interactive-secondary-neutral-hover, var(--color-background-screen-active));
|
|
1284
|
+
--Button-tertiary-color: var(--color-sentiment-content-primary, var(--color-interactive-primary));
|
|
1285
|
+
--Button-tertiary-color-hover: var(--color-sentiment-content-primary-hover, var(--color-interactive-primary-hover));
|
|
1286
|
+
--Button-tertiary-color-active: var(--color-sentiment-content-primary-active, var(--color-interactive-primary-active));
|
|
1299
1287
|
--Button-primary-negative-background: var(--color-sentiment-negative-primary);
|
|
1300
1288
|
--Button-primary-negative-background-hover: var(--color-sentiment-negative-primary-hover);
|
|
1301
1289
|
--Button-primary-negative-background-active: var(--color-sentiment-negative-primary-active);
|
|
@@ -1380,7 +1368,7 @@
|
|
|
1380
1368
|
--Button-color-active: var(--Button-secondary-neutral-color);
|
|
1381
1369
|
}
|
|
1382
1370
|
.wds-Button--secondary-neutral .wds-Button-icon--end {
|
|
1383
|
-
color: var(--
|
|
1371
|
+
color: var(--Button-secondary-color);
|
|
1384
1372
|
}
|
|
1385
1373
|
.wds-Button--tertiary {
|
|
1386
1374
|
--Button-background: var(--Button-tertiary-background);
|
|
@@ -4321,6 +4309,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
4321
4309
|
a,
|
|
4322
4310
|
button.np-link {
|
|
4323
4311
|
border-radius: 2px;
|
|
4312
|
+
color: var(--color-sentiment-content-primary, var(--color-content-link));
|
|
4324
4313
|
}
|
|
4325
4314
|
.np-link .tw-icon {
|
|
4326
4315
|
display: flex;
|
|
@@ -28,6 +28,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
28
28
|
var ProcessIndicator = require('../../processIndicator/ProcessIndicator.js');
|
|
29
29
|
var StatusIcon = require('../../statusIcon/StatusIcon.js');
|
|
30
30
|
var Body = require('../../body/Body.js');
|
|
31
|
+
var SentimentSurface = require('../../sentimentSurface/SentimentSurface.js');
|
|
31
32
|
|
|
32
33
|
const InlinePrompt = ({
|
|
33
34
|
sentiment: sentiment$1 = sentiment.Sentiment.POSITIVE,
|
|
@@ -36,15 +37,11 @@ const InlinePrompt = ({
|
|
|
36
37
|
className,
|
|
37
38
|
children,
|
|
38
39
|
media = null,
|
|
40
|
+
'data-testid': dataTestId,
|
|
39
41
|
...rest
|
|
40
42
|
}) => {
|
|
43
|
+
const surfaceSentiment = sentiment$1 === sentiment.Sentiment.POSITIVE ? 'success' : sentiment$1;
|
|
41
44
|
const renderMedia = () => {
|
|
42
|
-
if (media && ['proposition', 'positive'].includes(sentiment$1)) {
|
|
43
|
-
return media;
|
|
44
|
-
}
|
|
45
|
-
if (sentiment$1 === 'proposition') {
|
|
46
|
-
return /*#__PURE__*/jsxRuntime.jsx(icons.GiftBox, {});
|
|
47
|
-
}
|
|
48
45
|
if (muted) {
|
|
49
46
|
return /*#__PURE__*/jsxRuntime.jsx(icons.BackslashCircle, {
|
|
50
47
|
size: 16,
|
|
@@ -54,15 +51,24 @@ const InlinePrompt = ({
|
|
|
54
51
|
if (loading) {
|
|
55
52
|
return /*#__PURE__*/jsxRuntime.jsx(ProcessIndicator.default, {
|
|
56
53
|
"data-testid": "InlinePrompt_ProcessIndicator",
|
|
57
|
-
size: "xxs"
|
|
54
|
+
size: "xxs",
|
|
55
|
+
className: "wds-inline-prompt-process-indicator"
|
|
58
56
|
});
|
|
59
57
|
}
|
|
58
|
+
if (sentiment$1 === 'positive' && media) {
|
|
59
|
+
return media;
|
|
60
|
+
}
|
|
61
|
+
if (sentiment$1 === 'proposition') {
|
|
62
|
+
return media || /*#__PURE__*/jsxRuntime.jsx(icons.GiftBox, {});
|
|
63
|
+
}
|
|
60
64
|
return /*#__PURE__*/jsxRuntime.jsx(StatusIcon.default, {
|
|
61
65
|
size: 16,
|
|
62
66
|
sentiment: sentiment$1
|
|
63
67
|
});
|
|
64
68
|
};
|
|
65
|
-
return /*#__PURE__*/jsxRuntime.jsxs(
|
|
69
|
+
return /*#__PURE__*/jsxRuntime.jsxs(SentimentSurface.default, {
|
|
70
|
+
sentiment: surfaceSentiment,
|
|
71
|
+
"data-testid": dataTestId,
|
|
66
72
|
className: clsx.clsx('wds-inline-prompt', `wds-inline-prompt--${sentiment$1}`, {
|
|
67
73
|
'wds-inline-prompt--muted': muted,
|
|
68
74
|
'wds-inline-prompt--loading': loading
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlinePrompt.js","sources":["../../../src/prompt/InlinePrompt/InlinePrompt.tsx"],"sourcesContent":["import { Sentiment } from '../../common';\nimport { BackslashCircle, GiftBox } 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?:\n | `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`\n | 'proposition';\n loading?: boolean;\n /**\n *
|
|
1
|
+
{"version":3,"file":"InlinePrompt.js","sources":["../../../src/prompt/InlinePrompt/InlinePrompt.tsx"],"sourcesContent":["import { Sentiment } from '../../common';\nimport { BackslashCircle, GiftBox } from '@transferwise/icons';\nimport ProcessIndicator from '../../processIndicator';\nimport StatusIcon from '../../statusIcon';\nimport { clsx } from 'clsx';\nimport Body from '../../body';\nimport SentimentSurface from '../../sentimentSurface';\n\nexport type InlinePromptProps = {\n /**\n * The sentiment determines the colour scheme\n */\n sentiment?:\n | `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}`\n | 'proposition';\n /**\n * Replaces the icon with a spinner while waiting for the short-lived action to finish.\n * @default false\n */\n loading?: boolean;\n /**\n * While prompts cannot be fully (visually and functionally) disabled, this prop should be enabled\n * they are associated with actually disabled component (e.g. a disabled list item or input).\n * @default false\n */\n muted?: boolean;\n /**\n * Icon override for `proposition` and `positive` sentiments. Unsupported for remaining ones.\n */\n media?: React.ReactNode;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n children: React.ReactNode;\n};\n\n/**\n * Inline prompts appear alongside a specific component on the screen. They help the user stay\n * informed, fix something, or get more out of what they're doing.\n */\nexport const InlinePrompt = ({\n sentiment = Sentiment.POSITIVE,\n muted = false,\n loading = false,\n className,\n children,\n media = null,\n 'data-testid': dataTestId,\n ...rest\n}: InlinePromptProps) => {\n const surfaceSentiment = sentiment === Sentiment.POSITIVE ? 'success' : sentiment;\n\n const renderMedia = () => {\n if (muted) {\n return <BackslashCircle size={16} data-testid=\"InlinePrompt_Muted\" />;\n }\n if (loading) {\n return (\n <ProcessIndicator\n data-testid=\"InlinePrompt_ProcessIndicator\"\n size=\"xxs\"\n className=\"wds-inline-prompt-process-indicator\"\n />\n );\n }\n\n if (sentiment === 'positive' && media) {\n return media;\n }\n\n if (sentiment === 'proposition') {\n return media || <GiftBox />;\n }\n\n return <StatusIcon size={16} sentiment={sentiment} />;\n };\n\n return (\n <SentimentSurface\n sentiment={surfaceSentiment}\n data-testid={dataTestId}\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 </SentimentSurface>\n );\n};\n"],"names":["InlinePrompt","sentiment","Sentiment","POSITIVE","muted","loading","className","children","media","dataTestId","rest","surfaceSentiment","renderMedia","_jsx","BackslashCircle","size","ProcessIndicator","GiftBox","StatusIcon","_jsxs","SentimentSurface","clsx","Body"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCO,MAAMA,YAAY,GAAGA,CAAC;aAC3BC,WAAS,GAAGC,mBAAS,CAACC,QAAQ;AAC9BC,EAAAA,KAAK,GAAG,KAAK;AACbC,EAAAA,OAAO,GAAG,KAAK;EACfC,SAAS;EACTC,QAAQ;AACRC,EAAAA,KAAK,GAAG,IAAI;AACZ,EAAA,aAAa,EAAEC,UAAU;EACzB,GAAGC;AAAI,CACW,KAAI;EACtB,MAAMC,gBAAgB,GAAGV,WAAS,KAAKC,mBAAS,CAACC,QAAQ,GAAG,SAAS,GAAGF,WAAS;EAEjF,MAAMW,WAAW,GAAGA,MAAK;AACvB,IAAA,IAAIR,KAAK,EAAE;MACT,oBAAOS,cAAA,CAACC,qBAAe,EAAA;AAACC,QAAAA,IAAI,EAAE,EAAG;QAAC,aAAA,EAAY;AAAoB,QAAG;AACvE,IAAA;AACA,IAAA,IAAIV,OAAO,EAAE;MACX,oBACEQ,cAAA,CAACG,wBAAgB,EAAA;AACf,QAAA,aAAA,EAAY,+BAA+B;AAC3CD,QAAAA,IAAI,EAAC,KAAK;AACVT,QAAAA,SAAS,EAAC;AAAqC,OAAA,CAC/C;AAEN,IAAA;AAEA,IAAA,IAAIL,WAAS,KAAK,UAAU,IAAIO,KAAK,EAAE;AACrC,MAAA,OAAOA,KAAK;AACd,IAAA;IAEA,IAAIP,WAAS,KAAK,aAAa,EAAE;AAC/B,MAAA,OAAOO,KAAK,iBAAIK,cAAA,CAACI,aAAO,KAAG;AAC7B,IAAA;IAEA,oBAAOJ,cAAA,CAACK,kBAAU,EAAA;AAACH,MAAAA,IAAI,EAAE,EAAG;AAACd,MAAAA,SAAS,EAAEA;AAAU,MAAG;EACvD,CAAC;EAED,oBACEkB,eAAA,CAACC,wBAAgB,EAAA;AACfnB,IAAAA,SAAS,EAAEU,gBAAiB;AAC5B,IAAA,aAAA,EAAaF,UAAW;IACxBH,SAAS,EAAEe,SAAI,CACb,mBAAmB,EACnB,CAAA,mBAAA,EAAsBpB,WAAS,EAAE,EACjC;AACE,MAAA,0BAA0B,EAAEG,KAAK;AACjC,MAAA,4BAA4B,EAAEC;KAC/B,EACDC,SAAS,CACT;AAAA,IAAA,GACEI,IAAI;AAAAH,IAAAA,QAAA,gBAERM,cAAA,CAAA,KAAA,EAAA;AAAKP,MAAAA,SAAS,EAAC,kCAAkC;MAAAC,QAAA,EAAEK,WAAW;AAAE,KAAM,CACtE,eAAAC,cAAA,CAACS,YAAI,EAAA;AAAAf,MAAAA,QAAA,EAAEA;AAAQ,KAAO,CACxB;AAAA,GAAkB,CAAC;AAEvB;;;;"}
|
|
@@ -17,7 +17,7 @@ import '../../common/propsValues/variant.mjs';
|
|
|
17
17
|
import '../../common/propsValues/scroll.mjs';
|
|
18
18
|
import '../../common/propsValues/markdownNodeType.mjs';
|
|
19
19
|
import '../../common/fileType.mjs';
|
|
20
|
-
import {
|
|
20
|
+
import { BackslashCircle, GiftBox } from '@transferwise/icons';
|
|
21
21
|
import { clsx } from 'clsx';
|
|
22
22
|
import 'react';
|
|
23
23
|
import 'react-intl';
|
|
@@ -26,6 +26,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
26
26
|
import ProcessIndicator from '../../processIndicator/ProcessIndicator.mjs';
|
|
27
27
|
import StatusIcon from '../../statusIcon/StatusIcon.mjs';
|
|
28
28
|
import Body from '../../body/Body.mjs';
|
|
29
|
+
import SentimentSurface from '../../sentimentSurface/SentimentSurface.mjs';
|
|
29
30
|
|
|
30
31
|
const InlinePrompt = ({
|
|
31
32
|
sentiment = Sentiment.POSITIVE,
|
|
@@ -34,15 +35,11 @@ const InlinePrompt = ({
|
|
|
34
35
|
className,
|
|
35
36
|
children,
|
|
36
37
|
media = null,
|
|
38
|
+
'data-testid': dataTestId,
|
|
37
39
|
...rest
|
|
38
40
|
}) => {
|
|
41
|
+
const surfaceSentiment = sentiment === Sentiment.POSITIVE ? 'success' : sentiment;
|
|
39
42
|
const renderMedia = () => {
|
|
40
|
-
if (media && ['proposition', 'positive'].includes(sentiment)) {
|
|
41
|
-
return media;
|
|
42
|
-
}
|
|
43
|
-
if (sentiment === 'proposition') {
|
|
44
|
-
return /*#__PURE__*/jsx(GiftBox, {});
|
|
45
|
-
}
|
|
46
43
|
if (muted) {
|
|
47
44
|
return /*#__PURE__*/jsx(BackslashCircle, {
|
|
48
45
|
size: 16,
|
|
@@ -52,15 +49,24 @@ const InlinePrompt = ({
|
|
|
52
49
|
if (loading) {
|
|
53
50
|
return /*#__PURE__*/jsx(ProcessIndicator, {
|
|
54
51
|
"data-testid": "InlinePrompt_ProcessIndicator",
|
|
55
|
-
size: "xxs"
|
|
52
|
+
size: "xxs",
|
|
53
|
+
className: "wds-inline-prompt-process-indicator"
|
|
56
54
|
});
|
|
57
55
|
}
|
|
56
|
+
if (sentiment === 'positive' && media) {
|
|
57
|
+
return media;
|
|
58
|
+
}
|
|
59
|
+
if (sentiment === 'proposition') {
|
|
60
|
+
return media || /*#__PURE__*/jsx(GiftBox, {});
|
|
61
|
+
}
|
|
58
62
|
return /*#__PURE__*/jsx(StatusIcon, {
|
|
59
63
|
size: 16,
|
|
60
64
|
sentiment: sentiment
|
|
61
65
|
});
|
|
62
66
|
};
|
|
63
|
-
return /*#__PURE__*/jsxs(
|
|
67
|
+
return /*#__PURE__*/jsxs(SentimentSurface, {
|
|
68
|
+
sentiment: surfaceSentiment,
|
|
69
|
+
"data-testid": dataTestId,
|
|
64
70
|
className: clsx('wds-inline-prompt', `wds-inline-prompt--${sentiment}`, {
|
|
65
71
|
'wds-inline-prompt--muted': muted,
|
|
66
72
|
'wds-inline-prompt--loading': loading
|