@synerise/ds-file-uploader 1.3.8 → 1.3.10

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +20 -13
  3. package/dist/AvatarUploader/AvatarUploader.d.ts +7 -8
  4. package/dist/AvatarUploader/AvatarUploader.js +78 -124
  5. package/dist/AvatarUploader/AvatarUploader.styles.d.ts +26 -27
  6. package/dist/AvatarUploader/AvatarUploader.styles.js +54 -70
  7. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.const.d.ts +1 -2
  8. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.const.js +14 -10
  9. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.d.ts +2 -3
  10. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.js +49 -90
  11. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.styles.d.ts +16 -17
  12. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.styles.js +69 -91
  13. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.types.d.ts +2 -3
  14. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.types.js +1 -1
  15. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.util.d.ts +1 -2
  16. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.util.js +6 -3
  17. package/dist/FileUploader.d.ts +6 -7
  18. package/dist/FileUploader.js +91 -146
  19. package/dist/FileUploader.styles.d.ts +26 -27
  20. package/dist/FileUploader.styles.js +58 -78
  21. package/dist/FileUploader.types.d.ts +2 -3
  22. package/dist/FileUploader.types.js +1 -1
  23. package/dist/FileView/FileView.const.d.ts +1 -2
  24. package/dist/FileView/FileView.const.js +24 -19
  25. package/dist/FileView/FileView.d.ts +2 -3
  26. package/dist/FileView/FileView.js +72 -138
  27. package/dist/FileView/FileView.styles.d.ts +17 -18
  28. package/dist/FileView/FileView.styles.js +65 -83
  29. package/dist/FileView/FileView.types.d.ts +2 -3
  30. package/dist/FileView/FileView.types.js +1 -1
  31. package/dist/ItemUploader/ItemUploader.d.ts +3 -4
  32. package/dist/ItemUploader/ItemUploader.js +73 -104
  33. package/dist/ItemUploader/ItemUploader.styles.d.ts +26 -27
  34. package/dist/ItemUploader/ItemUploader.styles.js +53 -71
  35. package/dist/ItemUploader/ItemUploader.types.d.ts +0 -1
  36. package/dist/ItemUploader/ItemUploader.types.js +1 -1
  37. package/dist/ItemUploader/UploaderButton/FileViewItem.const.d.ts +0 -1
  38. package/dist/ItemUploader/UploaderButton/FileViewItem.const.js +16 -11
  39. package/dist/ItemUploader/UploaderButton/FileViewItem.d.ts +2 -3
  40. package/dist/ItemUploader/UploaderButton/FileViewItem.js +38 -67
  41. package/dist/ItemUploader/UploaderButton/FileViewItem.styles.d.ts +12 -13
  42. package/dist/ItemUploader/UploaderButton/FileViewItem.styles.js +55 -74
  43. package/dist/index.d.ts +0 -1
  44. package/dist/index.js +19 -13
  45. package/dist/modules.d.js +1 -1
  46. package/dist/modules.d.ts +0 -0
  47. package/package.json +12 -12
  48. package/dist/AvatarUploader/AvatarUploader.d.ts.map +0 -1
  49. package/dist/AvatarUploader/AvatarUploader.styles.d.ts.map +0 -1
  50. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.const.d.ts.map +0 -1
  51. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.d.ts.map +0 -1
  52. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.styles.d.ts.map +0 -1
  53. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.types.d.ts.map +0 -1
  54. package/dist/AvatarUploader/FileViewAvatar/FileViewAvatar.util.d.ts.map +0 -1
  55. package/dist/FileUploader.d.ts.map +0 -1
  56. package/dist/FileUploader.styles.d.ts.map +0 -1
  57. package/dist/FileUploader.types.d.ts.map +0 -1
  58. package/dist/FileView/FileView.const.d.ts.map +0 -1
  59. package/dist/FileView/FileView.d.ts.map +0 -1
  60. package/dist/FileView/FileView.styles.d.ts.map +0 -1
  61. package/dist/FileView/FileView.types.d.ts.map +0 -1
  62. package/dist/ItemUploader/ItemUploader.d.ts.map +0 -1
  63. package/dist/ItemUploader/ItemUploader.styles.d.ts.map +0 -1
  64. package/dist/ItemUploader/ItemUploader.types.d.ts.map +0 -1
  65. package/dist/ItemUploader/UploaderButton/FileViewItem.const.d.ts.map +0 -1
  66. package/dist/ItemUploader/UploaderButton/FileViewItem.d.ts.map +0 -1
  67. package/dist/ItemUploader/UploaderButton/FileViewItem.styles.d.ts.map +0 -1
  68. package/dist/index.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
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
+ ## [1.3.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-file-uploader@1.3.9...@synerise/ds-file-uploader@1.3.10) (2026-03-24)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-file-uploader
9
+
10
+ ## [1.3.9](https://github.com/Synerise/synerise-design/compare/@synerise/ds-file-uploader@1.3.8...@synerise/ds-file-uploader@1.3.9) (2026-03-20)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-file-uploader
13
+
6
14
  ## [1.3.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-file-uploader@1.3.7...@synerise/ds-file-uploader@1.3.8) (2026-03-09)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-file-uploader
