@synerise/ds-file-uploader 0.8.0 → 0.8.1
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/dist/FileUploader.d.ts.map +1 -1
- package/dist/FileUploader.js +4 -0
- package/dist/FileUploader.styles.d.ts +24 -4
- package/dist/FileUploader.styles.d.ts.map +1 -1
- package/dist/FileUploader.styles.js +12 -10
- package/package.json +10 -10
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
|
+
## [0.8.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-file-uploader@0.8.0...@synerise/ds-file-uploader@0.8.1) (2025-02-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **file-uploader:** css rule specificity ([70334e5](https://github.com/Synerise/synerise-design/commit/70334e545c882cc2da7db39ec89178653b41e398))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [0.8.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-file-uploader@0.7.11...@synerise/ds-file-uploader@0.8.0) (2025-01-29)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../src/FileUploader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../src/FileUploader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AASrD,OAAO,EAAe,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAgBtE,QAAA,MAAM,YAAY,gJAgBf,iBAAiB,sBAmInB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/dist/FileUploader.js
CHANGED
|
@@ -4,6 +4,7 @@ import { FormattedMessage } from 'react-intl';
|
|
|
4
4
|
import { useDropzone } from 'react-dropzone';
|
|
5
5
|
import Icon, { AddM, InfoFillS, FileUploadL } from '@synerise/ds-icon';
|
|
6
6
|
import Tooltip from '@synerise/ds-tooltip';
|
|
7
|
+
import { useTheme } from '@synerise/ds-core';
|
|
7
8
|
import FileView from './FileView/FileView';
|
|
8
9
|
import * as S from './FileUploader.styles';
|
|
9
10
|
function readAsText(file) {
|
|
@@ -42,6 +43,7 @@ var FileUploader = function FileUploader(_ref) {
|
|
|
42
43
|
var _useState = useState(true),
|
|
43
44
|
uploadSuccess = _useState[0],
|
|
44
45
|
setUploadSuccess = _useState[1];
|
|
46
|
+
var theme = useTheme();
|
|
45
47
|
var finalTexts = _extends({
|
|
46
48
|
buttonLabel: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
47
49
|
id: "DS.FILE-UPLOADER.BUTTON-LABEL",
|
|
@@ -132,9 +134,11 @@ var FileUploader = function FileUploader(_ref) {
|
|
|
132
134
|
"data-testid": "droparea",
|
|
133
135
|
filesLength: files.length
|
|
134
136
|
}, mode === 'multi-large' && files.length === 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Icon, {
|
|
137
|
+
color: theme.palette['grey-800'],
|
|
135
138
|
component: /*#__PURE__*/React.createElement(FileUploadL, null),
|
|
136
139
|
size: 48
|
|
137
140
|
}), /*#__PURE__*/React.createElement(S.LargeDropAreaLabel, null, finalTexts.buttonLabelLarge), /*#__PURE__*/React.createElement(S.LargeDropAreaDescription, null, finalTexts.buttonDescription)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Icon, {
|
|
141
|
+
color: theme.palette['grey-600'],
|
|
138
142
|
component: /*#__PURE__*/React.createElement(AddM, null),
|
|
139
143
|
size: 24
|
|
140
144
|
}), /*#__PURE__*/React.createElement(S.DropAreaLabel, null, finalTexts.buttonLabel))))), files.length > 0 && files.map(function (file, index) {
|
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import Button from '@synerise/ds-button';
|
|
3
3
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
export declare const Description: import("styled-components").StyledComponent<
|
|
4
|
+
export declare const Description: import("styled-components").StyledComponent<({ size, className, children, ellipsis }: {
|
|
5
|
+
size?: import("@synerise/ds-typography").TextSize | undefined;
|
|
6
|
+
ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
|
|
7
|
+
children?: import("react").ReactNode;
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
}) => import("react").JSX.Element, any, {
|
|
5
10
|
hasError?: boolean | undefined;
|
|
6
11
|
}, never>;
|
|
7
12
|
export declare const DropAreaContainer: import("styled-components").StyledComponent<"div", any, {
|
|
8
13
|
canUploadMore: boolean;
|
|
9
14
|
}, never>;
|
|
10
|
-
export declare const DropAreaLabel: import("styled-components").StyledComponent<
|
|
15
|
+
export declare const DropAreaLabel: import("styled-components").StyledComponent<({ size, className, children, ellipsis }: {
|
|
16
|
+
size?: import("@synerise/ds-typography").TextSize | undefined;
|
|
17
|
+
ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
|
|
18
|
+
children?: import("react").ReactNode;
|
|
19
|
+
className?: string | undefined;
|
|
20
|
+
}) => import("react").JSX.Element, any, {}, never>;
|
|
11
21
|
export declare const LargeDropAreaLabel: import("styled-components").StyledComponent<"label", any, {}, never>;
|
|
12
|
-
export declare const LargeDropAreaDescription: import("styled-components").StyledComponent<
|
|
22
|
+
export declare const LargeDropAreaDescription: import("styled-components").StyledComponent<({ size, className, children, ellipsis }: {
|
|
23
|
+
size?: import("@synerise/ds-typography").TextSize | undefined;
|
|
24
|
+
ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
|
|
25
|
+
children?: import("react").ReactNode;
|
|
26
|
+
className?: string | undefined;
|
|
27
|
+
}) => import("react").JSX.Element, any, {}, never>;
|
|
13
28
|
export declare const DropAreaButton: import("styled-components").StyledComponent<"button", any, {
|
|
14
29
|
isDropping?: boolean | undefined;
|
|
15
30
|
hasError?: boolean | undefined;
|
|
@@ -18,7 +33,12 @@ export declare const DropAreaButton: import("styled-components").StyledComponent
|
|
|
18
33
|
filesLength: number;
|
|
19
34
|
hidden: boolean;
|
|
20
35
|
}, never>;
|
|
21
|
-
export declare const ErrorMessage: import("styled-components").StyledComponent<
|
|
36
|
+
export declare const ErrorMessage: import("styled-components").StyledComponent<({ size, className, children, ellipsis }: {
|
|
37
|
+
size?: import("@synerise/ds-typography").TextSize | undefined;
|
|
38
|
+
ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
|
|
39
|
+
children?: import("react").ReactNode;
|
|
40
|
+
className?: string | undefined;
|
|
41
|
+
}) => import("react").JSX.Element, any, {}, never>;
|
|
22
42
|
export declare const Label: import("styled-components").StyledComponent<"label", any, {}, never>;
|
|
23
43
|
export declare const UploadButton: import("styled-components").StyledComponent<typeof Button, any, {}, never>;
|
|
24
44
|
//# sourceMappingURL=FileUploader.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploader.styles.d.ts","sourceRoot":"","sources":["../src/FileUploader.styles.ts"],"names":[],"mappings":";AAEA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAIzC,eAAO,MAAM,SAAS,oEAErB,CAAC;AAEF,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"FileUploader.styles.d.ts","sourceRoot":"","sources":["../src/FileUploader.styles.ts"],"names":[],"mappings":";AAEA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAIzC,eAAO,MAAM,SAAS,oEAErB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;SAMvB,CAAC;AAEF,eAAO,MAAM,iBAAiB;mBAA+B,OAAO;SAGnE,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;kDAKzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,sEAO9B,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;kDAMpC,CAAC;AAEF,eAAO,MAAM,cAAc;;;UAGnB,MAAM;aACH,OAAO;iBACH,MAAM;YACX,OAAO;SAyGhB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;kDAMxB,CAAC;AAEF,eAAO,MAAM,KAAK,sEAWjB,CAAC;AAEF,eAAO,MAAM,YAAY,4EAAmB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import
|
|
2
|
+
import { Label as TypographyLabel, Text } from '@synerise/ds-typography';
|
|
3
3
|
import Button from '@synerise/ds-button';
|
|
4
4
|
import { IconContainer } from '@synerise/ds-icon';
|
|
5
5
|
import { hexToRgba } from '@synerise/ds-utils';
|
|
@@ -7,7 +7,7 @@ export var Container = styled.div.withConfig({
|
|
|
7
7
|
displayName: "FileUploaderstyles__Container",
|
|
8
8
|
componentId: "sc-62r2x6-0"
|
|
9
9
|
})(["width:100%;"]);
|
|
10
|
-
export var Description = styled(
|
|
10
|
+
export var Description = styled(Text).withConfig({
|
|
11
11
|
displayName: "FileUploaderstyles__Description",
|
|
12
12
|
componentId: "sc-62r2x6-1"
|
|
13
13
|
})(["&&{margin:", ";display:block;color:", ";}"], function (props) {
|
|
@@ -21,33 +21,35 @@ export var DropAreaContainer = styled.div.withConfig({
|
|
|
21
21
|
})(["width:100%;margin:", ";"], function (props) {
|
|
22
22
|
return props.canUploadMore ? '12px 0 8px' : '0';
|
|
23
23
|
});
|
|
24
|
-
export var DropAreaLabel = styled(
|
|
24
|
+
export var DropAreaLabel = styled(Text).withConfig({
|
|
25
25
|
displayName: "FileUploaderstyles__DropAreaLabel",
|
|
26
26
|
componentId: "sc-62r2x6-3"
|
|
27
|
-
})(["color:", ";font-weight:500;"], function (props) {
|
|
28
|
-
return props.theme.palette['grey-
|
|
27
|
+
})(["&&{color:", ";font-weight:500;}"], function (props) {
|
|
28
|
+
return props.theme.palette['grey-600'];
|
|
29
29
|
});
|
|
30
30
|
export var LargeDropAreaLabel = styled(TypographyLabel).withConfig({
|
|
31
31
|
displayName: "FileUploaderstyles__LargeDropAreaLabel",
|
|
32
32
|
componentId: "sc-62r2x6-4"
|
|
33
33
|
})(["&&{font-size:14px;margin:4px 0 0;display:block;color:", ";}"], function (props) {
|
|
34
|
-
return props.theme.palette['grey-
|
|
34
|
+
return props.theme.palette['grey-800'];
|
|
35
35
|
});
|
|
36
|
-
export var LargeDropAreaDescription = styled(
|
|
36
|
+
export var LargeDropAreaDescription = styled(Text).withConfig({
|
|
37
37
|
displayName: "FileUploaderstyles__LargeDropAreaDescription",
|
|
38
38
|
componentId: "sc-62r2x6-5"
|
|
39
39
|
})(["&&{margin:4px 0 0;display:block;color:", ";}"], function (props) {
|
|
40
|
-
return props.theme.palette['grey-
|
|
40
|
+
return props.theme.palette['grey-600'];
|
|
41
41
|
});
|
|
42
42
|
export var DropAreaButton = styled.button.withConfig({
|
|
43
43
|
displayName: "FileUploaderstyles__DropAreaButton",
|
|
44
44
|
componentId: "sc-62r2x6-6"
|
|
45
|
-
})(["display:", ";align-items:center;border:1px dashed ", ";padding:11px 12px;border-radius:3px;cursor:pointer;background-color:transparent;width:100%;height:48px;transition:height 0.03s;", ";", "{fill:", ";}
|
|
45
|
+
})(["display:", ";align-items:center;border:1px dashed ", ";padding:11px 12px;border-radius:3px;cursor:pointer;background-color:transparent;width:100%;height:48px;transition:height 0.03s;", ";", ";", "{fill:", ";}", " ", " &:hover:not(:disabled){background-color:", ";border-color:", ";", ",", "{color:", ";}", "{fill:", ";color:", ";}}&:disabled{background-color:", ";", "{color:", ";}}&&:active{color:", ";border-color:", ";background-color:", ";}&:focus:not(:active):not(:disabled){border-color:", ";background-color:", ";}&:disabled{span,", "{opacity:0.4;}}", ""], function (props) {
|
|
46
46
|
return props.hidden ? 'none' : 'flex';
|
|
47
47
|
}, function (props) {
|
|
48
48
|
return props.theme.palette['grey-400'];
|
|
49
49
|
}, function (props) {
|
|
50
50
|
return props.mode === 'multi-large' && props.filesLength === 0 && "\n height: 160px;\n flex-direction: column;\n text-align: center;\n justify-content: center;\n ";
|
|
51
|
+
}, function (props) {
|
|
52
|
+
return props.mode !== 'multi-large' && "\n gap: 12px;\n ";
|
|
51
53
|
}, IconContainer, function (props) {
|
|
52
54
|
return props.theme.palette['grey-700'];
|
|
53
55
|
}, function (props) {
|
|
@@ -81,7 +83,7 @@ export var DropAreaButton = styled.button.withConfig({
|
|
|
81
83
|
}, IconContainer, function (props) {
|
|
82
84
|
return props.isDropping && !props.disabled && "\n height: " + (props.mode === 'multi-large' && props.filesLength === 0 ? '160px' : 'auto') + ";\n background-color: " + props.theme.palette['blue-050'] + " !important;\n border-color: " + props.theme.palette['blue-300'] + " !important;\n\n span, " + DropAreaLabel + ", " + LargeDropAreaLabel + ", " + LargeDropAreaDescription + " {\n color: " + props.theme.palette['blue-500'] + " !important;\n }\n\n " + IconContainer + " {\n fill: " + props.theme.palette['blue-500'] + " !important;\n }\n ";
|
|
83
85
|
});
|
|
84
|
-
export var ErrorMessage = styled(
|
|
86
|
+
export var ErrorMessage = styled(Text).withConfig({
|
|
85
87
|
displayName: "FileUploaderstyles__ErrorMessage",
|
|
86
88
|
componentId: "sc-62r2x6-7"
|
|
87
89
|
})(["&&{margin:8px 0 0;display:block;color:", ";}"], function (props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-file-uploader",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "FileUploader UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-button": "^0.23.
|
|
38
|
-
"@synerise/ds-icon": "^0.71.
|
|
39
|
-
"@synerise/ds-loader": "^0.4.
|
|
40
|
-
"@synerise/ds-popconfirm": "^0.11.
|
|
41
|
-
"@synerise/ds-progress-bar": "^0.10.
|
|
42
|
-
"@synerise/ds-tooltip": "^0.15.
|
|
43
|
-
"@synerise/ds-typography": "^0.17.
|
|
44
|
-
"@synerise/ds-utils": "^0.32.
|
|
37
|
+
"@synerise/ds-button": "^0.23.1",
|
|
38
|
+
"@synerise/ds-icon": "^0.71.1",
|
|
39
|
+
"@synerise/ds-loader": "^0.4.1",
|
|
40
|
+
"@synerise/ds-popconfirm": "^0.11.1",
|
|
41
|
+
"@synerise/ds-progress-bar": "^0.10.1",
|
|
42
|
+
"@synerise/ds-tooltip": "^0.15.1",
|
|
43
|
+
"@synerise/ds-typography": "^0.17.1",
|
|
44
|
+
"@synerise/ds-utils": "^0.32.1",
|
|
45
45
|
"filesize.js": "^2.0.0",
|
|
46
46
|
"react-dropzone": "^10.2.1"
|
|
47
47
|
},
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"react-intl": ">=3.12.0 <= 6.8",
|
|
52
52
|
"styled-components": "^5.3.3"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "38cb22e1c46d175306dd87e10649410eb93a4e44"
|
|
55
55
|
}
|