@transferwise/components 0.0.0-experimental-47816e0 → 0.0.0-experimental-13147b1

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 (38) hide show
  1. package/build/main.css +210 -210
  2. package/build/styles/main.css +210 -210
  3. package/build/styles/uploadInput/UploadInput.css +13 -81
  4. package/build/styles/uploadInput/uploadButton/UploadButton.css +78 -31
  5. package/build/styles/uploadInput/uploadItem/UploadItem.css +130 -109
  6. package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
  7. package/build/types/uploadInput/uploadButton/UploadButton.d.ts +6 -1
  8. package/build/types/uploadInput/uploadButton/UploadButton.d.ts.map +1 -1
  9. package/build/uploadInput/UploadInput.js +26 -16
  10. package/build/uploadInput/UploadInput.js.map +1 -1
  11. package/build/uploadInput/UploadInput.mjs +26 -16
  12. package/build/uploadInput/UploadInput.mjs.map +1 -1
  13. package/build/uploadInput/uploadButton/UploadButton.js +24 -31
  14. package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
  15. package/build/uploadInput/uploadButton/UploadButton.mjs +24 -31
  16. package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
  17. package/build/uploadInput/uploadItem/UploadItem.js +30 -37
  18. package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
  19. package/build/uploadInput/uploadItem/UploadItem.mjs +31 -38
  20. package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
  21. package/build/uploadInput/uploadItem/UploadItemLink.js +2 -1
  22. package/build/uploadInput/uploadItem/UploadItemLink.js.map +1 -1
  23. package/build/uploadInput/uploadItem/UploadItemLink.mjs +2 -1
  24. package/build/uploadInput/uploadItem/UploadItemLink.mjs.map +1 -1
  25. package/package.json +3 -3
  26. package/src/main.css +210 -210
  27. package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.story.tsx +8 -3
  28. package/src/uploadInput/UploadInput.css +13 -81
  29. package/src/uploadInput/UploadInput.less +17 -79
  30. package/src/uploadInput/UploadInput.tests.story.tsx +8 -3
  31. package/src/uploadInput/UploadInput.tsx +38 -28
  32. package/src/uploadInput/uploadButton/UploadButton.css +78 -31
  33. package/src/uploadInput/uploadButton/UploadButton.less +78 -35
  34. package/src/uploadInput/uploadButton/UploadButton.tsx +36 -25
  35. package/src/uploadInput/uploadItem/UploadItem.css +130 -109
  36. package/src/uploadInput/uploadItem/UploadItem.less +129 -118
  37. package/src/uploadInput/uploadItem/UploadItem.tsx +27 -27
  38. package/src/uploadInput/uploadItem/UploadItemLink.tsx +3 -3
