@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.
- package/build/main.css +209 -210
- package/build/styles/main.css +209 -210
- package/build/styles/uploadInput/UploadInput.css +13 -81
- package/build/styles/uploadInput/uploadButton/UploadButton.css +77 -31
- package/build/styles/uploadInput/uploadItem/UploadItem.css +130 -109
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/types/uploadInput/uploadButton/UploadButton.d.ts +5 -0
- package/build/types/uploadInput/uploadButton/UploadButton.d.ts.map +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts.map +1 -1
- package/build/uploadInput/UploadInput.js +30 -20
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +30 -20
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js +25 -32
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs +25 -32
- package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +32 -38
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +33 -39
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItemLink.js +2 -1
- package/build/uploadInput/uploadItem/UploadItemLink.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItemLink.mjs +2 -1
- package/build/uploadInput/uploadItem/UploadItemLink.mjs.map +1 -1
- package/package.json +2 -2
- package/src/main.css +209 -210
- package/src/uploadInput/UploadInput.css +13 -81
- package/src/uploadInput/UploadInput.less +18 -80
- package/src/uploadInput/UploadInput.tests.story.tsx +5 -5
- package/src/uploadInput/UploadInput.tsx +43 -32
- package/src/uploadInput/uploadButton/UploadButton.css +77 -31
- package/src/uploadInput/uploadButton/UploadButton.less +77 -35
- package/src/uploadInput/uploadButton/UploadButton.tsx +37 -26
- package/src/uploadInput/uploadItem/UploadItem.css +130 -109
- package/src/uploadInput/uploadItem/UploadItem.less +130 -118
- package/src/uploadInput/uploadItem/UploadItem.tsx +26 -28
- package/src/uploadInput/uploadItem/UploadItemLink.tsx +3 -3
|
@@ -1,144 +1,165 @@
|
|
|
1
|
-
.np-upload-
|
|
2
|
-
border: 1px solid #c9cbce;
|
|
3
|
-
border: 1px solid var(--color-interactive-secondary);
|
|
1
|
+
.np-upload-input__item {
|
|
4
2
|
position: relative;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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-
|
|
35
|
-
|
|
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-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
44
|
-
.np-upload-
|
|
45
|
-
|
|
46
|
-
|
|
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-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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-
|
|
60
|
-
|
|
61
|
-
-
|
|
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-
|
|
67
|
-
|
|
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-
|
|
70
|
-
|
|
116
|
+
.np-upload-input__item.is-interactive {
|
|
117
|
+
padding: 0;
|
|
71
118
|
}
|
|
72
|
-
.np-upload-
|
|
73
|
-
|
|
74
|
-
width: 100
|
|
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-
|
|
77
|
-
|
|
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-
|
|
82
|
-
.np-upload-
|
|
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-
|
|
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-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
151
|
+
padding-left: 16px;
|
|
152
|
+
padding-left: var(--size-16);
|
|
96
153
|
}
|
|
97
|
-
.np-upload-
|
|
98
|
-
|
|
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
|
-
|
|
104
|
-
|
|
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-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
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
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
42
|
-
|
|
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
|
-
|
|
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-
|
|
56
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
83
|
-
|
|
73
|
+
@media (--screen-400-zoom) {
|
|
74
|
+
--iconSize: var(--size-48);
|
|
75
|
+
--clickAreaTopRightOffset: calc(-1 * var(--buttonTopRightOffset));
|
|
84
76
|
}
|
|
85
77
|
|
|
86
|
-
|
|
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
|
-
|
|
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
|
-
&:
|
|
92
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
108
|
-
|
|
145
|
+
&:first-child {
|
|
146
|
+
.np-upload-input__item-link {
|
|
147
|
+
border-top-width: 0;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
109
150
|
}
|
|
110
|
-
}
|
|
111
151
|
|
|
112
|
-
.np-upload-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
160
|
+
&::before {
|
|
161
|
+
content: '•';
|
|
162
|
+
position: absolute;
|
|
163
|
+
display: block;
|
|
164
|
+
left: 0;
|
|
165
|
+
}
|
|
151
166
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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.
|
|
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="
|
|
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-
|
|
154
|
+
className={clsx('np-upload-input__item', { 'is-interactive': isSucceeded && url })}
|
|
153
155
|
data-testid={TEST_IDS.uploadItem}
|
|
154
156
|
>
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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=
|
|
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
|
-
|
|
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-
|
|
24
|
-
singleFileUpload ? 'np-upload-
|
|
23
|
+
'np-upload-input__item-link',
|
|
24
|
+
singleFileUpload ? 'np-upload-input__item-link--single-file' : '',
|
|
25
25
|
)}
|
|
26
26
|
onClick={onDownload}
|
|
27
27
|
>
|