package/README.md CHANGED
@@ -27,7 +27,6 @@ import FileUploader from '@synerise/ds-file-uploader'
27
27
  buttonLabel: 'Upload a new file',
28
28
  buttonDescription: 'or drag one here',
29
29
  size: 'Size:',
30
- uploading: 'Uploading...',
31
30
  }}
32
31
  onUpload={files => processFiles(files)}
33
32
  />
@@ -43,18 +42,19 @@ import FileUploader from '@synerise/ds-file-uploader'
43
42
  | Property | Description | Type | Default |
44
43
  | ----------- | -------------------------------------------------------------------------------- | ----------------------------------------- | -------- |
45
44
  | mode | uploader operation mode | `single` / `multi-medium` / `multi-large` | `single` |
46
- | mode | uploader maximum files number | number | - |
45
+ | filesAmount | uploader maximum files number | number | - |
47
46
  | description | description shown with uploader | string | - |
48
47
  | disabled | whether the uploader should be disabled | boolean | - |
49
- | removable | whether or not files should be removable | boolean | - |
48
+ | removable | whether or not files should be removable | boolean | `true` |
50
49
  | label | label shown on top of the uploader | string | - |
51
- | infoTooltip | display a tooltip near the label (label value is required for tooltip to appear) | string | - |
50
+ | tooltip | display a tooltip near the label (label value is required for tooltip to appear) | string | - |
52
51
  | error | display general error | string | - |
52
+ | retry | when true and a file has an error, shows a retry button that re-opens the dialog | boolean | - |
53
53
  | texts | texts to display | FileUploaderTexts | - |
54
- | files | uploaded files | ExtendedFile[] | - |
54
+ | files | uploaded files | ExtendedFile[] | `[]` |
55
55
  | accept | accepted mime types to upload | string[] | - |
56
- | onRemove | event fired when a file is removed | (file: File, index: number) => void | - |
57
- | onUpload | event fired when a file is removed | (files: File[]) => void | - |
56
+ | onRemove | event fired when a file is removed | (file: FileWithContent, index: number) => void | - |
57
+ | onUpload | event fired when files are selected or dropped | (files: FileWithContent[]) => void | - |
58
58
 
59
59
  ## ExtendedFile
60
60
 
@@ -74,9 +74,16 @@ import FileUploader from '@synerise/ds-file-uploader'
74
74
 
75
75
  ## FileUploaderTexts
76
76
 
