@transferwise/components 0.0.0-experimental-e41fdbd → 0.0.0-experimental-f1f1846

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 +209 -210
  2. package/build/styles/main.css +209 -210
  3. package/build/styles/uploadInput/UploadInput.css +13 -81
  4. package/build/styles/uploadInput/uploadButton/UploadButton.css +77 -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 +5 -0
  8. package/build/types/uploadInput/uploadButton/UploadButton.d.ts.map +1 -1
  9. package/build/types/uploadInput/uploadItem/UploadItem.d.ts.map +1 -1
  10. package/build/uploadInput/UploadInput.js +30 -20
  11. package/build/uploadInput/UploadInput.js.map +1 -1
  12. package/build/uploadInput/UploadInput.mjs +30 -20
  13. package/build/uploadInput/UploadInput.mjs.map +1 -1
  14. package/build/uploadInput/uploadButton/UploadButton.js +25 -32
  15. package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
  16. package/build/uploadInput/uploadButton/UploadButton.mjs +25 -32
  17. package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
  18. package/build/uploadInput/uploadItem/UploadItem.js +32 -38
  19. package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
  20. package/build/uploadInput/uploadItem/UploadItem.mjs +33 -39
  21. package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
  22. package/build/uploadInput/uploadItem/UploadItemLink.js +2 -1
  23. package/build/uploadInput/uploadItem/UploadItemLink.js.map +1 -1
  24. package/build/uploadInput/uploadItem/UploadItemLink.mjs +2 -1
  25. package/build/uploadInput/uploadItem/UploadItemLink.mjs.map +1 -1
  26. package/package.json +2 -2
  27. package/src/main.css +209 -210
  28. package/src/uploadInput/UploadInput.css +13 -81
  29. package/src/uploadInput/UploadInput.less +18 -80
  30. package/src/uploadInput/UploadInput.tests.story.tsx +5 -5
  31. package/src/uploadInput/UploadInput.tsx +43 -32
  32. package/src/uploadInput/uploadButton/UploadButton.css +77 -31
  33. package/src/uploadInput/uploadButton/UploadButton.less +77 -35
  34. package/src/uploadInput/uploadButton/UploadButton.tsx +37 -26
  35. package/src/uploadInput/uploadItem/UploadItem.css +130 -109
  36. package/src/uploadInput/uploadItem/UploadItem.less +130 -118
  37. package/src/uploadInput/uploadItem/UploadItem.tsx +26 -28
  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,172 @@
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));
18
- }
19
-
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;
23
- }
24
-
25
- &.np-upload-item--link:hover .np-upload-item__link:after {
26
- bottom: -1px;
11
+ &:first-child {
12
+ border-top: var(--outerBorder);
13
+ border-top-left-radius: var(--radius-small);
14
+ border-top-right-radius: var(--radius-small);
27
15
  }
28
16
 
29
- &:first-child {
30
- & ~ div {
31
- border-top: 1px;
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);
32
27
  }
33
28
  }
34
29
 
35
- &:not(:first-child) {
36
- .np-upload-item__link:hover {
37
- border-top-color: var(--color-border-neutral);
30
+ .np-upload-input__item-content {
31
+ padding-right: var(--size-32);
32
+ flex: 1;
33
+
34
+ @media (max-width: 320px) {
35
+ padding-right: var(--size-64);
38
36
  }
39
37
  }
40
38
 
41
- &:not(:last-child) {
42
- border-bottom: 0;
39
+ .np-upload-input__title,
40
+ .np-upload-input__text {
41
+ margin: 0;
42
+ text-align-last: left;
43
+ color: var(--color-content-secondary);
43
44
  }
44
45
 
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
- }
46
+ .np-upload-input__title + .np-upload-input__text {
47
+ margin-top: var(--size-4);
52
48
  }
53
- }
54
49
 
55
- .np-upload-button-container {
56
- &:hover:before,
57
- &.droppable-dropping:before {
58
- left: 0 !important;
59
- width: 100% !important;
50
+ .np-upload-input__icon {
51
+ padding-right: var(--size-16);
60
52
  }
61
53
 
62
- &:has(:focus-visible) {
63
- .ring();
64
- border-color: transparent;
65
- outline-offset: -3px;
54
+ .np-upload-input__item-link,
55
+ .np-upload-input__item-container {
56
+ align-items: flex-start;
57
+ display: flex;
58
+ width: 100%;
66
59
  }
67
- }
68
60
 
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
- }
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);
74
68
 
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;
89
107
  }
