@popsure/dirty-swan 0.27.28 → 0.27.30
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/dist/index.css +12 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +199 -131
- package/dist/index.js.map +1 -1
- package/dist/lib/components/multiDropzone/UploadFileCell/index.d.ts +6 -5
- package/dist/lib/components/multiDropzone/icons/index.d.ts +6 -20
- package/dist/lib/components/multiDropzone/index.d.ts +8 -18
- package/dist/lib/components/multiDropzone/index.test.d.ts +1 -0
- package/dist/lib/components/multiDropzone/types.d.ts +31 -0
- package/dist/lib/components/multiDropzone/utils/index.d.ts +11 -0
- package/dist/lib/scss/utils/_index.scss +12 -0
- package/dist/lib/util/formatBytes/index.d.ts +1 -0
- package/package.json +3 -2
- package/src/lib/components/input/currency/index.stories.mdx +2 -0
- package/src/lib/components/input/index.tsx +1 -1
- package/src/lib/components/input/style.module.scss +0 -6
- package/src/lib/components/multiDropzone/UploadFileCell/index.tsx +44 -64
- package/src/lib/components/multiDropzone/UploadFileCell/style.module.scss +3 -9
- package/src/lib/components/multiDropzone/icons/eye.svg +10 -3
- package/src/lib/components/multiDropzone/icons/file-error.svg +4 -0
- package/src/lib/components/multiDropzone/icons/file-upload.svg +4 -0
- package/src/lib/components/multiDropzone/icons/file.svg +4 -0
- package/src/lib/components/multiDropzone/icons/index.ts +12 -44
- package/src/lib/components/multiDropzone/icons/trash-error.svg +6 -0
- package/src/lib/components/multiDropzone/icons/trash.svg +5 -5
- package/src/lib/components/multiDropzone/icons/upload-small.svg +12 -0
- package/src/lib/components/multiDropzone/index.stories.mdx +60 -2
- package/src/lib/components/multiDropzone/index.test.tsx +235 -0
- package/src/lib/components/multiDropzone/index.tsx +98 -69
- package/src/lib/components/multiDropzone/types.ts +36 -0
- package/src/lib/components/multiDropzone/utils/index.test.ts +112 -0
- package/src/lib/components/multiDropzone/utils/index.ts +69 -0
- package/src/lib/scss/utils/_index.scss +12 -0
- package/src/lib/util/formatBytes/index.test.ts +19 -0
- package/src/lib/util/formatBytes/index.ts +13 -0
- package/src/setupTests.js +2 -0
- package/src/lib/components/multiDropzone/icons/bmp-complete.svg +0 -10
- package/src/lib/components/multiDropzone/icons/bmp.svg +0 -10
- package/src/lib/components/multiDropzone/icons/doc-complete.svg +0 -11
- package/src/lib/components/multiDropzone/icons/doc.svg +0 -11
- package/src/lib/components/multiDropzone/icons/docx-complete.svg +0 -12
- package/src/lib/components/multiDropzone/icons/docx.svg +0 -12
- package/src/lib/components/multiDropzone/icons/generic-complete.svg +0 -4
- package/src/lib/components/multiDropzone/icons/generic-error.svg +0 -7
- package/src/lib/components/multiDropzone/icons/generic.svg +0 -4
- package/src/lib/components/multiDropzone/icons/heic-complete.svg +0 -11
- package/src/lib/components/multiDropzone/icons/heic.svg +0 -11
- package/src/lib/components/multiDropzone/icons/jpeg-complete.svg +0 -11
- package/src/lib/components/multiDropzone/icons/jpeg.svg +0 -11
- package/src/lib/components/multiDropzone/icons/jpg-complete.svg +0 -10
- package/src/lib/components/multiDropzone/icons/jpg.svg +0 -10
- package/src/lib/components/multiDropzone/icons/pdf-complete.svg +0 -8
- package/src/lib/components/multiDropzone/icons/pdf.svg +0 -8
- package/src/lib/components/multiDropzone/icons/png-complete.svg +0 -10
- package/src/lib/components/multiDropzone/icons/png.svg +0 -10
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import { UploadStatus, UploadedFile } from '
|
|
3
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UploadStatus, UploadedFile } from '../types';
|
|
3
|
+
interface Props {
|
|
4
4
|
uploadStatus: UploadStatus;
|
|
5
5
|
file: UploadedFile;
|
|
6
6
|
onRemoveFile: (id: string) => void;
|
|
7
7
|
uploading: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
8
|
+
}
|
|
9
|
+
declare const UploadFileCell: React.FC<Props>;
|
|
10
|
+
export default UploadFileCell;
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
uploadIcon: string;
|
|
3
|
-
genericIcon: string;
|
|
4
|
-
bmpIcon: string;
|
|
5
|
-
docIcon: string;
|
|
6
|
-
docxIcon: string;
|
|
7
|
-
heicIcon: string;
|
|
8
|
-
jpegIcon: string;
|
|
9
|
-
jpgIcon: string;
|
|
10
|
-
pdfIcon: string;
|
|
11
|
-
pngIcon: string;
|
|
12
|
-
genericCompleteIcon: string;
|
|
13
|
-
bmpCompleteIcon: string;
|
|
14
|
-
docCompleteIcon: string;
|
|
15
|
-
docxCompleteIcon: string;
|
|
16
|
-
heicCompleteIcon: string;
|
|
17
|
-
jpegCompleteIcon: string;
|
|
18
|
-
jpgCompleteIcon: string;
|
|
19
|
-
pdfCompleteIcon: string;
|
|
20
|
-
pngCompleteIcon: string;
|
|
21
|
-
errorIcon: string;
|
|
22
2
|
eyeIcon: string;
|
|
3
|
+
fileErrorIcon: string;
|
|
4
|
+
fileIcon: string;
|
|
5
|
+
fileUploadIcon: string;
|
|
23
6
|
trashIcon: string;
|
|
7
|
+
trashErrorIcon: string;
|
|
8
|
+
uploadIcon: string;
|
|
9
|
+
uploadSmallIcon: string;
|
|
24
10
|
};
|
|
25
11
|
export default _default;
|
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
type: FileType | string;
|
|
8
|
-
previewUrl?: string;
|
|
9
|
-
progress: number;
|
|
10
|
-
error?: string;
|
|
11
|
-
}
|
|
12
|
-
interface Props {
|
|
2
|
+
import { AcceptType, FileType, TextOverrides, UploadedFile, UploadStatus } from './types';
|
|
3
|
+
interface MultiDropzoneProps {
|
|
4
|
+
accept?: AcceptType;
|
|
13
5
|
onFileSelect: (files: File[]) => void;
|
|
14
6
|
uploadedFiles: UploadedFile[];
|
|
15
7
|
uploading: boolean;
|
|
16
8
|
onRemoveFile: (id: string) => void;
|
|
17
9
|
isCondensed?: boolean;
|
|
18
10
|
maxFiles?: number;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
currentlyUploadingText?: string;
|
|
22
|
-
supportsText?: string;
|
|
23
|
-
};
|
|
11
|
+
maxSize?: number;
|
|
12
|
+
textOverrides?: TextOverrides;
|
|
24
13
|
}
|
|
25
|
-
declare const
|
|
26
|
-
export
|
|
14
|
+
declare const MultiDropZone: ({ accept, uploadedFiles, onFileSelect, uploading, onRemoveFile, isCondensed, maxFiles, maxSize, textOverrides, }: MultiDropzoneProps) => JSX.Element;
|
|
15
|
+
export type { FileType, MultiDropzoneProps, UploadedFile, UploadStatus };
|
|
16
|
+
export default MultiDropZone;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Accept } from "react-dropzone";
|
|
2
|
+
export declare type UploadStatus = 'UPLOADING' | 'COMPLETE' | 'ERROR';
|
|
3
|
+
export declare const DOCUMENT_FILES: string[];
|
|
4
|
+
export declare const IMAGE_FILES: string[];
|
|
5
|
+
export declare const FILE_TYPES: string[];
|
|
6
|
+
export declare type FileType = typeof FILE_TYPES[number];
|
|
7
|
+
export interface UploadedFile {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
type: FileType | string;
|
|
11
|
+
previewUrl?: string;
|
|
12
|
+
progress: number;
|
|
13
|
+
error?: string;
|
|
14
|
+
showProgressBar?: boolean;
|
|
15
|
+
showLoadingSpinner?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare type AcceptType = "document" | "image" | Accept;
|
|
18
|
+
export interface TextOverrides {
|
|
19
|
+
currentlyUploadingText?: string;
|
|
20
|
+
fileTypeError?: string;
|
|
21
|
+
fileTooLargeError?: string;
|
|
22
|
+
instructionsText?: string;
|
|
23
|
+
sizeUpToText?: string;
|
|
24
|
+
supportsText?: string;
|
|
25
|
+
supportsTextShort?: string;
|
|
26
|
+
tooManyFilesError?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ErrorMessage {
|
|
29
|
+
id: string;
|
|
30
|
+
message: string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Accept, FileError } from "react-dropzone";
|
|
2
|
+
import { AcceptType, TextOverrides, UploadStatus } from "../types";
|
|
3
|
+
export declare const getUploadStatus: (progress: number, error?: string | undefined) => UploadStatus;
|
|
4
|
+
export declare const DOCUMENT_FILES_ACCEPT: Accept;
|
|
5
|
+
export declare const IMAGE_FILES_ACCEPT: Accept;
|
|
6
|
+
export declare const getFormattedAcceptObject: (accept?: AcceptType) => Accept;
|
|
7
|
+
export declare const formatAcceptFileList: (accept: Accept) => string;
|
|
8
|
+
export declare const getErrorMessage: ({ code, message }: FileError, { fileList, maxSize }: {
|
|
9
|
+
fileList?: string | undefined;
|
|
10
|
+
maxSize?: number | undefined;
|
|
11
|
+
}, textOverrides?: TextOverrides | undefined) => string;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
@function url-encoded-color($color) {
|
|
2
2
|
@return '%23' + str-slice('#{$color}', 2, -1);
|
|
3
3
|
}
|
|
4
|
+
|
|
5
|
+
.sr-only {
|
|
6
|
+
border-width: 0;
|
|
7
|
+
clip: rect(0, 0, 0, 0);
|
|
8
|
+
height: 1px;
|
|
9
|
+
margin: -1px;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
padding: 0;
|
|
12
|
+
position: absolute;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
width: 1px;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatBytes(bytes: number, decimals?: number): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@popsure/dirty-swan",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.30",
|
|
4
4
|
"author": "Vincent Audoire <vincent@getpopsure.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"react-scroll-sync": "^0.9.0",
|
|
35
35
|
"remark-directive": "^2.0.1",
|
|
36
36
|
"sass": "^1.35.1",
|
|
37
|
-
"signature_pad": "^3.0.0-beta.3"
|
|
37
|
+
"signature_pad": "^3.0.0-beta.3",
|
|
38
|
+
"uuid": "^8.3.2"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
40
41
|
"react": "^16.12.0",
|
|
@@ -27,5 +27,7 @@ The following will be done:
|
|
|
27
27
|
<CurrencyInput className="wmx5 mt8" label="Amount" placeholder="100" />
|
|
28
28
|
<h4 className="p-h4 mt24">With label and no placeholder</h4>
|
|
29
29
|
<CurrencyInput className="wmx5 mt8" label="Amount" />
|
|
30
|
+
<h4 className="p-h4 mt24">With placeholder and no label</h4>
|
|
31
|
+
<CurrencyInput className="wmx5 mt8" hideLabel label="Amount" placeholder="0" />
|
|
30
32
|
</>
|
|
31
33
|
</Preview>
|
|
@@ -3,71 +3,39 @@ import classnames from 'classnames';
|
|
|
3
3
|
|
|
4
4
|
import styles from './style.module.scss';
|
|
5
5
|
import icons from '../icons/index';
|
|
6
|
-
import { UploadStatus, UploadedFile
|
|
6
|
+
import { UploadStatus, UploadedFile } from '../types';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
case 'doc':
|
|
15
|
-
return icons.docIcon;
|
|
16
|
-
case 'docx':
|
|
17
|
-
return icons.docxIcon;
|
|
18
|
-
case 'jpeg':
|
|
19
|
-
return icons.jpegIcon;
|
|
20
|
-
case 'jpg':
|
|
21
|
-
return icons.jpgIcon;
|
|
22
|
-
case 'pdf':
|
|
23
|
-
return icons.pdfIcon;
|
|
24
|
-
case 'png':
|
|
25
|
-
return icons.pngIcon;
|
|
26
|
-
default:
|
|
27
|
-
return icons.genericIcon;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const getCompleteIcon = (type: FileType | string): string => {
|
|
32
|
-
switch (type) {
|
|
33
|
-
case 'heic':
|
|
34
|
-
return icons.heicCompleteIcon;
|
|
35
|
-
case 'bmp':
|
|
36
|
-
return icons.bmpCompleteIcon;
|
|
37
|
-
case 'doc':
|
|
38
|
-
return icons.docCompleteIcon;
|
|
39
|
-
case 'docx':
|
|
40
|
-
return icons.docxCompleteIcon;
|
|
41
|
-
case 'jpeg':
|
|
42
|
-
return icons.jpegCompleteIcon;
|
|
43
|
-
case 'jpg':
|
|
44
|
-
return icons.jpgCompleteIcon;
|
|
45
|
-
case 'pdf':
|
|
46
|
-
return icons.pdfCompleteIcon;
|
|
47
|
-
case 'png':
|
|
48
|
-
return icons.pngCompleteIcon;
|
|
49
|
-
default:
|
|
50
|
-
return icons.genericCompleteIcon;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
8
|
+
interface Props {
|
|
9
|
+
uploadStatus: UploadStatus;
|
|
10
|
+
file: UploadedFile;
|
|
11
|
+
onRemoveFile: (id: string) => void;
|
|
12
|
+
uploading: boolean;
|
|
13
|
+
}
|
|
53
14
|
|
|
54
|
-
|
|
15
|
+
const UploadFileCell: React.FC<Props> = ({
|
|
55
16
|
uploadStatus,
|
|
56
17
|
file,
|
|
57
18
|
onRemoveFile,
|
|
58
19
|
uploading,
|
|
59
|
-
}: {
|
|
60
|
-
uploadStatus: UploadStatus;
|
|
61
|
-
file: UploadedFile;
|
|
62
|
-
onRemoveFile: (id: string) => void;
|
|
63
|
-
uploading: boolean;
|
|
64
20
|
}) => {
|
|
65
|
-
const {
|
|
21
|
+
const {
|
|
22
|
+
id,
|
|
23
|
+
error,
|
|
24
|
+
name,
|
|
25
|
+
progress,
|
|
26
|
+
previewUrl,
|
|
27
|
+
showLoadingSpinner = false,
|
|
28
|
+
showProgressBar = true
|
|
29
|
+
} = file;
|
|
30
|
+
|
|
31
|
+
const isComplete = uploadStatus === 'COMPLETE';
|
|
32
|
+
const isUploading = uploadStatus === 'UPLOADING';
|
|
33
|
+
const hasError = uploadStatus === 'ERROR';
|
|
66
34
|
|
|
67
35
|
const mapFileIcon: { [k in UploadStatus]: string } = {
|
|
68
|
-
UPLOADING:
|
|
69
|
-
COMPLETE:
|
|
70
|
-
ERROR: icons.
|
|
36
|
+
UPLOADING: icons.fileUploadIcon,
|
|
37
|
+
COMPLETE: icons.fileIcon,
|
|
38
|
+
ERROR: icons.fileErrorIcon,
|
|
71
39
|
};
|
|
72
40
|
|
|
73
41
|
const mapDisplayText: { [s in UploadStatus]: string } = {
|
|
@@ -79,7 +47,7 @@ export default ({
|
|
|
79
47
|
return (
|
|
80
48
|
<div
|
|
81
49
|
className={classnames(`mt8 ${styles['upload-file-cell']}`, {
|
|
82
|
-
[styles['upload-file-cell-error']]:
|
|
50
|
+
[styles['upload-file-cell-error']]: hasError,
|
|
83
51
|
})}
|
|
84
52
|
>
|
|
85
53
|
<div className={`w100 ${styles['cell-left-section']}`}>
|
|
@@ -89,13 +57,15 @@ export default ({
|
|
|
89
57
|
alt=""
|
|
90
58
|
/>
|
|
91
59
|
<div className="w100">
|
|
92
|
-
<div className={`p-p
|
|
60
|
+
<div className={`p-p ${styles['upload-display-text']}`}>
|
|
93
61
|
{mapDisplayText[uploadStatus]}
|
|
94
62
|
</div>
|
|
95
|
-
|
|
63
|
+
|
|
64
|
+
{isUploading && showProgressBar && (
|
|
96
65
|
<div className={`mt8 w100 ${styles['progress-bar-container']}`}>
|
|
97
66
|
<div className={`${styles['progress-bar']}`} />
|
|
98
67
|
<div
|
|
68
|
+
data-testid="ds-filecell-progressbar"
|
|
99
69
|
className={`${styles['progress-bar-filler']}`}
|
|
100
70
|
style={{ width: `${progress}%` }}
|
|
101
71
|
/>
|
|
@@ -105,14 +75,21 @@ export default ({
|
|
|
105
75
|
</div>
|
|
106
76
|
<div
|
|
107
77
|
className={classnames(styles['cell-right-section'], {
|
|
108
|
-
[styles['cell-right-section-complete']]:
|
|
78
|
+
[styles['cell-right-section-complete']]: isComplete,
|
|
109
79
|
})}
|
|
110
80
|
>
|
|
111
|
-
{
|
|
112
|
-
<div className={
|
|
81
|
+
{isUploading ? (
|
|
82
|
+
<div className={styles.spinner}>
|
|
83
|
+
{showLoadingSpinner && (
|
|
84
|
+
<div
|
|
85
|
+
className='ds-spinner ds-spinner__m'
|
|
86
|
+
data-testid="ds-filecell-spinner"
|
|
87
|
+
/>
|
|
88
|
+
)}
|
|
89
|
+
</div>
|
|
113
90
|
) : (
|
|
114
91
|
<div>
|
|
115
|
-
{
|
|
92
|
+
{isComplete && (
|
|
116
93
|
<a
|
|
117
94
|
className={styles['view-icon']}
|
|
118
95
|
href={previewUrl}
|
|
@@ -122,11 +99,12 @@ export default ({
|
|
|
122
99
|
<img src={icons.eyeIcon} alt="preview" />
|
|
123
100
|
</a>
|
|
124
101
|
)}
|
|
102
|
+
|
|
125
103
|
<img
|
|
126
104
|
className={classnames(styles['remove-icon'], {
|
|
127
105
|
[styles.disabled]: uploading,
|
|
128
106
|
})}
|
|
129
|
-
src={icons.trashIcon}
|
|
107
|
+
src={hasError ? icons.trashErrorIcon : icons.trashIcon}
|
|
130
108
|
onClick={() => onRemoveFile(id)}
|
|
131
109
|
alt="remove"
|
|
132
110
|
/>
|
|
@@ -136,3 +114,5 @@ export default ({
|
|
|
136
114
|
</div>
|
|
137
115
|
);
|
|
138
116
|
};
|
|
117
|
+
|
|
118
|
+
export default UploadFileCell;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
align-items: center;
|
|
6
6
|
justify-content: space-between;
|
|
7
7
|
|
|
8
|
+
height: 64px;
|
|
8
9
|
padding: 8px 16px;
|
|
9
10
|
|
|
10
11
|
border: 1px solid $ds-grey-400;
|
|
@@ -27,8 +28,8 @@
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
.main-icon {
|
|
30
|
-
width:
|
|
31
|
-
height:
|
|
31
|
+
width: 16px;
|
|
32
|
+
height: 20px;
|
|
32
33
|
margin-right: 16px;
|
|
33
34
|
}
|
|
34
35
|
|
|
@@ -81,13 +82,6 @@
|
|
|
81
82
|
cursor: default;
|
|
82
83
|
}
|
|
83
84
|
|
|
84
|
-
.spinner {
|
|
85
|
-
color: $ds-primary-500;
|
|
86
|
-
animation: appear-down 0.6s;
|
|
87
|
-
animation-fill-mode: both;
|
|
88
|
-
animation-delay: 0.6s;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
85
|
@keyframes appear-down {
|
|
92
86
|
from {
|
|
93
87
|
transform: translateY(-10px);
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
<svg width="
|
|
2
|
-
<path
|
|
3
|
-
<path d="
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_14605_3108)">
|
|
3
|
+
<path d="M0.832031 9.99998C0.832031 9.99998 4.16536 3.33331 9.9987 3.33331C15.832 3.33331 19.1654 9.99998 19.1654 9.99998C19.1654 9.99998 15.832 16.6666 9.9987 16.6666C4.16536 16.6666 0.832031 9.99998 0.832031 9.99998Z" stroke="#D2D2D8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M9.99902 12.5C11.3797 12.5 12.499 11.3807 12.499 10C12.499 8.61929 11.3797 7.5 9.99902 7.5C8.61831 7.5 7.49902 8.61929 7.49902 10C7.49902 11.3807 8.61831 12.5 9.99902 12.5Z" stroke="#D2D2D8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
</g>
|
|
6
|
+
<defs>
|
|
7
|
+
<clipPath id="clip0_14605_3108">
|
|
8
|
+
<rect width="20" height="20" fill="white" transform="translate(-0.000976562)"/>
|
|
9
|
+
</clipPath>
|
|
10
|
+
</defs>
|
|
4
11
|
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="18" height="22" viewBox="0 0 18 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M14.8272 21H2.72839C2.27 21 1.83037 20.8084 1.50624 20.4675C1.1821 20.1265 1 19.664 1 19.1818V6.45455L6.18518 1H14.8272C15.2856 1 15.7252 1.19156 16.0493 1.53253C16.3735 1.87351 16.5556 2.33597 16.5556 2.81818V19.1818C16.5556 19.664 16.3735 20.1265 16.0493 20.4675C15.7252 20.8084 15.2856 21 14.8272 21Z" stroke="#E55454" stroke-width="2" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M6.0646 1V4.77358C6.0646 5.27399 5.88674 5.75391 5.57014 6.10775C5.25354 6.46159 4.82414 6.66038 4.3764 6.66038H1" stroke="#E55454" stroke-width="2" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="18" height="22" viewBox="0 0 18 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M14.8272 21H2.72839C2.27 21 1.83037 20.8084 1.50624 20.4675C1.1821 20.1265 1 19.664 1 19.1818V6.45455L6.18518 1H14.8272C15.2856 1 15.7252 1.19156 16.0493 1.53253C16.3735 1.87351 16.5556 2.33597 16.5556 2.81818V19.1818C16.5556 19.664 16.3735 20.1265 16.0493 20.4675C15.7252 20.8084 15.2856 21 14.8272 21Z" stroke="#8E8CEE" stroke-width="2" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M6.0646 1V4.77358C6.0646 5.27399 5.88674 5.75391 5.57014 6.10775C5.25354 6.46159 4.82414 6.66038 4.3764 6.66038H1" stroke="#8E8CEE" stroke-width="2" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="18" height="22" viewBox="0 0 18 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M14.8272 21H2.7284C2.27 21 1.83037 20.8084 1.50624 20.4675C1.1821 20.1265 1 19.664 1 19.1818V6.45455L6.18519 1H14.8272C15.2856 1 15.7252 1.19156 16.0493 1.53253C16.3735 1.87351 16.5556 2.33597 16.5556 2.81818V19.1818C16.5556 19.664 16.3735 20.1265 16.0493 20.4675C15.7252 20.8084 15.2856 21 14.8272 21Z" stroke="#696970" stroke-width="2" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M6.0646 1V4.77358C6.0646 5.27399 5.88674 5.75391 5.57014 6.10775C5.25354 6.46159 4.82414 6.66038 4.3764 6.66038H1" stroke="#696970" stroke-width="2" stroke-linejoin="round"/>
|
|
4
|
+
</svg>
|
|
@@ -1,51 +1,19 @@
|
|
|
1
|
-
import uploadSvg from './upload.svg';
|
|
2
|
-
|
|
3
|
-
import genericSvg from './generic.svg';
|
|
4
|
-
import bmpSvg from './bmp.svg';
|
|
5
|
-
import docSvg from './doc.svg';
|
|
6
|
-
import docxSvg from './docx.svg';
|
|
7
|
-
import heicSvg from './heic.svg';
|
|
8
|
-
import jpegSvg from './jpeg.svg';
|
|
9
|
-
import jpgSvg from './jpg.svg';
|
|
10
|
-
import pdfSvg from './pdf.svg';
|
|
11
|
-
import pngSvg from './png.svg';
|
|
12
|
-
|
|
13
|
-
import genericCompleteSvg from './generic-complete.svg';
|
|
14
|
-
import bmpCompleteSvg from './bmp-complete.svg';
|
|
15
|
-
import docCompleteSvg from './doc-complete.svg';
|
|
16
|
-
import docxCompleteSvg from './docx-complete.svg';
|
|
17
|
-
import heicCompleteSvg from './heic-complete.svg';
|
|
18
|
-
import jpegCompleteSvg from './jpeg-complete.svg';
|
|
19
|
-
import jpgCompleteSvg from './jpg-complete.svg';
|
|
20
|
-
import pdfCompleteSvg from './pdf-complete.svg';
|
|
21
|
-
import pngCompleteSvg from './png-complete.svg';
|
|
22
|
-
|
|
23
|
-
import errorSvg from './generic-error.svg';
|
|
24
|
-
|
|
25
1
|
import eyeSvg from './eye.svg';
|
|
2
|
+
import fileSvg from './file.svg';
|
|
3
|
+
import fileErrorSvg from './file-error.svg';
|
|
4
|
+
import fileUploadSvg from './file-upload.svg';
|
|
26
5
|
import trashSvg from './trash.svg';
|
|
6
|
+
import trashErrorSvg from './trash-error.svg';
|
|
7
|
+
import uploadSvg from './upload.svg';
|
|
8
|
+
import uploadSmallSvg from './upload-small.svg';
|
|
27
9
|
|
|
28
10
|
export default {
|
|
29
|
-
uploadIcon: uploadSvg,
|
|
30
|
-
genericIcon: genericSvg,
|
|
31
|
-
bmpIcon: bmpSvg,
|
|
32
|
-
docIcon: docSvg,
|
|
33
|
-
docxIcon: docxSvg,
|
|
34
|
-
heicIcon: heicSvg,
|
|
35
|
-
jpegIcon: jpegSvg,
|
|
36
|
-
jpgIcon: jpgSvg,
|
|
37
|
-
pdfIcon: pdfSvg,
|
|
38
|
-
pngIcon: pngSvg,
|
|
39
|
-
genericCompleteIcon: genericCompleteSvg,
|
|
40
|
-
bmpCompleteIcon: bmpCompleteSvg,
|
|
41
|
-
docCompleteIcon: docCompleteSvg,
|
|
42
|
-
docxCompleteIcon: docxCompleteSvg,
|
|
43
|
-
heicCompleteIcon: heicCompleteSvg,
|
|
44
|
-
jpegCompleteIcon: jpegCompleteSvg,
|
|
45
|
-
jpgCompleteIcon: jpgCompleteSvg,
|
|
46
|
-
pdfCompleteIcon: pdfCompleteSvg,
|
|
47
|
-
pngCompleteIcon: pngCompleteSvg,
|
|
48
|
-
errorIcon: errorSvg,
|
|
49
11
|
eyeIcon: eyeSvg,
|
|
12
|
+
fileErrorIcon: fileErrorSvg,
|
|
13
|
+
fileIcon: fileSvg,
|
|
14
|
+
fileUploadIcon: fileUploadSvg,
|
|
50
15
|
trashIcon: trashSvg,
|
|
16
|
+
trashErrorIcon: trashErrorSvg,
|
|
17
|
+
uploadIcon: uploadSvg,
|
|
18
|
+
uploadSmallIcon: uploadSmallSvg,
|
|
51
19
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M2.5 5H4.16667H17.5" stroke="#E55454" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M6.66699 5.00002V3.33335C6.66699 2.89133 6.84259 2.4674 7.15515 2.15484C7.46771 1.84228 7.89163 1.66669 8.33366 1.66669H11.667C12.109 1.66669 12.5329 1.84228 12.8455 2.15484C13.1581 2.4674 13.3337 2.89133 13.3337 3.33335V5.00002M15.8337 5.00002V16.6667C15.8337 17.1087 15.6581 17.5326 15.3455 17.8452C15.0329 18.1578 14.609 18.3334 14.167 18.3334H5.83366C5.39163 18.3334 4.96771 18.1578 4.65515 17.8452C4.34259 17.5326 4.16699 17.1087 4.16699 16.6667V5.00002H15.8337Z" stroke="#E55454" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M8.33301 9.16669V14.1667" stroke="#E55454" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M11.667 9.16669V14.1667" stroke="#E55454" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
</svg>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<svg width="
|
|
2
|
-
<path d="
|
|
3
|
-
<path d="
|
|
4
|
-
<path d="
|
|
5
|
-
<path d="
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M2.5 5H4.16667H17.5" stroke="#D2D2D8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M6.66699 5.00002V3.33335C6.66699 2.89133 6.84259 2.4674 7.15515 2.15484C7.46771 1.84228 7.89163 1.66669 8.33366 1.66669H11.667C12.109 1.66669 12.5329 1.84228 12.8455 2.15484C13.1581 2.4674 13.3337 2.89133 13.3337 3.33335V5.00002M15.8337 5.00002V16.6667C15.8337 17.1087 15.6581 17.5326 15.3455 17.8452C15.0329 18.1578 14.609 18.3334 14.167 18.3334H5.83366C5.39163 18.3334 4.96771 18.1578 4.65515 17.8452C4.34259 17.5326 4.16699 17.1087 4.16699 16.6667V5.00002H15.8337Z" stroke="#D2D2D8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M8.33301 9.16669V14.1667" stroke="#D2D2D8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M11.667 9.16669V14.1667" stroke="#D2D2D8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
6
|
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_14605_3119)">
|
|
3
|
+
<path d="M7.31072 14.9498H4.75296C3.50626 14.9498 0.833008 13.811 0.833008 10.8673C0.833008 7.69987 3.50626 6.63794 4.84594 6.63794C5.02868 5.11158 6.03646 2.27952 9.74924 2.08331C13.3208 2.08331 14.9149 5.30618 14.6525 7.70738C16.0496 7.6209 19.1663 8.25113 19.1663 11.3875C19.1663 14.0551 16.3723 15.0691 14.9752 14.9498H12.7745" stroke="#8E8CEE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M10 18.0851V9.32739" stroke="#8E8CEE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M7.8125 11.5155L10.0007 9.32739L12.1888 11.5155" stroke="#8E8CEE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
</g>
|
|
7
|
+
<defs>
|
|
8
|
+
<clipPath id="clip0_14605_3119">
|
|
9
|
+
<rect width="20" height="20" fill="white"/>
|
|
10
|
+
</clipPath>
|
|
11
|
+
</defs>
|
|
12
|
+
</svg>
|
|
@@ -34,6 +34,25 @@ MultiDropzone component allows upload of multiple documents / files.
|
|
|
34
34
|
token: 'abc',
|
|
35
35
|
previewUrl: 'http://getpopsure.com/test_file_name.pdf',
|
|
36
36
|
},
|
|
37
|
+
{
|
|
38
|
+
id: '124',
|
|
39
|
+
type: 'pdf',
|
|
40
|
+
progress: '72',
|
|
41
|
+
name: 'test_file_name.pdf',
|
|
42
|
+
token: 'abc',
|
|
43
|
+
previewUrl: 'http://getpopsure.com/test_file_name.pdf',
|
|
44
|
+
showLoadingSpinner: true,
|
|
45
|
+
showProgressBar: false,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: '125',
|
|
49
|
+
type: 'pdf',
|
|
50
|
+
progress: '72',
|
|
51
|
+
name: 'test_file_name.pdf',
|
|
52
|
+
token: 'abc',
|
|
53
|
+
previewUrl: 'http://getpopsure.com/test_file_name.pdf',
|
|
54
|
+
showLoadingSpinner: true,
|
|
55
|
+
},
|
|
37
56
|
{
|
|
38
57
|
id: '456',
|
|
39
58
|
type: 'pdf',
|
|
@@ -111,6 +130,45 @@ MultiDropzone component allows upload of multiple documents / files.
|
|
|
111
130
|
/>
|
|
112
131
|
</Preview>
|
|
113
132
|
|
|
133
|
+
### Accepting only images
|
|
134
|
+
|
|
135
|
+
<Preview>
|
|
136
|
+
<MultiDropzone
|
|
137
|
+
accept="image"
|
|
138
|
+
isCondensed
|
|
139
|
+
uploadedFiles={[]}
|
|
140
|
+
onFileSelect={() => {}}
|
|
141
|
+
uploading={false}
|
|
142
|
+
onRemoveFile={() => {}}
|
|
143
|
+
/>
|
|
144
|
+
</Preview>
|
|
145
|
+
|
|
146
|
+
### Accepting only documents
|
|
147
|
+
|
|
148
|
+
<Preview>
|
|
149
|
+
<MultiDropzone
|
|
150
|
+
accept="document"
|
|
151
|
+
isCondensed
|
|
152
|
+
uploadedFiles={[]}
|
|
153
|
+
onFileSelect={() => {}}
|
|
154
|
+
uploading={false}
|
|
155
|
+
onRemoveFile={() => {}}
|
|
156
|
+
/>
|
|
157
|
+
</Preview>
|
|
158
|
+
|
|
159
|
+
### Limiting file size to 2MB
|
|
160
|
+
|
|
161
|
+
<Preview>
|
|
162
|
+
<MultiDropzone
|
|
163
|
+
isCondensed
|
|
164
|
+
uploadedFiles={[]}
|
|
165
|
+
onFileSelect={() => {}}
|
|
166
|
+
uploading={false}
|
|
167
|
+
onRemoveFile={() => {}}
|
|
168
|
+
maxSize={2096000}
|
|
169
|
+
/>
|
|
170
|
+
</Preview>
|
|
171
|
+
|
|
114
172
|
### i18n support
|
|
115
173
|
|
|
116
174
|
<Preview>
|
|
@@ -121,9 +179,9 @@ MultiDropzone component allows upload of multiple documents / files.
|
|
|
121
179
|
onRemoveFile={() => {}}
|
|
122
180
|
textOverrides={{
|
|
123
181
|
instructionsText: 'Datei auswählen oder per Drag & Drop platzieren',
|
|
124
|
-
|
|
182
|
+
supportsTextShort: 'Unterstützt werden',
|
|
125
183
|
currentlyUploadingText:
|
|
126
|
-
'Bitte warten während die Datei hochgeladen wird...'
|
|
184
|
+
'Bitte warten während die Datei hochgeladen wird...'
|
|
127
185
|
}}
|
|
128
186
|
/>
|
|
129
187
|
</Preview>
|