@transferwise/components 46.116.0 → 46.117.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.
- package/build/alert/Alert.js +2 -1
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +2 -1
- package/build/alert/Alert.mjs.map +1 -1
- package/build/main.css +60 -139
- 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 +17 -17
- package/build/styles/button/Button.vars.css +16 -16
- package/build/styles/iconButton/IconButton.css +8 -8
- package/build/styles/inputs/Input.css +2 -4
- package/build/styles/inputs/TextArea.css +2 -4
- package/build/styles/link/Link.css +1 -0
- package/build/styles/main.css +60 -139
- package/build/styles/popover/Popover.css +2 -4
- package/build/styles/prompt/InlinePrompt/InlinePrompt.css +26 -105
- package/build/styles/sentimentSurface/SentimentSurface.css +4 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- 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 +24 -0
- package/build/types/test-utils/story-config.d.ts.map +1 -1
- package/package.json +13 -12
- package/src/alert/Alert.tsx +3 -1
- package/src/button/Button.css +17 -17
- package/src/button/Button.less +1 -1
- package/src/button/Button.story.tsx +75 -110
- package/src/button/Button.tests.story.tsx +189 -0
- package/src/button/Button.vars.css +16 -16
- package/src/button/Button.vars.less +58 -18
- package/src/iconButton/IconButton.css +8 -8
- package/src/iconButton/IconButton.less +35 -4
- package/src/iconButton/IconButton.story.tsx +72 -3
- package/src/inputs/Input.css +2 -4
- package/src/inputs/TextArea.css +2 -4
- 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 +60 -139
- package/src/popover/Popover.css +2 -4
- 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 +4 -1
- package/src/sentimentSurface/SentimentSurface.docs.mdx +37 -478
- package/src/sentimentSurface/SentimentSurface.less +118 -114
- package/src/sentimentSurface/SentimentSurface.spec.tsx +31 -11
- package/src/sentimentSurface/SentimentSurface.story.tsx +325 -147
- package/src/sentimentSurface/SentimentSurface.tests.story.tsx +85 -86
- package/src/sentimentSurface/SentimentSurface.tsx +16 -9
- package/src/sentimentSurface/SentimentSurface.types.ts +5 -20
- package/src/test-utils/story-config.ts +0 -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/sentimentSurface/classMap.ts +0 -15
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
.wds-sentiment-surface {
|
|
2
|
+
&--hasBaseStyles {
|
|
2
3
|
background-color: var(--color-sentiment-background-surface);
|
|
3
4
|
color: var(--color-sentiment-content-primary);
|
|
5
|
+
}
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
&-negative {
|
|
8
|
+
.np-theme-personal &,
|
|
9
|
+
.np-theme-personal--bright-green & {
|
|
10
|
+
&-base {
|
|
11
|
+
.sentiment-surface-tokens(
|
|
10
12
|
#CB272F, #B8232B, #A72027,
|
|
11
13
|
#CB272F, #B8232B, #A72027,
|
|
12
14
|
#FBEAEA, #F9E1E1, #F8D8D8,
|
|
@@ -14,23 +16,23 @@
|
|
|
14
16
|
#FBEAEA, #F9E1E1, #F8D8D8,
|
|
15
17
|
#FBEAEA, #F9E1E1, #F8D8D8
|
|
16
18
|
);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
&-elevated {
|
|
21
|
+
.sentiment-surface-tokens(
|
|
20
22
|
#FFFFFF, #F5CCCC, #F1B7B7,
|
|
21
23
|
#FBEAEA, #F5CCCC, #F1B7B7,
|
|
22
24
|
#CB272F, #B8232B, #A72027,
|
|
23
|
-
#9B141B, #831116, #
|
|
25
|
+
#9B141B, #831116, #6D0e13,
|
|
24
26
|
#CB272F, #B8232B, #A72027,
|
|
25
27
|
#90000D, #B8232B, #A72027
|
|
26
28
|
);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
}
|
|
30
|
+
}
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
.np-theme-personal--dark &,
|
|
33
|
+
.np-theme-personal--forest-green & {
|
|
34
|
+
&-base {
|
|
35
|
+
.sentiment-surface-tokens(
|
|
34
36
|
#FFA8AD, #FFBDC0, #FFD1D3,
|
|
35
37
|
#FFA8AD, #FFBDC0, #FFD1D3,
|
|
36
38
|
#410B0D, #641115, #761418,
|
|
@@ -38,9 +40,9 @@
|
|
|
38
40
|
#410B0D, #641115, #761418,
|
|
39
41
|
#410B0D, #641115, #761418
|
|
40
42
|
);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
}
|
|
44
|
+
&-elevated {
|
|
45
|
+
.sentiment-surface-tokens(
|
|
44
46
|
#410B0D, #641115, #761418,
|
|
45
47
|
#410B0D, #641115, #761418,
|
|
46
48
|
#FFA8AD, #FFBDC0, #FFD1D3,
|
|
@@ -48,15 +50,15 @@
|
|
|
48
50
|
#FFA8AD, #FFBDC0, #FFD1D3,
|
|
49
51
|
#FFA8AD, #FFBDC0, #FFD1D3
|
|
50
52
|
);
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
+
}
|
|
53
54
|
}
|
|
55
|
+
}
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
&-warning {
|
|
58
|
+
.np-theme-personal &,
|
|
59
|
+
.np-theme-personal--bright-green & {
|
|
60
|
+
&-base {
|
|
61
|
+
.sentiment-surface-tokens(
|
|
60
62
|
#4A3B1C, #302612, #2C2311, // content-primary (default, hover, active)
|
|
61
63
|
#FFD11A, #FFBF0F, #FFBB00, // interactive-primary
|
|
62
64
|
#FFF7D7, #FFF0B2, #FFE98F, // interactive-secondary
|
|
@@ -64,9 +66,9 @@
|
|
|
64
66
|
#4A3B1C, #302612, #2C2311, // interactive-control
|
|
65
67
|
#FFF7D7, #FFF0B2, #FFE98F // background-surface
|
|
66
68
|
);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
}
|
|
70
|
+
&-elevated {
|
|
71
|
+
.sentiment-surface-tokens(
|
|
70
72
|
#4A3B1C, #302612, #2C2311, // content-primary
|
|
71
73
|
#4A3B1C, #302612, #2C2311, // interactive-primary
|
|
72
74
|
#FFD11A, #FFBF0F, #FFBB00, // interactive-secondary
|
|
@@ -74,13 +76,13 @@
|
|
|
74
76
|
#FFD11A, #FFBF0F, #FFBB00, // interactive-control
|
|
75
77
|
#FFD11A, #FFBF0F, #FFBB00 // background-surface
|
|
76
78
|
);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
}
|
|
80
|
+
}
|
|
79
81
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
.np-theme-personal--dark &,
|
|
83
|
+
.np-theme-personal--forest-green & {
|
|
84
|
+
&-base {
|
|
85
|
+
.sentiment-surface-tokens(
|
|
84
86
|
#FADC65, #F9D648, #F8CD20, // content-primary
|
|
85
87
|
#FADC65, #F9D648, #F8CD20, // interactive-primary
|
|
86
88
|
#3A3523, #504930, #665D3D, // interactive-secondary
|
|
@@ -88,9 +90,9 @@
|
|
|
88
90
|
#3A3523, #504930, #665D3D, // interactive-control
|
|
89
91
|
#3A3523, #504930, #665D3D // background-surface
|
|
90
92
|
);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
}
|
|
94
|
+
&-elevated {
|
|
95
|
+
.sentiment-surface-tokens(
|
|
94
96
|
#3A3523, #504930, #665D3D, // content-primary
|
|
95
97
|
#3A3523, #504930, #665D3D, // interactive-primary
|
|
96
98
|
#FADC65, #F9D648, #F8CD20, // interactive-secondary
|
|
@@ -98,14 +100,14 @@
|
|
|
98
100
|
#FADC65, #F9D648, #F8CD20, // interactive-control
|
|
99
101
|
#FADC65, #F9D648, #F8CD20 // background-surface
|
|
100
102
|
);
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
+
}
|
|
103
104
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
}
|
|
106
|
+
&-success {
|
|
107
|
+
.np-theme-personal &,
|
|
108
|
+
.np-theme-personal--bright-green & {
|
|
109
|
+
&-base {
|
|
110
|
+
.sentiment-surface-tokens(
|
|
109
111
|
#054D28, #043A1E, #022614, // content-primary (default, hover, active)
|
|
110
112
|
#054D28, #043A1E, #022614, // interactive-primary
|
|
111
113
|
#E2F6D5, #D3F2C0, #C5EDAB, // interactive-secondary
|
|
@@ -113,9 +115,9 @@
|
|
|
113
115
|
#E2F6D5, #D3F2C0, #C5EDAB, // interactive-control
|
|
114
116
|
#E2F6D5, #D3F2C0, #C5EDAB // background-surface
|
|
115
117
|
);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
}
|
|
119
|
+
&-elevated {
|
|
120
|
+
.sentiment-surface-tokens(
|
|
119
121
|
#E2F6D5, #D3F2C0, #C5EDAB, // content-primary
|
|
120
122
|
#E2F6D5, #D3F2C0, #C5EDAB, // interactive-primary
|
|
121
123
|
#054D28, #043A1E, #022614, // interactive-secondary
|
|
@@ -123,13 +125,13 @@
|
|
|
123
125
|
#054D28, #043A1E, #022614, // interactive-control
|
|
124
126
|
#054D28, #043A1E, #022614 // background-surface
|
|
125
127
|
);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
+
}
|
|
129
|
+
}
|
|
128
130
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
.np-theme-personal--dark &,
|
|
132
|
+
.np-theme-personal--forest-green & {
|
|
133
|
+
&-base {
|
|
134
|
+
.sentiment-surface-tokens(
|
|
133
135
|
#BAE5A0, #C8EAB3, #D6F0C7, // content-primary
|
|
134
136
|
#BAE5A0, #C8EAB3, #D6F0C7, // interactive-primary
|
|
135
137
|
#252C20, #323B2B, #3E4A36, // interactive-secondary
|
|
@@ -137,9 +139,9 @@
|
|
|
137
139
|
#252C20, #323B2B, #3E4A36, // interactive-control
|
|
138
140
|
#252C20, #323B2B, #3E4A36 // background-surface
|
|
139
141
|
);
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
142
|
+
}
|
|
143
|
+
&-elevated {
|
|
144
|
+
.sentiment-surface-tokens(
|
|
143
145
|
#252C20, #323B2B, #3E4A36, // content-primary
|
|
144
146
|
#252C20, #323B2B, #3E4A36, // interactive-primary
|
|
145
147
|
#BAE5A0, #C8EAB3, #D6F0C7, // interactive-secondary
|
|
@@ -147,14 +149,14 @@
|
|
|
147
149
|
#BAE5A0, #C8EAB3, #D6F0C7, // interactive-control
|
|
148
150
|
#BAE5A0, #C8EAB3, #D6F0C7 // background-surface
|
|
149
151
|
);
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
+
}
|
|
152
153
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
}
|
|
155
|
+
&-neutral {
|
|
156
|
+
.np-theme-personal &,
|
|
157
|
+
.np-theme-personal--bright-green & {
|
|
158
|
+
&-base {
|
|
159
|
+
.sentiment-surface-tokens(
|
|
158
160
|
#454745, #353635, #232423, // content-primary (default, hover, active)
|
|
159
161
|
#454745, #353635, #232423, // interactive-primary
|
|
160
162
|
#F1F1ED, #E7E7E1, #DFDED5, // interactive-secondary
|
|
@@ -162,9 +164,9 @@
|
|
|
162
164
|
#F1F1ED, #E7E7E1, #DFDED5, // interactive-control
|
|
163
165
|
#F1F1ED, #E7E7E1, #DFDED5 // background-surface
|
|
164
166
|
);
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
167
|
+
}
|
|
168
|
+
&-elevated {
|
|
169
|
+
.sentiment-surface-tokens(
|
|
168
170
|
#F1F1ED, #E7E7E1, #DFDED5, // content-primary
|
|
169
171
|
#F1F1ED, #E7E7E1, #DFDED5, // interactive-primary
|
|
170
172
|
#454745, #353635, #232423, // interactive-secondary
|
|
@@ -172,13 +174,13 @@
|
|
|
172
174
|
#454745, #353635, #232423, // interactive-control
|
|
173
175
|
#454745, #353635, #232423 // background-surface
|
|
174
176
|
);
|
|
175
|
-
|
|
176
|
-
|
|
177
|
+
}
|
|
178
|
+
}
|
|
177
179
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
.np-theme-personal--dark &,
|
|
181
|
+
.np-theme-personal--forest-green & {
|
|
182
|
+
&-base {
|
|
183
|
+
.sentiment-surface-tokens(
|
|
182
184
|
#F1F1ED, #E7E7E1, #DFDED5, // content-primary
|
|
183
185
|
#F1F1ED, #E7E7E1, #DFDED5, // interactive-primary
|
|
184
186
|
#2A2C29, #414441, #595B58, // interactive-secondary
|
|
@@ -186,9 +188,9 @@
|
|
|
186
188
|
#2A2C29, #414441, #595B58, // interactive-control
|
|
187
189
|
#2A2C29, #414441, #595B58 // background-surface
|
|
188
190
|
);
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
191
|
+
}
|
|
192
|
+
&-elevated {
|
|
193
|
+
.sentiment-surface-tokens(
|
|
192
194
|
#2A2C29, #414441, #595B58, // content-primary
|
|
193
195
|
#2A2C29, #414441, #595B58, // interactive-primary
|
|
194
196
|
#F1F1ED, #E7E7E1, #DFDED5, // interactive-secondary
|
|
@@ -196,14 +198,14 @@
|
|
|
196
198
|
#F1F1ED, #E7E7E1, #DFDED5, // interactive-control
|
|
197
199
|
#F1F1ED, #E7E7E1, #DFDED5 // background-surface
|
|
198
200
|
);
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
+
}
|
|
201
202
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
}
|
|
204
|
+
&-proposition {
|
|
205
|
+
.np-theme-personal &,
|
|
206
|
+
.np-theme-personal--bright-green & {
|
|
207
|
+
&-base {
|
|
208
|
+
.sentiment-surface-tokens(
|
|
207
209
|
#0E0F0C, #0A2826, #074140, // content-primary (default, hover, active)
|
|
208
210
|
#054D4D, #043A3A, #022626, // interactive-primary
|
|
209
211
|
#E0F7F7, #CAF1F1, #B6ECEC, // interactive-secondary
|
|
@@ -211,9 +213,9 @@
|
|
|
211
213
|
#E0F7F7, #CAF1F1, #B6ECEC, // interactive-control
|
|
212
214
|
#E0F7F7, #CAF1F1, #B6ECEC // background-surface
|
|
213
215
|
);
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
216
|
+
}
|
|
217
|
+
&-elevated {
|
|
218
|
+
.sentiment-surface-tokens(
|
|
217
219
|
#FFFFFF, #EAF9F9, #D5F4F4, // content-primary
|
|
218
220
|
#E0F7F7, #CAF1F1, #B6ECEC, // interactive-primary
|
|
219
221
|
#054D4D, #043A3A, #022626, // interactive-secondary
|
|
@@ -221,13 +223,13 @@
|
|
|
221
223
|
#054D4D, #043A3A, #022626, // interactive-control
|
|
222
224
|
#054D4D, #043A3A, #022626 // background-surface
|
|
223
225
|
);
|
|
224
|
-
|
|
225
|
-
|
|
226
|
+
}
|
|
227
|
+
}
|
|
226
228
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
.np-theme-personal--dark &,
|
|
230
|
+
.np-theme-personal--forest-green & {
|
|
231
|
+
&-base {
|
|
232
|
+
.sentiment-surface-tokens(
|
|
231
233
|
#FFFFFF, #EAF9F9, #D5F4F4, // content-primary
|
|
232
234
|
#E0F7F7, #CAF1F1, #B6ECEC, // interactive-primary
|
|
233
235
|
#0B312F, #124F4C, #176460, // interactive-secondary
|
|
@@ -235,9 +237,9 @@
|
|
|
235
237
|
#0B312F, #124F4C, #176460, // interactive-control
|
|
236
238
|
#0B312F, #124F4C, #176460 // background-surface
|
|
237
239
|
);
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
240
|
+
}
|
|
241
|
+
&-elevated {
|
|
242
|
+
.sentiment-surface-tokens(
|
|
241
243
|
#0E0F0C, #0A2826, #074140, // content-primary
|
|
242
244
|
#0B312F, #104744, #16605C, // interactive-primary
|
|
243
245
|
#E0F7F7, #CAF1F1, #B6ECEC, // interactive-secondary
|
|
@@ -245,9 +247,11 @@
|
|
|
245
247
|
#E0F7F7, #CAF1F1, #B6ECEC, // interactive-control
|
|
246
248
|
#E0F7F7, #CAF1F1, #B6ECEC // background-surface
|
|
247
249
|
);
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
+
}
|
|
250
251
|
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
--ring-outline-color: var(--color-sentiment-content-primary, var(--color-content-primary));
|
|
251
255
|
}
|
|
252
256
|
|
|
253
257
|
.sentiment-surface-tokens(
|
|
@@ -270,27 +274,27 @@
|
|
|
270
274
|
@background-surface-hover,
|
|
271
275
|
@background-surface-active
|
|
272
276
|
) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
277
|
+
--color-sentiment-content-primary: @content-primary;
|
|
278
|
+
--color-sentiment-content-primary-hover: @content-primary-hover;
|
|
279
|
+
--color-sentiment-content-primary-active: @content-primary-active;
|
|
276
280
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
281
|
+
--color-sentiment-interactive-primary: @interactive-primary;
|
|
282
|
+
--color-sentiment-interactive-primary-hover: @interactive-primary-hover;
|
|
283
|
+
--color-sentiment-interactive-primary-active: @interactive-primary-active;
|
|
280
284
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
285
|
+
--color-sentiment-interactive-secondary: @interactive-secondary;
|
|
286
|
+
--color-sentiment-interactive-secondary-hover: @interactive-secondary-hover;
|
|
287
|
+
--color-sentiment-interactive-secondary-active: @interactive-secondary-active;
|
|
284
288
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
289
|
+
--color-sentiment-interactive-secondary-neutral: @interactive-secondary-neutral;
|
|
290
|
+
--color-sentiment-interactive-secondary-neutral-hover: @interactive-secondary-neutral-hover;
|
|
291
|
+
--color-sentiment-interactive-secondary-neutral-active: @interactive-secondary-neutral-active;
|
|
288
292
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
293
|
+
--color-sentiment-interactive-control: @interactive-control;
|
|
294
|
+
--color-sentiment-interactive-control-hover: @interactive-control-hover;
|
|
295
|
+
--color-sentiment-interactive-control-active: @interactive-control-active;
|
|
292
296
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
297
|
+
--color-sentiment-background-surface: @background-surface;
|
|
298
|
+
--color-sentiment-background-surface-hover: @background-surface-hover;
|
|
299
|
+
--color-sentiment-background-surface-active: @background-surface-active;
|
|
296
300
|
}
|
|
@@ -13,7 +13,7 @@ describe('SentimentSurface', () => {
|
|
|
13
13
|
|
|
14
14
|
it('renders as div by default', () => {
|
|
15
15
|
render(
|
|
16
|
-
<SentimentSurface sentiment="neutral"
|
|
16
|
+
<SentimentSurface sentiment="neutral" data-testid="surface">
|
|
17
17
|
{testContent}
|
|
18
18
|
</SentimentSurface>,
|
|
19
19
|
);
|
|
@@ -22,7 +22,7 @@ describe('SentimentSurface', () => {
|
|
|
22
22
|
|
|
23
23
|
it('renders as custom element when as prop is provided', () => {
|
|
24
24
|
render(
|
|
25
|
-
<SentimentSurface sentiment="neutral" as="section"
|
|
25
|
+
<SentimentSurface sentiment="neutral" as="section" data-testid="surface">
|
|
26
26
|
{testContent}
|
|
27
27
|
</SentimentSurface>,
|
|
28
28
|
);
|
|
@@ -30,13 +30,33 @@ describe('SentimentSurface', () => {
|
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
+
describe('hasBaseStyles', () => {
|
|
34
|
+
it('applies base styles by default', () => {
|
|
35
|
+
render(
|
|
36
|
+
<SentimentSurface sentiment="neutral" data-testid="surface">
|
|
37
|
+
{testContent}
|
|
38
|
+
</SentimentSurface>,
|
|
39
|
+
);
|
|
40
|
+
expect(screen.getByTestId('surface')).toHaveClass('wds-sentiment-surface--hasBaseStyles');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('does not apply base styles when hasBaseStyles is false', () => {
|
|
44
|
+
render(
|
|
45
|
+
<SentimentSurface sentiment="neutral" hasBaseStyles={false} data-testid="surface">
|
|
46
|
+
{testContent}
|
|
47
|
+
</SentimentSurface>,
|
|
48
|
+
);
|
|
49
|
+
expect(screen.getByTestId('surface')).not.toHaveClass('wds-sentiment-surface--hasBaseStyles');
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
33
53
|
describe('sentiment variants', () => {
|
|
34
54
|
const sentiments: Sentiment[] = ['negative', 'warning', 'neutral', 'success', 'proposition'];
|
|
35
55
|
|
|
36
56
|
sentiments.forEach((sentiment) => {
|
|
37
57
|
it(`renders ${sentiment} sentiment with correct class`, () => {
|
|
38
58
|
render(
|
|
39
|
-
<SentimentSurface sentiment={sentiment}
|
|
59
|
+
<SentimentSurface sentiment={sentiment} data-testid="surface">
|
|
40
60
|
{testContent}
|
|
41
61
|
</SentimentSurface>,
|
|
42
62
|
);
|
|
@@ -53,7 +73,7 @@ describe('SentimentSurface', () => {
|
|
|
53
73
|
emphasisLevels.forEach((emphasis) => {
|
|
54
74
|
it(`renders ${emphasis} emphasis with correct class`, () => {
|
|
55
75
|
render(
|
|
56
|
-
<SentimentSurface sentiment="neutral" emphasis={emphasis}
|
|
76
|
+
<SentimentSurface sentiment="neutral" emphasis={emphasis} data-testid="surface">
|
|
57
77
|
{testContent}
|
|
58
78
|
</SentimentSurface>,
|
|
59
79
|
);
|
|
@@ -65,7 +85,7 @@ describe('SentimentSurface', () => {
|
|
|
65
85
|
|
|
66
86
|
it('defaults to base emphasis when not provided', () => {
|
|
67
87
|
render(
|
|
68
|
-
<SentimentSurface sentiment="neutral"
|
|
88
|
+
<SentimentSurface sentiment="neutral" data-testid="surface">
|
|
69
89
|
{testContent}
|
|
70
90
|
</SentimentSurface>,
|
|
71
91
|
);
|
|
@@ -79,7 +99,7 @@ describe('SentimentSurface', () => {
|
|
|
79
99
|
it('applies custom className', () => {
|
|
80
100
|
const customClass = 'custom-class';
|
|
81
101
|
render(
|
|
82
|
-
<SentimentSurface sentiment="neutral" className={customClass}
|
|
102
|
+
<SentimentSurface sentiment="neutral" className={customClass} data-testid="surface">
|
|
83
103
|
{testContent}
|
|
84
104
|
</SentimentSurface>,
|
|
85
105
|
);
|
|
@@ -96,10 +116,10 @@ describe('SentimentSurface', () => {
|
|
|
96
116
|
expect(screen.getByText(testContent)).toHaveAttribute('id', customId);
|
|
97
117
|
});
|
|
98
118
|
|
|
99
|
-
it('applies
|
|
119
|
+
it('applies data-testid attribute', () => {
|
|
100
120
|
const testId = 'test-surface';
|
|
101
121
|
render(
|
|
102
|
-
<SentimentSurface sentiment="neutral"
|
|
122
|
+
<SentimentSurface sentiment="neutral" data-testid={testId}>
|
|
103
123
|
{testContent}
|
|
104
124
|
</SentimentSurface>,
|
|
105
125
|
);
|
|
@@ -109,7 +129,7 @@ describe('SentimentSurface', () => {
|
|
|
109
129
|
it('applies custom style', () => {
|
|
110
130
|
const customStyle = { padding: '20px' };
|
|
111
131
|
render(
|
|
112
|
-
<SentimentSurface sentiment="neutral" style={customStyle}
|
|
132
|
+
<SentimentSurface sentiment="neutral" style={customStyle} data-testid="surface">
|
|
113
133
|
{testContent}
|
|
114
134
|
</SentimentSurface>,
|
|
115
135
|
);
|
|
@@ -121,7 +141,7 @@ describe('SentimentSurface', () => {
|
|
|
121
141
|
it('supports aria-label attribute', () => {
|
|
122
142
|
const ariaLabel = 'Surface label';
|
|
123
143
|
render(
|
|
124
|
-
<SentimentSurface sentiment="neutral" aria-label={ariaLabel}
|
|
144
|
+
<SentimentSurface sentiment="neutral" aria-label={ariaLabel} data-testid="surface">
|
|
125
145
|
{testContent}
|
|
126
146
|
</SentimentSurface>,
|
|
127
147
|
);
|
|
@@ -130,7 +150,7 @@ describe('SentimentSurface', () => {
|
|
|
130
150
|
|
|
131
151
|
it('supports role attribute', () => {
|
|
132
152
|
render(
|
|
133
|
-
<SentimentSurface sentiment="neutral" role="region"
|
|
153
|
+
<SentimentSurface sentiment="neutral" role="region" data-testid="surface">
|
|
134
154
|
{testContent}
|
|
135
155
|
</SentimentSurface>,
|
|
136
156
|
);
|