90
108
 
91
- &:after {
92
- left: 0 !important;
93
- width: 100% !important;
109
+ &:active {
110
+ background-color: var(--color-background-neutral-active);
94
111
  }
95
112
  }
113
+ }
114
+
115
+ &.is-interactive {
116
+ padding: 0;
96
117
 
97
- &:hover,
98
- &:active {
118
+ &:hover:not(:has(.np-upload-input__item-button:hover)) {
119
+
120
+ &:before,
121
+ & + .np-upload-input__item:before {
122
+ width: 100%;
123
+ left: 0;
124
+ }
125
+ }
126
+
127
+ .np-upload-input__item-link {
128
+ padding: var(--size-16);
99
129
  text-decoration: none;
100
- .np-upload-button {
130
+ border-radius: inherit;
131
+ border-top: 1px solid transparent;
132
+ background-clip: padding-box;
133
+
134
+ &:focus-visible {
135
+ outline-offset: -2px;
136
+ outline-width: 3px;
137
+ }
138
+
139
+ &:hover,
140
+ &:active {
101
141
  background-color: var(--color-background-neutral);
102
- border-radius: inherit;
103
142
  }
104
143
  }
105
- }
106
144
 
107
- &:first-of-type a {
108
- border-top: 0;
145
+ &:first-child {
146
+ .np-upload-input__item-link {
147
+ border-top-width: 0;
148
+ }
149
+ }
109
150
  }
110
- }
111
151
 
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
- }
152
+ .np-upload-input-errors {
153
+ padding-left: 0;
154
+ list-style-type: "";
120
155
 
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
- }
156
+ & > li {
157
+ position: relative;
158
+ padding-left: var(--size-16);
146
159
 
147
- &:hover {
148
- background-color: var(--color-sentiment-negative);
149
- color: var(--color-contrast-overlay) !important;
150
- }
160
+ &::before {
161
+ content: '•';
162
+ position: absolute;
163
+ display: block;
164
+ left: 0;
165
+ }
151
166
 
152
- &:before {
153
- display: block;
154
- width: 44px;
155
- height: 44px;
156
- content: '';
157
- border-radius: 50%;
158
- position: absolute;
167
+ @media (max-width: 320px) {
168
+ padding-left: var(--size-32);
169
+ }
170
+ }
159
171
  }
160
172
  }