77
- | Property | Description | Type | Default |
78
- | ----------------- | ------------------------------------- | ------------------------ | ------- |
79
- | buttonLabel | upload button label | string / React.ReactNode | - |
80
- | buttonDescription | upload button description | string / React.ReactNode | - |
81
- | size | file size label | string / React.ReactNode | - |
82
- | uploading | text to display when uploading a file | string / React.ReactNode | - |
77
+ | Property | Description | Type | Default |
78
+ | ----------------- | -------------------------------------------------------- | ------------------------ | ------- |
79
+ | buttonLabel | upload button label (compact drop zone) | string / React.ReactNode | - |
80
+ | buttonLabelLarge | upload label (multi-large mode, no files uploaded yet) | string / React.ReactNode | - |
81
+ | buttonDescription | upload button description (multi-large mode) | string / React.ReactNode | - |
82
+ | size | file size label prefix | string / React.ReactNode | - |
83
+ | removeTooltip | tooltip text on the remove icon | string / React.ReactNode | - |
84
+ | cancelText | popconfirm cancel button label | string / React.ReactNode | - |
85
+ | okText | popconfirm confirm button label | string / React.ReactNode | - |
86
+ | removeConfirmTitle| popconfirm title | string / React.ReactNode | - |
87
+ | fileWeight | label for file weight during upload | string / React.ReactNode | - |
88
+ | retryLabel | label on the retry button | string / React.ReactNode | - |
89
+ | percent | current upload percentage (passed to ProgressBar) | number | - |
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { type FileUploaderRef } from '../FileUploader.types';
1
+ import { default as React } from 'react';
2
+ import { FileUploaderRef } from '../FileUploader.types';
3
3
  declare const AvatarUploader: React.ForwardRefExoticComponent<{
4
4
  className?: string;
5
5
  mode: "single" | "multi-medium" | "multi-large";
@@ -11,16 +11,15 @@ declare const AvatarUploader: React.ForwardRefExoticComponent<{
11
11
  removeTooltip?: React.ReactNode;
12
12
  label?: string;
13
13
  error?: string;
14
- texts?: import("../FileUploader.types").FileViewTexts & {
14
+ texts?: import('../FileUploader.types').FileViewTexts & {
15
15
  buttonLabel?: React.ReactNode;
16
16
  buttonLabelLarge?: React.ReactNode;
17
17
  buttonDescription?: React.ReactNode;
18
18
  };
19
- files: import("../FileUploader.types").ExtendedFile[];
19
+ files: import('../FileUploader.types').ExtendedFile[];
20
20
  accept?: string[];
21
- onRemove?: (file: import("../FileUploader.types").FileWithContent, index: number) => void;
22
- onUpload?: (files: import("../FileUploader.types").FileWithContent[]) => void;
21
+ onRemove?: (file: import('../FileUploader.types').FileWithContent, index: number) => void;
22
+ onUpload?: (files: import('../FileUploader.types').FileWithContent[]) => void;
23
23
  retry?: boolean;
24
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "label" | "className" | "mode" | "disabled" | "accept" | "description" | "tooltip" | "error" | "removable" | "onRemove" | "texts" | "filesAmount" | "removeTooltip" | "files" | "onUpload" | "retry"> & import("@synerise/ds-utils").DataAttributes & React.RefAttributes<FileUploaderRef>>;
24
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "label" | "className" | "mode" | "disabled" | "accept" | "description" | "tooltip" | "error" | "removable" | "onRemove" | "texts" | "filesAmount" | "removeTooltip" | "files" | "onUpload" | "retry"> & import('@synerise/ds-utils').DataAttributes & React.RefAttributes<FileUploaderRef>>;
25
25
  export default AvatarUploader;
26
- //# sourceMappingURL=AvatarUploader.d.ts.map
@@ -1,53 +1,45 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React, { forwardRef, useCallback, useImperativeHandle, useState } from 'react';
3
- import { useDropzone } from 'react-dropzone';
4
- import Button from '@synerise/ds-button';
5
- import { useTheme } from '@synerise/ds-core';
6
- import Icon, { Add3M, FileTypePictureL, InfoFillS } from '@synerise/ds-icon';
7
- import Tooltip from '@synerise/ds-tooltip';
8
- import * as S from './AvatarUploader.styles';
9
- import FileViewAvatar from './FileViewAvatar/FileViewAvatar';
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { forwardRef, useState, useCallback, useImperativeHandle } from "react";
3
+ import { useDropzone } from "react-dropzone";
4
+ import Button from "@synerise/ds-button";
5
+ import { useTheme } from "@synerise/ds-core";
6
+ import Icon, { InfoFillS, FileTypePictureL, Add3M } from "@synerise/ds-icon";
7
+ import Tooltip from "@synerise/ds-tooltip";
8
+ import { Container, Label, UploaderContainer, DropAreaContainer, DropAreaButton, Description } from "./AvatarUploader.styles.js";
9
+ import FileViewAvatar from "./FileViewAvatar/FileViewAvatar.js";
10
10
  function readAsText(file) {
11
- return new Promise(function (resolve) {
12
- var reader = new FileReader();
13
- file.type !== 'text/plain' && resolve(null);
14
- reader.onerror = function () {
15
- return resolve(null);
16
- };
17
- reader.onload = function () {
18
- return resolve(reader.result);
19
- };
11
+ return new Promise((resolve) => {
12
+ const reader = new FileReader();
13
+ file.type !== "text/plain" && resolve(null);
14
+ reader.onerror = () => resolve(null);
15
+ reader.onload = () => resolve(reader.result);
20
16
  reader.readAsText(file);
21
17
  });
22
18
  }
23
- var AvatarUploader = /*#__PURE__*/forwardRef(function (_ref, ref) {
24
- var className = _ref.className,
25
- onUpload = _ref.onUpload,
26
- disabled = _ref.disabled,
27
- accept = _ref.accept,
28
- error = _ref.error,
29
- label = _ref.label,
30
- _onRemove = _ref.onRemove,
31
- description = _ref.description,
32
- tooltip = _ref.tooltip,
33
- filesAmount = _ref.filesAmount,
34
- _ref$mode = _ref.mode,
35
- mode = _ref$mode === void 0 ? 'single' : _ref$mode,
36
- _ref$removable = _ref.removable,
37
- removable = _ref$removable === void 0 ? true : _ref$removable,
38
- _ref$files = _ref.files,
39
- files = _ref$files === void 0 ? [] : _ref$files,
40
- texts = _ref.texts;
41
- var _useState = useState(true),
42
- uploadSuccess = _useState[0],
43
- setUploadSuccess = _useState[1];
44
- var theme = useTheme();
45
- var readFilesContent = useCallback(function (addedFiles) {
46
- var readerPromises = addedFiles.map(function (file) {
19
+ const AvatarUploader = forwardRef(({
20
+ className,
21
+ onUpload,
22
+ disabled,
23
+ accept,
24
+ error,
25
+ label,
26
+ onRemove,
27
+ description,
28
+ tooltip,
29
+ filesAmount,
30
+ mode = "single",
31
+ removable = true,
32
+ files = [],
33
+ texts
34
+ }, ref) => {
35
+ const [uploadSuccess, setUploadSuccess] = useState(true);
36
+ const theme = useTheme();
37
+ const readFilesContent = useCallback((addedFiles) => {
38
+ const readerPromises = addedFiles.map((file) => {
47
39
  return readAsText(file);
48
40
  });
49
- Promise.all(readerPromises).then(function (filesContent) {
50
- var filesWithContent = addedFiles.map(function (file, index) {
41
+ Promise.all(readerPromises).then((filesContent) => {
42
+ const filesWithContent = addedFiles.map((file, index) => {
51
43
  return Object.assign(file, {
52
44
  content: filesContent[index]
53
45
  });
@@ -55,8 +47,8 @@ var AvatarUploader = /*#__PURE__*/forwardRef(function (_ref, ref) {
55
47
  onUpload && onUpload(filesWithContent);
56
48
  });
57
49
  }, [onUpload]);
58
- var onDrop = useCallback(function (acceptedFiles) {
59
- var possibleUpload = 0;
50
+ const onDrop = useCallback((acceptedFiles) => {
51
+ let possibleUpload = 0;
60
52
  if (filesAmount) {
61
53
  possibleUpload = filesAmount - files.length;
62
54
  }
@@ -67,87 +59,49 @@ var AvatarUploader = /*#__PURE__*/forwardRef(function (_ref, ref) {
67
59
  readFilesContent(acceptedFiles);
68
60
  }
69
61
  }, [filesAmount, files, setUploadSuccess, readFilesContent]);
70
- var _useDropzone = useDropzone({
71
- accept: accept ? accept.join(',') : undefined,
72
- multiple: mode !== 'single',
73
- onDrop: onDrop,
74
- disabled: disabled
75
- }),
76
- getRootProps = _useDropzone.getRootProps,
77
- getInputProps = _useDropzone.getInputProps,
78
- isDragActive = _useDropzone.isDragActive,
79
- open = _useDropzone.open,
80
- inputRef = _useDropzone.inputRef,
81
- rootRef = _useDropzone.rootRef;
82
- useImperativeHandle(ref, function () {
83
- return {
84
- open: open,
85
- inputRef: inputRef,
86
- rootRef: rootRef
87
- };
62
+ const {
63
+ getRootProps,
64
+ getInputProps,
65
+ isDragActive,
66
+ open,
67
+ inputRef,
68
+ rootRef
69
+ } = useDropzone({
70
+ accept: accept ? accept.join(",") : void 0,
71
+ multiple: mode !== "single",
72
+ onDrop,
73
+ disabled
88
74
  });
75
+ useImperativeHandle(ref, () => ({
76
+ open,
77
+ inputRef,
78
+ rootRef
79
+ }));
89
80
  if (filesAmount && filesAmount < 1) {
90
81
  filesAmount = 1;
91
82
  throw new Error('Invalid value of property "filesAmount" ');
92
83
  }
93
- var hasError = Boolean(error) || !uploadSuccess;
94
- var _useState2 = useState(false),
95
- pressed = _useState2[0],
96
- setPressed = _useState2[1];
97
- return /*#__PURE__*/React.createElement(S.Container, {
98
- className: "ds-file-avatar-uploader " + (className || '')
99
- }, label && /*#__PURE__*/React.createElement(S.Label, null, /*#__PURE__*/React.createElement("span", null, label), tooltip && /*#__PURE__*/React.createElement(Tooltip, {
100
- trigger: "hover",
101
- placement: "top",
102
- title: tooltip
103
- }, /*#__PURE__*/React.createElement("span", {
104
- "data-testid": "tooltip-info"
105
- }, /*#__PURE__*/React.createElement(Icon, {
106
- component: /*#__PURE__*/React.createElement(InfoFillS, null),
107
- color: theme.palette['grey-400'],
108
- size: 24
109
- })))), files.length > 0 && files.map(function (file, index) {
110
- return /*#__PURE__*/React.createElement(FileViewAvatar, {
111
- key: file.file.lastModified,
112
- texts: texts,
113
- removable: removable,
114
- onRemove: function onRemove() {
115
- return _onRemove && _onRemove(file.file, index);
116
- },
117
- data: file,
118
- description: description
119
- });
120
- }), (mode !== 'single' && (filesAmount ? files.length < filesAmount : true) || files.length === 0) && /*#__PURE__*/React.createElement(S.UploaderContainer, null, /*#__PURE__*/React.createElement(S.DropAreaContainer, _extends({}, getRootProps(), {
121
- canUploadMore: mode !== 'single' && files.length > 0
122
- }), /*#__PURE__*/React.createElement("input", _extends({}, getInputProps(), {
123
- "data-testid": "drop-area-input"
124
- })), /*#__PURE__*/React.createElement(S.DropAreaButton, {
125
- type: "button",
126
- mode: mode,
127
- disabled: disabled,
128
- isDropping: isDragActive,
129
- hasError: hasError,
130
- onMouseDown: function onMouseDown() {
131
- return setPressed(true);
132
- },
133
- onMouseUp: function onMouseUp() {
134
- return setPressed(false);
135
- },
136
- pressed: pressed,
137
- "data-testid": "drop-area",
138
- filesLength: files.length
139
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Icon, {
140
- component: /*#__PURE__*/React.createElement(FileTypePictureL, null),
141
- size: 48
142
- }))))), /*#__PURE__*/React.createElement("div", null, (mode !== 'single' && (filesAmount ? files.length < filesAmount : true) || files.length === 0) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _extends({}, getRootProps(), {
143
- disabled: disabled,
144
- type: "secondary",
145
- mode: "icon-label"
146
- }), /*#__PURE__*/React.createElement(Icon, {
147
- component: /*#__PURE__*/React.createElement(Add3M, null),
148
- size: 24
149
- }), "Add file"), description && /*#__PURE__*/React.createElement(S.Description, {
150
- hasError: hasError
151
- }, description))));
84
+ const hasError = Boolean(error) || !uploadSuccess;
85
+ const [pressed, setPressed] = useState(false);
86
+ return /* @__PURE__ */ jsxs(Container, { className: `ds-file-avatar-uploader ${className || ""}`, children: [
87
+ label && /* @__PURE__ */ jsxs(Label, { children: [
88
+ /* @__PURE__ */ jsx("span", { children: label }),
89
+ tooltip && /* @__PURE__ */ jsx(Tooltip, { trigger: "hover", placement: "top", title: tooltip, children: /* @__PURE__ */ jsx("span", { "data-testid": "tooltip-info", children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(InfoFillS, {}), color: theme.palette["grey-400"], size: 24 }) }) })
90
+ ] }),
91
+ files.length > 0 && files.map((file, index) => /* @__PURE__ */ jsx(FileViewAvatar, { texts, removable, onRemove: () => onRemove && onRemove(file.file, index), data: file, description }, file.file.lastModified)),
92
+ (mode !== "single" && (filesAmount ? files.length < filesAmount : true) || files.length === 0) && /* @__PURE__ */ jsx(UploaderContainer, { children: /* @__PURE__ */ jsxs(DropAreaContainer, { ...getRootProps(), canUploadMore: mode !== "single" && files.length > 0, children: [
93
+ /* @__PURE__ */ jsx("input", { ...getInputProps(), "data-testid": "drop-area-input" }),
94
+ /* @__PURE__ */ jsx(DropAreaButton, { type: "button", mode, disabled, isDropping: isDragActive, hasError, onMouseDown: () => setPressed(true), onMouseUp: () => setPressed(false), pressed, "data-testid": "drop-area", filesLength: files.length, children: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(FileTypePictureL, {}), size: 48 }) }) })
95
+ ] }) }),
96
+ /* @__PURE__ */ jsx("div", { children: (mode !== "single" && (filesAmount ? files.length < filesAmount : true) || files.length === 0) && /* @__PURE__ */ jsxs(Fragment, { children: [
97
+ /* @__PURE__ */ jsxs(Button, { ...getRootProps(), disabled, type: "secondary", mode: "icon-label", children: [
98
+ /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(Add3M, {}), size: 24 }),
99
+ "Add file"
100
+ ] }),
101
+ description && /* @__PURE__ */ jsx(Description, { hasError, children: description })
102
+ ] }) })
103
+ ] });
152
104
  });
153
- export default AvatarUploader;
105
+ export {
106
+ AvatarUploader as default
107
+ };
@@ -1,45 +1,44 @@
1
- export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const UploaderContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const Description: import("styled-components").StyledComponent<({ size, className, children, ellipsis, style, }: {
4
- size?: import("@synerise/ds-typography").TextSize;
5
- ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps;
6
- children?: import("react").ReactNode;
1
+ export declare const Container: import('styled-components').StyledComponent<"div", any, {}, never>;
2
+ export declare const UploaderContainer: import('styled-components').StyledComponent<"div", any, {}, never>;
3
+ export declare const Description: import('styled-components').StyledComponent<({ size, className, children, ellipsis, style, }: {
4
+ size?: import('@synerise/ds-typography').TextSize;
5
+ ellipsis?: import('@synerise/ds-typography/dist/Ellipsis').EllipsisProps;
6
+ children?: import('react').ReactNode;
7
7
  className?: string;
8
- style?: import("react").CSSProperties;
8
+ style?: import('react').CSSProperties;
9
9
  }) => React.JSX.Element, any, {
10
10
  hasError?: boolean;
11
11
  }, never>;
12
- export declare const DropAreaContainer: import("styled-components").StyledComponent<"div", any, {
12
+ export declare const DropAreaContainer: import('styled-components').StyledComponent<"div", any, {
13
13
  canUploadMore: boolean;
14
14
  }, never>;
15
- export declare const DropAreaLabel: import("styled-components").StyledComponent<({ size, className, children, ellipsis, style, }: {
16
- size?: import("@synerise/ds-typography").TextSize;
17
- ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps;
18
- children?: import("react").ReactNode;
15
+ export declare const DropAreaLabel: import('styled-components').StyledComponent<({ size, className, children, ellipsis, style, }: {
16
+ size?: import('@synerise/ds-typography').TextSize;
17
+ ellipsis?: import('@synerise/ds-typography/dist/Ellipsis').EllipsisProps;
18
+ children?: import('react').ReactNode;
19
19
  className?: string;
20
- style?: import("react").CSSProperties;
20
+ style?: import('react').CSSProperties;
21
21
  }) => React.JSX.Element, any, {}, never>;
22
- export declare const LargeDropAreaLabel: import("styled-components").StyledComponent<"label", any, {}, never>;
23
- export declare const LargeDropAreaDescription: import("styled-components").StyledComponent<({ size, className, children, ellipsis, style, }: {
24
- size?: import("@synerise/ds-typography").TextSize;
25
- ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps;
26
- children?: import("react").ReactNode;
22
+ export declare const LargeDropAreaLabel: import('styled-components').StyledComponent<"label", any, {}, never>;
23
+ export declare const LargeDropAreaDescription: import('styled-components').StyledComponent<({ size, className, children, ellipsis, style, }: {
24
+ size?: import('@synerise/ds-typography').TextSize;
25
+ ellipsis?: import('@synerise/ds-typography/dist/Ellipsis').EllipsisProps;
26
+ children?: import('react').ReactNode;
27
27
  className?: string;
28
- style?: import("react").CSSProperties;
28
+ style?: import('react').CSSProperties;
29
29
  }) => React.JSX.Element, any, {}, never>;
30
- export declare const DropAreaButton: import("styled-components").StyledComponent<"button", any, {
30
+ export declare const DropAreaButton: import('styled-components').StyledComponent<"button", any, {
31
31
  isDropping?: boolean;
32
32
  hasError?: boolean;
33
33
  mode: string;
34
34
  pressed: boolean;
35
35
  filesLength: number;
36
36
  }, never>;
37
- export declare const ErrorMessage: import("styled-components").StyledComponent<({ size, className, children, ellipsis, style, }: {
38
- size?: import("@synerise/ds-typography").TextSize;
39
- ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps;
40
- children?: import("react").ReactNode;
37
+ export declare const ErrorMessage: import('styled-components').StyledComponent<({ size, className, children, ellipsis, style, }: {
38
+ size?: import('@synerise/ds-typography').TextSize;
39
+ ellipsis?: import('@synerise/ds-typography/dist/Ellipsis').EllipsisProps;
40
+ children?: import('react').ReactNode;
41
41
  className?: string;
42
- style?: import("react").CSSProperties;
42
+ style?: import('react').CSSProperties;
43
43
  }) => React.JSX.Element, any, {}, never>;
44
- export declare const Label: import("styled-components").StyledComponent<"label", any, {}, never>;
45
- //# sourceMappingURL=AvatarUploader.styles.d.ts.map
44
+ export declare const Label: import('styled-components').StyledComponent<"label", any, {}, never>;
@@ -1,92 +1,76 @@
1
- import styled, { css } from 'styled-components';
2
- import { IconContainer } from '@synerise/ds-icon';
3
- import { Text, Label as TypographyLabel } from '@synerise/ds-typography';
4
- import { hexToRgba } from '@synerise/ds-utils';
5
- export var Container = styled.div.withConfig({
1
+ import styled, { css } from "styled-components";
2
+ import { IconContainer } from "@synerise/ds-icon";
3
+ import { Label as Label$1, Text } from "@synerise/ds-typography";
4
+ import { hexToRgba } from "@synerise/ds-utils";
5
+ const Container = /* @__PURE__ */ styled.div.withConfig({
6
6
  displayName: "AvatarUploaderstyles__Container",
7
7
  componentId: "sc-1lljrgr-0"
8
8
  })(["width:100%;display:flex;"]);
9
- export var UploaderContainer = styled.div.withConfig({
9
+ const UploaderContainer = /* @__PURE__ */ styled.div.withConfig({
10
10
  displayName: "AvatarUploaderstyles__UploaderContainer",
11
11
  componentId: "sc-1lljrgr-1"
12
12
  })(["align-items:center;padding-right:14px;"]);
13
- export var Description = styled(Text).withConfig({
13
+ const Description = /* @__PURE__ */ styled(Text).withConfig({
14
14
  displayName: "AvatarUploaderstyles__Description",
15
15
  componentId: "sc-1lljrgr-2"
16
- })(["&&{margin:", ";display:block;color:", ";}"], function (props) {
17
- return props.hasError ? '4px 0 8px' : '16px 0 8px';
18
- }, function (props) {
19
- return props.theme.palette['grey-500'];
20
- });
21
- export var DropAreaContainer = styled.div.withConfig({
16
+ })(["&&{margin:", ";display:block;color:", ";}"], (props) => props.hasError ? "4px 0 8px" : "16px 0 8px", (props) => props.theme.palette["grey-500"]);
17
+ const DropAreaContainer = /* @__PURE__ */ styled.div.withConfig({
22
18
  displayName: "AvatarUploaderstyles__DropAreaContainer",
23
19
  componentId: "sc-1lljrgr-3"
24
- })(["width:100%;margin:", ";"], function (props) {
25
- return props.canUploadMore ? '12px 0 8px' : '0';
26
- });
27
- export var DropAreaLabel = styled(Text).withConfig({
20
+ })(["width:100%;margin:", ";"], (props) => props.canUploadMore ? "12px 0 8px" : "0");
21
+ const DropAreaLabel = /* @__PURE__ */ styled(Text).withConfig({
28
22
  displayName: "AvatarUploaderstyles__DropAreaLabel",
29
23
  componentId: "sc-1lljrgr-4"
30
- })(["color:", ";font-weight:500;"], function (props) {
31
- return props.theme.palette['grey-700'];
32
- });
33
- export var LargeDropAreaLabel = styled(TypographyLabel).withConfig({
24
+ })(["color:", ";font-weight:500;"], (props) => props.theme.palette["grey-700"]);
25
+ const LargeDropAreaLabel = /* @__PURE__ */ styled(Label$1).withConfig({
34
26
  displayName: "AvatarUploaderstyles__LargeDropAreaLabel",
35
27
  componentId: "sc-1lljrgr-5"
36
- })(["&&{font-size:14px;margin:4px 0 0;display:block;color:", ";}"], function (props) {
37
- return props.theme.palette['grey-700'];
38
- });
39
- export var LargeDropAreaDescription = styled(Text).withConfig({
28
+ })(["&&{font-size:14px;margin:4px 0 0;display:block;color:", ";}"], (props) => props.theme.palette["grey-700"]);
29
+ const LargeDropAreaDescription = /* @__PURE__ */ styled(Text).withConfig({
40
30
  displayName: "AvatarUploaderstyles__LargeDropAreaDescription",
41
31
  componentId: "sc-1lljrgr-6"
42
- })(["&&{margin:4px 0 0;display:block;color:", ";}"], function (props) {
43
- return props.theme.palette['grey-700'];
44
- });
45
- export var DropAreaButton = styled.button.withConfig({
32
+ })(["&&{margin:4px 0 0;display:block;color:", ";}"], (props) => props.theme.palette["grey-700"]);
33
+ const DropAreaButton = /* @__PURE__ */ styled.button.withConfig({
46
34
  displayName: "AvatarUploaderstyles__DropAreaButton",
47
35
  componentId: "sc-1lljrgr-7"
48
- })(["align-items:center;border:1px dashed ", ";padding:11px 12px;border-radius:3px;cursor:pointer;background-color:transparent;width:80px;height:80px;transition:height 0.3s;", ";", "{color:", ";}span{display:inline-block;margin:0 0 0 12px;}", " ", " &:hover:not(:disabled){background-color:", ";border-color:", ";", ",", "{color:", ";}", "{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) {
49
- return props.theme.palette['grey-400'];
50
- }, function (props) {
51
- return props.mode === 'multi-large' && props.filesLength === 0 && "\n height: 108px;\n flex-direction: column;\n text-align: center;\n justify-content: center;\n ";
52
- }, IconContainer, function (props) {
53
- return props.theme.palette['grey-800'];
54
- }, function (props) {
55
- return props.hasError && "\n background-color: " + props.theme.palette['red-050'] + ";\n border-color: " + props.theme.palette['red-600'] + ";\n ";
56
- }, function (props) {
57
- return props.pressed && !props.disabled && css(["&&&:active,&&&{background-color:", ";}"], hexToRgba(props.theme.palette['grey-200'], 0.4));
58
- }, function (props) {
59
- return hexToRgba(props.theme.palette['grey-200'], 0.2);
60
- }, function (props) {
61
- return props.theme.palette['grey-400'];
62
- }, DropAreaLabel, LargeDropAreaLabel, function (props) {
63
- return props.theme.palette['grey-700'];
64
- }, IconContainer, function (props) {
65
- return props.theme.palette['grey-700'];
66
- }, function (props) {
67
- return props.theme.palette['grey-050'];
68
- }, LargeDropAreaLabel, function (props) {
69
- return props.theme.palette['grey-400'];
70
- }, function (props) {
71
- return props.theme.palette['red-400'];
72
- }, function (props) {
73
- return props.theme.palette['grey-400'];
74
- }, function (props) {
75
- return props.theme.palette['grey-050'];
76
- }, function (props) {
77
- return props.theme.palette['blue-600'];
78
- }, function (props) {
79
- return props.theme.palette['blue-050'];
80
- }, IconContainer, function (props) {
81
- return props.isDropping && !props.disabled && "\n height: " + (props.mode === 'multi-large' ? '200px' : '80px') + ";\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 color: " + props.theme.palette['blue-500'] + " !important;\n }\n ";
82
- });
83
- export var ErrorMessage = styled(Text).withConfig({
36
+ })(["align-items:center;border:1px dashed ", ";padding:11px 12px;border-radius:3px;cursor:pointer;background-color:transparent;width:80px;height:80px;transition:height 0.3s;", ";", "{color:", ";}span{display:inline-block;margin:0 0 0 12px;}", " ", " &:hover:not(:disabled){background-color:", ";border-color:", ";", ",", "{color:", ";}", "{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;}}", ""], (props) => props.theme.palette["grey-400"], (props) => props.mode === "multi-large" && props.filesLength === 0 && `
37
+ height: 108px;
38
+ flex-direction: column;
39
+ text-align: center;
40
+ justify-content: center;
41
+ `, IconContainer, (props) => props.theme.palette["grey-800"], (props) => props.hasError && `
42
+ background-color: ${props.theme.palette["red-050"]};
43
+ border-color: ${props.theme.palette["red-600"]};
44
+ `, (props) => props.pressed && !props.disabled && css(["&&&:active,&&&{background-color:", ";}"], hexToRgba(props.theme.palette["grey-200"], 0.4)), (props) => hexToRgba(props.theme.palette["grey-200"], 0.2), (props) => props.theme.palette["grey-400"], DropAreaLabel, LargeDropAreaLabel, (props) => props.theme.palette["grey-700"], IconContainer, (props) => props.theme.palette["grey-700"], (props) => props.theme.palette["grey-050"], LargeDropAreaLabel, (props) => props.theme.palette["grey-400"], (props) => props.theme.palette["red-400"], (props) => props.theme.palette["grey-400"], (props) => props.theme.palette["grey-050"], (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["blue-050"], IconContainer, (props) => props.isDropping && !props.disabled && `
45
+ height: ${props.mode === "multi-large" ? "200px" : "80px"};
46
+ background-color: ${props.theme.palette["blue-050"]} !important;
47
+ border-color: ${props.theme.palette["blue-300"]} !important;
48
+
49
+ span, ${DropAreaLabel}, ${LargeDropAreaLabel}, ${LargeDropAreaDescription} {
50
+ color: ${props.theme.palette["blue-500"]} !important;
51
+ }
52
+
53
+ ${IconContainer} {
54
+ color: ${props.theme.palette["blue-500"]} !important;
55
+ }
56
+ `);
57
+ const ErrorMessage = /* @__PURE__ */ styled(Text).withConfig({
84
58
  displayName: "AvatarUploaderstyles__ErrorMessage",
85
59
  componentId: "sc-1lljrgr-8"
86
- })(["&&{margin:8px 0 0;display:block;color:", ";}"], function (props) {
87
- return props.theme.palette['red-600'];
88
- });
89
- export var Label = styled(TypographyLabel).withConfig({
60
+ })(["&&{margin:8px 0 0;display:block;color:", ";}"], (props) => props.theme.palette["red-600"]);
61
+ const Label = /* @__PURE__ */ styled(Label$1).withConfig({
90
62
  displayName: "AvatarUploaderstyles__Label",
91
63
  componentId: "sc-1lljrgr-9"
92
- })(["&&{cursor:initial;margin:0 0 8px;display:flex;align-items:center;}"]);
64
+ })(["&&{cursor:initial;margin:0 0 8px;display:flex;align-items:center;}"]);
65
+ export {
66
+ Container,
67
+ Description,
68
+ DropAreaButton,
69
+ DropAreaContainer,
70
+ DropAreaLabel,
71
+ ErrorMessage,
72
+ Label,
73
+ LargeDropAreaDescription,
74
+ LargeDropAreaLabel,
75
+ UploaderContainer
76
+ };
@@ -1,4 +1,3 @@
1
- import { type PreviewableMimeType } from './FileViewAvatar.types';
1
+ import { PreviewableMimeType } from './FileViewAvatar.types';
2
2
  export declare const previewableMimeTypes: PreviewableMimeType[];
3
3
  export declare const ICON_MAP: Record<PreviewableMimeType, JSX.Element>;
4
- //# sourceMappingURL=FileViewAvatar.const.d.ts.map
@@ -1,10 +1,14 @@
1
- import React from 'react';
2
- import { FileTypeImageM } from '@synerise/ds-icon';
3
- export var previewableMimeTypes = ['image/png', 'image/gif', 'image/jpeg', 'image/svg+xml', 'text/csv'];
4
- export var ICON_MAP = {
5
- 'image/png': /*#__PURE__*/React.createElement(FileTypeImageM, null),
6
- 'image/gif': /*#__PURE__*/React.createElement(FileTypeImageM, null),
7
- 'image/jpeg': /*#__PURE__*/React.createElement(FileTypeImageM, null),
8
- 'image/svg+xml': /*#__PURE__*/React.createElement(FileTypeImageM, null),
9
- 'text/csv': /*#__PURE__*/React.createElement(FileTypeImageM, null)
10
- };
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { FileTypeImageM } from "@synerise/ds-icon";
3
+ const previewableMimeTypes = ["image/png", "image/gif", "image/jpeg", "image/svg+xml", "text/csv"];
4
+ const ICON_MAP = {
5
+ "image/png": /* @__PURE__ */ jsx(FileTypeImageM, {}),
6
+ "image/gif": /* @__PURE__ */ jsx(FileTypeImageM, {}),
7
+ "image/jpeg": /* @__PURE__ */ jsx(FileTypeImageM, {}),
8
+ "image/svg+xml": /* @__PURE__ */ jsx(FileTypeImageM, {}),
9
+ "text/csv": /* @__PURE__ */ jsx(FileTypeImageM, {})
10
+ };
11
+ export {
12
+ ICON_MAP,
13
+ previewableMimeTypes
14
+ };
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { type FileViewAvatarProps } from './FileViewAvatar.types';
1
+ import { default as React } from 'react';
2
+ import { FileViewAvatarProps } from './FileViewAvatar.types';
3
3
  declare const FileViewAvatar: ({ data, texts, onRemove, removable, description, }: FileViewAvatarProps) => React.JSX.Element;
4
4
  export default FileViewAvatar;
5
- //# sourceMappingURL=FileViewAvatar.d.ts.map