@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
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
.wds-sentiment-surface {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
&--hasBaseStyles {
|
|
3
|
+
background-color: var(--color-sentiment-background-surface);
|
|
4
|
+
color: var(--color-sentiment-content-primary);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
&-negative {
|
|
8
|
+
.np-theme-personal &,
|
|
9
|
+
.np-theme-business &,
|
|
10
|
+
.np-theme-platform &,
|
|
11
|
+
.np-theme-personal--bright-green &,
|
|
12
|
+
.np-theme-business--bright-green & {
|
|
13
|
+
&-base {
|
|
14
|
+
.sentiment-surface-tokens(
|
|
7
15
|
#CB272F, #B8232B, #A72027,
|
|
8
16
|
#CB272F, #B8232B, #A72027,
|
|
9
17
|
#FBEAEA, #F9E1E1, #F8D8D8,
|
|
@@ -11,23 +19,26 @@
|
|
|
11
19
|
#FBEAEA, #F9E1E1, #F8D8D8,
|
|
12
20
|
#FBEAEA, #F9E1E1, #F8D8D8
|
|
13
21
|
);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
}
|
|
23
|
+
&-elevated {
|
|
24
|
+
.sentiment-surface-tokens(
|
|
17
25
|
#FFFFFF, #F5CCCC, #F1B7B7,
|
|
18
26
|
#FBEAEA, #F5CCCC, #F1B7B7,
|
|
19
27
|
#CB272F, #B8232B, #A72027,
|
|
20
|
-
#9B141B, #831116, #
|
|
28
|
+
#9B141B, #831116, #6D0e13,
|
|
21
29
|
#CB272F, #B8232B, #A72027,
|
|
22
30
|
#90000D, #B8232B, #A72027
|
|
23
31
|
);
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
}
|
|
33
|
+
}
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
.np-theme-personal--dark &,
|
|
36
|
+
.np-theme-business--dark &,
|
|
37
|
+
.np-theme-personal--forest-green &,
|
|
38
|
+
.np-theme-business--forest-green &,
|
|
39
|
+
.np-theme-platform--forest-green & {
|
|
40
|
+
&-base {
|
|
41
|
+
.sentiment-surface-tokens(
|
|
31
42
|
#FFA8AD, #FFBDC0, #FFD1D3,
|
|
32
43
|
#FFA8AD, #FFBDC0, #FFD1D3,
|
|
33
44
|
#410B0D, #641115, #761418,
|
|
@@ -35,9 +46,9 @@
|
|
|
35
46
|
#410B0D, #641115, #761418,
|
|
36
47
|
#410B0D, #641115, #761418
|
|
37
48
|
);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
}
|
|
50
|
+
&-elevated {
|
|
51
|
+
.sentiment-surface-tokens(
|
|
41
52
|
#410B0D, #641115, #761418,
|
|
42
53
|
#410B0D, #641115, #761418,
|
|
43
54
|
#FFA8AD, #FFBDC0, #FFD1D3,
|
|
@@ -45,15 +56,18 @@
|
|
|
45
56
|
#FFA8AD, #FFBDC0, #FFD1D3,
|
|
46
57
|
#FFA8AD, #FFBDC0, #FFD1D3
|
|
47
58
|
);
|
|
48
|
-
|
|
49
|
-
}
|
|
59
|
+
}
|
|
50
60
|
}
|
|
61
|
+
}
|
|
51
62
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
&-warning {
|
|
64
|
+
.np-theme-personal &,
|
|
65
|
+
.np-theme-business &,
|
|
66
|
+
.np-theme-platform &,
|
|
67
|
+
.np-theme-personal--bright-green &,
|
|
68
|
+
.np-theme-business--bright-green & {
|
|
69
|
+
&-base {
|
|
70
|
+
.sentiment-surface-tokens(
|
|
57
71
|
#4A3B1C, #302612, #2C2311, // content-primary (default, hover, active)
|
|
58
72
|
#FFD11A, #FFBF0F, #FFBB00, // interactive-primary
|
|
59
73
|
#FFF7D7, #FFF0B2, #FFE98F, // interactive-secondary
|
|
@@ -61,9 +75,9 @@
|
|
|
61
75
|
#4A3B1C, #302612, #2C2311, // interactive-control
|
|
62
76
|
#FFF7D7, #FFF0B2, #FFE98F // background-surface
|
|
63
77
|
);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
78
|
+
}
|
|
79
|
+
&-elevated {
|
|
80
|
+
.sentiment-surface-tokens(
|
|
67
81
|
#4A3B1C, #302612, #2C2311, // content-primary
|
|
68
82
|
#4A3B1C, #302612, #2C2311, // interactive-primary
|
|
69
83
|
#FFD11A, #FFBF0F, #FFBB00, // interactive-secondary
|
|
@@ -71,13 +85,16 @@
|
|
|
71
85
|
#FFD11A, #FFBF0F, #FFBB00, // interactive-control
|
|
72
86
|
#FFD11A, #FFBF0F, #FFBB00 // background-surface
|
|
73
87
|
);
|
|
74
|
-
|
|
75
|
-
|
|
88
|
+
}
|
|
89
|
+
}
|
|
76
90
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
.np-theme-personal--dark &,
|
|
92
|
+
.np-theme-business--dark &,
|
|
93
|
+
.np-theme-personal--forest-green &,
|
|
94
|
+
.np-theme-business--forest-green &,
|
|
95
|
+
.np-theme-platform--forest-green & {
|
|
96
|
+
&-base {
|
|
97
|
+
.sentiment-surface-tokens(
|
|
81
98
|
#FADC65, #F9D648, #F8CD20, // content-primary
|
|
82
99
|
#FADC65, #F9D648, #F8CD20, // interactive-primary
|
|
83
100
|
#3A3523, #504930, #665D3D, // interactive-secondary
|
|
@@ -85,9 +102,9 @@
|
|
|
85
102
|
#3A3523, #504930, #665D3D, // interactive-control
|
|
86
103
|
#3A3523, #504930, #665D3D // background-surface
|
|
87
104
|
);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
105
|
+
}
|
|
106
|
+
&-elevated {
|
|
107
|
+
.sentiment-surface-tokens(
|
|
91
108
|
#3A3523, #504930, #665D3D, // content-primary
|
|
92
109
|
#3A3523, #504930, #665D3D, // interactive-primary
|
|
93
110
|
#FADC65, #F9D648, #F8CD20, // interactive-secondary
|
|
@@ -95,14 +112,17 @@
|
|
|
95
112
|
#FADC65, #F9D648, #F8CD20, // interactive-control
|
|
96
113
|
#FADC65, #F9D648, #F8CD20 // background-surface
|
|
97
114
|
);
|
|
98
|
-
|
|
99
|
-
}
|
|
115
|
+
}
|
|
100
116
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
117
|
+
}
|
|
118
|
+
&-success {
|
|
119
|
+
.np-theme-personal &,
|
|
120
|
+
.np-theme-business &,
|
|
121
|
+
.np-theme-platform &,
|
|
122
|
+
.np-theme-personal--bright-green &,
|
|
123
|
+
.np-theme-business--bright-green & {
|
|
124
|
+
&-base {
|
|
125
|
+
.sentiment-surface-tokens(
|
|
106
126
|
#054D28, #043A1E, #022614, // content-primary (default, hover, active)
|
|
107
127
|
#054D28, #043A1E, #022614, // interactive-primary
|
|
108
128
|
#E2F6D5, #D3F2C0, #C5EDAB, // interactive-secondary
|
|
@@ -110,9 +130,9 @@
|
|
|
110
130
|
#E2F6D5, #D3F2C0, #C5EDAB, // interactive-control
|
|
111
131
|
#E2F6D5, #D3F2C0, #C5EDAB // background-surface
|
|
112
132
|
);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
133
|
+
}
|
|
134
|
+
&-elevated {
|
|
135
|
+
.sentiment-surface-tokens(
|
|
116
136
|
#E2F6D5, #D3F2C0, #C5EDAB, // content-primary
|
|
117
137
|
#E2F6D5, #D3F2C0, #C5EDAB, // interactive-primary
|
|
118
138
|
#054D28, #043A1E, #022614, // interactive-secondary
|
|
@@ -120,13 +140,16 @@
|
|
|
120
140
|
#054D28, #043A1E, #022614, // interactive-control
|
|
121
141
|
#054D28, #043A1E, #022614 // background-surface
|
|
122
142
|
);
|
|
123
|
-
|
|
124
|
-
|
|
143
|
+
}
|
|
144
|
+
}
|
|
125
145
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
146
|
+
.np-theme-personal--dark &,
|
|
147
|
+
.np-theme-business--dark &,
|
|
148
|
+
.np-theme-personal--forest-green &,
|
|
149
|
+
.np-theme-business--forest-green &,
|
|
150
|
+
.np-theme-platform--forest-green & {
|
|
151
|
+
&-base {
|
|
152
|
+
.sentiment-surface-tokens(
|
|
130
153
|
#BAE5A0, #C8EAB3, #D6F0C7, // content-primary
|
|
131
154
|
#BAE5A0, #C8EAB3, #D6F0C7, // interactive-primary
|
|
132
155
|
#252C20, #323B2B, #3E4A36, // interactive-secondary
|
|
@@ -134,9 +157,9 @@
|
|
|
134
157
|
#252C20, #323B2B, #3E4A36, // interactive-control
|
|
135
158
|
#252C20, #323B2B, #3E4A36 // background-surface
|
|
136
159
|
);
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
160
|
+
}
|
|
161
|
+
&-elevated {
|
|
162
|
+
.sentiment-surface-tokens(
|
|
140
163
|
#252C20, #323B2B, #3E4A36, // content-primary
|
|
141
164
|
#252C20, #323B2B, #3E4A36, // interactive-primary
|
|
142
165
|
#BAE5A0, #C8EAB3, #D6F0C7, // interactive-secondary
|
|
@@ -144,14 +167,17 @@
|
|
|
144
167
|
#BAE5A0, #C8EAB3, #D6F0C7, // interactive-control
|
|
145
168
|
#BAE5A0, #C8EAB3, #D6F0C7 // background-surface
|
|
146
169
|
);
|
|
147
|
-
|
|
148
|
-
}
|
|
170
|
+
}
|
|
149
171
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
172
|
+
}
|
|
173
|
+
&-neutral {
|
|
174
|
+
.np-theme-personal &,
|
|
175
|
+
.np-theme-business &,
|
|
176
|
+
.np-theme-platform &,
|
|
177
|
+
.np-theme-personal--bright-green &,
|
|
178
|
+
.np-theme-business--bright-green & {
|
|
179
|
+
&-base {
|
|
180
|
+
.sentiment-surface-tokens(
|
|
155
181
|
#454745, #353635, #232423, // content-primary (default, hover, active)
|
|
156
182
|
#454745, #353635, #232423, // interactive-primary
|
|
157
183
|
#F1F1ED, #E7E7E1, #DFDED5, // interactive-secondary
|
|
@@ -159,9 +185,9 @@
|
|
|
159
185
|
#F1F1ED, #E7E7E1, #DFDED5, // interactive-control
|
|
160
186
|
#F1F1ED, #E7E7E1, #DFDED5 // background-surface
|
|
161
187
|
);
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
188
|
+
}
|
|
189
|
+
&-elevated {
|
|
190
|
+
.sentiment-surface-tokens(
|
|
165
191
|
#F1F1ED, #E7E7E1, #DFDED5, // content-primary
|
|
166
192
|
#F1F1ED, #E7E7E1, #DFDED5, // interactive-primary
|
|
167
193
|
#454745, #353635, #232423, // interactive-secondary
|
|
@@ -169,13 +195,16 @@
|
|
|
169
195
|
#454745, #353635, #232423, // interactive-control
|
|
170
196
|
#454745, #353635, #232423 // background-surface
|
|
171
197
|
);
|
|
172
|
-
|
|
173
|
-
|
|
198
|
+
}
|
|
199
|
+
}
|
|
174
200
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
201
|
+
.np-theme-personal--dark &,
|
|
202
|
+
.np-theme-business--dark &,
|
|
203
|
+
.np-theme-personal--forest-green &,
|
|
204
|
+
.np-theme-business--forest-green &,
|
|
205
|
+
.np-theme-platform--forest-green & {
|
|
206
|
+
&-base {
|
|
207
|
+
.sentiment-surface-tokens(
|
|
179
208
|
#F1F1ED, #E7E7E1, #DFDED5, // content-primary
|
|
180
209
|
#F1F1ED, #E7E7E1, #DFDED5, // interactive-primary
|
|
181
210
|
#2A2C29, #414441, #595B58, // interactive-secondary
|
|
@@ -183,9 +212,9 @@
|
|
|
183
212
|
#2A2C29, #414441, #595B58, // interactive-control
|
|
184
213
|
#2A2C29, #414441, #595B58 // background-surface
|
|
185
214
|
);
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
215
|
+
}
|
|
216
|
+
&-elevated {
|
|
217
|
+
.sentiment-surface-tokens(
|
|
189
218
|
#2A2C29, #414441, #595B58, // content-primary
|
|
190
219
|
#2A2C29, #414441, #595B58, // interactive-primary
|
|
191
220
|
#F1F1ED, #E7E7E1, #DFDED5, // interactive-secondary
|
|
@@ -193,14 +222,17 @@
|
|
|
193
222
|
#F1F1ED, #E7E7E1, #DFDED5, // interactive-control
|
|
194
223
|
#F1F1ED, #E7E7E1, #DFDED5 // background-surface
|
|
195
224
|
);
|
|
196
|
-
|
|
197
|
-
}
|
|
225
|
+
}
|
|
198
226
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
227
|
+
}
|
|
228
|
+
&-proposition {
|
|
229
|
+
.np-theme-personal &,
|
|
230
|
+
.np-theme-business &,
|
|
231
|
+
.np-theme-platform &,
|
|
232
|
+
.np-theme-personal--bright-green &,
|
|
233
|
+
.np-theme-business--bright-green & {
|
|
234
|
+
&-base {
|
|
235
|
+
.sentiment-surface-tokens(
|
|
204
236
|
#0E0F0C, #0A2826, #074140, // content-primary (default, hover, active)
|
|
205
237
|
#054D4D, #043A3A, #022626, // interactive-primary
|
|
206
238
|
#E0F7F7, #CAF1F1, #B6ECEC, // interactive-secondary
|
|
@@ -208,9 +240,9 @@
|
|
|
208
240
|
#E0F7F7, #CAF1F1, #B6ECEC, // interactive-control
|
|
209
241
|
#E0F7F7, #CAF1F1, #B6ECEC // background-surface
|
|
210
242
|
);
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
243
|
+
}
|
|
244
|
+
&-elevated {
|
|
245
|
+
.sentiment-surface-tokens(
|
|
214
246
|
#FFFFFF, #EAF9F9, #D5F4F4, // content-primary
|
|
215
247
|
#E0F7F7, #CAF1F1, #B6ECEC, // interactive-primary
|
|
216
248
|
#054D4D, #043A3A, #022626, // interactive-secondary
|
|
@@ -218,13 +250,16 @@
|
|
|
218
250
|
#054D4D, #043A3A, #022626, // interactive-control
|
|
219
251
|
#054D4D, #043A3A, #022626 // background-surface
|
|
220
252
|
);
|
|
221
|
-
|
|
222
|
-
|
|
253
|
+
}
|
|
254
|
+
}
|
|
223
255
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
256
|
+
.np-theme-personal--dark &,
|
|
257
|
+
.np-theme-business--dark &,
|
|
258
|
+
.np-theme-personal--forest-green &,
|
|
259
|
+
.np-theme-business--forest-green &,
|
|
260
|
+
.np-theme-platform--forest-green & {
|
|
261
|
+
&-base {
|
|
262
|
+
.sentiment-surface-tokens(
|
|
228
263
|
#FFFFFF, #EAF9F9, #D5F4F4, // content-primary
|
|
229
264
|
#E0F7F7, #CAF1F1, #B6ECEC, // interactive-primary
|
|
230
265
|
#0B312F, #124F4C, #176460, // interactive-secondary
|
|
@@ -232,9 +267,9 @@
|
|
|
232
267
|
#0B312F, #124F4C, #176460, // interactive-control
|
|
233
268
|
#0B312F, #124F4C, #176460 // background-surface
|
|
234
269
|
);
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
270
|
+
}
|
|
271
|
+
&-elevated {
|
|
272
|
+
.sentiment-surface-tokens(
|
|
238
273
|
#0E0F0C, #0A2826, #074140, // content-primary
|
|
239
274
|
#0B312F, #104744, #16605C, // interactive-primary
|
|
240
275
|
#E0F7F7, #CAF1F1, #B6ECEC, // interactive-secondary
|
|
@@ -242,9 +277,11 @@
|
|
|
242
277
|
#E0F7F7, #CAF1F1, #B6ECEC, // interactive-control
|
|
243
278
|
#E0F7F7, #CAF1F1, #B6ECEC // background-surface
|
|
244
279
|
);
|
|
245
|
-
|
|
246
|
-
}
|
|
280
|
+
}
|
|
247
281
|
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
--ring-outline-color: var(--color-sentiment-content-primary, var(--color-content-primary));
|
|
248
285
|
}
|
|
249
286
|
|
|
250
287
|
.sentiment-surface-tokens(
|
|
@@ -267,27 +304,27 @@
|
|
|
267
304
|
@background-surface-hover,
|
|
268
305
|
@background-surface-active
|
|
269
306
|
) {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
307
|
+
--color-sentiment-content-primary: @content-primary;
|
|
308
|
+
--color-sentiment-content-primary-hover: @content-primary-hover;
|
|
309
|
+
--color-sentiment-content-primary-active: @content-primary-active;
|
|
273
310
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
311
|
+
--color-sentiment-interactive-primary: @interactive-primary;
|
|
312
|
+
--color-sentiment-interactive-primary-hover: @interactive-primary-hover;
|
|
313
|
+
--color-sentiment-interactive-primary-active: @interactive-primary-active;
|
|
277
314
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
315
|
+
--color-sentiment-interactive-secondary: @interactive-secondary;
|
|
316
|
+
--color-sentiment-interactive-secondary-hover: @interactive-secondary-hover;
|
|
317
|
+
--color-sentiment-interactive-secondary-active: @interactive-secondary-active;
|
|
281
318
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
319
|
+
--color-sentiment-interactive-secondary-neutral: @interactive-secondary-neutral;
|
|
320
|
+
--color-sentiment-interactive-secondary-neutral-hover: @interactive-secondary-neutral-hover;
|
|
321
|
+
--color-sentiment-interactive-secondary-neutral-active: @interactive-secondary-neutral-active;
|
|
285
322
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
323
|
+
--color-sentiment-interactive-control: @interactive-control;
|
|
324
|
+
--color-sentiment-interactive-control-hover: @interactive-control-hover;
|
|
325
|
+
--color-sentiment-interactive-control-active: @interactive-control-active;
|
|
289
326
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
327
|
+
--color-sentiment-background-surface: @background-surface;
|
|
328
|
+
--color-sentiment-background-surface-hover: @background-surface-hover;
|
|
329
|
+
--color-sentiment-background-surface-active: @background-surface-active;
|
|
293
330
|
}
|
|
@@ -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
|
);
|