├── .all-contributorsrc
├── .babelrc.js
├── .eslintrc.json
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── config.yml
│ └── feature_request.md
├── pull_request_template.md
└── workflows
│ ├── build.yml
│ └── docs.yml
├── .gitignore
├── .mochasetup.js
├── .size-snapshot.json
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── dist
├── index.d.ts
├── index.es.js
├── index.es.js.map
├── index.js
└── index.js.map
├── docs
├── installation.md
├── intro.md
├── screenshots.md
├── support.md
└── theming.md
├── package.json
├── pics
├── demo_pic.jpg
├── demo_pic2.JPG
├── demo_pic4.JPG
└── demo_pic5.JPG
├── rollup.config.js
├── src
├── components
│ ├── DropzoneArea.js
│ ├── DropzoneArea.md
│ ├── DropzoneAreaBase.js
│ ├── DropzoneAreaBase.md
│ ├── DropzoneDialog.js
│ ├── DropzoneDialog.md
│ ├── DropzoneDialogBase.js
│ ├── DropzoneDialogBase.md
│ ├── PreviewList.js
│ └── SnackbarContentWrapper.js
├── helpers.js
├── index.d.ts
└── index.js
├── styleguide.config.js
└── yarn.lock
/.all-contributorsrc:
--------------------------------------------------------------------------------
1 | {
2 | "projectName": "material-ui-dropzone",
3 | "projectOwner": "Yuvaleros",
4 | "repoType": "github",
5 | "repoHost": "https://github.com",
6 | "files": [
7 | "README.md"
8 | ],
9 | "imageSize": 80,
10 | "commit": false,
11 | "commitConvention": "gitmoji",
12 | "contributors": [
13 | {
14 | "login": "Yuvaleros",
15 | "name": "Yuvaleros",
16 | "avatar_url": "https://avatars1.githubusercontent.com/u/3898166?v=4",
17 | "profile": "https://github.com/Yuvaleros",
18 | "contributions": [
19 | "ideas",
20 | "code",
21 | "design",
22 | "doc",
23 | "question",
24 | "review",
25 | "maintenance"
26 | ]
27 | },
28 | {
29 | "login": "panz3r",
30 | "name": "Mattia Panzeri",
31 | "avatar_url": "https://avatars3.githubusercontent.com/u/1754457?v=4",
32 | "profile": "https://github.com/panz3r",
33 | "contributions": [
34 | "ideas",
35 | "code",
36 | "design",
37 | "doc",
38 | "example",
39 | "infra",
40 | "bug",
41 | "question",
42 | "review",
43 | "maintenance"
44 | ]
45 | },
46 | {
47 | "login": "max-carroll",
48 | "name": "Max Carroll",
49 | "avatar_url": "https://avatars2.githubusercontent.com/u/13512675?v=4",
50 | "profile": "https://github.com/max-carroll",
51 | "contributions": [
52 | "ideas",
53 | "code",
54 | "design",
55 | "example",
56 | "review"
57 | ]
58 | },
59 | {
60 | "login": "mattcorner",
61 | "name": "Matthew Corner",
62 | "avatar_url": "https://avatars1.githubusercontent.com/u/27866636?v=4",
63 | "profile": "https://github.com/mattcorner",
64 | "contributions": [
65 | "bug",
66 | "ideas",
67 | "code"
68 | ]
69 | },
70 | {
71 | "login": "loongyh",
72 | "name": "Barry Loong",
73 | "avatar_url": "https://avatars3.githubusercontent.com/u/20846761?v=4",
74 | "profile": "https://github.com/loongyh",
75 | "contributions": [
76 | "ideas",
77 | "code"
78 | ]
79 | },
80 | {
81 | "login": "blouin",
82 | "name": "JF Blouin",
83 | "avatar_url": "https://avatars1.githubusercontent.com/u/20212446?v=4",
84 | "profile": "https://github.com/blouin",
85 | "contributions": [
86 | "ideas",
87 | "code"
88 | ]
89 | },
90 | {
91 | "login": "anthonyraymond",
92 | "name": "Anthony Raymond",
93 | "avatar_url": "https://avatars1.githubusercontent.com/u/7503585?v=4",
94 | "profile": "http://stackoverflow.com/users/2275818/anthony-raymond",
95 | "contributions": [
96 | "code",
97 | "example"
98 | ]
99 | },
100 | {
101 | "login": "isaacbuckman",
102 | "name": "isaacbuckman",
103 | "avatar_url": "https://avatars1.githubusercontent.com/u/34870239?v=4",
104 | "profile": "https://github.com/isaacbuckman",
105 | "contributions": [
106 | "bug",
107 | "code",
108 | "example"
109 | ]
110 | },
111 | {
112 | "login": "MatthijsMud",
113 | "name": "MatthijsMud",
114 | "avatar_url": "https://avatars3.githubusercontent.com/u/11519728?v=4",
115 | "profile": "https://github.com/MatthijsMud",
116 | "contributions": [
117 | "bug",
118 | "code"
119 | ]
120 | }
121 | ],
122 | "contributorsPerLine": 3
123 | }
124 |
--------------------------------------------------------------------------------
/.babelrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | [
4 | '@babel/preset-env',
5 | {
6 | modules: false,
7 | },
8 | ],
9 | '@babel/preset-react',
10 | ],
11 | plugins: [
12 | 'babel-plugin-optimize-clsx',
13 | [
14 | '@babel/plugin-proposal-class-properties',
15 | {
16 | loose: true,
17 | },
18 | ],
19 | [
20 | '@babel/plugin-proposal-object-rest-spread',
21 | {
22 | loose: true,
23 | },
24 | ],
25 | // any package needs to declare 7.4.4 as a runtime dependency. default is ^7.0.0
26 | [
27 | '@babel/plugin-transform-runtime',
28 | {
29 | version: '^7.4.4',
30 | },
31 | ],
32 | // for IE 11 support
33 | '@babel/plugin-transform-object-assign',
34 | // material-ui 'productionPlugins'
35 | '@babel/plugin-transform-react-constant-elements',
36 | 'babel-plugin-transform-dev-warning',
37 | [
38 | 'babel-plugin-transform-react-remove-prop-types',
39 | {
40 | mode: 'unsafe-wrap',
41 | },
42 | ],
43 | // END material-ui 'productionPlugins'
44 | ],
45 | ignore: [/@babel[\\|/]runtime/], // Fix a Windows issue.
46 | };
47 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "es6": true,
4 | "browser": true,
5 | "mocha": true,
6 | "node": true
7 | },
8 | "parser": "babel-eslint",
9 | "parserOptions": {
10 | "ecmaVersion": 7,
11 | "sourceType": "module",
12 | "ecmaFeatures": {
13 | "jsx": true,
14 | "experimentalObjectRestSpread": true
15 | }
16 | },
17 | "globals": {
18 | "React": true
19 | },
20 | "settings": {
21 | "react": {
22 | "version": "15.0"
23 | }
24 | },
25 | "plugins": [
26 | "babel",
27 | "react"
28 | ],
29 | "extends": [
30 | "eslint:recommended",
31 | "plugin:react/recommended"
32 | ],
33 | "rules": {
34 | "array-bracket-spacing": ["error", "never"],
35 | "arrow-parens": "error",
36 | "arrow-spacing": "error",
37 | "brace-style": "error",
38 | "comma-dangle": ["error", "always-multiline"],
39 | "comma-spacing": ["error", {"before": false, "after": true}],
40 | "comma-style": ["error", "last"],
41 | "computed-property-spacing": ["error", "never"],
42 | "consistent-return": "off",
43 | "consistent-this": ["error", "self"],
44 | "dot-location": ["error", "property"],
45 | "dot-notation": "error",
46 | "eol-last": "error",
47 | "eqeqeq": ["error", "smart"],
48 | "generator-star-spacing": "error",
49 | "id-blacklist": ["error", "e"],
50 | "indent": ["error", 4, {"SwitchCase": 1}],
51 | "jsx-quotes": ["error", "prefer-double"],
52 | "key-spacing": "error",
53 | "keyword-spacing": "error",
54 | "max-len": ["error", 120, 4, {"ignoreComments": true}],
55 | "new-cap": ["off", {"capIsNew": true, "newIsCap": true}],
56 | "no-await-in-loop": "error",
57 | "no-case-declarations": "off",
58 | "no-cond-assign": "error",
59 | "no-dupe-args": "error",
60 | "no-dupe-keys": "error",
61 | "no-duplicate-case": "error",
62 | "no-empty-pattern": "error",
63 | "no-extra-boolean-cast": "error",
64 | "no-extra-semi": "error",
65 | "no-multi-spaces": "error",
66 | "no-multiple-empty-lines": "error",
67 | "no-shadow": "off",
68 | "no-spaced-func": "error",
69 | "no-trailing-spaces": "error",
70 | "no-undef": "error",
71 | "no-underscore-dangle": "error",
72 | "no-unneeded-ternary": "error",
73 | "no-unreachable": "error",
74 | "no-unused-expressions": "error",
75 | "no-unused-vars": "error",
76 | "no-var": "error",
77 | "object-curly-spacing": ["error", "never"],
78 | "one-var": ["error", "never"],
79 | "operator-linebreak": ["error", "after"],
80 | "padded-blocks": ["error", "never"],
81 | "prefer-arrow-callback": "off",
82 | "prefer-const": "error",
83 | "quotes": ["error", "single", "avoid-escape"],
84 | "semi": ["error", "always"],
85 | "space-before-blocks": ["error", "always"],
86 | "space-before-function-paren": ["error", "never"],
87 | "space-infix-ops": "error",
88 | "space-unary-ops": ["error", {"words": true, "nonwords": false}],
89 | "spaced-comment": "error",
90 | "strict": "off",
91 | "yoda": "error",
92 | "babel/new-cap": "off",
93 | "babel/object-shorthand": "off"
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F41B Bug Report"
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 | ---
8 |
9 | ## Bug Report
10 |
11 | ### Describe the bug
12 |
13 |
16 |
17 | ### Steps to reproduce
18 |
19 |
28 |
29 | ### Expected behavior
30 |
31 |
34 |
35 |
40 |
41 | ### Versions
42 |
43 | - OS: [e.g. iOS]
44 | - Browser: [e.g. chrome, safari]
45 | - `@mui/material` version: [e.g. 5.0.2]
46 | - `material-ui-dropzone` version: [e.g. 3.0.1]
47 |
48 | ### Additional context
49 |
50 |
53 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: true
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: "\U0001F680 Feature Request"
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 | ---
8 |
9 | ## Feature Request
10 |
11 | ### Describe the problem related to this feature request
12 |
13 |
17 |
18 | ### Describe the solution you'd like
19 |
20 |
23 |
24 | ### Describe alternatives you've considered
25 |
26 |
29 |
30 | ### Teachability, Documentation, Adoption, Migration Strategy
31 |
32 |
36 |
37 | ### Additional context
38 |
39 |
42 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ## Description
2 |
3 |
8 |
9 |
15 |
16 | ## Type of change
17 |
18 |
21 |
22 | - Bug fix (non-breaking change which fixes an issue)
23 | - New feature (non-breaking change which adds functionality)
24 | - Breaking change (fix or feature that would cause existing functionality to not work as expected)
25 |
26 | ## How Has This Been Tested
27 |
28 |
33 |
34 | - [ ] Test A
35 | - [ ] Test B
36 |
37 | **Test Configuration**:
38 |
39 | - Browser:
40 |
41 | ## Checklist
42 |
43 | - [ ] My code follows the style guidelines of this project
44 | - [ ] I have performed a self-review of my own code
45 | - [ ] I have commented my code, particularly in hard-to-understand areas
46 | - [ ] I have made corresponding changes to the documentation
47 | - [ ] My changes generate no new warnings
48 | - [ ] I have added tests that prove my fix is effective or that my feature works
49 | - [ ] New and existing unit tests pass locally with my changes
50 | - [ ] Any dependent changes have been merged and published in downstream modules
51 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Rebuild Dist
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | - v2.x
8 |
9 | env:
10 | CI: true
11 |
12 | jobs:
13 | build-and-commit:
14 | runs-on: ubuntu-latest
15 |
16 | steps:
17 | - name: Clone repository
18 | uses: actions/checkout@v2
19 |
20 | - run: node --version
21 | - run: yarn --version
22 |
23 | - name: Install dependencies
24 | run: yarn install --frozen-lockfile
25 |
26 | - name: Build
27 | run: yarn build
28 |
29 | - name: Push changes
30 | uses: actions-go/push@v1
31 | with:
32 | author-name: ${{ github.actor }}
33 | author-email: ${{ github.actor }}@users.noreply.github.com
34 | commit-message: ':package: Rebuild dist @ ${{ github.sha }}'
35 |
--------------------------------------------------------------------------------
/.github/workflows/docs.yml:
--------------------------------------------------------------------------------
1 | name: Update Docs
2 |
3 | on:
4 | push:
5 | tags:
6 | - '*'
7 |
8 | env:
9 | CI: true
10 |
11 | jobs:
12 | build-and-deploy:
13 | runs-on: ubuntu-latest
14 |
15 | steps:
16 | - name: Clone repository
17 | uses: actions/checkout@v2
18 |
19 | - run: node --version
20 | - run: yarn --version
21 |
22 | - name: Install dependencies
23 | run: yarn install --frozen-lockfile
24 |
25 | - name: Build docs
26 | run: yarn docs:build
27 |
28 | - name: Deploy to gh-pages
29 | uses: JamesIves/github-pages-deploy-action@releases/v3
30 | with:
31 | ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
32 | BRANCH: gh-pages # The branch the action should deploy to.
33 | FOLDER: styleguide # The folder the action should deploy.
34 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .idea/
3 | build/
4 | node_modules/
5 | styleguide/
6 |
--------------------------------------------------------------------------------
/.mochasetup.js:
--------------------------------------------------------------------------------
1 | require('babel-register')();
2 | require ('ignore-styles');
3 |
--------------------------------------------------------------------------------
/.size-snapshot.json:
--------------------------------------------------------------------------------
1 | {
2 | "dist/index.js": {
3 | "bundled": 58038,
4 | "minified": 26083,
5 | "gzipped": 6105
6 | },
7 | "dist/index.es.js": {
8 | "bundled": 56840,
9 | "minified": 25059,
10 | "gzipped": 5983,
11 | "treeshaked": {
12 | "rollup": {
13 | "code": 10987,
14 | "import_statements": 1540
15 | },
16 | "webpack": {
17 | "code": 22114
18 | }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # material-ui-dropzone
2 |
3 | Thanks to all contributers who improved **material-ui-dropzone** by opening an issue/PR.
4 |
5 | This changelog refers to `master` branch (currently `v3.x`), for `v2.x`-specific changelog see [`v2.x CHANGELOG.md`](https://github.com/Yuvaleros/material-ui-dropzone/blob/v2.x/CHANGELOG.md).
6 |
7 | ## `v3.5.0`
8 |
9 | ###### To be released
10 |
11 | #### :sparkles: Features
12 |
13 | * Update DropzoneDialog to allow for a custom dialog title (PR [#234](https://github.com/Yuvaleros/material-ui-dropzone/pull/234) by **@4-Eyes**)
14 |
15 | #### :bug: Bugfixes
16 |
17 | * Use binary system instead of decimal for size error (PR [#245](https://github.com/Yuvaleros/material-ui-dropzone/pull/245) by **@AntoineGrandchamp**)
18 |
19 | #### :label: Typings
20 |
21 | * Add disableRejectionFeedback to DropzoneAreaBaseProps type (PR [#247](https://github.com/Yuvaleros/material-ui-dropzone/pull/247) by **@Parya-Jafari**, related to issue [#141](https://github.com/Yuvaleros/material-ui-dropzone/issues/141) by **@PabloCanalSuarez**)
22 |
23 | ## `v3.4.1`
24 |
25 | ###### Unreleased
26 |
27 | #### :bug: Bugfixes
28 |
29 | * Fix `react-dropzone` props not being passed properly (PR [#239](https://github.com/Yuvaleros/material-ui-dropzone/pull/239) by **@panz3r**, fixes [#235](https://github.com/Yuvaleros/material-ui-dropzone/issues/235) by **@grahamlangford**)
30 |
31 | ## `v3.4.0`
32 |
33 | ###### August 18, 2020
34 |
35 | #### :sparkles: New Features
36 |
37 | * Allow all filetypes by default (PR [#226](https://github.com/Yuvaleros/material-ui-dropzone/pull/226) by **@panz3r**, fixes [#214](https://github.com/Yuvaleros/material-ui-dropzone/issues/214) by **@FilipeCosta06**)
38 | * Allow passing a custom Icon to be displayed inside Dropzone area (PR [#227](https://github.com/Yuvaleros/material-ui-dropzone/pull/227) by **@panz3r**, closes [#48](https://github.com/Yuvaleros/material-ui-dropzone/issues/48) by **@N4Design**)
39 |
40 | #### :lipstick: UI Changes
41 |
42 | * Fix Snackbar icons margins (PR [#223](https://github.com/Yuvaleros/material-ui-dropzone/pull/223) by **@Armanio**)
43 |
44 | ## `v3.3.1`
45 |
46 | ###### July 24, 2020
47 |
48 | #### :label: Typings
49 |
50 | * Update PropTypes for `initialFiles` to avoid issues with `NextJS` (Fixes [#208](https://github.com/Yuvaleros/material-ui-dropzone/issues/208))
51 |
52 | ## `v3.3.0`
53 |
54 | ###### June 20, 2020
55 |
56 | #### :sparkles: New Features
57 |
58 | * Make `previewChips` use the grid system as well (PR [#173](https://github.com/Yuvaleros/material-ui-dropzone/pull/173) by **@anthonyraymond**)
59 | * Set `initialFiles` with `File` or `URL string` (PR [#194](https://github.com/Yuvaleros/material-ui-dropzone/pull/194) by **@isaacbuckman**, reported as [#192](https://github.com/Yuvaleros/material-ui-dropzone/issues/192) by **@isaacbuckman**)
60 | * Add `onAlert` callback prop to hook into Snackbar messaging (PR [#205](https://github.com/Yuvaleros/material-ui-dropzone/pull/205) by **@mattcorner**, reported as [#200](https://github.com/Yuvaleros/material-ui-dropzone/issues/200) by **@mattcorner**)
61 |
62 | ## `v3.2.1`
63 |
64 | ###### Unreleased
65 |
66 | #### :bug: Bugfixes
67 |
68 | * Show remove buttons when they have focus (PR [#191](https://github.com/Yuvaleros/material-ui-dropzone/pull/191) by **@MatthijsMud**, reported as [#190](https://github.com/Yuvaleros/material-ui-dropzone/issues/190) by **@MatthijsMud**)
69 | * Change `SnackbarContentWrapper` class names for variants to avoid conflicts with Material UI internals (PR [#198](https://github.com/Yuvaleros/material-ui-dropzone/pull/198) by **@panz3r**, reported as [#183](https://github.com/Yuvaleros/material-ui-dropzone/issues/183) by **@mattcorner**)
70 | * Fix error message when dropping more than `filesLimit` files (PR [#199](https://github.com/Yuvaleros/material-ui-dropzone/pull/199) by **@panz3r**, reported as [#196](https://github.com/Yuvaleros/material-ui-dropzone/issues/196) by **@edricwu**)
71 |
72 | #### :label: Typings
73 |
74 | * Update Typescript typings
75 | * Fixes issue [#172](https://github.com/Yuvaleros/material-ui-dropzone/issues/172) by **@amirmishani**
76 | * Fixes issue [#184](https://github.com/Yuvaleros/material-ui-dropzone/issues/184) by **@zikaeroh**
77 |
78 | #### :arrow_up: Dependencies Update
79 |
80 | * Bump `websocket-extensions` from `0.1.3` to `0.1.4`
81 | * Bump `@babel/*` devDeps to `7.10.x`
82 |
83 | ## `v3.2.0`
84 |
85 | ###### June 03, 2020
86 |
87 | #### :sparkles: New Features
88 |
89 | * Add `DropzoneAreaBase` and `DropzoneDialogBase` controlled components (PR [#175](https://github.com/Yuvaleros/material-ui-dropzone/pull/175) by **@panz3r**)
90 |
91 | ## `v3.1.0`
92 |
93 | ###### May 27, 2020
94 |
95 | #### :sparkles: New Features
96 |
97 | * Add `getPreviewIcon` prop to DropzoneArea component to customize file preview (PR [#154](https://github.com/Yuvaleros/material-ui-dropzone/pull/154) by **@max-carroll**)
98 | * Add support for style with MUI Theme, see [docs](https://yuvaleros.github.io/material-ui-dropzone/#section-theme) for more details (PR [#158](https://github.com/Yuvaleros/material-ui-dropzone/pull/158) by **@panz3r**):
99 | * Closes issue [#73](https://github.com/Yuvaleros/material-ui-dropzone/issues/73) by **@sirsaeta**
100 | * Closes issue [#80](https://github.com/Yuvaleros/material-ui-dropzone/issues/80) by **@mikiasmohamed**
101 | * Closes issue [#125](https://github.com/Yuvaleros/material-ui-dropzone/issues/125) by **@suiaing**
102 | * Closes issue [#146](https://github.com/Yuvaleros/material-ui-dropzone/issues/146) by **@mattcorner**
103 | * Add `showAlerts` property to show alerts only on error (PR [#170](https://github.com/Yuvaleros/material-ui-dropzone/pull/170) by **@blouin**):
104 | * `showAlerts` can be a boolean ("global" `true` or `false` for all alerts).
105 | * `showAlerts` can be an array, with values `error`, `info`, `success`:
106 | * `showAlerts={['error']}` for only `errors`
107 | * `showAlerts={['error', 'info']}` for both `errors` and `info`
108 | * `showAlerts={['error', 'success', 'info']}` is same as `showAlerts={true}`
109 | * `showAlerts={[]}` is same as `showAlerts={false}`
110 |
111 | #### :bug: Bugfixes
112 |
113 | * Avoid appending extension if present when loading external files (PR [#150](https://github.com/Yuvaleros/material-ui-dropzone/pull/150) by **@panz3r**, reported as [#135](https://github.com/Yuvaleros/material-ui-dropzone/issues/135) by **@mballeng91**)
114 | * Prevent control focus rubber band (PR [#156](https://github.com/Yuvaleros/material-ui-dropzone/pull/156) by **@max-carroll**, reported as [#145](https://github.com/Yuvaleros/material-ui-dropzone/issues/145) by **@topninja**)
115 |
116 | ## `v3.0.0`
117 |
118 | ###### April 25, 2020
119 |
120 | #### :boom: **BREAKING**
121 |
122 | * Upgrade `react-dropzone` to version 10 (PR [#120](https://github.com/Yuvaleros/material-ui-dropzone/pull/120) by **@panz3r**)
123 | * Drop support for React `<16.8` and Material-UI `v3` (PR [#120](https://github.com/Yuvaleros/material-ui-dropzone/pull/120) by **@panz3r**)
124 | * After the code refactor of PR [#121](https://github.com/Yuvaleros/material-ui-dropzone/pull/121), the `onChange` handler is invoked also on component mount (with or without files depending on the value of the `initialFiles` prop) - see issue [#153](https://github.com/Yuvaleros/material-ui-dropzone/issues/153) for more details.
125 |
126 | #### :sparkles: New Features
127 |
128 | * Addition of `previewText` prop to `DropzoneArea` component (PR [#121](https://github.com/Yuvaleros/material-ui-dropzone/pull/121) by **@panz3r**, same as [#112](https://github.com/Yuvaleros/material-ui-dropzone/pull/112) by **@charlot567**)
129 | * Add `disableRejectionFeedback` prop to `DropzoneArea` component (PR [#142](https://github.com/Yuvaleros/material-ui-dropzone/pull/142) by **@panz3r**, reported as [#141](https://github.com/Yuvaleros/material-ui-dropzone/issues/141) by **@PabloCanalSuarez**)
130 | * Add `inputProps` prop to `DropzoneArea` component (PR [#134](https://github.com/Yuvaleros/material-ui-dropzone/pull/134) by **@panz3r**), fixes:
131 | * set name for `` element ([#92](https://github.com/Yuvaleros/material-ui-dropzone/issues/92) by **@mnlbox**)
132 | * Upload Directory/folder ([#122](https://github.com/Yuvaleros/material-ui-dropzone/issues/122) by **@antares-va-tech**)
133 | * Add `dropzoneProps` prop to `DropzoneArea` component (PR [#134](https://github.com/Yuvaleros/material-ui-dropzone/pull/134) by **@panz3r**), fixes:
134 | * Dropzone disable attribute not working ([#103](https://github.com/Yuvaleros/material-ui-dropzone/issues/103) by **@stefanstankovic995**)
135 | * Add `alertSnackbarProps` prop to `DropzoneArea` component (PR [#134](https://github.com/Yuvaleros/material-ui-dropzone/pull/134) by **@panz3r**), fixes:
136 | * Ability to override snackbard background colours ([#45](https://github.com/Yuvaleros/material-ui-dropzone/issues/45) by **@IsabellaRey**)
137 | * Allow the abillity of change anchorOrigin of snackbar ([#64](https://github.com/Yuvaleros/material-ui-dropzone/issues/64) by **@widomin**)
138 |
139 | #### :bug: Bugfixes
140 |
141 | * Avoid appending extension if present when loading external files (PR [#137](https://github.com/Yuvaleros/material-ui-dropzone/pull/137) by **@panz3r**, reported as [#135](https://github.com/Yuvaleros/material-ui-dropzone/issues/135) by **@mballeng91**)
142 | * onDrop returns each file one at a time (PR [#121](https://github.com/Yuvaleros/material-ui-dropzone/pull/121) by **@panz3r**, reported as [#65](https://github.com/Yuvaleros/material-ui-dropzone/issues/65) by **@AlanOrtega91**)
143 | * Fully support setting `acceptedFiles` as `.fileending` (PR [#121](https://github.com/Yuvaleros/material-ui-dropzone/pull/121) by **@panz3r**, reported as [#107](https://github.com/Yuvaleros/material-ui-dropzone/issues/107) by **@wirmar**)
144 |
145 | #### :lipstick: UI
146 |
147 | * Should be using Typography instead of `
` (PR [#121](https://github.com/Yuvaleros/material-ui-dropzone/pull/121) by **@panz3r**, reported as [#31](https://github.com/Yuvaleros/material-ui-dropzone/issues/31) by **@PolGuixe** and **@IsabellaRey**)
148 |
149 | #### :recycle: Refactoring
150 |
151 | * Code refactor ([#121](https://github.com/Yuvaleros/material-ui-dropzone/pull/121) by **@panz3r**)
152 |
153 | #### :pencil: Docs
154 |
155 | * Improved docs ([#128](https://github.com/Yuvaleros/material-ui-dropzone/pull/128) by **@panz3r**)
156 |
157 |
158 |
159 | ## `v2.5.0`
160 |
161 | ###### April 15, 2020
162 |
163 | #### :sparkles: New Features
164 |
165 | * Add `previewGridClasses`, `previewGridProps` props (PR [#124](https://github.com/Yuvaleros/material-ui-dropzone/pull/124) by **@loongyh**, reported as [#85](https://github.com/Yuvaleros/material-ui-dropzone/issues/85) by **@zeckdude**)
166 | * Add `dialogProps` prop to customize `DropzoneDialog` appearance (PR [#105](https://github.com/Yuvaleros/material-ui-dropzone/pull/105) by **@chattling**)
167 |
168 | #### :bug: Bugfixes
169 |
170 | * ReferenceError: regeneratorRuntime is not defined (PR [#111](https://github.com/Yuvaleros/material-ui-dropzone/pull/111) by **@panz3r**, reported as [#77](https://github.com/Yuvaleros/material-ui-dropzone/issues/77) by **@rooch84**, **@Tassfighter** and **@eluchsinger**)
171 |
172 | #### :zap: Improvements
173 |
174 | * Review dependencies (PR [#111](https://github.com/Yuvaleros/material-ui-dropzone/pull/111) by **@panz3r**)
175 | * Tooling upgrade (PR [#115](https://github.com/Yuvaleros/material-ui-dropzone/pull/115) by **@panz3r**)
176 |
177 | #### :pencil: Docs
178 |
179 | * Added new `dialogProps` prop to `README` (PR [#113](https://github.com/Yuvaleros/material-ui-dropzone/pull/113) by **@chattling**)
180 | * Fix submit/cancel typo (PR [#126](https://github.com/Yuvaleros/material-ui-dropzone/pull/126) by **@Maxim-Mazurok**)
181 |
182 |
183 |
184 | ## `v2.4.9`
185 |
186 | ###### March 10, 2020
187 |
188 | #### :sparkles: New Features
189 |
190 | * Add `dialogProps` prop to customize `DropzoneDialog` appearance (PR [#105](https://github.com/Yuvaleros/material-ui-dropzone/pull/105) by **@chattling**)
191 |
192 | #### :bug: Bugfixes
193 |
194 | * Move `@material-ui/icons` to `peerDependencies` (PR [#104](https://github.com/Yuvaleros/material-ui-dropzone/pull/104) by **@panz3r**, reported as [#95](https://github.com/Yuvaleros/material-ui-dropzone/issues/95) by **@char0n**)
195 |
196 |
197 |
198 | ## `v2.4.8`
199 |
200 | ###### February 22, 2020
201 |
202 | #### :bug: Bugfixes
203 |
204 | * initialFiles not shown up (PR [#101](https://github.com/Yuvaleros/material-ui-dropzone/pull/101) by **@faupol3**, reported as [#87](https://github.com/Yuvaleros/material-ui-dropzone/issues/87) by **@ameenazeemiacmedocs**)
205 | * Unable to preview png file (PR [#101](https://github.com/Yuvaleros/material-ui-dropzone/pull/101) by **@faupol3**, reported as [#90](https://github.com/Yuvaleros/material-ui-dropzone/issues/90) by **@shailesh-padave**)
206 | * remove console logs from Dropzone dialog (PR [#102](https://github.com/Yuvaleros/material-ui-dropzone/pull/102) by **@chattling**, reported as [#96](https://github.com/Yuvaleros/material-ui-dropzone/issues/96) by **@Morteza-Jenabzadeh**)
207 |
208 | #### :recycle: Refactoring
209 |
210 | * Improved code quality (PR [#94](https://github.com/Yuvaleros/material-ui-dropzone/pull/94) by **@GRcwolf**)
211 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 |
2 | # Contributor Covenant Code of Conduct
3 |
4 | ## Our Pledge
5 |
6 | We as members, contributors, and leaders pledge to make participation in our
7 | community a harassment-free experience for everyone, regardless of age, body
8 | size, visible or invisible disability, ethnicity, sex characteristics, gender
9 | identity and expression, level of experience, education, socio-economic status,
10 | nationality, personal appearance, race, religion, or sexual identity
11 | and orientation.
12 |
13 | We pledge to act and interact in ways that contribute to an open, welcoming,
14 | diverse, inclusive, and healthy community.
15 |
16 | ## Our Standards
17 |
18 | Examples of behavior that contributes to a positive environment for our
19 | community include:
20 |
21 | * Demonstrating empathy and kindness toward other people
22 | * Being respectful of differing opinions, viewpoints, and experiences
23 | * Giving and gracefully accepting constructive feedback
24 | * Accepting responsibility and apologizing to those affected by our mistakes,
25 | and learning from the experience
26 | * Focusing on what is best not just for us as individuals, but for the
27 | overall community
28 |
29 | Examples of unacceptable behavior include:
30 |
31 | * The use of sexualized language or imagery, and sexual attention or
32 | advances of any kind
33 | * Trolling, insulting or derogatory comments, and personal or political attacks
34 | * Public or private harassment
35 | * Publishing others' private information, such as a physical or email
36 | address, without their explicit permission
37 | * Other conduct which could reasonably be considered inappropriate in a
38 | professional setting
39 |
40 | ## Enforcement Responsibilities
41 |
42 | Community leaders are responsible for clarifying and enforcing our standards of
43 | acceptable behavior and will take appropriate and fair corrective action in
44 | response to any behavior that they deem inappropriate, threatening, offensive,
45 | or harmful.
46 |
47 | Community leaders have the right and responsibility to remove, edit, or reject
48 | comments, commits, code, wiki edits, issues, and other contributions that are
49 | not aligned to this Code of Conduct, and will communicate reasons for moderation
50 | decisions when appropriate.
51 |
52 | ## Scope
53 |
54 | This Code of Conduct applies within all community spaces, and also applies when
55 | an individual is officially representing the community in public spaces.
56 | Examples of representing our community include using an official e-mail address,
57 | posting via an official social media account, or acting as an appointed
58 | representative at an online or offline event.
59 |
60 | ## Enforcement
61 |
62 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
63 | reported to the community leaders responsible for enforcement at Github by
64 | opening an issue [here](https://github.com/Yuvaleros/material-ui-dropzone/issues/new).
65 | All complaints will be reviewed and investigated promptly and fairly.
66 |
67 | All community leaders are obligated to respect the privacy and security of the
68 | reporter of any incident.
69 |
70 | ## Enforcement Guidelines
71 |
72 | Community leaders will follow these Community Impact Guidelines in determining
73 | the consequences for any action they deem in violation of this Code of Conduct:
74 |
75 | ### 1. Correction
76 |
77 | **Community Impact**: Use of inappropriate language or other behavior deemed
78 | unprofessional or unwelcome in the community.
79 |
80 | **Consequence**: A private, written warning from community leaders, providing
81 | clarity around the nature of the violation and an explanation of why the
82 | behavior was inappropriate. A public apology may be requested.
83 |
84 | ### 2. Warning
85 |
86 | **Community Impact**: A violation through a single incident or series
87 | of actions.
88 |
89 | **Consequence**: A warning with consequences for continued behavior. No
90 | interaction with the people involved, including unsolicited interaction with
91 | those enforcing the Code of Conduct, for a specified period of time. This
92 | includes avoiding interactions in community spaces as well as external channels
93 | like social media. Violating these terms may lead to a temporary or
94 | permanent ban.
95 |
96 | ### 3. Temporary Ban
97 |
98 | **Community Impact**: A serious violation of community standards, including
99 | sustained inappropriate behavior.
100 |
101 | **Consequence**: A temporary ban from any sort of interaction or public
102 | communication with the community for a specified period of time. No public or
103 | private interaction with the people involved, including unsolicited interaction
104 | with those enforcing the Code of Conduct, is allowed during this period.
105 | Violating these terms may lead to a permanent ban.
106 |
107 | ### 4. Permanent Ban
108 |
109 | **Community Impact**: Demonstrating a pattern of violation of community
110 | standards, including sustained inappropriate behavior, harassment of an
111 | individual, or aggression toward or disparagement of classes of individuals.
112 |
113 | **Consequence**: A permanent ban from any sort of public interaction within
114 | the community.
115 |
116 | ## Attribution
117 |
118 | This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
119 | version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120 |
121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct
122 | enforcement ladder](https://github.com/mozilla/diversity).
123 |
124 | For answers to common questions about this code of conduct, see the FAQ at
125 | https://www.contributor-covenant.org/faq. Translations are available at
126 | https://www.contributor-covenant.org/translations.
127 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | We're really glad you're reading this because we need volunteer developers to help this project come to fruition. 👏
4 |
5 | ## Instructions
6 |
7 | These steps will guide you through contributing to this project:
8 |
9 | - Fork the repo
10 | - Clone it and install dependencies
11 |
12 | ```shell
13 | git clone https://github.com/[YOUR-USERNAME]/material-ui-dropzone
14 |
15 | yarn install
16 | ```
17 |
18 | - Launch the interactive docs by running
19 |
20 | ```shell
21 | yarn docs:dev
22 | ```
23 |
24 | - Make and commit your changes
25 | - Make sure the command `yarn build` is working
26 | - Finally send a [GitHub Pull Request](https://github.com/Yuvaleros/material-ui-dropzone/compare) with a clear list of what you've done (read more [about pull requests](https://help.github.com/articles/about-pull-requests/))
27 |
28 | ### Notes
29 |
30 | Make sure all of your commits are atomic (one feature per commit) and follows the [Gitmoji](https://gitmoji.carloscuesta.me) convention.
31 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Yuvaleros
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # material-ui-dropzone
2 |
3 | > Material-UI-dropzone is a [React](https://github.com/facebook/react) component using [Material-UI](https://github.com/mui-org/material-ui) and is based on the excellent [react-dropzone](https://github.com/react-dropzone/react-dropzone) library.
4 |
5 | [](https://github.com/Yuvaleros/material-ui-dropzone/blob/master/LICENSE) [](#contributors)
6 |
7 |
8 | [](https://github.com/Yuvaleros/material-ui-dropzone/actions?query=workflow%3A%22Rebuild+Dist%22) [](https://github.com/Yuvaleros/material-ui-dropzone/actions?query=workflow%3A%22Update+Docs%22)
9 |
10 | [](https://www.npmjs.com/package/material-ui-dropzone) [](https://www.npmjs.com/package/material-ui-dropzone)
11 |
12 | This components provide either a file-upload dropzone or a file-upload dropzone inside of a dialog.
13 |
14 | The file-upload dropzone features some snazzy "File Allowed/Not Allowed" effects, previews and alerts.
15 |
16 | ## Installation
17 |
18 | ```shell
19 | npm install --save material-ui-dropzone
20 | ```
21 |
22 | or
23 |
24 | ```shell
25 | yarn add material-ui-dropzone
26 | ```
27 |
28 | ## Support
29 |
30 | `material-ui-dropzone` complies to the following support matrix.
31 |
32 | | version | React | Material-UI |
33 | | ------- | ---------------- | -------------- |
34 | | `3.x` | `16.8+` | `4.x` |
35 | | `2.x` | `15.x` or `16.x` | `3.x` or `4.x` |
36 |
37 | ## Screenshots
38 |
39 | This is the Dialog component:
40 |
41 | 
42 | 
43 |
44 | When you drag a file onto the dropzone, you get a neat effect:
45 |
46 | 
47 |
48 | And if you drag in a wrong type of file, you'll get yelled at:
49 |
50 | 
51 |
52 | **N.B. This has some limitations (see [here](https://github.com/react-dropzone/react-dropzone/tree/master/examples/accept#browser-limitations) for more details).**
53 |
54 | ## Documentation and Examples
55 |
56 | See [https://yuvaleros.github.io/material-ui-dropzone](https://yuvaleros.github.io/material-ui-dropzone) for Documentation and Examples.
57 |
58 | ## Components
59 |
60 | ### DropzoneArea
61 |
62 | This components creates the dropzone, previews and snackbar notifications without a dialog
63 |
64 | ```jsx static
65 | import React, {Component} from 'react'
66 | import {DropzoneArea} from 'material-ui-dropzone'
67 |
68 | class DropzoneAreaExample extends Component{
69 | constructor(props){
70 | super(props);
71 | this.state = {
72 | files: []
73 | };
74 | }
75 | handleChange(files){
76 | this.setState({
77 | files: files
78 | });
79 | }
80 | render(){
81 | return (
82 |
85 | )
86 | }
87 | }
88 |
89 | export default DropzoneAreaExample;
90 | ```
91 |
92 | ### DropzoneDialog
93 |
94 | This component provides the DropzoneArea inside of a MaterialUI Dialog.
95 |
96 | ```jsx static
97 | import React, { Component } from 'react'
98 | import {DropzoneDialog} from 'material-ui-dropzone'
99 | import Button from '@mui/material/Button';
100 |
101 | export default class DropzoneDialogExample extends Component {
102 | constructor(props) {
103 | super(props);
104 | this.state = {
105 | open: false,
106 | files: []
107 | };
108 | }
109 |
110 | handleClose() {
111 | this.setState({
112 | open: false
113 | });
114 | }
115 |
116 | handleSave(files) {
117 | //Saving files to state for further use and closing Modal.
118 | this.setState({
119 | files: files,
120 | open: false
121 | });
122 | }
123 |
124 | handleOpen() {
125 | this.setState({
126 | open: true,
127 | });
128 | }
129 |
130 | render() {
131 | return (
132 |