@transferwise/components 0.0.0-experimental-e06e456 → 0.0.0-experimental-e3978a5

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 (201) hide show
  1. package/build/index.js +2 -0
  2. package/build/index.js.map +1 -1
  3. package/build/index.mjs +1 -0
  4. package/build/index.mjs.map +1 -1
  5. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +56 -0
  6. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -0
  7. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +54 -0
  8. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -0
  9. package/build/listItem/AvatarLayout/ListItemAvatarLayout.js +23 -0
  10. package/build/listItem/AvatarLayout/ListItemAvatarLayout.js.map +1 -0
  11. package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs +21 -0
  12. package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs.map +1 -0
  13. package/build/listItem/AvatarView/ListItemAvatarView.js +23 -0
  14. package/build/listItem/AvatarView/ListItemAvatarView.js.map +1 -0
  15. package/build/listItem/AvatarView/ListItemAvatarView.mjs +21 -0
  16. package/build/listItem/AvatarView/ListItemAvatarView.mjs.map +1 -0
  17. package/build/listItem/Button/ListItemButton.js +43 -0
  18. package/build/listItem/Button/ListItemButton.js.map +1 -0
  19. package/build/listItem/Button/ListItemButton.mjs +41 -0
  20. package/build/listItem/Button/ListItemButton.mjs.map +1 -0
  21. package/build/listItem/Checkbox/ListItemCheckbox.js +30 -0
  22. package/build/listItem/Checkbox/ListItemCheckbox.js.map +1 -0
  23. package/build/listItem/Checkbox/ListItemCheckbox.mjs +28 -0
  24. package/build/listItem/Checkbox/ListItemCheckbox.mjs.map +1 -0
  25. package/build/listItem/IconButton/ListItemIconButton.js +56 -0
  26. package/build/listItem/IconButton/ListItemIconButton.js.map +1 -0
  27. package/build/listItem/IconButton/ListItemIconButton.mjs +54 -0
  28. package/build/listItem/IconButton/ListItemIconButton.mjs.map +1 -0
  29. package/build/listItem/Image/ListItemImage.js +31 -0
  30. package/build/listItem/Image/ListItemImage.js.map +1 -0
  31. package/build/listItem/Image/ListItemImage.mjs +29 -0
  32. package/build/listItem/Image/ListItemImage.mjs.map +1 -0
  33. package/build/listItem/ListItem.js +313 -0
  34. package/build/listItem/ListItem.js.map +1 -0
  35. package/build/listItem/ListItem.mjs +308 -0
  36. package/build/listItem/ListItem.mjs.map +1 -0
  37. package/build/listItem/ListItemContext.js +8 -0
  38. package/build/listItem/ListItemContext.js.map +1 -0
  39. package/build/listItem/ListItemContext.mjs +6 -0
  40. package/build/listItem/ListItemContext.mjs.map +1 -0
  41. package/build/listItem/Navigation/ListItemNavigation.js +44 -0
  42. package/build/listItem/Navigation/ListItemNavigation.js.map +1 -0
  43. package/build/listItem/Navigation/ListItemNavigation.mjs +42 -0
  44. package/build/listItem/Navigation/ListItemNavigation.mjs.map +1 -0
  45. package/build/listItem/Prompt/ListItemPrompt.js +59 -0
  46. package/build/listItem/Prompt/ListItemPrompt.js.map +1 -0
  47. package/build/listItem/Prompt/ListItemPrompt.mjs +54 -0
  48. package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -0
  49. package/build/listItem/Radio/ListItemRadio.js +30 -0
  50. package/build/listItem/Radio/ListItemRadio.js.map +1 -0
  51. package/build/listItem/Radio/ListItemRadio.mjs +28 -0
  52. package/build/listItem/Radio/ListItemRadio.mjs.map +1 -0
  53. package/build/listItem/Switch/ListItemSwitch.js +30 -0
  54. package/build/listItem/Switch/ListItemSwitch.js.map +1 -0
  55. package/build/listItem/Switch/ListItemSwitch.mjs +28 -0
  56. package/build/listItem/Switch/ListItemSwitch.mjs.map +1 -0
  57. package/build/listItem/useListItemControl.js +22 -0
  58. package/build/listItem/useListItemControl.js.map +1 -0
  59. package/build/listItem/useListItemControl.mjs +20 -0
  60. package/build/listItem/useListItemControl.mjs.map +1 -0
  61. package/build/listItem/useListItemMedia.js +21 -0
  62. package/build/listItem/useListItemMedia.js.map +1 -0
  63. package/build/listItem/useListItemMedia.mjs +19 -0
  64. package/build/listItem/useListItemMedia.mjs.map +1 -0
  65. package/build/main.css +771 -1
  66. package/build/styles/button/Button.css +1 -1
  67. package/build/styles/listItem/ListItem.css +770 -0
  68. package/build/styles/listItem/ListItem.grid.css +370 -0
  69. package/build/styles/main.css +771 -1
  70. package/build/types/index.d.ts +2 -0
  71. package/build/types/index.d.ts.map +1 -1
  72. package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts +15 -0
  73. package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts.map +1 -0
  74. package/build/types/listItem/AdditionalInfo/index.d.ts +3 -0
  75. package/build/types/listItem/AdditionalInfo/index.d.ts.map +1 -0
  76. package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts +18 -0
  77. package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts.map +1 -0
  78. package/build/types/listItem/AvatarLayout/index.d.ts +3 -0
  79. package/build/types/listItem/AvatarLayout/index.d.ts.map +1 -0
  80. package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts +16 -0
  81. package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts.map +1 -0
  82. package/build/types/listItem/AvatarView/index.d.ts +3 -0
  83. package/build/types/listItem/AvatarView/index.d.ts.map +1 -0
  84. package/build/types/listItem/Button/ListItemButton.d.ts +20 -0
  85. package/build/types/listItem/Button/ListItemButton.d.ts.map +1 -0
  86. package/build/types/listItem/Button/index.d.ts +3 -0
  87. package/build/types/listItem/Button/index.d.ts.map +1 -0
  88. package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts +14 -0
  89. package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts.map +1 -0
  90. package/build/types/listItem/Checkbox/index.d.ts +3 -0
  91. package/build/types/listItem/Checkbox/index.d.ts.map +1 -0
  92. package/build/types/listItem/IconButton/ListItemIconButton.d.ts +18 -0
  93. package/build/types/listItem/IconButton/ListItemIconButton.d.ts.map +1 -0
  94. package/build/types/listItem/IconButton/index.d.ts +3 -0
  95. package/build/types/listItem/IconButton/index.d.ts.map +1 -0
  96. package/build/types/listItem/Image/ListItemImage.d.ts +25 -0
  97. package/build/types/listItem/Image/ListItemImage.d.ts.map +1 -0
  98. package/build/types/listItem/Image/index.d.ts +3 -0
  99. package/build/types/listItem/Image/index.d.ts.map +1 -0
  100. package/build/types/listItem/ListItem.d.ts +113 -0
  101. package/build/types/listItem/ListItem.d.ts.map +1 -0
  102. package/build/types/listItem/ListItemContext.d.ts +21 -0
  103. package/build/types/listItem/ListItemContext.d.ts.map +1 -0
  104. package/build/types/listItem/Navigation/ListItemNavigation.d.ts +15 -0
  105. package/build/types/listItem/Navigation/ListItemNavigation.d.ts.map +1 -0
  106. package/build/types/listItem/Navigation/index.d.ts +3 -0
  107. package/build/types/listItem/Navigation/index.d.ts.map +1 -0
  108. package/build/types/listItem/Prompt/ListItemPrompt.d.ts +16 -0
  109. package/build/types/listItem/Prompt/ListItemPrompt.d.ts.map +1 -0
  110. package/build/types/listItem/Prompt/index.d.ts +3 -0
  111. package/build/types/listItem/Prompt/index.d.ts.map +1 -0
  112. package/build/types/listItem/Radio/ListItemRadio.d.ts +14 -0
  113. package/build/types/listItem/Radio/ListItemRadio.d.ts.map +1 -0
  114. package/build/types/listItem/Radio/index.d.ts +3 -0
  115. package/build/types/listItem/Radio/index.d.ts.map +1 -0
  116. package/build/types/listItem/Switch/ListItemSwitch.d.ts +14 -0
  117. package/build/types/listItem/Switch/ListItemSwitch.d.ts.map +1 -0
  118. package/build/types/listItem/Switch/index.d.ts +3 -0
  119. package/build/types/listItem/Switch/index.d.ts.map +1 -0
  120. package/build/types/listItem/_stories/helpers.d.ts +27 -0
  121. package/build/types/listItem/_stories/helpers.d.ts.map +1 -0
  122. package/build/types/listItem/_stories/subcomponents.d.ts +18 -0
  123. package/build/types/listItem/_stories/subcomponents.d.ts.map +1 -0
  124. package/build/types/listItem/index.d.ts +14 -0
  125. package/build/types/listItem/index.d.ts.map +1 -0
  126. package/build/types/listItem/test-utils.d.ts +7 -0
  127. package/build/types/listItem/test-utils.d.ts.map +1 -0
  128. package/build/types/listItem/useListItemControl.d.ts +5 -0
  129. package/build/types/listItem/useListItemControl.d.ts.map +1 -0
  130. package/build/types/listItem/useListItemMedia.d.ts +6 -0
  131. package/build/types/listItem/useListItemMedia.d.ts.map +1 -0
  132. package/package.json +1 -1
  133. package/src/button/Button.css +1 -1
  134. package/src/button/Button.less +1 -1
  135. package/src/button/Button.story.tsx +4 -9
  136. package/src/index.ts +15 -0
  137. package/src/list/List.story.tsx +13 -3
  138. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.spec.tsx +56 -0
  139. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +198 -0
  140. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.tsx +36 -0
  141. package/src/listItem/AdditionalInfo/index.ts +2 -0
  142. package/src/listItem/AvatarLayout/ListItemAvatarLayout.spec.tsx +59 -0
  143. package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +124 -0
  144. package/src/listItem/AvatarLayout/ListItemAvatarLayout.tsx +27 -0
  145. package/src/listItem/AvatarLayout/index.ts +2 -0
  146. package/src/listItem/AvatarView/ListItemAvatarView.spec.tsx +75 -0
  147. package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +339 -0
  148. package/src/listItem/AvatarView/ListItemAvatarView.tsx +27 -0
  149. package/src/listItem/AvatarView/index.ts +2 -0
  150. package/src/listItem/Button/ListItemButton.spec.tsx +68 -0
  151. package/src/listItem/Button/ListItemButton.story.tsx +473 -0
  152. package/src/listItem/Button/ListItemButton.tsx +56 -0
  153. package/src/listItem/Button/index.ts +2 -0
  154. package/src/listItem/Checkbox/ListItemCheckbox.spec.tsx +82 -0
  155. package/src/listItem/Checkbox/ListItemCheckbox.story.tsx +128 -0
  156. package/src/listItem/Checkbox/ListItemCheckbox.tsx +33 -0
  157. package/src/listItem/Checkbox/index.ts +2 -0
  158. package/src/listItem/IconButton/ListItemIconButton.spec.tsx +119 -0
  159. package/src/listItem/IconButton/ListItemIconButton.story.tsx +284 -0
  160. package/src/listItem/IconButton/ListItemIconButton.tsx +73 -0
  161. package/src/listItem/IconButton/index.ts +2 -0
  162. package/src/listItem/Image/ListItemImage.spec.tsx +30 -0
  163. package/src/listItem/Image/ListItemImage.story.tsx +80 -0
  164. package/src/listItem/Image/ListItemImage.tsx +46 -0
  165. package/src/listItem/Image/index.ts +2 -0
  166. package/src/listItem/ListItem.css +770 -0
  167. package/src/listItem/ListItem.grid.css +370 -0
  168. package/src/listItem/ListItem.grid.less +622 -0
  169. package/src/listItem/ListItem.less +421 -0
  170. package/src/listItem/ListItem.spec.tsx +1521 -0
  171. package/src/listItem/ListItem.tsx +444 -0
  172. package/src/listItem/ListItemContext.tsx +26 -0
  173. package/src/listItem/Navigation/ListItemNavigation.spec.tsx +59 -0
  174. package/src/listItem/Navigation/ListItemNavigation.story.tsx +112 -0
  175. package/src/listItem/Navigation/ListItemNavigation.tsx +39 -0
  176. package/src/listItem/Navigation/index.ts +2 -0
  177. package/src/listItem/Prompt/ListItemPrompt.spec.tsx +36 -0
  178. package/src/listItem/Prompt/ListItemPrompt.story.tsx +204 -0
  179. package/src/listItem/Prompt/ListItemPrompt.tsx +32 -0
  180. package/src/listItem/Prompt/index.ts +2 -0
  181. package/src/listItem/Radio/ListItemRadio.spec.tsx +66 -0
  182. package/src/listItem/Radio/ListItemRadio.story.tsx +111 -0
  183. package/src/listItem/Radio/ListItemRadio.tsx +33 -0
  184. package/src/listItem/Radio/index.ts +2 -0
  185. package/src/listItem/Switch/ListItemSwitch.spec.tsx +47 -0
  186. package/src/listItem/Switch/ListItemSwitch.story.tsx +79 -0
  187. package/src/listItem/Switch/ListItemSwitch.tsx +33 -0
  188. package/src/listItem/Switch/index.ts +2 -0
  189. package/src/listItem/_stories/ListItem.focus.test.story.tsx +265 -0
  190. package/src/listItem/_stories/ListItem.layout.test.story.tsx +354 -0
  191. package/src/listItem/_stories/ListItem.scenarios.story.tsx +228 -0
  192. package/src/listItem/_stories/ListItem.story.tsx +775 -0
  193. package/src/listItem/_stories/ListItem.variants.test.story.tsx +271 -0
  194. package/src/listItem/_stories/helpers.tsx +53 -0
  195. package/src/listItem/_stories/subcomponents.tsx +139 -0
  196. package/src/listItem/index.ts +14 -0
  197. package/src/listItem/test-utils.tsx +33 -0
  198. package/src/listItem/useListItemControl.tsx +18 -0
  199. package/src/listItem/useListItemMedia.tsx +16 -0
  200. package/src/main.css +771 -1
  201. package/src/main.less +1 -0