@@ -112,7 +112,7 @@ const UploadItem = forwardRef<UploadItemRef, UploadItemProps>(
112
112
  const getDescription = () => {
113
113
  if (error || errors?.length || status === Status.FAILED) {
114
114
  return (
115
- <Body type={Typography.BODY_DEFAULT_BOLD} className="text-negative">
115
+ <Body type={Typography.BODY_DEFAULT_BOLD} className="np-upload-input__text text-negative">
116
116
  {errors?.length ? getMultipleErrors(errors) : getErrorMessage(error)}
117
117
  </Body>
118
118
  );
@@ -121,15 +121,17 @@ const UploadItem = forwardRef<UploadItemRef, UploadItemProps>(
121
121
  switch (status) {
122
122
  case Status.PENDING:
123
123
  return (
124
- <Body type={Typography.BODY_DEFAULT_BOLD}>{formatMessage(MESSAGES.uploading)}</Body>
124
+ <Body type={Typography.BODY_DEFAULT} className="np-upload-input__text">
125
+ {formatMessage(MESSAGES.uploading)}
126
+ </Body>
125
127
  );
126
128
  case Status.PROCESSING:
127
- return <Body>{formatMessage(MESSAGES.deleting)}</Body>;
129
+ return <Body className="np-upload-input__text">{formatMessage(MESSAGES.deleting)}</Body>;
128
130
  case Status.SUCCEEDED:
129
131
  case Status.DONE:
130
132
  default:
131
133
  return (
132
- <Body type={Typography.BODY_DEFAULT_BOLD} className="text-positive">
134
+ <Body type={Typography.BODY_DEFAULT_BOLD} className="np-upload-input__text">
133
135
  {formatMessage(MESSAGES.uploaded)}
134
136
  </Body>
135
137
  );
@@ -149,40 +151,36 @@ const UploadItem = forwardRef<UploadItemRef, UploadItemProps>(
149
151
 
150
152
  return (
151
153
  <div
152
- className={clsx('np-upload-item', { 'np-upload-item--link': isSucceeded })}
154
+ className={clsx('np-upload-input__item', { 'is-interactive': isSucceeded && url })}
153
155
  data-testid={TEST_IDS.uploadItem}
154
156
  >
155
- <div className="np-upload-item__body">
156
- <UploadItemLink
157
- ref={linkRef}
158
- url={isSucceeded ? url : undefined}
159
- singleFileUpload={singleFileUpload}
160
- onDownload={onDownloadFile}
161
- >
162
- <div className="np-upload-button" aria-live="polite">
163
- <div className="media">
164
- <div className="np-upload-icon media-left">{getIcon()}</div>
165
- <div className="media-body text-xs-left" data-testid={TEST_IDS.mediaBody}>
166
- <Body className="text-word-break d-block text-primary">{getTitle()}</Body>
167
- {getDescription()}
168
- </div>
169
- </div>
170
- </div>
171
- </UploadItemLink>
172
- {canDelete && (
157
+ <UploadItemLink
158
+ ref={linkRef}
159
+ url={isSucceeded ? url : undefined}
160
+ singleFileUpload={singleFileUpload}
161
+ onDownload={onDownloadFile}
162
+ >
163
+ <span className="np-upload-input__icon">{getIcon()}</span>
164
+ <div className="np-upload-input__item-content" data-testid={TEST_IDS.mediaBody}>
165
+ <Body type={Typography.BODY_LARGE} className="np-upload-input__title text-word-break">
166
+ {getTitle()}
167
+ </Body>
168
+ {getDescription()}
169
+ </div>
170
+ </UploadItemLink>
171
+ {canDelete && (
172
+ <div className="np-upload-input__item-action">
173
173
  <button
174
174
  ref={buttonRef}
175
175
  aria-label={formatMessage(MESSAGES.removeFile, { filename })}
176
- className={clsx('btn', 'np-upload-item__remove-button', 'media-left', {
177
- 'np-upload-item--single-file': singleFileUpload,
178
- })}
176
+ className="np-upload-input__item-button"
179
177
  type="button"
180
178
  onClick={() => onDelete()}
181
179
  >
182
180
  <Bin size={16} />
183
181
  </button>
184
- )}
185
- </div>
182
+ </div>
183
+ )}
186
184
  </div>
187
185
  );
188
186
  },
@@ -10,7 +10,7 @@ type UploadItemLinkProps = PropsWithChildren<{
10
10
  export const UploadItemLink = forwardRef<HTMLAnchorElement | HTMLDivElement, UploadItemLinkProps>(
11
11
  ({ children, url, onDownload, singleFileUpload }, ref) => {
12
12
  if (!url) {
13
- return <div ref={ref as React.RefObject<HTMLDivElement>}>{children}</div>;
13
+ return <div ref={ref as React.RefObject<HTMLDivElement>} className={clsx('np-upload-input__item-container')}>{children}</div>;
14
14
  }
15
15
 
16
16
  return (
@@ -20,8 +20,8 @@ export const UploadItemLink = forwardRef<HTMLAnchorElement | HTMLDivElement, Upl
20
20
  target="_blank"
21
21
  rel="noopener noreferrer"
22
22
  className={clsx(
23
- 'np-upload-item__link',
24
- singleFileUpload ? 'np-upload-item--single-file' : '',
23
+ 'np-upload-input__item-link',
24
+ singleFileUpload ? 'np-upload-input__item-link--single-file' : '',
25
25
  )}
26
26
  onClick={onDownload}
27
27
  >