@@ -1,144 +1,165 @@
1
- .np-upload-item {
2
- border: 1px solid #c9cbce;
3
- border: 1px solid var(--color-interactive-secondary);
1
+ .np-upload-input__item {
4
2
  position: relative;
5
- }
6
- .np-upload-item:first-child ~ div:not(.np-upload-item--link):before,
7
- .np-upload-item:not(:first-child).np-upload-item--link .np-upload-item__link:before,
8
- .np-upload-item.np-upload-item--link:hover .np-upload-item__link:after {
3
+ padding: 16px;
4
+ padding: var(--size-16);
5
+ display: flex;
6
+ align-items: flex-start;
7
+ border-left: var(--outerBorder);
8
+ border-right: var(--outerBorder);
9
+ }
10
+ .np-upload-input__item:first-child {
11
+ border-top: var(--outerBorder);
12
+ border-top-left-radius: 10px;
13
+ border-top-left-radius: var(--radius-small);
14
+ border-top-right-radius: 10px;
15
+ border-top-right-radius: var(--radius-small);
16
+ }
17
+ .np-upload-input__item + .np-upload-input__item:before {
18
+ content: " ";
9
19
  display: block;
10
20
  position: absolute;
11
21
  height: 1px;
12
- background-color: rgba(0,0,0,0.10196);
13
- background-color: var(--color-border-neutral);
14
- content: " ";
15
22
  left: 16px;
16
23
  left: var(--size-16);
17
24
  width: calc(100% - 2 * 16px);
18
25
  width: calc(100% - 2 * var(--size-16));
19
- }
20
- .np-upload-item:first-child ~ div:not(.np-upload-item--link):before,
21
- .np-upload-item:not(:first-child).np-upload-item--link .np-upload-item__link:before {
22
26
  top: 0;
27
+ background: rgba(0,0,0,0.10196);
28
+ background: var(--color-border-neutral);
23
29
  }
24
- .np-upload-item.np-upload-item--link:hover .np-upload-item__link:after {
25
- bottom: -1px;
26
- }
27
- .np-upload-item:first-child ~ div {
28
- border-top: 1px;
30
+ .np-upload-input__item .np-upload-input__item-content {
31
+ padding-right: 32px;
32
+ padding-right: var(--size-32);
33
+ flex: 1;
29
34
  }
30
- .np-upload-item:not(:first-child) .np-upload-item__link:hover {
31
- border-top-color: rgba(0,0,0,0.10196);
32
- border-top-color: var(--color-border-neutral);
35
+ @media (max-width: 320px) {
36
+ .np-upload-input__item .np-upload-input__item-content {
37
+ padding-right: 64px;
38
+ padding-right: var(--size-64);
39
+ }
33
40
  }
34
- .np-upload-item:not(:last-child) {
35
- border-bottom: 0;
41
+ .np-upload-input__item .np-upload-input__title,
42
+ .np-upload-input__item .np-upload-input__text {
43
+ margin: 0;
44
+ -moz-text-align-last: left;
45
+ text-align-last: left;
46
+ color: #5d7079;
47
+ color: var(--color-content-secondary);
48
+ }
49
+ .np-upload-input__item .np-upload-input__title + .np-upload-input__text {
50
+ margin-top: 4px;
51
+ margin-top: var(--size-4);
52
+ }
53
+ .np-upload-input__item .np-upload-input__icon {
54
+ padding-right: 16px;
55
+ padding-right: var(--size-16);
56
+ }
57
+ .np-upload-input__item .np-upload-input__item-link,
58
+ .np-upload-input__item .np-upload-input__item-container {
59
+ align-items: flex-start;
60
+ display: flex;
61
+ width: 100%;
36
62
  }
37
- .np-upload-item.np-upload-item--link:hover + .np-upload-item:before,
38
- .np-upload-item.np-upload-item--link:hover + .np-upload-button-container:before,
39
- .np-upload-item.np-upload-item--link:hover + .np-upload-item .np-upload-item__link:before,
40
- .np-upload-item.np-upload-item--link:hover + .np-upload-button-container .np-upload-item__link:before {
41
- display: none;
63
+ .np-upload-input__item .np-upload-input__item-action {
64
+ --iconSize: var(--size-24);
65
+ --clickAreaSize: 44px;
66
+ --buttonTopRightOffset: var(--size-16);
67
+ --clickAreaTopRightOffset: calc((var(--clickAreaSize) - var(--iconSize)) * -0.5);
68
+ position: absolute;
69
+ right: 16px;
70
+ right: var(--buttonTopRightOffset);
71
+ top: 16px;
72
+ top: var(--buttonTopRightOffset);
42
73
  }
43
- .np-upload-button-container:hover:before,
44
- .np-upload-button-container.droppable-dropping:before {
45
- left: 0 !important;
46
- width: 100% !important;
74
+ @media (max-width: 320px) {
75
+ .np-upload-input__item .np-upload-input__item-action {
76
+ --iconSize: var(--size-48);
77
+ --clickAreaTopRightOffset: calc(-1 * var(--buttonTopRightOffset));
78
+ }
47
79
  }
48
- .np-upload-button-container:has(:focus-visible) {
49
- outline: var(--ring-outline-color) solid var(--ring-outline-width);
50
- outline-offset: var(--ring-outline-offset);
51
- border-color: transparent;
52
- outline-offset: -3px;
80
+ .np-upload-input__item .np-upload-input__item-action .np-upload-input__item-button {
81
+ -webkit-appearance: none;
82
+ -moz-appearance: none;
83
+ appearance: none;
84
+ height: var(--iconSize);
85
+ width: var(--iconSize);
86
+ padding: 0 4px;
87
+ padding: 0 var(--size-4);
88
+ border-radius: 50%;
89
+ border: 0;
90
+ background-color: rgba(134,167,189,0.10196);
91
+ background-color: var(--color-background-neutral);
92
+ color: var(--color-interactive-primary);
93
+ transition: color, background-color 0.15s ease-in-out;
94
+ outline-offset: 0;
95
+ display: flex;
96
+ align-items: center;
97
+ justify-content: center;
53
98
  }
54
- .np-upload-item--single-file:focus-visible,
55
- .np-upload-item__link:focus-visible,
56
- .np-upload-button-container:has(:focus-visible) {
57
- outline-width: 3px;
99
+ .np-upload-input__item .np-upload-input__item-action .np-upload-input__item-button:before {
100
+ content: '';
101
+ display: block;
102
+ width: var(--clickAreaSize);
103
+ height: var(--clickAreaSize);
104
+ border-radius: 50%;
105
+ position: absolute;
106
+ top: var(--clickAreaTopRightOffset);
107
+ right: var(--clickAreaTopRightOffset);
58
108
  }
59
- .np-upload-item--link a {
60
- flex: 1;
61
- -webkit-text-decoration: none;
62
- text-decoration: none;
63
- border-top: 1px solid transparent;
64
- border-radius: inherit;
109
+ .np-upload-input__item .np-upload-input__item-action .np-upload-input__item-button:hover {
110
+ background-color: var(--color-sentiment-negative);
111
+ color: var(--color-contrast-overlay) !important;
65
112
  }
66
- .np-upload-item--link a:focus-visible {
67
- outline-offset: -2px;
113
+ .np-upload-input__item .np-upload-input__item-action .np-upload-input__item-button:active {
114
+ background-color: var(--color-background-neutral-active);
68
115
  }
69
- .np-upload-item--link a:hover:before {
70
- display: none !important;
116
+ .np-upload-input__item.is-interactive {
117
+ padding: 0;
71
118
  }
72
- .np-upload-item--link a:hover:after {
73
- left: 0 !important;
74
- width: 100% !important;
119
+ .np-upload-input__item.is-interactive:hover:not(:has(.np-upload-input__item-button:hover)):before,
120
+ .np-upload-input__item.is-interactive:hover:not(:has(.np-upload-input__item-button:hover)) + .np-upload-input__item:before {
121
+ width: 100%;
122
+ left: 0;
75
123
  }
76
- .np-upload-item--link a:hover,
77
- .np-upload-item--link a:active {
124
+ .np-upload-input__item.is-interactive .np-upload-input__item-link {
125
+ padding: 16px;
126
+ padding: var(--size-16);
78
127
  -webkit-text-decoration: none;
79
128
  text-decoration: none;
129
+ border-radius: inherit;
130
+ border-top: 1px solid transparent;
131
+ background-clip: padding-box;
132
+ }
133
+ .np-upload-input__item.is-interactive .np-upload-input__item-link:focus-visible {
134
+ outline-offset: -2px;
135
+ outline-width: 3px;
80
136
  }
81
- .np-upload-item--link a:hover .np-upload-button,
82
- .np-upload-item--link a:active .np-upload-button {
137
+ .np-upload-input__item.is-interactive .np-upload-input__item-link:hover,
138
+ .np-upload-input__item.is-interactive .np-upload-input__item-link:active {
83
139
  background-color: rgba(134,167,189,0.10196);
84
140
  background-color: var(--color-background-neutral);
85
- border-radius: inherit;
86
141
  }
87
- .np-upload-item--link:first-of-type a {
88
- border-top: 0;
142
+ .np-upload-input__item.is-interactive:first-child .np-upload-input__item-link {
143
+ border-top-width: 0;
89
144
  }
90
- .np-upload-item__body {
91
- display: flex;
92
- align-items: center;
93
- justify-content: space-between;
145
+ .np-upload-input__item .np-upload-input-errors {
146
+ padding-left: 0;
147
+ list-style-type: "";
148
+ }
149
+ .np-upload-input__item .np-upload-input-errors > li {
94
150
  position: relative;
95
- border-radius: inherit;
151
+ padding-left: 16px;
152
+ padding-left: var(--size-16);
96
153
  }
97
- .np-upload-item__remove-button {
98
- display: flex;
99
- align-items: center;
100
- justify-content: center;
101
- align-self: flex-start;
154
+ .np-upload-input__item .np-upload-input-errors > li::before {
155
+ content: '•';
102
156
  position: absolute;
103
- height: 24px;
104
- height: var(--size-24);
105
- min-height: 0;
106
- width: 24px;
107
- width: var(--size-24);
108
- padding: 0;
109
- border-radius: 50% !important;
110
- outline-offset: 0 !important;
111
- background-color: rgba(134,167,189,0.10196);
112
- background-color: var(--color-background-neutral);
113
- border: none;
114
- color: var(--color-interactive-primary);
115
- right: 16px;
116
- right: var(--size-16);
117
- top: 16px;
118
- top: var(--size-16);
119
- transition: color, background-color 0.15s ease-in-out;
157
+ display: block;
158
+ left: 0;
120
159
  }
121
160
  @media (max-width: 320px) {
122
- .np-upload-item__remove-button {
123
- top: 16px;
124
- top: var(--size-16);
125
- right: 16px;
126
- right: var(--size-16);
127
- height: 48px;
128
- height: var(--size-48);
129
- width: 48px;
130
- width: var(--size-48);
161
+ .np-upload-input__item .np-upload-input-errors > li {
162
+ padding-left: 32px;
163
+ padding-left: var(--size-32);
131
164
  }
132
165
  }
133
- .np-upload-item__remove-button:hover {
134
- background-color: var(--color-sentiment-negative);
135
- color: var(--color-contrast-overlay) !important;
136
- }
137
- .np-upload-item__remove-button:before {
138
- display: block;
139
- width: 44px;
140
- height: 44px;
141
- content: '';
142
- border-radius: 50%;
143
- position: absolute;
144
- }
@@ -1,160 +1,171 @@
1
1
  @import (reference) "../../../node_modules/@transferwise/neptune-css/src/less/ring.less";
2
2
 
3
- // Be aware of touching styles related to :before/:after pseudo-elements in this file, delimiters between items build by using them
4
- .np-upload-item {
5
- border: 1px solid var(--color-interactive-secondary);
3
+ .np-upload-input__item {
6
4
  position: relative;
5
+ padding: var(--size-16);
6
+ display: flex;
7
+ align-items: flex-start;
8
+ border-left: var(--outerBorder);
9
+ border-right: var(--outerBorder);
7
10
 
8
- &:first-child ~ div:not(.np-upload-item--link):before,
9
- &:not(:first-child).np-upload-item--link .np-upload-item__link:before,
10
- &.np-upload-item--link:hover .np-upload-item__link:after {
11
- display: block;
12
- position: absolute;
13
- height: 1px;
14
- background-color: var(--color-border-neutral);
15
- content: " ";
16
- left: var(--size-16);
17
- width: calc(100% - 2 * var(--size-16));
11
+ &:first-child {
12
+ border-top: var(--outerBorder);
13
+ border-top-left-radius: var(--radius-small);
14
+ border-top-right-radius: var(--radius-small);
18
15
  }
19
16
 
20
- &:first-child ~ div:not(.np-upload-item--link):before,
21
- &:not(:first-child).np-upload-item--link .np-upload-item__link:before {
22
- top: 0;
17
+ & + .np-upload-input__item {
18
+ &:before {
19
+ content: " ";
20
+ display: block;
21
+ position: absolute;
22
+ height: 1px;
23
+ left: var(--size-16);
24
+ width: calc(100% - 2 * var(--size-16));
25
+ top: 0;
26
+ background: var(--color-border-neutral);
27
+ }
23
28
  }
24
29
 
25
- &.np-upload-item--link:hover .np-upload-item__link:after {
26
- bottom: -1px;
27
- }
30
+ .np-upload-input__item-content {
31
+ padding-right: var(--size-32);
32
+ flex: 1;
28
33
 
29
- &:first-child {
30
- & ~ div {
31
- border-top: 1px;
34
+ @media (max-width: 320px) {
35
+ padding-right: var(--size-64);
32
36
  }
33
37
  }
34
38
 
35
- &:not(:first-child) {
36
- .np-upload-item__link:hover {
37
- border-top-color: var(--color-border-neutral);
38
- }
39
+ .np-upload-input__title,
40
+ .np-upload-input__text {
41
+ margin: 0;
42
+ text-align-last: left;
43
+ color: var(--color-content-secondary);
39
44
  }
40
45
 
41
- &:not(:last-child) {
42
- border-bottom: 0;
46
+ .np-upload-input__title + .np-upload-input__text {
47
+ margin-top: var(--size-4);
43
48
  }
44
49
 
45
-
46
- &.np-upload-item--link:hover + .np-upload-item,
47
- &.np-upload-item--link:hover + .np-upload-button-container {
48
- &:before,
49
- .np-upload-item__link:before {
50
- display: none;
51
- }
50
+ .np-upload-input__icon {
51
+ padding-right: var(--size-16);
52
52
  }
53
- }
54
53
 
55
- .np-upload-button-container {
56
- &:hover:before,
57
- &.droppable-dropping:before {
58
- left: 0 !important;
59
- width: 100% !important;
54
+ .np-upload-input__item-link,
55
+ .np-upload-input__item-container {
56
+ align-items: flex-start;
57
+ display: flex;
58
+ width: 100%;
60
59
  }
61
60
 
62
- &:has(:focus-visible) {
63
- .ring();
64
- border-color: transparent;
65
- outline-offset: -3px;
66
- }
67
- }
61
+ .np-upload-input__item-action {
62
+ --iconSize: var(--size-24);
63
+ --clickAreaSize: 44px;
64
+ --buttonTopRightOffset: var(--size-16);
65
+ // Offset towards the parent's top-right edge
66
+ // ensuring no overflow on smaller screens
67
+ --clickAreaTopRightOffset: calc((var(--clickAreaSize) - var(--iconSize)) * -.5);
68
68
 
69
- .np-upload-item--single-file:focus-visible,
70
- .np-upload-item__link:focus-visible,
71
- .np-upload-button-container:has(:focus-visible) {
72
- outline-width: 3px;
73
- }
74
-
75
- .np-upload-item--link {
76
- a {
77
- flex: 1;
78
- text-decoration: none;
79
- border-top: 1px solid transparent;
80
- border-radius: inherit;
69
+ position: absolute;
70
+ right: var(--buttonTopRightOffset);
71
+ top: var(--buttonTopRightOffset);
81
72
 
82
- &:focus-visible {
83
- outline-offset: -2px;
73
+ @media (--screen-400-zoom) {
74
+ --iconSize: var(--size-48);
75
+ --clickAreaTopRightOffset: calc(-1 * var(--buttonTopRightOffset));
84
76
  }
85
77
 
86
- &:hover {
78
+ .np-upload-input__item-button {
79
+ appearance: none;
80
+ height: var(--iconSize);
81
+ width: var(--iconSize);
82
+ padding: 0 var(--size-4);
83
+ border-radius: 50%;
84
+ border: 0;
85
+ background-color: var(--color-background-neutral);
86
+ color: var(--color-interactive-primary);
87
+ transition: color, background-color 0.15s ease-in-out;
88
+ outline-offset: 0;
89
+ display: flex;
90
+ align-items: center;
91
+ justify-content: center;
92
+
87
93
  &:before {
88
- display: none !important;
94
+ content: '';
95
+ display: block;
96
+ width: var(--clickAreaSize);
97
+ height: var(--clickAreaSize);
98
+ border-radius: 50%;
99
+ position: absolute;
100
+ top: var(--clickAreaTopRightOffset);
101
+ right: var(--clickAreaTopRightOffset);
102
+ }
103
+
104
+ &:hover {
105
+ background-color: var(--color-sentiment-negative);
106
+ color: var(--color-contrast-overlay) !important;
107
+ }
108
+
109
+ &:active {
110
+ background-color: var(--color-background-neutral-active);
89
111
  }
112
+ }
113
+ }
90
114
 
91
- &:after {
92
- left: 0 !important;
93
- width: 100% !important;
115
+ &.is-interactive {
116
+ padding: 0;
117
+
118
+ &:hover:not(:has(.np-upload-input__item-button:hover)) {
119
+ &:before,
120
+ & + .np-upload-input__item:before {
121
+ width: 100%;
122
+ left: 0;
94
123
  }
95
124
  }
96
125
 
97
- &:hover,
98
- &:active {
126
+ .np-upload-input__item-link {
127
+ padding: var(--size-16);
99
128
  text-decoration: none;
100
- .np-upload-button {
129
+ border-radius: inherit;
130
+ border-top: 1px solid transparent;
131
+ background-clip: padding-box;
132
+
133
+ &:focus-visible {
134
+ outline-offset: -2px;
135
+ outline-width: 3px;
136
+ }
137
+
138
+ &:hover,
139
+ &:active {
101
140
  background-color: var(--color-background-neutral);
102
- border-radius: inherit;
103
141
  }
104
142
  }
105
- }
106
143
 
107
- &:first-of-type a {
108
- border-top: 0;
144
+ &:first-child {
145
+ .np-upload-input__item-link {
146
+ border-top-width: 0;
147
+ }
148
+ }
109
149
  }
110
- }
111
150
 
112
- .np-upload-item__body {
113
- display: flex;
114
- align-items: center;
115
- justify-content: space-between;
116
- // We should have the `relative` position for the body, because we have `absolute` position for `np-upload-item__remove-button` to achieve appropriate `hover` effects
117
- position: relative;
118
- border-radius: inherit;
119
- }
151
+ .np-upload-input-errors {
152
+ padding-left: 0;
153
+ list-style-type: "";
120
154
 
121
- .np-upload-item__remove-button {
122
- display: flex;
123
- align-items: center;
124
- justify-content: center;
125
- align-self: flex-start;
126
- position: absolute;
127
- height: var(--size-24);
128
- min-height: 0;
129
- width: var(--size-24);
130
- padding: 0;
131
- border-radius: 50% !important;
132
- outline-offset: 0 !important;
133
- background-color: var(--color-background-neutral);
134
- border: none;
135
- color: var(--color-interactive-primary);
136
- right: var(--size-16);
137
- top: var(--size-16);
138
- transition: color, background-color 0.15s ease-in-out;
139
-
140
- @media (--screen-400-zoom) {
141
- top: var(--size-16);
142
- right: var(--size-16);
143
- height: var(--size-48);
144
- width: var(--size-48);
145
- }
155
+ & > li {
156
+ position: relative;
157
+ padding-left: var(--size-16);
146
158
 
147
- &:hover {
148
- background-color: var(--color-sentiment-negative);
149
- color: var(--color-contrast-overlay) !important;
150
- }
159
+ &::before {
160
+ content: '•';
161
+ position: absolute;
162
+ display: block;
163
+ left: 0;
164
+ }
151
165
 
152
- &:before {
153
- display: block;
154
- width: 44px;
155
- height: 44px;
156
- content: '';
157
- border-radius: 50%;
158
- position: absolute;
166
+ @media (max-width: 320px) {
167
+ padding-left: var(--size-32);
168
+ }
169
+ }
159
170
  }
160
171
  }
@@ -97,7 +97,7 @@ const UploadItem = ({
97
97
  const getDescription = () => {
98
98
  if (error || errors?.length || status === Status.FAILED) {
99
99
  return (
100
- <Body type={Typography.BODY_DEFAULT_BOLD} className="text-negative">
100
+ <Body type={Typography.BODY_DEFAULT_BOLD} className="np-upload-input__text text-negative">
101
101
  {errors?.length ? getMultipleErrors(errors) : getErrorMessage(error)}
102
102
  </Body>
103
103
  );
@@ -105,14 +105,18 @@ const UploadItem = ({
105
105
 
106
106
  switch (status) {
107
107
  case Status.PENDING:
108
- return <Body type={Typography.BODY_DEFAULT_BOLD}>{formatMessage(MESSAGES.uploading)}</Body>;
108
+ return (
109
+ <Body type={Typography.BODY_DEFAULT} className="np-upload-input__text">
110
+ {formatMessage(MESSAGES.uploading)}
111
+ </Body>
112
+ );
109
113
  case Status.PROCESSING:
110
- return <Body>{formatMessage(MESSAGES.deleting)}</Body>;
114
+ return <Body className="np-upload-input__text">{formatMessage(MESSAGES.deleting)}</Body>;
111
115
  case Status.SUCCEEDED:
112
116
  case Status.DONE:
113
117
  default:
114
118
  return (
115
- <Body type={Typography.BODY_DEFAULT_BOLD} className="text-positive">
119
+ <Body type={Typography.BODY_DEFAULT_BOLD} className="np-upload-input__text">
116
120
  {formatMessage(MESSAGES.uploaded)}
117
121
  </Body>
118
122
  );
@@ -132,38 +136,34 @@ const UploadItem = ({
132
136
 
133
137
  return (
134
138
  <div
135
- className={clsx('np-upload-item', { 'np-upload-item--link': isSucceeded })}
139
+ className={clsx('np-upload-input__item', { 'is-interactive': isSucceeded && url })}
136
140
  data-testid={TEST_IDS.uploadItem}
137
141
  >
138
- <div className="np-upload-item__body">
139
- <UploadItemLink
140
- url={isSucceeded ? url : undefined}
141
- singleFileUpload={singleFileUpload}
142
- onDownload={onDownloadFile}
143
- >
144
- <div className="np-upload-button" aria-live="polite">
145
- <div className="media">
146
- <div className="np-upload-icon media-left">{getIcon()}</div>
147
- <div className="media-body text-xs-left" data-testid={TEST_IDS.mediaBody}>
148
- <Body className="text-word-break d-block text-primary">{getTitle()}</Body>
149
- {getDescription()}
150
- </div>
151
- </div>
152
- </div>
153
- </UploadItemLink>
154
- {canDelete && (
142
+ <UploadItemLink
143
+ url={isSucceeded ? url : undefined}
144
+ singleFileUpload={singleFileUpload}
145
+ onDownload={onDownloadFile}
146
+ >
147
+ <span className="np-upload-input__icon">{getIcon()}</span>
148
+ <div className="np-upload-input__item-content">
149
+ <Body type={Typography.BODY_LARGE} className="np-upload-input__title text-word-break">
150
+ {getTitle()}
151
+ </Body>
152
+ {getDescription()}
153
+ </div>
154
+ </UploadItemLink>
155
+ {canDelete && (
156
+ <div className="np-upload-input__item-action">
155
157
  <button
156
158
  aria-label={formatMessage(MESSAGES.removeFile, { filename })}
157
- className={clsx('btn', 'np-upload-item__remove-button', 'media-left', {
158
- 'np-upload-item--single-file': singleFileUpload,
159
- })}
159
+ className="np-upload-input__item-button"
160
160
  type="button"
161
161
  onClick={() => onDelete()}
162
162
  >
163
163
  <Bin size={16} />
164
164
  </button>
165
- )}
166
- </div>
165
+ </div>
166
+ )}
167
167
  </div>
168
168
  );
169
169
  };
@@ -14,7 +14,7 @@ export const UploadItemLink = ({
14
14
  singleFileUpload,
15
15
  }: UploadItemLinkProps) => {
16
16
  if (!url) {
17
- return <div>{children}</div>;
17
+ return <div className={clsx('np-upload-input__item-container')}>{children}</div>;
18
18
  }
19
19
 
20
20
  return (
@@ -23,8 +23,8 @@ export const UploadItemLink = ({
23
23
  target="_blank"
24
24
  rel="noopener noreferrer"
25
25
  className={clsx(
26
- 'np-upload-item__link',
27
- singleFileUpload ? 'np-upload-item--single-file' : '',
26
+ 'np-upload-input__item-link',
27
+ singleFileUpload ? 'np-upload-input__item-link--single-file' : '',
28
28
  )}
29
29
  onClick={onDownload}
30
30
  >