@transferwise/components 46.67.1 → 46.68.0
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/button/Button.js +22 -6
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +22 -6
- package/build/button/Button.mjs.map +1 -1
- package/build/main.css +212 -210
- package/build/styles/button/Button.css +3 -0
- package/build/styles/main.css +212 -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/typeahead/Typeahead.js +23 -10
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +23 -11
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.js +6 -3
- package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs +6 -3
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs.map +1 -1
- package/build/typeahead/typeaheadOption/TypeaheadOption.js +9 -6
- package/build/typeahead/typeaheadOption/TypeaheadOption.js.map +1 -1
- package/build/typeahead/typeaheadOption/TypeaheadOption.mjs +9 -6
- package/build/typeahead/typeaheadOption/TypeaheadOption.mjs.map +1 -1
- package/build/types/button/Button.d.ts.map +1 -1
- package/build/types/typeahead/Typeahead.d.ts +1 -1
- package/build/types/typeahead/Typeahead.d.ts.map +1 -1
- package/build/types/typeahead/typeaheadInput/TypeaheadInput.d.ts +2 -0
- package/build/types/typeahead/typeaheadInput/TypeaheadInput.d.ts.map +1 -1
- package/build/types/typeahead/typeaheadOption/TypeaheadOption.d.ts +2 -1
- package/build/types/typeahead/typeaheadOption/TypeaheadOption.d.ts.map +1 -1
- 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 +3 -3
- package/src/button/Button.css +3 -0
- package/src/button/Button.less +6 -0
- package/src/button/Button.spec.js +81 -45
- package/src/button/Button.story.tsx +54 -20
- package/src/button/Button.tsx +32 -7
- package/src/button/__snapshots__/Button.spec.js.snap +56 -12
- package/src/main.css +212 -210
- package/src/typeahead/Typeahead.spec.js +14 -0
- package/src/typeahead/Typeahead.story.tsx +12 -9
- package/src/typeahead/Typeahead.tsx +34 -16
- package/src/typeahead/typeaheadInput/TypeaheadInput.spec.js +6 -0
- package/src/typeahead/typeaheadInput/TypeaheadInput.tsx +10 -1
- package/src/typeahead/typeaheadOption/TypeaheadOption.spec.js +8 -0
- package/src/typeahead/typeaheadOption/TypeaheadOption.tsx +9 -6
- 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
|
@@ -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
|
>
|