@entur/fileupload 0.3.59 → 0.3.61

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/LICENSE.md CHANGED
@@ -208,74 +208,3 @@ The European Commission may update this Appendix to later versions of the above
208
208
  a new version of the EUPL, as long as they provide the rights granted in Article 2 of this Licence and protect the
209
209
  covered Source Code from exclusive appropriation.
210
210
  All other changes or additions to this Appendix require the production of a new EUPL version.
211
-
212
- # Standard Nucleo License
213
-
214
- - Last updated: July 2, 2018
215
- - [Github repo](https://github.com/NucleoApp/license-standard)
216
-
217
- By purchasing the Nucleo icons, you have the right to:
218
-
219
- - Use the Nucleo icons in unlimited personal and commercial projects, for yourself or a client, with no limitation to the number of impressions for your end product.
220
- - Use the Nucleo icons in applications, software, UI/UX design, print, and logo design.
221
- - Modify the Nucleo icons to create your icon variations.
222
-
223
- You don't have the right to:
224
-
225
- - Sublicense, resell, share, transfer, or otherwise redistribute the Nucleo icons (even for free or within a more complex downloadable file).
226
- - Use the Nucleo icons in a product that is directly competitive with Nucleo.
227
-
228
- ## Limitations & Extended license
229
-
230
- - **For each project, you can use a maximum of 250 Nucleo icons** (intended per unique style: for example, if you're using the same icon in both the outline and glyph styles, or in 2 different sizes, you're using 2 icons). You can lift this limit by purchasing an Extended License.
231
- - If you're using Nucleo icons in templates, themes or plugins offered for sale, you can use a maximum of 100 Nucleo icons. You can lift this limit by purchasing an Extended License.
232
- - If you're using the Nucleo icons in open source projects, you can use a maximum of 100 Nucleo icons.
233
- - If you're interested in using the Nucleo icons in items offered for sale (or for free) where the Nucleo icons contribute to the core value of the product being sold/shared, you will need an Extended License (e.g., a CMS where users can browse the Nucleo icons and pick the ones to include in their design).
234
-
235
- [Learn more about the Extended License](https://nucleoapp.com/extended-license)
236
-
237
- ## Freelance Projects & Contracted work
238
-
239
- If you're working on a project for a client, you can share with your client a maximum of 250 Nucleo icons per project. You can't share the Nucleo source files unless the client purchases a license.
240
-
241
- If the Nucleo icons contribute to the core value of the product being sold/shared, or if you (or your client) wish to include more than 250 icons in the project, the [Extended License](https://nucleoapp.com/extended-license) is required.
242
-
243
- ## Templates, Themes, UI Kits & Plugins
244
-
245
- If you're using Nucleo icons in templates, themes or plugins offered for sale (e.g., UI kits, Wordpress Themes, HTML/CSS Templates), **you can include up to 100 icons in the downloadable source files**. This limitation applies to the icon fonts as well.
246
-
247
- The downloadable source file has to include the [Nucleo Copyright Notice](https://nucleoapp.com/copyright-notice).
248
-
249
- If the Nucleo icons contribute to the core value of the template, theme or plugin sold (e.g., a theme builder where users can browse Nucleo icons and pick the ones to include in their design), or if you wish to use more than 100 Nucleo icons, you will need an [Extended License](https://nucleoapp.com/extended-license).
250
-
251
- It's not possible to purchase an Extended License if the template, theme or plugin is distributed for free.
252
-
253
- If you're offering a free and pro version of your product, the free version cannot include more than 100 icons even if you purchased an Extended License to lift the limit. The Extended License applies only to the pro version of your product.
254
-
255
- ## Open source projects
256
-
257
- If you're using the Nucleo icons in open source projects, **you can include up to 100 icons in the downloadable source files**. This limitation applies to the icon fonts as well.
258
-
259
- The downloadable source file has to include the [Nucleo Copyright Notice](https://nucleoapp.com/copyright-notice).
260
-
261
- It's not possible to purchase an Extended License for open source projects.
262
-
263
- ## Sharing Nucleo icons with team members
264
-
265
- If you're the sole owner of a Nucleo license, you can share with your team members only the icons used in your work, with a maximum of 250 icons (e.g., if you're a designer, you can share with the developers of your team only the Nucleo icons used in your design files).
266
-
267
- Your team members cannot reuse the Nucleo icons in other projects unless they purchase a license.
268
-
269
- If more than one team member needs access to the Nucleo icons, you can consider purchasing a [team license](https://nucleoapp.com/pricing).
270
-
271
- ## Design systems
272
-
273
- If you wish to include the Nucleo icons in a design system available on a public server, you can use a maximum of 250 Nucleo icons, even if your team purchased a Nucleo team license.
274
-
275
- If the design system is accessible only by the members of your organization (e.g., is hosted on a password protected server), but you're the sole owner of a Nucleo license, you can share with your colleagues a maximum of 250 Nucleo icons.
276
-
277
- If the design system is on a public server, you can lift the 250 icons limit by buying an [Extended License](https://nucleoapp.com/extended-license). However, please keep in mind you can't provide a link/button to download all the icons.
278
-
279
- If your team purchased a Nucleo team license that covers all the users with access to the design system, and the design system is not public (e.g., is hosted on a password protected server), then there's no limitation to the number of icons that can be included.
280
-
281
- If you're still unclear about what is or isn't allowed under this license, please contact us at info@nucleoapp.com.
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropzoneOptions, FileRejection, DropEvent, FileWithPath } from 'react-dropzone';
3
3
  import './FileUpload.scss';
4
- declare type FileUploadProps = DropzoneOptions & {
4
+ type FileUploadProps = DropzoneOptions & {
5
5
  /** Tekst som vises ved fullført opplasting
6
6
  * @default "Opplasting fullført"
7
7
  */
@@ -17,72 +17,64 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
17
17
  var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
18
18
 
19
19
  function _extends() {
20
- _extends = Object.assign || function (target) {
20
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
21
21
  for (var i = 1; i < arguments.length; i++) {
22
22
  var source = arguments[i];
23
-
24
23
  for (var key in source) {
25
24
  if (Object.prototype.hasOwnProperty.call(source, key)) {
26
25
  target[key] = source[key];
27
26
  }
28
27
  }
29
28
  }
30
-
31
29
  return target;
32
30
  };
33
-
34
31
  return _extends.apply(this, arguments);
35
32
  }
36
-
37
33
  function _objectWithoutPropertiesLoose(source, excluded) {
38
34
  if (source == null) return {};
39
35
  var target = {};
40
36
  var sourceKeys = Object.keys(source);
41
37
  var key, i;
42
-
43
38
  for (i = 0; i < sourceKeys.length; i++) {
44
39
  key = sourceKeys[i];
45
40
  if (excluded.indexOf(key) >= 0) continue;
46
41
  target[key] = source[key];
47
42
  }
48
-
49
43
  return target;
50
44
  }
51
45
 
52
46
  var _excluded = ["standbyText", "errorText", "successText", "errorUpload", "onDrop", "onDelete", "accept", "files", "label", "removeFileButtonDescription", "style"];
53
47
  var FileUpload = function FileUpload(_ref) {
54
48
  var _ref$standbyText = _ref.standbyText,
55
- standbyText = _ref$standbyText === void 0 ? 'Dra fil eller klikk for å laste opp' : _ref$standbyText,
56
- _ref$errorText = _ref.errorText,
57
- errorText = _ref$errorText === void 0 ? 'Feil ved opplasting av fil' : _ref$errorText,
58
- _ref$successText = _ref.successText,
59
- successText = _ref$successText === void 0 ? 'Opplasting fullført' : _ref$successText,
60
- _ref$errorUpload = _ref.errorUpload,
61
- errorUpload = _ref$errorUpload === void 0 ? false : _ref$errorUpload,
62
- onDrop = _ref.onDrop,
63
- _ref$onDelete = _ref.onDelete,
64
- onDelete = _ref$onDelete === void 0 ? function (file) {
65
- return console.log(file);
66
- } : _ref$onDelete,
67
- _ref$accept = _ref.accept,
68
- accept = _ref$accept === void 0 ? '' : _ref$accept,
69
- _ref$files = _ref.files,
70
- files = _ref$files === void 0 ? [] : _ref$files,
71
- label = _ref.label,
72
- _ref$removeFileButton = _ref.removeFileButtonDescription,
73
- removeFileButtonDescription = _ref$removeFileButton === void 0 ? 'Fjern fil' : _ref$removeFileButton,
74
- style = _ref.style,
75
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
76
-
49
+ standbyText = _ref$standbyText === void 0 ? 'Dra fil eller klikk for å laste opp' : _ref$standbyText,
50
+ _ref$errorText = _ref.errorText,
51
+ errorText = _ref$errorText === void 0 ? 'Feil ved opplasting av fil' : _ref$errorText,
52
+ _ref$successText = _ref.successText,
53
+ successText = _ref$successText === void 0 ? 'Opplasting fullført' : _ref$successText,
54
+ _ref$errorUpload = _ref.errorUpload,
55
+ errorUpload = _ref$errorUpload === void 0 ? false : _ref$errorUpload,
56
+ onDrop = _ref.onDrop,
57
+ _ref$onDelete = _ref.onDelete,
58
+ onDelete = _ref$onDelete === void 0 ? function (file) {
59
+ return console.log(file);
60
+ } : _ref$onDelete,
61
+ _ref$accept = _ref.accept,
62
+ accept = _ref$accept === void 0 ? '' : _ref$accept,
63
+ _ref$files = _ref.files,
64
+ files = _ref$files === void 0 ? [] : _ref$files,
65
+ label = _ref.label,
66
+ _ref$removeFileButton = _ref.removeFileButtonDescription,
67
+ removeFileButtonDescription = _ref$removeFileButton === void 0 ? 'Fjern fil' : _ref$removeFileButton,
68
+ style = _ref.style,
69
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
77
70
  var _useDropzone = reactDropzone.useDropzone(_extends({
78
- onDrop: onDrop,
79
- accept: accept
80
- }, rest)),
81
- getRootProps = _useDropzone.getRootProps,
82
- getInputProps = _useDropzone.getInputProps,
83
- isDragActive = _useDropzone.isDragActive,
84
- isDragReject = _useDropzone.isDragReject;
85
-
71
+ onDrop: onDrop,
72
+ accept: accept
73
+ }, rest)),
74
+ getRootProps = _useDropzone.getRootProps,
75
+ getInputProps = _useDropzone.getInputProps,
76
+ isDragActive = _useDropzone.isDragActive,
77
+ isDragReject = _useDropzone.isDragReject;
86
78
  var success = files.length > 0;
87
79
  return React__default["default"].createElement("div", _extends({
88
80
  className: "eds-file-upload__wrapper"
@@ -119,7 +111,6 @@ var FileUpload = function FileUpload(_ref) {
119
111
  }, React__default["default"].createElement(a11y.VisuallyHidden, null, removeFileButtonDescription, ", ", file.name), React__default["default"].createElement(icons.DeleteIcon, null)));
120
112
  })));
121
113
  };
122
-
123
114
  function convertSizeToHuman(size) {
124
115
  if (size < 1000) {
125
116
  return size + 'bytes;';
@@ -1 +1 @@
1
- {"version":3,"file":"fileupload.cjs.development.js","sources":["../src/FileUpload.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n useDropzone,\n DropzoneOptions,\n FileRejection,\n DropEvent,\n FileWithPath,\n} from 'react-dropzone';\nimport classNames from 'classnames';\n\nimport { FileIcon, DeleteIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Label } from '@entur/typography';\nimport { VisuallyHidden } from '@entur/a11y';\n\nimport './FileUpload.scss';\n\ntype FileUploadProps = DropzoneOptions & {\n /** Tekst som vises ved fullført opplasting\n * @default \"Opplasting fullført\"\n */\n successText?: string;\n /** Tekst som vises om opplasting feilet\n * @default \"Feil ved opplasting av fil\"\n */\n errorText?: string;\n /** Tekst som vises før man laster opp noe\n * @default \"Dra fil eller klikk for å laste opp\"\n */\n standbyText?: string;\n /** Boolean for hvis opplastingen feiler.\n * @default false\n */\n errorUpload?: boolean;\n /** Callback for når en fil legges til */\n onDrop?<T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ): void;\n /** Callback for når en fil slettes fra lista */\n onDelete?: (file: FileWithPath) => void;\n /** Hvilken filtyper som skal aksepteres */\n accept?: string | string[];\n /** Filene som er aktive i komponenten */\n files: File[];\n /** Beskrivende tekst som forklarer feltet */\n label?: string;\n /** Mulighet for å laste opp flere filer */\n multiple?: boolean;\n /**Minste filstørrelse */\n minSize?: number;\n /**Største filstørrelse */\n maxSize?: number;\n /**Tekst som leses opp av skjermleser på søppelbøtte-ikonet\n * @default \"Fjern fil\"\n */\n removeFileButtonDescription?: string;\n [key: string]: any;\n};\n\nexport const FileUpload: React.FC<FileUploadProps> = ({\n standbyText = 'Dra fil eller klikk for å laste opp',\n errorText = 'Feil ved opplasting av fil',\n successText = 'Opplasting fullført',\n errorUpload = false,\n onDrop,\n onDelete = file => console.log(file),\n accept = '',\n files = [],\n label,\n removeFileButtonDescription = 'Fjern fil',\n style,\n ...rest\n}) => {\n const { getRootProps, getInputProps, isDragActive, isDragReject } =\n useDropzone({\n onDrop,\n accept: accept,\n ...rest,\n });\n\n const success = files.length > 0;\n\n return (\n <div className=\"eds-file-upload__wrapper\" {...style}>\n <div className=\"eds-file-upload__input\" {...getRootProps()}>\n {label && <Label style={{ display: 'flex' }}>{label}</Label>}\n <input {...getInputProps()} />\n <span\n className={classNames(\n 'eds-file-upload__dropzone',\n {\n 'eds-file-upload__dropzone--success': success,\n },\n { 'eds-file-upload__dropzone--active': isDragActive },\n { 'eds-file-upload__dropzone--reject': isDragReject },\n { 'eds-file-upload__dropzone--error': errorUpload },\n )}\n >\n {success ? successText : errorUpload ? errorText : standbyText}\n </span>\n </div>\n <div className=\"eds-file-upload__file-list\">\n {files.map((file: FileWithPath, index) => (\n <div className=\"eds-file-upload__file-name\" key={index}>\n <FileIcon className=\"eds-file-upload__file-name-icon\" />\n <span className=\"eds-field-upload__file-name-path\">\n {file.path} - {convertSizeToHuman(file.size)}{' '}\n </span>\n <IconButton onClick={() => onDelete(file)}>\n <VisuallyHidden>\n {removeFileButtonDescription}, {file.name}\n </VisuallyHidden>\n <DeleteIcon />\n </IconButton>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nfunction convertSizeToHuman(size: number) {\n if (size < 1000) {\n return size + 'bytes;';\n } else if (size < 1000000) {\n return `${size / 1000} KB`;\n } else {\n return `${(size / 1000000).toPrecision(4)} MB`;\n }\n}\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('fileupload');\n\nexport * from './FileUpload';\n"],"names":["FileUpload","standbyText","errorText","successText","errorUpload","onDrop","onDelete","file","console","log","accept","files","label","removeFileButtonDescription","style","rest","useDropzone","getRootProps","getInputProps","isDragActive","isDragReject","success","length","React","className","Label","display","classNames","map","index","key","FileIcon","path","convertSizeToHuman","size","IconButton","onClick","VisuallyHidden","name","DeleteIcon","toPrecision","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6DaA,UAAU,GAA8B,SAAxCA,UAAwC;8BACnDC;MAAAA,4CAAc;4BACdC;MAAAA,wCAAY;8BACZC;MAAAA,4CAAc;8BACdC;MAAAA,4CAAc;MACdC,cAAAA;2BACAC;MAAAA,sCAAW,UAAAC,IAAI;AAAA,WAAIC,OAAO,CAACC,GAAR,CAAYF,IAAZ,CAAJ;AAAA;yBACfG;MAAAA,kCAAS;wBACTC;MAAAA,gCAAQ;MACRC,aAAAA;mCACAC;MAAAA,iEAA8B;MAC9BC,aAAAA;MACGC;;AAEH,qBACEC,yBAAW;AACTX,IAAAA,MAAM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AA,EACiBC,kBAAkB,CAAC1B,IAAI,CAAC2B,IAAN,CADnC,EACgD,GADhD,CAFF,EAKEX,uCAAA,CAACY,iBAAD;AAAYC,MAAAA,OAAO,EAAE;AAAA,eAAM9B,QAAQ,CAACC,IAAD,CAAd;AAAA;KAArB,EACEgB,uCAAA,CAACc,mBAAD,MAAA,EACGxB,2BADH,MAAA,EACkCN,IAAI,CAAC+B,IADvC,CADF,EAIEf,uCAAA,CAACgB,gBAAD,MAAA,CAJF,CALF,CADS;AAAA,GAAV,CADH,CAlBF,CADF;AAqCD;;AAED,SAASN,kBAAT,CAA4BC,IAA5B;AACE,MAAIA,IAAI,GAAG,IAAX,EAAiB;AACf,WAAOA,IAAI,GAAG,QAAd;AACD,GAFD,MAEO,IAAIA,IAAI,GAAG,OAAX,EAAoB;AACzB,WAAUA,IAAI,GAAG,IAAjB;AACD,GAFM,MAEA;AACL,WAAU,CAACA,IAAI,GAAG,OAAR,EAAiBM,WAAjB,CAA6B,CAA7B,CAAV;AACD;AACF;;AChIDC,4BAAsB,CAAC,YAAD,CAAtB;;;;"}
1
+ {"version":3,"file":"fileupload.cjs.development.js","sources":["../src/FileUpload.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n useDropzone,\n DropzoneOptions,\n FileRejection,\n DropEvent,\n FileWithPath,\n} from 'react-dropzone';\nimport classNames from 'classnames';\n\nimport { FileIcon, DeleteIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Label } from '@entur/typography';\nimport { VisuallyHidden } from '@entur/a11y';\n\nimport './FileUpload.scss';\n\ntype FileUploadProps = DropzoneOptions & {\n /** Tekst som vises ved fullført opplasting\n * @default \"Opplasting fullført\"\n */\n successText?: string;\n /** Tekst som vises om opplasting feilet\n * @default \"Feil ved opplasting av fil\"\n */\n errorText?: string;\n /** Tekst som vises før man laster opp noe\n * @default \"Dra fil eller klikk for å laste opp\"\n */\n standbyText?: string;\n /** Boolean for hvis opplastingen feiler.\n * @default false\n */\n errorUpload?: boolean;\n /** Callback for når en fil legges til */\n onDrop?<T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ): void;\n /** Callback for når en fil slettes fra lista */\n onDelete?: (file: FileWithPath) => void;\n /** Hvilken filtyper som skal aksepteres */\n accept?: string | string[];\n /** Filene som er aktive i komponenten */\n files: File[];\n /** Beskrivende tekst som forklarer feltet */\n label?: string;\n /** Mulighet for å laste opp flere filer */\n multiple?: boolean;\n /**Minste filstørrelse */\n minSize?: number;\n /**Største filstørrelse */\n maxSize?: number;\n /**Tekst som leses opp av skjermleser på søppelbøtte-ikonet\n * @default \"Fjern fil\"\n */\n removeFileButtonDescription?: string;\n [key: string]: any;\n};\n\nexport const FileUpload: React.FC<FileUploadProps> = ({\n standbyText = 'Dra fil eller klikk for å laste opp',\n errorText = 'Feil ved opplasting av fil',\n successText = 'Opplasting fullført',\n errorUpload = false,\n onDrop,\n onDelete = file => console.log(file),\n accept = '',\n files = [],\n label,\n removeFileButtonDescription = 'Fjern fil',\n style,\n ...rest\n}) => {\n const { getRootProps, getInputProps, isDragActive, isDragReject } =\n useDropzone({\n onDrop,\n accept: accept,\n ...rest,\n });\n\n const success = files.length > 0;\n\n return (\n <div className=\"eds-file-upload__wrapper\" {...style}>\n <div className=\"eds-file-upload__input\" {...getRootProps()}>\n {label && <Label style={{ display: 'flex' }}>{label}</Label>}\n <input {...getInputProps()} />\n <span\n className={classNames(\n 'eds-file-upload__dropzone',\n {\n 'eds-file-upload__dropzone--success': success,\n },\n { 'eds-file-upload__dropzone--active': isDragActive },\n { 'eds-file-upload__dropzone--reject': isDragReject },\n { 'eds-file-upload__dropzone--error': errorUpload },\n )}\n >\n {success ? successText : errorUpload ? errorText : standbyText}\n </span>\n </div>\n <div className=\"eds-file-upload__file-list\">\n {files.map((file: FileWithPath, index) => (\n <div className=\"eds-file-upload__file-name\" key={index}>\n <FileIcon className=\"eds-file-upload__file-name-icon\" />\n <span className=\"eds-field-upload__file-name-path\">\n {file.path} - {convertSizeToHuman(file.size)}{' '}\n </span>\n <IconButton onClick={() => onDelete(file)}>\n <VisuallyHidden>\n {removeFileButtonDescription}, {file.name}\n </VisuallyHidden>\n <DeleteIcon />\n </IconButton>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nfunction convertSizeToHuman(size: number) {\n if (size < 1000) {\n return size + 'bytes;';\n } else if (size < 1000000) {\n return `${size / 1000} KB`;\n } else {\n return `${(size / 1000000).toPrecision(4)} MB`;\n }\n}\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('fileupload');\n\nexport * from './FileUpload';\n"],"names":["FileUpload","standbyText","errorText","successText","errorUpload","onDrop","onDelete","file","console","log","accept","files","label","removeFileButtonDescription","style","rest","useDropzone","getRootProps","getInputProps","isDragActive","isDragReject","success","length","React","createElement","className","Label","display","classNames","map","index","key","FileIcon","path","convertSizeToHuman","size","IconButton","onClick","VisuallyHidden","name","DeleteIcon","toPrecision","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DaA,IAAAA,UAAU,GAA8B,SAAxCA,UAAU,CAalB,IAAA,EAAA;AAAA,EAAA,IAAA,gBAAA,GAAA,IAAA,CAZHC,WAAW;AAAXA,IAAAA,WAAW,iCAAG,qCAAqC,GAAA,gBAAA;AAAA,IAAA,cAAA,GAAA,IAAA,CACnDC,SAAS;AAATA,IAAAA,SAAS,+BAAG,4BAA4B,GAAA,cAAA;AAAA,IAAA,gBAAA,GAAA,IAAA,CACxCC,WAAW;AAAXA,IAAAA,WAAW,iCAAG,qBAAqB,GAAA,gBAAA;AAAA,IAAA,gBAAA,GAAA,IAAA,CACnCC,WAAW;AAAXA,IAAAA,WAAW,iCAAG,KAAK,GAAA,gBAAA;AACnBC,IAAAA,MAAM,QAANA,MAAM;AAAA,IAAA,aAAA,GAAA,IAAA,CACNC,QAAQ;IAARA,QAAQ,GAAA,aAAA,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QAAQ,CAACC,IAAI,CAAC,CAAA;AAAA,OAAA;KAAA,EACvCgB,yBAAA,CAAAC,aAAA,CAACc,mBAAc,EAAA,IAAA,EACZzB,2BAA2B,QAAIN,IAAI,CAACgC,IAAI,CAC1B,EACjBhB,yBAAC,CAAAC,aAAA,CAAAgB,gBAAU,OAAG,CACH,CACT,CAAA;GACP,CAAC,CACE,CACF,CAAA;AAEV,EAAC;AAED,SAASN,kBAAkB,CAACC,IAAY,EAAA;EACtC,IAAIA,IAAI,GAAG,IAAI,EAAE;IACf,OAAOA,IAAI,GAAG,QAAQ,CAAA;AACvB,GAAA,MAAM,IAAIA,IAAI,GAAG,OAAO,EAAE;IACzB,OAAUA,IAAI,GAAG,IAAI,GAAA,MAAA,CAAA;AACtB,GAAA,MAAM;IACL,OAAU,CAACA,IAAI,GAAG,OAAO,EAAEM,WAAW,CAAC,CAAC,CAAC,GAAA,KAAA,CAAA;AAC1C,GAAA;AACH;;AChIAC,4BAAsB,CAAC,YAAY,CAAC;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@entur/utils"),t=require("react"),l=require("react-dropzone"),r=require("classnames"),a=require("@entur/icons"),n=require("@entur/button"),o=require("@entur/typography"),i=require("@entur/a11y");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(t),d=s(r);function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e},c.apply(this,arguments)}var p=["standbyText","errorText","successText","errorUpload","onDrop","onDelete","accept","files","label","removeFileButtonDescription","style"];e.warnAboutMissingStyles("fileupload"),exports.FileUpload=function(e){var t=e.standbyText,r=void 0===t?"Dra fil eller klikk for å laste opp":t,s=e.errorText,f=void 0===s?"Feil ved opplasting av fil":s,v=e.successText,m=void 0===v?"Opplasting fullført":v,_=e.errorUpload,y=void 0!==_&&_,b=e.onDrop,g=e.onDelete,D=void 0===g?function(e){return console.log(e)}:g,E=e.accept,x=void 0===E?"":E,h=e.files,j=void 0===h?[]:h,q=e.label,z=e.removeFileButtonDescription,N=void 0===z?"Fjern fil":z,O=e.style,k=function(e,t){if(null==e)return{};var l,r,a={},n=Object.keys(e);for(r=0;r<n.length;r++)t.indexOf(l=n[r])>=0||(a[l]=e[l]);return a}(e,p),F=l.useDropzone(c({onDrop:b,accept:x},k)),T=F.getRootProps,B=F.getInputProps,P=F.isDragActive,I=F.isDragReject,w=j.length>0;return u.default.createElement("div",c({className:"eds-file-upload__wrapper"},O),u.default.createElement("div",c({className:"eds-file-upload__input"},T()),q&&u.default.createElement(o.Label,{style:{display:"flex"}},q),u.default.createElement("input",c({},B())),u.default.createElement("span",{className:d.default("eds-file-upload__dropzone",{"eds-file-upload__dropzone--success":w},{"eds-file-upload__dropzone--active":P},{"eds-file-upload__dropzone--reject":I},{"eds-file-upload__dropzone--error":y})},w?m:y?f:r)),u.default.createElement("div",{className:"eds-file-upload__file-list"},j.map((function(e,t){return u.default.createElement("div",{className:"eds-file-upload__file-name",key:t},u.default.createElement(a.FileIcon,{className:"eds-file-upload__file-name-icon"}),u.default.createElement("span",{className:"eds-field-upload__file-name-path"},e.path," - ",(l=e.size)<1e3?l+"bytes;":l<1e6?l/1e3+" KB":(l/1e6).toPrecision(4)+" MB"," "),u.default.createElement(n.IconButton,{onClick:function(){return D(e)}},u.default.createElement(i.VisuallyHidden,null,N,", ",e.name),u.default.createElement(a.DeleteIcon,null)));var l}))))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@entur/utils"),t=require("react"),l=require("react-dropzone"),r=require("classnames"),a=require("@entur/icons"),n=require("@entur/button"),o=require("@entur/typography"),i=require("@entur/a11y");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(t),d=s(r);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e},c.apply(this,arguments)}var p=["standbyText","errorText","successText","errorUpload","onDrop","onDelete","accept","files","label","removeFileButtonDescription","style"];e.warnAboutMissingStyles("fileupload"),exports.FileUpload=function(e){var t=e.standbyText,r=void 0===t?"Dra fil eller klikk for å laste opp":t,s=e.errorText,f=void 0===s?"Feil ved opplasting av fil":s,v=e.successText,m=void 0===v?"Opplasting fullført":v,_=e.errorUpload,y=void 0!==_&&_,b=e.onDrop,g=e.onDelete,D=void 0===g?function(e){return console.log(e)}:g,E=e.accept,x=void 0===E?"":E,j=e.files,h=void 0===j?[]:j,q=e.label,z=e.removeFileButtonDescription,O=void 0===z?"Fjern fil":z,N=e.style,k=function(e,t){if(null==e)return{};var l,r,a={},n=Object.keys(e);for(r=0;r<n.length;r++)t.indexOf(l=n[r])>=0||(a[l]=e[l]);return a}(e,p),F=l.useDropzone(c({onDrop:b,accept:x},k)),T=F.getRootProps,B=F.getInputProps,P=F.isDragActive,I=F.isDragReject,w=h.length>0;return u.default.createElement("div",c({className:"eds-file-upload__wrapper"},N),u.default.createElement("div",c({className:"eds-file-upload__input"},T()),q&&u.default.createElement(o.Label,{style:{display:"flex"}},q),u.default.createElement("input",c({},B())),u.default.createElement("span",{className:d.default("eds-file-upload__dropzone",{"eds-file-upload__dropzone--success":w},{"eds-file-upload__dropzone--active":P},{"eds-file-upload__dropzone--reject":I},{"eds-file-upload__dropzone--error":y})},w?m:y?f:r)),u.default.createElement("div",{className:"eds-file-upload__file-list"},h.map((function(e,t){return u.default.createElement("div",{className:"eds-file-upload__file-name",key:t},u.default.createElement(a.FileIcon,{className:"eds-file-upload__file-name-icon"}),u.default.createElement("span",{className:"eds-field-upload__file-name-path"},e.path," - ",(l=e.size)<1e3?l+"bytes;":l<1e6?l/1e3+" KB":(l/1e6).toPrecision(4)+" MB"," "),u.default.createElement(n.IconButton,{onClick:function(){return D(e)}},u.default.createElement(i.VisuallyHidden,null,O,", ",e.name),u.default.createElement(a.DeleteIcon,null)));var l}))))};
2
2
  //# sourceMappingURL=fileupload.cjs.production.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fileupload.cjs.production.min.js","sources":["../src/index.tsx","../src/FileUpload.tsx"],"sourcesContent":["import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('fileupload');\n\nexport * from './FileUpload';\n","import React from 'react';\nimport {\n useDropzone,\n DropzoneOptions,\n FileRejection,\n DropEvent,\n FileWithPath,\n} from 'react-dropzone';\nimport classNames from 'classnames';\n\nimport { FileIcon, DeleteIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Label } from '@entur/typography';\nimport { VisuallyHidden } from '@entur/a11y';\n\nimport './FileUpload.scss';\n\ntype FileUploadProps = DropzoneOptions & {\n /** Tekst som vises ved fullført opplasting\n * @default \"Opplasting fullført\"\n */\n successText?: string;\n /** Tekst som vises om opplasting feilet\n * @default \"Feil ved opplasting av fil\"\n */\n errorText?: string;\n /** Tekst som vises før man laster opp noe\n * @default \"Dra fil eller klikk for å laste opp\"\n */\n standbyText?: string;\n /** Boolean for hvis opplastingen feiler.\n * @default false\n */\n errorUpload?: boolean;\n /** Callback for når en fil legges til */\n onDrop?<T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ): void;\n /** Callback for når en fil slettes fra lista */\n onDelete?: (file: FileWithPath) => void;\n /** Hvilken filtyper som skal aksepteres */\n accept?: string | string[];\n /** Filene som er aktive i komponenten */\n files: File[];\n /** Beskrivende tekst som forklarer feltet */\n label?: string;\n /** Mulighet for å laste opp flere filer */\n multiple?: boolean;\n /**Minste filstørrelse */\n minSize?: number;\n /**Største filstørrelse */\n maxSize?: number;\n /**Tekst som leses opp av skjermleser på søppelbøtte-ikonet\n * @default \"Fjern fil\"\n */\n removeFileButtonDescription?: string;\n [key: string]: any;\n};\n\nexport const FileUpload: React.FC<FileUploadProps> = ({\n standbyText = 'Dra fil eller klikk for å laste opp',\n errorText = 'Feil ved opplasting av fil',\n successText = 'Opplasting fullført',\n errorUpload = false,\n onDrop,\n onDelete = file => console.log(file),\n accept = '',\n files = [],\n label,\n removeFileButtonDescription = 'Fjern fil',\n style,\n ...rest\n}) => {\n const { getRootProps, getInputProps, isDragActive, isDragReject } =\n useDropzone({\n onDrop,\n accept: accept,\n ...rest,\n });\n\n const success = files.length > 0;\n\n return (\n <div className=\"eds-file-upload__wrapper\" {...style}>\n <div className=\"eds-file-upload__input\" {...getRootProps()}>\n {label && <Label style={{ display: 'flex' }}>{label}</Label>}\n <input {...getInputProps()} />\n <span\n className={classNames(\n 'eds-file-upload__dropzone',\n {\n 'eds-file-upload__dropzone--success': success,\n },\n { 'eds-file-upload__dropzone--active': isDragActive },\n { 'eds-file-upload__dropzone--reject': isDragReject },\n { 'eds-file-upload__dropzone--error': errorUpload },\n )}\n >\n {success ? successText : errorUpload ? errorText : standbyText}\n </span>\n </div>\n <div className=\"eds-file-upload__file-list\">\n {files.map((file: FileWithPath, index) => (\n <div className=\"eds-file-upload__file-name\" key={index}>\n <FileIcon className=\"eds-file-upload__file-name-icon\" />\n <span className=\"eds-field-upload__file-name-path\">\n {file.path} - {convertSizeToHuman(file.size)}{' '}\n </span>\n <IconButton onClick={() => onDelete(file)}>\n <VisuallyHidden>\n {removeFileButtonDescription}, {file.name}\n </VisuallyHidden>\n <DeleteIcon />\n </IconButton>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nfunction convertSizeToHuman(size: number) {\n if (size < 1000) {\n return size + 'bytes;';\n } else if (size < 1000000) {\n return `${size / 1000} KB`;\n } else {\n return `${(size / 1000000).toPrecision(4)} MB`;\n }\n}\n"],"names":["warnAboutMissingStyles","standbyText","errorText","successText","errorUpload","onDrop","onDelete","file","console","log","accept","files","label","removeFileButtonDescription","style","rest","useDropzone","getRootProps","getInputProps","isDragActive","isDragReject","success","length","React","className","Label","display","classNames","map","index","key","FileIcon","path","size","toPrecision","IconButton","onClick","VisuallyHidden","name","DeleteIcon"],"mappings":"itBAGAA,yBAAuB,iCC0D8B,oBACnDC,YAAAA,aAAc,4CACdC,UAAAA,aAAY,mCACZC,YAAAA,aAAc,4BACdC,YAAAA,gBACAC,IAAAA,WACAC,SAAAA,aAAW,SAAAC,UAAQC,QAAQC,IAAIF,UAC/BG,OAAAA,aAAS,SACTC,MAAAA,aAAQ,KACRC,IAAAA,UACAC,4BAAAA,aAA8B,cAC9BC,IAAAA,MACGC,4IAGDC,iBACEX,OAAAA,EACAK,OAAQA,GACLK,IAJCE,IAAAA,aAAcC,IAAAA,cAAeC,IAAAA,aAAcC,IAAAA,aAO7CC,EAAUV,EAAMW,OAAS,SAG7BC,iCAAKC,UAAU,4BAA+BV,GAC5CS,iCAAKC,UAAU,0BAA6BP,KACzCL,GAASW,wBAACE,SAAMX,MAAO,CAAEY,QAAS,SAAWd,GAC9CW,qCAAWL,MACXK,gCACEC,UAAWG,UACT,4BACA,sCACwCN,GAExC,qCAAuCF,GACvC,qCAAuCC,GACvC,oCAAsChB,KAGvCiB,EAAUlB,EAAcC,EAAcF,EAAYD,IAGvDsB,+BAAKC,UAAU,8BACZb,EAAMiB,KAAI,SAACrB,EAAoBsB,UAC9BN,+BAAKC,UAAU,6BAA6BM,IAAKD,GAC/CN,wBAACQ,YAASP,UAAU,oCACpBD,gCAAMC,UAAU,oCACbjB,EAAKyB,YAeQC,EAfoB1B,EAAK0B,MAgBxC,IACFA,EAAO,SACLA,EAAO,IACNA,EAAO,YAENA,EAAO,KAASC,YAAY,SArBiB,KAEhDX,wBAACY,cAAWC,QAAS,kBAAM9B,EAASC,KAClCgB,wBAACc,sBACExB,OAA+BN,EAAK+B,MAEvCf,wBAACgB,qBASf,IAA4BN"}
1
+ {"version":3,"file":"fileupload.cjs.production.min.js","sources":["../src/index.tsx","../src/FileUpload.tsx"],"sourcesContent":["import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('fileupload');\n\nexport * from './FileUpload';\n","import React from 'react';\nimport {\n useDropzone,\n DropzoneOptions,\n FileRejection,\n DropEvent,\n FileWithPath,\n} from 'react-dropzone';\nimport classNames from 'classnames';\n\nimport { FileIcon, DeleteIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Label } from '@entur/typography';\nimport { VisuallyHidden } from '@entur/a11y';\n\nimport './FileUpload.scss';\n\ntype FileUploadProps = DropzoneOptions & {\n /** Tekst som vises ved fullført opplasting\n * @default \"Opplasting fullført\"\n */\n successText?: string;\n /** Tekst som vises om opplasting feilet\n * @default \"Feil ved opplasting av fil\"\n */\n errorText?: string;\n /** Tekst som vises før man laster opp noe\n * @default \"Dra fil eller klikk for å laste opp\"\n */\n standbyText?: string;\n /** Boolean for hvis opplastingen feiler.\n * @default false\n */\n errorUpload?: boolean;\n /** Callback for når en fil legges til */\n onDrop?<T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ): void;\n /** Callback for når en fil slettes fra lista */\n onDelete?: (file: FileWithPath) => void;\n /** Hvilken filtyper som skal aksepteres */\n accept?: string | string[];\n /** Filene som er aktive i komponenten */\n files: File[];\n /** Beskrivende tekst som forklarer feltet */\n label?: string;\n /** Mulighet for å laste opp flere filer */\n multiple?: boolean;\n /**Minste filstørrelse */\n minSize?: number;\n /**Største filstørrelse */\n maxSize?: number;\n /**Tekst som leses opp av skjermleser på søppelbøtte-ikonet\n * @default \"Fjern fil\"\n */\n removeFileButtonDescription?: string;\n [key: string]: any;\n};\n\nexport const FileUpload: React.FC<FileUploadProps> = ({\n standbyText = 'Dra fil eller klikk for å laste opp',\n errorText = 'Feil ved opplasting av fil',\n successText = 'Opplasting fullført',\n errorUpload = false,\n onDrop,\n onDelete = file => console.log(file),\n accept = '',\n files = [],\n label,\n removeFileButtonDescription = 'Fjern fil',\n style,\n ...rest\n}) => {\n const { getRootProps, getInputProps, isDragActive, isDragReject } =\n useDropzone({\n onDrop,\n accept: accept,\n ...rest,\n });\n\n const success = files.length > 0;\n\n return (\n <div className=\"eds-file-upload__wrapper\" {...style}>\n <div className=\"eds-file-upload__input\" {...getRootProps()}>\n {label && <Label style={{ display: 'flex' }}>{label}</Label>}\n <input {...getInputProps()} />\n <span\n className={classNames(\n 'eds-file-upload__dropzone',\n {\n 'eds-file-upload__dropzone--success': success,\n },\n { 'eds-file-upload__dropzone--active': isDragActive },\n { 'eds-file-upload__dropzone--reject': isDragReject },\n { 'eds-file-upload__dropzone--error': errorUpload },\n )}\n >\n {success ? successText : errorUpload ? errorText : standbyText}\n </span>\n </div>\n <div className=\"eds-file-upload__file-list\">\n {files.map((file: FileWithPath, index) => (\n <div className=\"eds-file-upload__file-name\" key={index}>\n <FileIcon className=\"eds-file-upload__file-name-icon\" />\n <span className=\"eds-field-upload__file-name-path\">\n {file.path} - {convertSizeToHuman(file.size)}{' '}\n </span>\n <IconButton onClick={() => onDelete(file)}>\n <VisuallyHidden>\n {removeFileButtonDescription}, {file.name}\n </VisuallyHidden>\n <DeleteIcon />\n </IconButton>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nfunction convertSizeToHuman(size: number) {\n if (size < 1000) {\n return size + 'bytes;';\n } else if (size < 1000000) {\n return `${size / 1000} KB`;\n } else {\n return `${(size / 1000000).toPrecision(4)} MB`;\n }\n}\n"],"names":["warnAboutMissingStyles","_ref","_ref$standbyText","standbyText","_ref$errorText","errorText","_ref$successText","successText","_ref$errorUpload","errorUpload","onDrop","_ref$onDelete","onDelete","file","console","log","_ref$accept","accept","_ref$files","files","label","_ref$removeFileButton","removeFileButtonDescription","style","rest","_objectWithoutPropertiesLoose","_excluded","_useDropzone","useDropzone","_extends","getRootProps","getInputProps","isDragActive","isDragReject","success","length","React","createElement","className","Label","display","classNames","map","index","key","FileIcon","path","size","toPrecision","IconButton","onClick","VisuallyHidden","name","DeleteIcon"],"mappings":"quBAGAA,EAAsBA,uBAAC,iCC0D8B,SAahDC,GAAA,IAAAC,EAAAD,EAZHE,YAAAA,aAAc,sCAAqCD,EA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,cAAA,OAAA,CAAAC,UAAU,oCACbzB,EAAKiC,YAeQC,EAfoBlC,EAAKkC,MAgBxC,IACFA,EAAO,SACLA,EAAO,IACNA,EAAO,IAAI,QAEVA,EAAO,KAASC,YAAY,GAAE,MArBe,KAEhDZ,UAACC,cAAAY,EAAAA,WAAW,CAAAC,QAAS,WAAA,OAAMtC,EAASC,KAClCuB,EAAAA,QAAAC,cAACc,EAAAA,eAAc,KACZ7B,OAA+BT,EAAKuC,MAEvChB,EAAC,QAAAC,cAAAgB,EAAUA,mBASzB,IAA4BN"}
@@ -8,72 +8,64 @@ import { Label } from '@entur/typography';
8
8
  import { VisuallyHidden } from '@entur/a11y';
9
9
 
10
10
  function _extends() {
11
- _extends = Object.assign || function (target) {
11
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
12
12
  for (var i = 1; i < arguments.length; i++) {
13
13
  var source = arguments[i];
14
-
15
14
  for (var key in source) {
16
15
  if (Object.prototype.hasOwnProperty.call(source, key)) {
17
16
  target[key] = source[key];
18
17
  }
19
18
  }
20
19
  }
21
-
22
20
  return target;
23
21
  };
24
-
25
22
  return _extends.apply(this, arguments);
26
23
  }
27
-
28
24
  function _objectWithoutPropertiesLoose(source, excluded) {
29
25
  if (source == null) return {};
30
26
  var target = {};
31
27
  var sourceKeys = Object.keys(source);
32
28
  var key, i;
33
-
34
29
  for (i = 0; i < sourceKeys.length; i++) {
35
30
  key = sourceKeys[i];
36
31
  if (excluded.indexOf(key) >= 0) continue;
37
32
  target[key] = source[key];
38
33
  }
39
-
40
34
  return target;
41
35
  }
42
36
 
43
37
  var _excluded = ["standbyText", "errorText", "successText", "errorUpload", "onDrop", "onDelete", "accept", "files", "label", "removeFileButtonDescription", "style"];
44
38
  var FileUpload = function FileUpload(_ref) {
45
39
  var _ref$standbyText = _ref.standbyText,
46
- standbyText = _ref$standbyText === void 0 ? 'Dra fil eller klikk for å laste opp' : _ref$standbyText,
47
- _ref$errorText = _ref.errorText,
48
- errorText = _ref$errorText === void 0 ? 'Feil ved opplasting av fil' : _ref$errorText,
49
- _ref$successText = _ref.successText,
50
- successText = _ref$successText === void 0 ? 'Opplasting fullført' : _ref$successText,
51
- _ref$errorUpload = _ref.errorUpload,
52
- errorUpload = _ref$errorUpload === void 0 ? false : _ref$errorUpload,
53
- onDrop = _ref.onDrop,
54
- _ref$onDelete = _ref.onDelete,
55
- onDelete = _ref$onDelete === void 0 ? function (file) {
56
- return console.log(file);
57
- } : _ref$onDelete,
58
- _ref$accept = _ref.accept,
59
- accept = _ref$accept === void 0 ? '' : _ref$accept,
60
- _ref$files = _ref.files,
61
- files = _ref$files === void 0 ? [] : _ref$files,
62
- label = _ref.label,
63
- _ref$removeFileButton = _ref.removeFileButtonDescription,
64
- removeFileButtonDescription = _ref$removeFileButton === void 0 ? 'Fjern fil' : _ref$removeFileButton,
65
- style = _ref.style,
66
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
67
-
40
+ standbyText = _ref$standbyText === void 0 ? 'Dra fil eller klikk for å laste opp' : _ref$standbyText,
41
+ _ref$errorText = _ref.errorText,
42
+ errorText = _ref$errorText === void 0 ? 'Feil ved opplasting av fil' : _ref$errorText,
43
+ _ref$successText = _ref.successText,
44
+ successText = _ref$successText === void 0 ? 'Opplasting fullført' : _ref$successText,
45
+ _ref$errorUpload = _ref.errorUpload,
46
+ errorUpload = _ref$errorUpload === void 0 ? false : _ref$errorUpload,
47
+ onDrop = _ref.onDrop,
48
+ _ref$onDelete = _ref.onDelete,
49
+ onDelete = _ref$onDelete === void 0 ? function (file) {
50
+ return console.log(file);
51
+ } : _ref$onDelete,
52
+ _ref$accept = _ref.accept,
53
+ accept = _ref$accept === void 0 ? '' : _ref$accept,
54
+ _ref$files = _ref.files,
55
+ files = _ref$files === void 0 ? [] : _ref$files,
56
+ label = _ref.label,
57
+ _ref$removeFileButton = _ref.removeFileButtonDescription,
58
+ removeFileButtonDescription = _ref$removeFileButton === void 0 ? 'Fjern fil' : _ref$removeFileButton,
59
+ style = _ref.style,
60
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
68
61
  var _useDropzone = useDropzone(_extends({
69
- onDrop: onDrop,
70
- accept: accept
71
- }, rest)),
72
- getRootProps = _useDropzone.getRootProps,
73
- getInputProps = _useDropzone.getInputProps,
74
- isDragActive = _useDropzone.isDragActive,
75
- isDragReject = _useDropzone.isDragReject;
76
-
62
+ onDrop: onDrop,
63
+ accept: accept
64
+ }, rest)),
65
+ getRootProps = _useDropzone.getRootProps,
66
+ getInputProps = _useDropzone.getInputProps,
67
+ isDragActive = _useDropzone.isDragActive,
68
+ isDragReject = _useDropzone.isDragReject;
77
69
  var success = files.length > 0;
78
70
  return React.createElement("div", _extends({
79
71
  className: "eds-file-upload__wrapper"
@@ -110,7 +102,6 @@ var FileUpload = function FileUpload(_ref) {
110
102
  }, React.createElement(VisuallyHidden, null, removeFileButtonDescription, ", ", file.name), React.createElement(DeleteIcon, null)));
111
103
  })));
