@transferwise/components 37.7.2-beta.d59732c70d.0 → 37.7.2
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/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.js +1 -1
- package/build/es/polyfill/uploadInput/uploadItem/UploadItem.js +1 -1
- package/build/umd/no-polyfill/main.js +1 -1
- package/build/umd/polyfill/main.js +1 -1
- package/package.json +6 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [37.7.2](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.7.1...@transferwise/components@37.7.2) (2021-10-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **components:** break long file names on UploadInput ([#1181](https://github.com/transferwise/neptune-web/issues/1181)) ([c0f4ff9](https://github.com/transferwise/neptune-web/commit/c0f4ff99621960cb4643bd3d54c9700b0dbcbeff))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [37.7.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.7.0...@transferwise/components@37.7.1) (2021-09-30)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @transferwise/components
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
 [](https://www.npmjs.com/package/@transferwise/components)
|
|
1
|
+
[](https://github.com/transferwise/neptune-web/actions) [](https://www.npmjs.com/package/@transferwise/components)
|
|
2
2
|
|
|
3
3
|
# Neptune Web React Components
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import _typeof from"@babel/runtime/helpers/typeof";import{AlertCircle,CrossCircle}from"@transferwise/icons";import classNames from"classnames";import{useIntl}from"react-intl";import{Size,Status}from"../../common";import{useDirection}from"../../common/hooks";import ProcessIndicator from"../../processIndicator/ProcessIndicator";import MESSAGES from"./UploadItem.messages";import{UploadItemBody}from"./UploadItemBody";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var TEST_IDS;(function(a){a.uploadItem="uploadItem",a.mediaBody="mediaBody"})(TEST_IDS||(TEST_IDS={}));var UploadItem=function(a){var b=a.file,c=a.canDelete,d=a.onDelete,e=a.onDownload,f=useDirection(),g=f.isRTL,h=useIntl(),i=h.formatMessage,j=b.status,k=b.filename,l=b.error,m=b.url,n=[Status.SUCCEEDED,void 0].includes(j)&&!!m,o=function(){return"object"===_typeof(l)&&l.message||l||i(MESSAGES.uploadingFailed)};return/*#__PURE__*/_jsx("div",{className:classNames("np-upload-item",{"np-upload-item__link":n}),"data-testid":TEST_IDS.uploadItem,children:/*#__PURE__*/_jsxs("div",{className:"np-upload-item__body",children:[/*#__PURE__*/_jsx(UploadItemBody,{url:n?m:void 0,onDownload:function onDownloadFile(a){e&&(a.preventDefault(),e(b))},children:/*#__PURE__*/_jsx("div",{className:"np-upload-button",children:/*#__PURE__*/_jsxs("div",{className:"media",children:[/*#__PURE__*/_jsx("div",{className:classNames("np-upload-icon",{"media-right":g,"media-left":!g}),children:function getIcon(){if(l||j===Status.FAILED)return/*#__PURE__*/_jsx(AlertCircle,{size:24,className:"text-danger"});var a;switch(j){case Status.PROCESSING:case Status.PENDING:a=/*#__PURE__*/_jsx(ProcessIndicator,{size:Size.EXTRA_SMALL,status:Status.PROCESSING});break;case Status.SUCCEEDED:case Status.DONE:default:a=/*#__PURE__*/_jsx(ProcessIndicator,{size:Size.EXTRA_SMALL,status:Status.SUCCEEDED});}return/*#__PURE__*/_jsx("span",{style:{transform:"scale(0.8335)"},children:a});// Scale down ProcessIndicator to be 20px*20px to match `icons`
|
|
2
|
-
}()}),/*#__PURE__*/_jsxs("div",{className:classNames("media-body",{"text-xs-right":g,"text-xs-left":!g}),"data-testid":TEST_IDS.mediaBody,children:[/*#__PURE__*/_jsx("div",{className:"text-primary",children:function getTitle(){return k||i(MESSAGES.uploadedFile)}()}),/*#__PURE__*/_jsx("small",{className:"np-upload-description text-primary",children:function getDescription(){if(l||j===Status.FAILED)return/*#__PURE__*/_jsx("span",{className:"text-danger",children:o()});switch(j){case Status.PENDING:return/*#__PURE__*/_jsx("span",{children:i(MESSAGES.uploading)});case Status.PROCESSING:return/*#__PURE__*/_jsx("span",{children:i(MESSAGES.deleting)});case Status.SUCCEEDED:case Status.DONE:default:return/*#__PURE__*/_jsx("span",{className:"text-success",children:i(MESSAGES.uploaded)});}}()})]})]})})}),c&&/*#__PURE__*/_jsx("button",{"aria-label":i(MESSAGES.removeFile,{filename:k}),className:classNames("btn np-upload-item__remove-button",{"media-right":!g,"media-left":g}),type:"button",onClick:function onClick(){return d()},children:/*#__PURE__*/_jsx(CrossCircle,{filled:!0,size:16})})]})})};export default UploadItem;
|
|
2
|
+
}()}),/*#__PURE__*/_jsxs("div",{className:classNames("media-body",{"text-xs-right":g,"text-xs-left":!g}),"data-testid":TEST_IDS.mediaBody,children:[/*#__PURE__*/_jsx("div",{className:"text-word-break text-primary",children:function getTitle(){return k||i(MESSAGES.uploadedFile)}()}),/*#__PURE__*/_jsx("small",{className:"np-upload-description text-primary",children:function getDescription(){if(l||j===Status.FAILED)return/*#__PURE__*/_jsx("span",{className:"text-danger",children:o()});switch(j){case Status.PENDING:return/*#__PURE__*/_jsx("span",{children:i(MESSAGES.uploading)});case Status.PROCESSING:return/*#__PURE__*/_jsx("span",{children:i(MESSAGES.deleting)});case Status.SUCCEEDED:case Status.DONE:default:return/*#__PURE__*/_jsx("span",{className:"text-success",children:i(MESSAGES.uploaded)});}}()})]})]})})}),c&&/*#__PURE__*/_jsx("button",{"aria-label":i(MESSAGES.removeFile,{filename:k}),className:classNames("btn np-upload-item__remove-button",{"media-right":!g,"media-left":g}),type:"button",onClick:function onClick(){return d()},children:/*#__PURE__*/_jsx(CrossCircle,{filled:!0,size:16})})]})})};export default UploadItem;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import _typeof from"@babel/runtime/helpers/typeof";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import{AlertCircle,CrossCircle}from"@transferwise/icons";import classNames from"classnames";import{useIntl}from"react-intl";import{Size,Status}from"../../common";import{useDirection}from"../../common/hooks";import ProcessIndicator from"../../processIndicator/ProcessIndicator";import MESSAGES from"./UploadItem.messages";import{UploadItemBody}from"./UploadItemBody";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var TEST_IDS;(function(a){a.uploadItem="uploadItem",a.mediaBody="mediaBody"})(TEST_IDS||(TEST_IDS={}));var UploadItem=function(a){var b=a.file,c=a.canDelete,d=a.onDelete,e=a.onDownload,f=useDirection(),g=f.isRTL,h=useIntl(),i=h.formatMessage,j=b.status,k=b.filename,l=b.error,m=b.url,n=[Status.SUCCEEDED,void 0].includes(j)&&!!m,o=function(){return"object"===_typeof(l)&&l.message||l||i(MESSAGES.uploadingFailed)};return/*#__PURE__*/_jsx("div",{className:classNames("np-upload-item",{"np-upload-item__link":n}),"data-testid":TEST_IDS.uploadItem,children:/*#__PURE__*/_jsxs("div",{className:"np-upload-item__body",children:[/*#__PURE__*/_jsx(UploadItemBody,{url:n?m:void 0,onDownload:function onDownloadFile(a){e&&(a.preventDefault(),e(b))},children:/*#__PURE__*/_jsx("div",{className:"np-upload-button",children:/*#__PURE__*/_jsxs("div",{className:"media",children:[/*#__PURE__*/_jsx("div",{className:classNames("np-upload-icon",{"media-right":g,"media-left":!g}),children:function getIcon(){if(l||j===Status.FAILED)return/*#__PURE__*/_jsx(AlertCircle,{size:24,className:"text-danger"});var a;switch(j){case Status.PROCESSING:case Status.PENDING:a=/*#__PURE__*/_jsx(ProcessIndicator,{size:Size.EXTRA_SMALL,status:Status.PROCESSING});break;case Status.SUCCEEDED:case Status.DONE:default:a=/*#__PURE__*/_jsx(ProcessIndicator,{size:Size.EXTRA_SMALL,status:Status.SUCCEEDED});}return/*#__PURE__*/_jsx("span",{style:{transform:"scale(0.8335)"},children:a});// Scale down ProcessIndicator to be 20px*20px to match `icons`
|
|
2
|
-
}()}),/*#__PURE__*/_jsxs("div",{className:classNames("media-body",{"text-xs-right":g,"text-xs-left":!g}),"data-testid":TEST_IDS.mediaBody,children:[/*#__PURE__*/_jsx("div",{className:"text-primary",children:function getTitle(){return k||i(MESSAGES.uploadedFile)}()}),/*#__PURE__*/_jsx("small",{className:"np-upload-description text-primary",children:function getDescription(){if(l||j===Status.FAILED)return/*#__PURE__*/_jsx("span",{className:"text-danger",children:o()});switch(j){case Status.PENDING:return/*#__PURE__*/_jsx("span",{children:i(MESSAGES.uploading)});case Status.PROCESSING:return/*#__PURE__*/_jsx("span",{children:i(MESSAGES.deleting)});case Status.SUCCEEDED:case Status.DONE:default:return/*#__PURE__*/_jsx("span",{className:"text-success",children:i(MESSAGES.uploaded)});}}()})]})]})})}),c&&/*#__PURE__*/_jsx("button",{"aria-label":i(MESSAGES.removeFile,{filename:k}),className:classNames("btn np-upload-item__remove-button",{"media-right":!g,"media-left":g}),type:"button",onClick:function onClick(){return d()},children:/*#__PURE__*/_jsx(CrossCircle,{filled:!0,size:16})})]})})};export default UploadItem;
|
|
2
|
+
}()}),/*#__PURE__*/_jsxs("div",{className:classNames("media-body",{"text-xs-right":g,"text-xs-left":!g}),"data-testid":TEST_IDS.mediaBody,children:[/*#__PURE__*/_jsx("div",{className:"text-word-break text-primary",children:function getTitle(){return k||i(MESSAGES.uploadedFile)}()}),/*#__PURE__*/_jsx("small",{className:"np-upload-description text-primary",children:function getDescription(){if(l||j===Status.FAILED)return/*#__PURE__*/_jsx("span",{className:"text-danger",children:o()});switch(j){case Status.PENDING:return/*#__PURE__*/_jsx("span",{children:i(MESSAGES.uploading)});case Status.PROCESSING:return/*#__PURE__*/_jsx("span",{children:i(MESSAGES.deleting)});case Status.SUCCEEDED:case Status.DONE:default:return/*#__PURE__*/_jsx("span",{className:"text-success",children:i(MESSAGES.uploaded)});}}()})]})]})})}),c&&/*#__PURE__*/_jsx("button",{"aria-label":i(MESSAGES.removeFile,{filename:k}),className:classNames("btn np-upload-item__remove-button",{"media-right":!g,"media-left":g}),type:"button",onClick:function onClick(){return d()},children:/*#__PURE__*/_jsx(CrossCircle,{filled:!0,size:16})})]})})};export default UploadItem;
|