@longline/aqua-ui 1.0.27 → 1.0.28

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.
@@ -2,6 +2,11 @@ import * as React from 'react';
2
2
  interface IProps {
3
3
  /** @ignore */
4
4
  className?: string;
5
+ /**
6
+ * If set, allows a file filter, e.g. `.xls,.xlsx`.
7
+ * This does _not_ prevent the user to upload another kind of file.
8
+ */
9
+ accept?: string;
5
10
  onDragover: () => void;
6
11
  onDragLeave: () => void;
7
12
  onAddFiles: (files: File[]) => void;
@@ -40,7 +40,7 @@ var DropboxBase = function (props) {
40
40
  React.createElement("div", null, (_a = props.message) !== null && _a !== void 0 ? _a : "Drop a file here to upload, or click to select."),
41
41
  React.createElement("svg", null,
42
42
  React.createElement("use", { xlinkHref: SVG.Other.CloudUpload })),
43
- React.createElement("input", { ref: inputElement, type: "file", multiple: true, onChange: handleAddFile })));
43
+ React.createElement("input", { ref: inputElement, type: "file", accept: props.accept, multiple: true, onChange: handleAddFile })));
44
44
  };
45
45
  var Dropbox = styled(DropboxBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n border: dashed 2px ", ";\n border-radius: ", "px;\n cursor: pointer;\n width: 100%;\n text-align: center;\n\n ", "\n\n div {\n margin-top: 8px;\n font-weight: 500;\n color: ", ";\n }\n\n svg {\n display: block;\n margin: 8px;\n width: 100%;\n height: 150px;\n fill: ", ";\n }\n\n input {\n display: none;\n }\n"], ["\n position: relative;\n border: dashed 2px ", ";\n border-radius: ", "px;\n cursor: pointer;\n width: 100%;\n text-align: center;\n\n ", "\n\n div {\n margin-top: 8px;\n font-weight: 500;\n color: ", ";\n }\n\n svg {\n display: block;\n margin: 8px;\n width: 100%;\n height: 150px;\n fill: ", ";\n }\n\n input {\n display: none;\n }\n"])), function (p) { return p.hover ? p.theme.colors.neutral[100] : p.theme.colors.neutral[80]; }, function (p) { return p.theme.radius.normal; }, function (p) { return p.hover && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), p.theme.colors.primary[3]); }, function (p) { return p.hover ? p.theme.colors.neutral[100] : p.theme.colors.neutral[80]; }, function (p) { return p.hover ? p.theme.colors.primary[1] : p.theme.colors.primary[2]; });
46
46
  export { Dropbox };
@@ -4,6 +4,11 @@ interface IDropzoneProps {
4
4
  className?: string;
5
5
  /** @ignore */
6
6
  children?: React.ReactNode;
7
+ /**
8
+ * If set, allows a file filter, e.g. `.xls,.xlsx`.
9
+ * This does _not_ prevent the user to upload another kind of file.
10
+ */
11
+ accept?: string;
7
12
  /**
8
13
  * Callback to call when files are dropped in the Dropzone. Multiple files can be uploaded at
9
14
  * a time.
@@ -25,6 +25,6 @@ var Dropzone = function (props) {
25
25
  var handleDragLeave = function () {
26
26
  setHover(false);
27
27
  };
28
- return (React.createElement(Dropbox, { hover: hover, message: props.message, onDragover: handleDragOver, onDragLeave: handleDragLeave, onAddFiles: handleAddFiles }));
28
+ return (React.createElement(Dropbox, { hover: hover, message: props.message, accept: props.accept, onDragover: handleDragOver, onDragLeave: handleDragLeave, onAddFiles: handleAddFiles }));
29
29
  };
30
30
  export { Dropzone };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",