@@ -0,0 +1,421 @@
1
+ @import "./ListItem.grid.less";
2
+ @import (reference) "../../node_modules/@transferwise/neptune-css/src/less/ring.less";
3
+
4
+ .wds-list-item {
5
+ list-style: none;
6
+ width: 100%;
7
+ border-radius: var(--radius-medium);
8
+ background-color: var(--color-background-screen);
9
+ position: relative;
10
+ padding: var(--size-12) 0;
11
+ container-type: inline-size;
12
+
13
+ & + .wds-list-item-spotlight,
14
+ .wds-list-item-spotlight + &{
15
+ margin-top: var(--size-16);
16
+ }
17
+
18
+ &:focus-within{
19
+ z-index: 1;
20
+ }
21
+
22
+ &-view {
23
+ display: grid;
24
+ grid-column: 1 / -1;
25
+ grid-row: 1 / -1;
26
+ grid-template-columns: subgrid;
27
+ grid-template-rows: subgrid;
28
+
29
+ &.fullyInteractive {
30
+ margin-bottom: 0;
31
+ &:before {
32
+ content: '';
33
+ position: absolute;
34
+ inset: 0;
35
+ }
36
+ }
37
+ }
38
+
39
+ a {
40
+ text-underline-offset: calc(var(--size-4) / 2);
41
+ }
42
+
43
+ &-interactive {
44
+ .wds-list-item-control:focus-visible,
45
+ // checkboxes are the only control that didn't work with .wds-list-item-control:focus-visible above. TODO: update checkbox so that it does
46
+ .np-checkbox-button:has(input[type="checkbox"]:focus-visible) .tw-checkbox-button {
47
+ outline: none;
48
+ }
49
+
50
+ .wds-list-item-additional-info {
51
+ .ring-offset-0
52
+ }
53
+
54
+ a.wds-list-item-control {
55
+ &, &:hover, &:focus {
56
+ text-decoration: none;
57
+ }
58
+
59
+ &:has(.wds-list-item-control_pseudo-element) {
60
+ position: relative;
61
+ z-index: 1;
62
+ }
63
+
64
+ &.wds-list-item-control_pseudo-element {
65
+ &:before {
66
+ content: '';
67
+ position: absolute;
68
+ inset: 0;
69
+ }
70
+ }
71
+ }
72
+
73
+ // spotlighted list item has extra horizontal padding so the focus
74
+ // and hover styles can be rendered within the main container.
75
+ &.wds-list-item-spotlight {
76
+ &:has(.wds-list-item-control:focus-visible),
77
+ &:has(input[type="checkbox"]:focus-visible) {
78
+ .ring();
79
+ outline-offset: -1px;
80
+ }
81
+
82
+ &:not(.disabled, :disabled) {
83
+ &:hover {
84
+ background-color: var(--color-background-screen-hover);
85
+ }
86
+
87
+ &:active {
88
+ background-color: var(--color-background-screen-active);
89
+ }
90
+ }
91
+
92
+ &:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button) {
93
+ &:hover {
94
+ background-color: unset;
95
+ }
96
+ }
97
+ }
98
+
99
+ // non-spotlighted list item has no horizontal padding so the focus
100
+ // and hover styles have to be rendered out of bounds.
101
+ &:not(.wds-list-item-spotlight) {
102
+ &:has(.wds-list-item-control:focus-visible),
103
+ &:has(input[type="checkbox"]:focus-visible) {
104
+ &:before {
105
+ .ring();
106
+ content: '';
107
+ position: absolute;
108
+ inset: 0 -8px;
109
+ border-radius: var(--radius-medium);
110
+ outline-offset: -1px;
111
+ }
112
+ }
113
+
114
+ &:not(.disabled, :disabled) {
115
+ &:hover,
116
+ &:active {
117
+ &:before {
118
+ content: '';
119
+ position: absolute;
120
+ inset: 0 -8px;
121
+ border-radius: var(--radius-medium);
122
+ }
123
+ }
124
+
125
+ &:hover:before {
126
+ background-color: var(--color-background-screen-hover);
127
+ }
128
+
129
+ &:active:before {
130
+ background-color: var(--color-background-screen-active);
131
+ }
132
+ }
133
+
134
+ &:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button) {
135
+ &:hover:before {
136
+ background-color: unset;
137
+ }
138
+ }
139
+ }
140
+
141
+ &:not(.disabled, :disabled):hover {
142
+ .wds-list-item-control-wrapper {
143
+ .wds-Button {
144
+ background-color: var(--Button-background-hover);
145
+ color: var(--Button-color-hover);
146
+ transition: none;
147
+ }
148
+ }
149
+ }
150
+
151
+ .wds-list-item-button-control {
152
+ .wds-Button {
153
+ transition: none;
154
+ }
155
+ }
156
+ }
157
+
158
+ &-media {
159
+ grid-area: media;
160
+ display: flex;
161
+ align-items: start;
162
+
163
+ &-image-wrapper {
164
+ width: var(--wds-list-item-media-size);
165
+ height: var(--wds-list-item-media-size);
166
+ }
167
+
168
+ &-image {
169
+ width: 100%;
170
+ height: 100%;
171
+ object-fit: contain;
172
+ }
173
+ }
174
+
175
+ &-body {
176
+ grid-area: body;
177
+ align-items: center;
178
+ width: 100%;
179
+ display: grid;
180
+ grid-template-columns: var(--wds-list-item-body-left, 1fr) var(--wds-list-item-body-right, max-content);
181
+ gap: var(--size-16);
182
+ word-break: break-word;
183
+ }
184
+
185
+ &-title, &-title-value {
186
+ color: var(--color-content-primary);
187
+ }
188
+
189
+ &-value {
190
+ text-align: right;
191
+ }
192
+
193
+ &-body-center {
194
+ display: flex;
195
+ flex-direction: row;
196
+ align-items: center;
197
+ }
198
+
199
+ &-additional-info {
200
+ grid-area: info;
201
+ color: var(--color-content-tertiary);
202
+ margin-top: calc(var(--size-4) * -1);
203
+ }
204
+
205
+ &-control-wrapper {
206
+ grid-area: control;
207
+ align-content: center;
208
+ height: var(--wds-list-item-control-wrapper-height);
209
+ }
210
+
211
+ &-navigation {
212
+ .tw-icon-chevron-right {
213
+ color: var(--color-interactive-secondary);
214
+ }
215
+ }
216
+
217
+ &-control {
218
+ flex: 0 0 auto;
219
+ }
220
+
221
+ &.disabled {
222
+ filter: none;
223
+ opacity: 1;
224
+
225
+ label {
226
+ cursor: not-allowed;
227
+ }
228
+
229
+ .tw-icon-backslash-circle {
230
+ color: var(--color-content-tertiary);
231
+ }
232
+ }
233
+
234
+
235
+
236
+ &-spotlight {
237
+ padding-left: var(--size-12);
238
+ padding-right: var(--size-12);
239
+
240
+ &-active {
241
+ background-color: var(--color-background-neutral);
242
+ &:not(.disabled, :disabled):hover {
243
+ background-color: var(--color-background-neutral-hover);
244
+ }
245
+ &:not(.disabled, :disabled):active {
246
+ background-color: var(--color-background-neutral-active);
247
+ }
248
+ }
249
+
250
+ &-inactive {
251
+ background-color: color-mix(in srgb, var(--color-background-neutral) 25%, transparent);
252
+
253
+ &:not(.disabled, :disabled):hover {
254
+ background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
255
+ }
256
+ &:not(.disabled, :disabled):active {
257
+ background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
258
+ }
259
+ }
260
+ }
261
+
262
+ .wds-list-item-spotlight__border{
263
+ position: absolute;
264
+ inset:0;
265
+ width: 100%;
266
+ height: 100%;
267
+
268
+ rect {
269
+ --wds-list-item-spotlight-borderWidth: 1px;
270
+ --wds-list-item-spotlight-borderWidthOffset: .5px; // half of the border width to center the border
271
+ --wds-list-item-spotlight-strokeDashSize: calc(var(--size-12) * .5);
272
+
273
+ fill: none;
274
+ stroke: var(--color-border-neutral);
275
+ width: calc(100% - var(--wds-list-item-spotlight-borderWidth));
276
+ height: calc(100% - var(--wds-list-item-spotlight-borderWidth));
277
+ x: var(--wds-list-item-spotlight-borderWidthOffset);
278
+ y: var(--wds-list-item-spotlight-borderWidthOffset);
279
+ rx: calc(var(--radius-medium) - var(--wds-list-item-spotlight-borderWidthOffset));
280
+ ry: calc(var(--radius-medium) - var(--wds-list-item-spotlight-borderWidthOffset));
281
+ stroke-dasharray:
282
+ var(--wds-list-item-spotlight-strokeDashSize)
283
+ var(--wds-list-item-spotlight-strokeDashSize);
284
+ }
285
+ }
286
+
287
+ &-prompt {
288
+ grid-area: prompt;
289
+
290
+ display: inline-flex;
291
+ justify-self: start;
292
+ text-align: left;
293
+ padding-top: calc(var(--padding-x-small) / 2);
294
+ padding-bottom: calc(var(--padding-x-small) / 2);
295
+ padding-left: calc(var(--padding-x-small) - 1px);
296
+ padding-right: var(--padding-x-small);
297
+ border-radius: var(--radius-small);
298
+ word-break: break-word;
299
+ overflow-wrap: break-word;
300
+
301
+ &:has(a),
302
+ &:has(button) {
303
+ position: relative;
304
+ z-index: 1;
305
+ }
306
+
307
+ a, button {
308
+ text-underline-offset: calc(var(--size-4) / 2);
309
+ &:first-of-type {
310
+ &:before {
311
+ content: '';
312
+ position: absolute;
313
+ inset: 0;
314
+ }
315
+ }
316
+ }
317
+
318
+ &.np-prompt-icon {
319
+ padding-left: calc(var(--padding-x-small) - 1px);
320
+ padding-right: var(--padding-x-small);
321
+ display: inline-flex;
322
+ align-items: center;
323
+ gap: var(--size-4);
324
+ }
325
+
326
+ .np-prompt-icon {
327
+ padding-right: calc(var(--size-12) / 2);
328
+ padding-top: calc(var(--size-4) - 1px);
329
+ padding-bottom: calc(var(--size-4) - 1px);
330
+
331
+ .tw-icon-tags,
332
+ .tw-icon-confetti {
333
+ color: var(--color-sentiment-positive-primary);
334
+ }
335
+ }
336
+
337
+ &.negative {
338
+ background-color: var(--color-sentiment-negative-secondary);
339
+ color: var(--color-sentiment-negative-primary);
340
+ a, button {
341
+ color: var(--color-sentiment-negative-primary);
342
+ &:hover {
343
+ color: var(--color-sentiment-negative-primary-hover);
344
+ }
345
+ &:active {
346
+ color: var(--color-sentiment-negative-primary-active);
347
+ }
348
+ }
349
+ .wds-list-item-prompt&:has(a, button) {
350
+ &:hover {
351
+ background-color: var(--color-sentiment-negative-secondary-hover);
352
+ }
353
+ &:active {
354
+ background-color: var(--color-sentiment-negative-secondary-active);
355
+ }
356
+ }
357
+ }
358
+ &.positive,
359
+ &.discount,
360
+ &.savings {
361
+ background-color: var(--color-sentiment-positive-secondary);
362
+ color: var(--color-sentiment-positive-primary);
363
+ a, button {
364
+ color: var(--color-sentiment-positive-primary);
365
+ &:hover {
366
+ color: var(--color-sentiment-positive-primary-hover);
367
+ }
368
+ &:active {
369
+ color: var(--color-sentiment-positive-primary-active);
370
+ }
371
+ }
372
+ .wds-list-item-prompt&:has(a, button) {
373
+ &:hover {
374
+ background-color: var(--color-sentiment-positive-secondary-hover);
375
+ }
376
+ &:active {
377
+ background-color: var(--color-sentiment-positive-secondary-active);
378
+ }
379
+ }
380
+ }
381
+ &.neutral {
382
+ background-color: var(--color-background-neutral);
383
+ color: var(--color-content-primary);
384
+ a, button {
385
+ color: var(--color-content-primary);
386
+ }
387
+ .wds-list-item-prompt&:has(a, button) {
388
+ &:hover {
389
+ background-color: var(--color-background-neutral-hover);
390
+ }
391
+ &:active {
392
+ background-color: var(--color-background-neutral-active);
393
+ }
394
+ }
395
+ }
396
+ &.warning {
397
+ background-color: var(--color-sentiment-warning-secondary);
398
+ color: var(--color-sentiment-warning-content);
399
+ a, button {
400
+ color: var(--color-sentiment-warning-content);
401
+ &:hover {
402
+ color: var(--color-sentiment-warning-content-hover);
403
+ }
404
+ &:active {
405
+ color: var(--color-sentiment-warning-content-active);
406
+ }
407
+ }
408
+ .wds-list-item-prompt&:has(a, button) {
409
+ &:hover {
410
+ // someday we'll have hover and active states for warning
411
+ // background-color: var(--color-sentiment-warning-secondary-hover);
412
+ background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 92%, var(--color-sentiment-warning-primary));
413
+ }
414
+ &:active {
415
+ // background-color: var(--color-sentiment-warning-secondary-active);
416
+ background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 84%, var(--color-sentiment-warning-primary));
417
+ }
418
+ }
419
+ }
420
+ }
421
+ }