112
104
  };
113
-
114
105
  function convertSizeToHuman(size) {
115
106
  if (size < 1000) {
116
107
  return size + 'bytes;';
@@ -1 +1 @@
1
- {"version":3,"file":"fileupload.esm.js","sources":["../src/FileUpload.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n useDropzone,\n DropzoneOptions,\n FileRejection,\n DropEvent,\n FileWithPath,\n} from 'react-dropzone';\nimport classNames from 'classnames';\n\nimport { FileIcon, DeleteIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Label } from '@entur/typography';\nimport { VisuallyHidden } from '@entur/a11y';\n\nimport './FileUpload.scss';\n\ntype FileUploadProps = DropzoneOptions & {\n /** Tekst som vises ved fullført opplasting\n * @default \"Opplasting fullført\"\n */\n successText?: string;\n /** Tekst som vises om opplasting feilet\n * @default \"Feil ved opplasting av fil\"\n */\n errorText?: string;\n /** Tekst som vises før man laster opp noe\n * @default \"Dra fil eller klikk for å laste opp\"\n */\n standbyText?: string;\n /** Boolean for hvis opplastingen feiler.\n * @default false\n */\n errorUpload?: boolean;\n /** Callback for når en fil legges til */\n onDrop?<T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ): void;\n /** Callback for når en fil slettes fra lista */\n onDelete?: (file: FileWithPath) => void;\n /** Hvilken filtyper som skal aksepteres */\n accept?: string | string[];\n /** Filene som er aktive i komponenten */\n files: File[];\n /** Beskrivende tekst som forklarer feltet */\n label?: string;\n /** Mulighet for å laste opp flere filer */\n multiple?: boolean;\n /**Minste filstørrelse */\n minSize?: number;\n /**Største filstørrelse */\n maxSize?: number;\n /**Tekst som leses opp av skjermleser på søppelbøtte-ikonet\n * @default \"Fjern fil\"\n */\n removeFileButtonDescription?: string;\n [key: string]: any;\n};\n\nexport const FileUpload: React.FC<FileUploadProps> = ({\n standbyText = 'Dra fil eller klikk for å laste opp',\n errorText = 'Feil ved opplasting av fil',\n successText = 'Opplasting fullført',\n errorUpload = false,\n onDrop,\n onDelete = file => console.log(file),\n accept = '',\n files = [],\n label,\n removeFileButtonDescription = 'Fjern fil',\n style,\n ...rest\n}) => {\n const { getRootProps, getInputProps, isDragActive, isDragReject } =\n useDropzone({\n onDrop,\n accept: accept,\n ...rest,\n });\n\n const success = files.length > 0;\n\n return (\n <div className=\"eds-file-upload__wrapper\" {...style}>\n <div className=\"eds-file-upload__input\" {...getRootProps()}>\n {label && <Label style={{ display: 'flex' }}>{label}</Label>}\n <input {...getInputProps()} />\n <span\n className={classNames(\n 'eds-file-upload__dropzone',\n {\n 'eds-file-upload__dropzone--success': success,\n },\n { 'eds-file-upload__dropzone--active': isDragActive },\n { 'eds-file-upload__dropzone--reject': isDragReject },\n { 'eds-file-upload__dropzone--error': errorUpload },\n )}\n >\n {success ? successText : errorUpload ? errorText : standbyText}\n </span>\n </div>\n <div className=\"eds-file-upload__file-list\">\n {files.map((file: FileWithPath, index) => (\n <div className=\"eds-file-upload__file-name\" key={index}>\n <FileIcon className=\"eds-file-upload__file-name-icon\" />\n <span className=\"eds-field-upload__file-name-path\">\n {file.path} - {convertSizeToHuman(file.size)}{' '}\n </span>\n <IconButton onClick={() => onDelete(file)}>\n <VisuallyHidden>\n {removeFileButtonDescription}, {file.name}\n </VisuallyHidden>\n <DeleteIcon />\n </IconButton>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nfunction convertSizeToHuman(size: number) {\n if (size < 1000) {\n return size + 'bytes;';\n } else if (size < 1000000) {\n return `${size / 1000} KB`;\n } else {\n return `${(size / 1000000).toPrecision(4)} MB`;\n }\n}\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('fileupload');\n\nexport * from './FileUpload';\n"],"names":["FileUpload","standbyText","errorText","successText","errorUpload","onDrop","onDelete","file","console","log","accept","files","label","removeFileButtonDescription","style","rest","useDropzone","getRootProps","getInputProps","isDragActive","isDragReject","success","length","React","className","Label","display","classNames","map","index","key","FileIcon","path","convertSizeToHuman","size","IconButton","onClick","VisuallyHidden","name","DeleteIcon","toPrecision","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6DaA,UAAU,GAA8B,SAAxCA,UAAwC;8BACnDC;MAAAA,4CAAc;4BACdC;MAAAA,wCAAY;8BACZC;MAAAA,4CAAc;8BACdC;MAAAA,4CAAc;MACdC,cAAAA;2BACAC;MAAAA,sCAAW,UAAAC,IAAI;AAAA,WAAIC,OAAO,CAACC,GAAR,CAAYF,IAAZ,CAAJ;AAAA;yBACfG;MAAAA,kCAAS;wBACTC;MAAAA,gCAAQ;MACRC,aAAAA;mCACAC;MAAAA,iEAA8B;MAC9BC,aAAAA;MACGC;;AAEH,qBACEC,WAAW;AACTX,IAAAA,MAAM,EAANA,MADS;AAETK,IAAAA,MAAM,EAAEA;AAFC,KAGNK,IAHM,EADb;AAAA,MAAQE,YAAR,gBAAQA,YAAR;AAAA,MAAsBC,aAAtB,gBAAsBA,aAAtB;AAAA,MAAqCC,YAArC,gBAAqCA,YAArC;AAAA,MAAm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mBAAA,CAACc,cAAD,MAAA,EACGxB,2BADH,MAAA,EACkCN,IAAI,CAAC+B,IADvC,CADF,EAIEf,mBAAA,CAACgB,UAAD,MAAA,CAJF,CALF,CADS;AAAA,GAAV,CADH,CAlBF,CADF;AAqCD;;AAED,SAASN,kBAAT,CAA4BC,IAA5B;AACE,MAAIA,IAAI,GAAG,IAAX,EAAiB;AACf,WAAOA,IAAI,GAAG,QAAd;AACD,GAFD,MAEO,IAAIA,IAAI,GAAG,OAAX,EAAoB;AACzB,WAAUA,IAAI,GAAG,IAAjB;AACD,GAFM,MAEA;AACL,WAAU,CAACA,IAAI,GAAG,OAAR,EAAiBM,WAAjB,CAA6B,CAA7B,CAAV;AACD;AACF;;AChIDC,sBAAsB,CAAC,YAAD,CAAtB;;;;"}
1
+ {"version":3,"file":"fileupload.esm.js","sources":["../src/FileUpload.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n useDropzone,\n DropzoneOptions,\n FileRejection,\n DropEvent,\n FileWithPath,\n} from 'react-dropzone';\nimport classNames from 'classnames';\n\nimport { FileIcon, DeleteIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Label } from '@entur/typography';\nimport { VisuallyHidden } from '@entur/a11y';\n\nimport './FileUpload.scss';\n\ntype FileUploadProps = DropzoneOptions & {\n /** Tekst som vises ved fullført opplasting\n * @default \"Opplasting fullført\"\n */\n successText?: string;\n /** Tekst som vises om opplasting feilet\n * @default \"Feil ved opplasting av fil\"\n */\n errorText?: string;\n /** Tekst som vises før man laster opp noe\n * @default \"Dra fil eller klikk for å laste opp\"\n */\n standbyText?: string;\n /** Boolean for hvis opplastingen feiler.\n * @default false\n */\n errorUpload?: boolean;\n /** Callback for når en fil legges til */\n onDrop?<T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ): void;\n /** Callback for når en fil slettes fra lista */\n onDelete?: (file: FileWithPath) => void;\n /** Hvilken filtyper som skal aksepteres */\n accept?: string | string[];\n /** Filene som er aktive i komponenten */\n files: File[];\n /** Beskrivende tekst som forklarer feltet */\n label?: string;\n /** Mulighet for å laste opp flere filer */\n multiple?: boolean;\n /**Minste filstørrelse */\n minSize?: number;\n /**Største filstørrelse */\n maxSize?: number;\n /**Tekst som leses opp av skjermleser på søppelbøtte-ikonet\n * @default \"Fjern fil\"\n */\n removeFileButtonDescription?: string;\n [key: string]: any;\n};\n\nexport const FileUpload: React.FC<FileUploadProps> = ({\n standbyText = 'Dra fil eller klikk for å laste opp',\n errorText = 'Feil ved opplasting av fil',\n successText = 'Opplasting fullført',\n errorUpload = false,\n onDrop,\n onDelete = file => console.log(file),\n accept = '',\n files = [],\n label,\n removeFileButtonDescription = 'Fjern fil',\n style,\n ...rest\n}) => {\n const { getRootProps, getInputProps, isDragActive, isDragReject } =\n useDropzone({\n onDrop,\n accept: accept,\n ...rest,\n });\n\n const success = files.length > 0;\n\n return (\n <div className=\"eds-file-upload__wrapper\" {...style}>\n <div className=\"eds-file-upload__input\" {...getRootProps()}>\n {label && <Label style={{ display: 'flex' }}>{label}</Label>}\n <input {...getInputProps()} />\n <span\n className={classNames(\n 'eds-file-upload__dropzone',\n {\n 'eds-file-upload__dropzone--success': success,\n },\n { 'eds-file-upload__dropzone--active': isDragActive },\n { 'eds-file-upload__dropzone--reject': isDragReject },\n { 'eds-file-upload__dropzone--error': errorUpload },\n )}\n >\n {success ? successText : errorUpload ? errorText : standbyText}\n </span>\n </div>\n <div className=\"eds-file-upload__file-list\">\n {files.map((file: FileWithPath, index) => (\n <div className=\"eds-file-upload__file-name\" key={index}>\n <FileIcon className=\"eds-file-upload__file-name-icon\" />\n <span className=\"eds-field-upload__file-name-path\">\n {file.path} - {convertSizeToHuman(file.size)}{' '}\n </span>\n <IconButton onClick={() => onDelete(file)}>\n <VisuallyHidden>\n {removeFileButtonDescription}, {file.name}\n </VisuallyHidden>\n <DeleteIcon />\n </IconButton>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nfunction convertSizeToHuman(size: number) {\n if (size < 1000) {\n return size + 'bytes;';\n } else if (size < 1000000) {\n return `${size / 1000} KB`;\n } else {\n return `${(size / 1000000).toPrecision(4)} MB`;\n }\n}\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('fileupload');\n\nexport * from './FileUpload';\n"],"names":["FileUpload","standbyText","errorText","successText","errorUpload","onDrop","onDelete","file","console","log","accept","files","label","removeFileButtonDescription","style","rest","useDropzone","getRootProps","getInputProps","isDragActive","isDragReject","success","length","React","createElement","className","Label","display","classNames","map","index","key","FileIcon","path","convertSizeToHuman","size","IconButton","onClick","VisuallyHidden","name","DeleteIcon","toPrecision","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DaA,IAAAA,UAAU,GAA8B,SAAxCA,UAAU,CAalB,IAAA,EAAA;AAAA,EAAA,IAAA,gBAAA,GAAA,IAAA,CAZHC,WAAW;AAAXA,IAAAA,WAAW,iCAAG,qCAAqC,GAAA,gBAAA;AAAA,IAAA,cAAA,GAAA,IAAA,CACnDC,SAAS;AAATA,IAAAA,SAAS,+BAAG,4BAA4B,GAAA,cAAA;AAAA,IAAA,gBAAA,GAAA,IAAA,CACxCC,WAAW;AAAXA,IAAAA,WAAW,iCAAG,qBAAqB,GAAA,gBAAA;AAAA,IAAA,gBAAA,GAAA,IAAA,CACnCC,WAAW;AAAXA,IAAAA,WAAW,iCAAG,KAAK,GAAA,gBAAA;AACnBC,IAAAA,MAAM,QAANA,MAAM;AAAA,IAAA,aAAA,GAAA,IAAA,CACNC,QAAQ;IAARA,QAAQ,GAAA,aAAA,KAAA,KAAA,CAAA,GAAG,UAAAC,IAAI,EAAA;AAAA,MAAA,OAAIC,OAAO,CAACC,GAAG,CAACF,IAAI,CAAC,CAAA;AAAA,KAAA,GAAA,aAAA;AAAA,IAAA,WAAA,GAAA,IAAA,CACpCG,MAAM;AAANA,IAAAA,MAAM,4BAAG,EAA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CAAC,CACE,CACF,CAAA;AAEV,EAAC;AAED,SAASN,kBAAkB,CAACC,IAAY,EAAA;EACtC,IAAIA,IAAI,GAAG,IAAI,EAAE;IACf,OAAOA,IAAI,GAAG,QAAQ,CAAA;AACvB,GAAA,MAAM,IAAIA,IAAI,GAAG,OAAO,EAAE;IACzB,OAAUA,IAAI,GAAG,IAAI,GAAA,MAAA,CAAA;AACtB,GAAA,MAAM;IACL,OAAU,CAACA,IAAI,GAAG,OAAO,EAAEM,WAAW,CAAC,CAAC,CAAC,GAAA,KAAA,CAAA;AAC1C,GAAA;AACH;;AChIAC,sBAAsB,CAAC,YAAY,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entur/fileupload",
3
- "version": "0.3.59",
3
+ "version": "0.3.61",
4
4
  "license": "EUPL-1.2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/fileupload.esm.js",
@@ -20,15 +20,15 @@
20
20
  "start": "dts watch --noClean",
21
21
  "build": "dts build",
22
22
  "test": "dts test",
23
- "lint": "dts lint"
23
+ "lint": "dts lint src"
24
24
  },
25
25
  "dependencies": {
26
- "@entur/a11y": "^0.2.54",
27
- "@entur/button": "^2.10.9",
28
- "@entur/icons": "^5.4.2",
29
- "@entur/tokens": "^3.4.4",
30
- "@entur/typography": "^1.7.5",
31
- "@entur/utils": "^0.5.0",
26
+ "@entur/a11y": "^0.2.56",
27
+ "@entur/button": "^2.10.11",
28
+ "@entur/icons": "^5.5.0",
29
+ "@entur/tokens": "^3.5.0",
30
+ "@entur/typography": "^1.7.7",
31
+ "@entur/utils": "^0.5.2",
32
32
  "classnames": "^2.3.1",
33
33
  "react-dropzone": "^11.3.4"
34
34
  },
@@ -36,5 +36,5 @@
36
36
  "react": ">=16.8.0",
37
37
  "react-dom": ">=16.8.0"
38
38
  },
39
- "gitHead": "36772ae4f2d8375622acff19736c07d15435cb95"
39
+ "gitHead": "30b38034aaafba9fb308fb3d8c8bfaab9608d720"
40
40
  }
package/CHANGELOG.md DELETED
@@ -1,276 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [0.3.58](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.57...@entur/fileupload@0.3.58) (2023-01-19)
7
-
8
- **Note:** Version bump only for package @entur/fileupload
9
-
10
- ## [0.3.57](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.54...@entur/fileupload@0.3.57) (2022-12-09)
11
-
12
- **Note:** Version bump only for package @entur/fileupload
13
-
14
- ## [0.3.56](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.55...@entur/fileupload@0.3.56) (2022-11-24)
15
-
16
- **Note:** Version bump only for package @entur/fileupload
17
-
18
- ## [0.3.55](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.54...@entur/fileupload@0.3.55) (2022-10-31)
19
-
20
- **Note:** Version bump only for package @entur/fileupload
21
-
22
- ## [0.3.54](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.53...@entur/fileupload@0.3.54) (2022-10-31)
23
-
24
- ### Bug Fixes
25
-
26
- - **file upload:** set onDelete type to be optional as it actually is ([1248b59](https://bitbucket.org/enturas/design-system/commits/1248b597c795459c484d788c077d9c3a58f0a1a2))
27
-
28
- ## [0.3.53](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.52...@entur/fileupload@0.3.53) (2022-10-31)
29
-
30
- **Note:** Version bump only for package @entur/fileupload
31
-
32
- ## [0.3.52](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.51...@entur/fileupload@0.3.52) (2022-10-31)
33
-
34
- **Note:** Version bump only for package @entur/fileupload
35
-
36
- ## [0.3.51](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.50...@entur/fileupload@0.3.51) (2022-10-20)
37
-
38
- **Note:** Version bump only for package @entur/fileupload
39
-
40
- ## [0.3.50](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.49...@entur/fileupload@0.3.50) (2022-10-20)
41
-
42
- **Note:** Version bump only for package @entur/fileupload
43
-
44
- ## [0.3.49](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.48...@entur/fileupload@0.3.49) (2022-10-12)
45
-
46
- **Note:** Version bump only for package @entur/fileupload
47
-
48
- ## [0.3.47](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.46...@entur/fileupload@0.3.47) (2022-08-31)
49
-
50
- **Note:** Version bump only for package @entur/fileupload
51
-
52
- ## [0.3.46](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.45...@entur/fileupload@0.3.46) (2022-08-31)
53
-
54
- ### Bug Fixes
55
-
56
- - **file upload:** add descriptive screen reader text to remove file button ([42c37d1](https://bitbucket.org/enturas/design-system/commits/42c37d131e2db5f712b1ce7cf3336b6d536cadd2))
57
-
58
- ## [0.3.45](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.44...@entur/fileupload@0.3.45) (2022-08-24)
59
-
60
- **Note:** Version bump only for package @entur/fileupload
61
-
62
- ## [0.3.44](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.43...@entur/fileupload@0.3.44) (2022-08-09)
63
-
64
- **Note:** Version bump only for package @entur/fileupload
65
-
66
- ## [0.3.43](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.42...@entur/fileupload@0.3.43) (2022-07-05)
67
-
68
- **Note:** Version bump only for package @entur/fileupload
69
-
70
- ## [0.3.42](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.41...@entur/fileupload@0.3.42) (2022-06-28)
71
-
72
- **Note:** Version bump only for package @entur/fileupload
73
-
74
- ## [0.3.41](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.40...@entur/fileupload@0.3.41) (2022-06-24)
75
-
76
- **Note:** Version bump only for package @entur/fileupload
77
-
78
- ## [0.3.40](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.39...@entur/fileupload@0.3.40) (2022-06-02)
79
-
80
- **Note:** Version bump only for package @entur/fileupload
81
-
82
- ## [0.3.39](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.38...@entur/fileupload@0.3.39) (2022-05-13)
83
-
84
- **Note:** Version bump only for package @entur/fileupload
85
-
86
- ## [0.3.38](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.37...@entur/fileupload@0.3.38) (2022-05-04)
87
-
88
- **Note:** Version bump only for package @entur/fileupload
89
-
90
- ## [0.3.37](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.36...@entur/fileupload@0.3.37) (2022-04-27)
91
-
92
- **Note:** Version bump only for package @entur/fileupload
93
-
94
- ## [0.3.36](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.35...@entur/fileupload@0.3.36) (2022-04-20)
95
-
96
- **Note:** Version bump only for package @entur/fileupload
97
-
98
- ## [0.3.35](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.34...@entur/fileupload@0.3.35) (2022-04-19)
99
-
100
- **Note:** Version bump only for package @entur/fileupload
101
-
102
- ## [0.3.34](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.33...@entur/fileupload@0.3.34) (2022-03-01)
103
-
104
- **Note:** Version bump only for package @entur/fileupload
105
-
106
- ## [0.3.33](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.32...@entur/fileupload@0.3.33) (2022-02-09)
107
-
108
- **Note:** Version bump only for package @entur/fileupload
109
-
110
- ## [0.3.32](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.31...@entur/fileupload@0.3.32) (2021-11-17)
111
-
112
- **Note:** Version bump only for package @entur/fileupload
113
-
114
- ## [0.3.31](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.30...@entur/fileupload@0.3.31) (2021-09-23)
115
-
116
- **Note:** Version bump only for package @entur/fileupload
117
-
118
- ## [0.3.30](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.29...@entur/fileupload@0.3.30) (2021-09-13)
119
-
120
- **Note:** Version bump only for package @entur/fileupload
121
-
122
- ## [0.3.29](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.28...@entur/fileupload@0.3.29) (2021-09-07)
123
-
124
- ### Bug Fixes
125
-
126
- - fix lint warning ([6d8d06e](https://bitbucket.org/enturas/design-system/commits/6d8d06e7f2a088d2e857d41d52aa08f4ab50a49f))
127
- - update dependencies ([d99dbde](https://bitbucket.org/enturas/design-system/commits/d99dbde566107589902f7f19bde3286a7195a600))
128
- - utilize reworked focus token ([586758f](https://bitbucket.org/enturas/design-system/commits/586758fc86eb5aa52116c63c14ef033eb2e8b12f))
129
-
130
- ## [0.3.28](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.27...@entur/fileupload@0.3.28) (2021-08-13)
131
-
132
- **Note:** Version bump only for package @entur/fileupload
133
-
134
- ## [0.3.27](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.26...@entur/fileupload@0.3.27) (2021-07-16)
135
-
136
- **Note:** Version bump only for package @entur/fileupload
137
-
138
- ## [0.3.26](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.25...@entur/fileupload@0.3.26) (2021-06-25)
139
-
140
- ### Bug Fixes
141
-
142
- - update dependencies ([30a33f7](https://bitbucket.org/enturas/design-system/commits/30a33f773e488c64c4cec2d1d07a9d617412f46a))
143
-
144
- ## [0.3.25](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.24...@entur/fileupload@0.3.25) (2021-05-05)
145
-
146
- **Note:** Version bump only for package @entur/fileupload
147
-
148
- ## [0.3.24](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.23...@entur/fileupload@0.3.24) (2021-04-23)
149
-
150
- ### Bug Fixes
151
-
152
- - utilize new focus tokens ([17113ef](https://bitbucket.org/enturas/design-system/commits/17113ef3f791c86fa6e19e71680fd5acdbae4990))
153
-
154
- ## [0.3.23](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.22...@entur/fileupload@0.3.23) (2021-04-09)
155
-
156
- **Note:** Version bump only for package @entur/fileupload
157
-
158
- ## [0.3.22](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.21...@entur/fileupload@0.3.22) (2021-03-02)
159
-
160
- **Note:** Version bump only for package @entur/fileupload
161
-
162
- ## [0.3.21](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.20...@entur/fileupload@0.3.21) (2021-02-17)
163
-
164
- **Note:** Version bump only for package @entur/fileupload
165
-
166
- ## [0.3.20](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.19...@entur/fileupload@0.3.20) (2021-01-29)
167
-
168
- **Note:** Version bump only for package @entur/fileupload
169
-
170
- ## [0.3.19](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.18...@entur/fileupload@0.3.19) (2021-01-20)
171
-
172
- **Note:** Version bump only for package @entur/fileupload
173
-
174
- ## [0.3.18](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.17...@entur/fileupload@0.3.18) (2021-01-13)
175
-
176
- ### Bug Fixes
177
-
178
- - transpose grey colors for updated color tokens ([d6a444c](https://bitbucket.org/enturas/design-system/commits/d6a444c2c37339b9bac0702738ed52693367d344))
179
-
180
- ## [0.3.17](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.16...@entur/fileupload@0.3.17) (2021-01-05)
181
-
182
- **Note:** Version bump only for package @entur/fileupload
183
-
184
- ## [0.3.16](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.15...@entur/fileupload@0.3.16) (2020-12-04)
185
-
186
- **Note:** Version bump only for package @entur/fileupload
187
-
188
- ## [0.3.15](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.14...@entur/fileupload@0.3.15) (2020-11-10)
189
-
190
- ### Bug Fixes
191
-
192
- - **fileupload:** improve typing for onDrop prop ([29005c0](https://bitbucket.org/enturas/design-system/commits/29005c0a37dd2ad2c539072a0b22741ab98b6a3c))
193
-
194
- ## [0.3.14](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.13...@entur/fileupload@0.3.14) (2020-11-05)
195
-
196
- **Note:** Version bump only for package @entur/fileupload
197
-
198
- ## [0.3.13](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.12...@entur/fileupload@0.3.13) (2020-10-28)
199
-
200
- **Note:** Version bump only for package @entur/fileupload
201
-
202
- ## [0.3.12](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.11...@entur/fileupload@0.3.12) (2020-10-23)
203
-
204
- **Note:** Version bump only for package @entur/fileupload
205
-
206
- ## [0.3.11](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.10...@entur/fileupload@0.3.11) (2020-10-16)
207
-
208
- **Note:** Version bump only for package @entur/fileupload
209
-
210
- ## [0.3.10](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.9...@entur/fileupload@0.3.10) (2020-10-09)
211
-
212
- ### Bug Fixes
213
-
214
- - **fileupload:** adjust size to accomadate new input fields ([640ab33](https://bitbucket.org/enturas/design-system/commits/640ab33d45b11a325d03e2328eb1b1752a9d47d2))
215
-
216
- ## [0.3.9](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.8...@entur/fileupload@0.3.9) (2020-09-25)
217
-
218
- **Note:** Version bump only for package @entur/fileupload
219
-
220
- ## [0.3.8](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.7...@entur/fileupload@0.3.8) (2020-09-14)
221
-
222
- **Note:** Version bump only for package @entur/fileupload
223
-
224
- ## [0.3.7](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.6...@entur/fileupload@0.3.7) (2020-09-02)
225
-
226
- **Note:** Version bump only for package @entur/fileupload
227
-
228
- ## [0.3.6](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.5...@entur/fileupload@0.3.6) (2020-08-26)
229
-
230
- **Note:** Version bump only for package @entur/fileupload
231
-
232
- ## [0.3.5](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.4...@entur/fileupload@0.3.5) (2020-08-19)
233
-
234
- **Note:** Version bump only for package @entur/fileupload
235
-
236
- ## [0.3.4](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.3...@entur/fileupload@0.3.4) (2020-08-11)
237
-
238
- **Note:** Version bump only for package @entur/fileupload
239
-
240
- ## [0.3.3](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.2...@entur/fileupload@0.3.3) (2020-07-22)
241
-
242
- **Note:** Version bump only for package @entur/fileupload
243
-
244
- ## [0.3.2](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.1...@entur/fileupload@0.3.2) (2020-07-16)
245
-
246
- **Note:** Version bump only for package @entur/fileupload
247
-
248
- ## [0.3.1](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.0...@entur/fileupload@0.3.1) (2020-07-09)
249
-
250
- ### Bug Fixes
251
-
252
- - fix styling bugs for fileupload ([c194c71](https://bitbucket.org/enturas/design-system/commits/c194c71b55cc1e6511959f063928dfbec1c00b47))
253
-
254
- # [0.3.0](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.2.3...@entur/fileupload@0.3.0) (2020-07-03)
255
-
256
- ### Features
257
-
258
- - add label prop to fileupload component ([ec235b5](https://bitbucket.org/enturas/design-system/commits/ec235b5b4babc7571a809102528f829df01c526d))
259
-
260
- ## [0.2.3](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.2.2...@entur/fileupload@0.2.3) (2020-06-17)
261
-
262
- **Note:** Version bump only for package @entur/fileupload
263
-
264
- ## [0.2.2](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.2.1...@entur/fileupload@0.2.2) (2020-05-27)
265
-
266
- **Note:** Version bump only for package @entur/fileupload
267
-
268
- ## [0.2.1](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.2.0...@entur/fileupload@0.2.1) (2020-05-26)
269
-
270
- **Note:** Version bump only for package @entur/fileupload
271
-
272
- # 0.2.0 (2020-05-20)
273
-
274
- ### Features
275
-
276
- - add fileuploading component ([06f408d](https://bitbucket.org/enturas/design-system/commits/06f408d575fb2ed03aedfdac5df5d329b3d5895d))