@brighthr/component-file-selector
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -5,3 +5,3 @@ import React from 'react'; | ||
}; | ||
declare const FileSelector: ({ onFilesSelected, }: FileSelectorProps) => React.ReactElement; | ||
declare const FileSelector: ({ onFilesSelected, ...props }: FileSelectorProps) => React.ReactElement; | ||
export default FileSelector; |
@@ -1,2 +0,2 @@ | ||
import e from"react";import t from"classnames";import{useDropzone as r}from"react-dropzone";import o from"@brighthr/component-icon";import a from"@brighthr/component-button";function n(){return n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},n.apply(this,arguments)}const i=({onFilesSelected:i})=>{const{getRootProps:l,getInputProps:c,isDragActive:s}=r({onDrop:i});return e.createElement("div",n({},l({"aria-role":"button","aria-label":"click to select files"})),e.createElement("div",{className:t("flex flex-col items-center p-8 border-2 transition-all border-neutral-500 border-dotted",{"bg-white":!s,"bg-primary-50":s})},e.createElement(o,{iconName:"arrow-big-up",size:60,className:t("mb-3",{"fill-neutral-500":!s,"fill-primary-500":s})}),e.createElement("input",n({"data-testid":"dnd"},c())),e.createElement("div",{className:"mb-4"},"Drag and drop your files here to upload"),e.createElement(a,{outlineButton:!0,text:"Browse files..."})))};export{i as default}; | ||
import e from"react";import t from"classnames";import{useDropzone as r}from"react-dropzone";import o from"@brighthr/component-icon";import n from"@brighthr/component-button";function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},a.apply(this,arguments)}const l=["onFilesSelected"],i=i=>{let{onFilesSelected:c}=i,s=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)t.indexOf(r=a[o])>=0||(n[r]=e[r]);return n}(i,l);const{getRootProps:m,getInputProps:p,isDragActive:f}=r({onDrop:c});return e.createElement("div",a({},s,m({"aria-role":"button","aria-label":"click to select files"})),e.createElement("div",{className:t("flex flex-col items-center p-8 border-2 transition-all border-neutral-500 border-dotted",{"bg-white":!f,"bg-primary-50":f})},e.createElement(o,{iconName:"arrow-big-up",size:60,className:t("mb-3",{"fill-neutral-500":!f,"fill-primary-500":f})}),e.createElement("input",a({"data-testid":"dnd"},p())),e.createElement("div",{className:"mb-4"},"Drag and drop your files here to upload"),e.createElement(n,{outlineButton:!0,text:"Browse files..."})))};export{i as default}; | ||
//# sourceMappingURL=index.modern.js.map |
@@ -1,2 +0,2 @@ | ||
import e from"react";import t from"classnames";import{useDropzone as r}from"react-dropzone";import o from"@brighthr/component-icon";import a from"@brighthr/component-button";function n(){return n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},n.apply(this,arguments)}var i=function(i){var l=r({onDrop:i.onFilesSelected}),c=l.getInputProps,m=l.isDragActive;return e.createElement("div",n({},(0,l.getRootProps)({"aria-role":"button","aria-label":"click to select files"})),e.createElement("div",{className:t("flex flex-col items-center p-8 border-2 transition-all border-neutral-500 border-dotted",{"bg-white":!m,"bg-primary-50":m})},e.createElement(o,{iconName:"arrow-big-up",size:60,className:t("mb-3",{"fill-neutral-500":!m,"fill-primary-500":m})}),e.createElement("input",n({"data-testid":"dnd"},c())),e.createElement("div",{className:"mb-4"},"Drag and drop your files here to upload"),e.createElement(a,{outlineButton:!0,text:"Browse files..."})))};export{i as default}; | ||
import e from"react";import t from"classnames";import{useDropzone as r}from"react-dropzone";import o from"@brighthr/component-icon";import n from"@brighthr/component-button";function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},a.apply(this,arguments)}var i=["onFilesSelected"],l=function(l){var c=l.onFilesSelected,s=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)t.indexOf(r=a[o])>=0||(n[r]=e[r]);return n}(l,i),m=r({onDrop:c}),p=m.getInputProps,f=m.isDragActive;return e.createElement("div",a({},s,(0,m.getRootProps)({"aria-role":"button","aria-label":"click to select files"})),e.createElement("div",{className:t("flex flex-col items-center p-8 border-2 transition-all border-neutral-500 border-dotted",{"bg-white":!f,"bg-primary-50":f})},e.createElement(o,{iconName:"arrow-big-up",size:60,className:t("mb-3",{"fill-neutral-500":!f,"fill-primary-500":f})}),e.createElement("input",a({"data-testid":"dnd"},p())),e.createElement("div",{className:"mb-4"},"Drag and drop your files here to upload"),e.createElement(n,{outlineButton:!0,text:"Browse files..."})))};export{l as default}; | ||
//# sourceMappingURL=index.module.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("classnames"),require("react-dropzone"),require("@brighthr/component-icon"),require("@brighthr/component-button")):"function"==typeof define&&define.amd?define(["react","classnames","react-dropzone","@brighthr/component-icon","@brighthr/component-button"],t):(e||self).componentFileSelector=t(e.react,e.classnames,e.reactDropzone,e.Icon,e.Button)}(this,function(e,t,r,n,o){function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=/*#__PURE__*/a(e),i=/*#__PURE__*/a(t),c=/*#__PURE__*/a(n),u=/*#__PURE__*/a(o);function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d.apply(this,arguments)}return function(e){var t=r.useDropzone({onDrop:e.onFilesSelected}),n=t.getInputProps,o=t.isDragActive;return l.default.createElement("div",d({},(0,t.getRootProps)({"aria-role":"button","aria-label":"click to select files"})),l.default.createElement("div",{className:i.default("flex flex-col items-center p-8 border-2 transition-all border-neutral-500 border-dotted",{"bg-white":!o,"bg-primary-50":o})},l.default.createElement(c.default,{iconName:"arrow-big-up",size:60,className:i.default("mb-3",{"fill-neutral-500":!o,"fill-primary-500":o})}),l.default.createElement("input",d({"data-testid":"dnd"},n())),l.default.createElement("div",{className:"mb-4"},"Drag and drop your files here to upload"),l.default.createElement(u.default,{outlineButton:!0,text:"Browse files..."})))}}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("classnames"),require("react-dropzone"),require("@brighthr/component-icon"),require("@brighthr/component-button")):"function"==typeof define&&define.amd?define(["react","classnames","react-dropzone","@brighthr/component-icon","@brighthr/component-button"],t):(e||self).componentFileSelector=t(e.react,e.classnames,e.reactDropzone,e.Icon,e.Button)}(this,function(e,t,r,n,o){function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=/*#__PURE__*/a(e),i=/*#__PURE__*/a(t),u=/*#__PURE__*/a(n),c=/*#__PURE__*/a(o);function f(){return f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}var d=["onFilesSelected"];return function(e){var t=e.onFilesSelected,n=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(o[r]=e[r]);return o}(e,d),o=r.useDropzone({onDrop:t}),a=o.getInputProps,s=o.isDragActive;return l.default.createElement("div",f({},n,(0,o.getRootProps)({"aria-role":"button","aria-label":"click to select files"})),l.default.createElement("div",{className:i.default("flex flex-col items-center p-8 border-2 transition-all border-neutral-500 border-dotted",{"bg-white":!s,"bg-primary-50":s})},l.default.createElement(u.default,{iconName:"arrow-big-up",size:60,className:i.default("mb-3",{"fill-neutral-500":!s,"fill-primary-500":s})}),l.default.createElement("input",f({"data-testid":"dnd"},a())),l.default.createElement("div",{className:"mb-4"},"Drag and drop your files here to upload"),l.default.createElement(c.default,{outlineButton:!0,text:"Browse files..."})))}}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "@brighthr/component-file-selector", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"license": "MIT", | ||
@@ -42,3 +42,3 @@ "type": "module", | ||
}, | ||
"gitHead": "c50f731a131c4ad01dd2280ce78afb90a61d0534" | ||
"gitHead": "e070240d0f57feb9c7d07c5e7c0db55698f3d490" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
20035
151