From 762399f6808542356005e22e7d76098a3eddbb6f Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Fri, 5 Apr 2019 10:50:08 +1100 Subject: [PATCH 1/4] Added baseline file-upload functionality --- packages/file-upload/CHANGELOG.md | 34 ++++++ packages/file-upload/LICENSE | 21 ++++ packages/file-upload/README.md | 83 ++++++++++++++ packages/file-upload/package.json | 106 ++++++++++++++++++ packages/file-upload/src/js/react.js | 45 ++++++++ .../file-upload/src/sass/_dependencies.scss | 6 + packages/file-upload/src/sass/_globals.scss | 25 +++++ packages/file-upload/src/sass/_module.scss | 23 ++++ packages/file-upload/src/sass/_print.scss | 11 ++ packages/file-upload/tests/index.html | 53 +++++++++ packages/file-upload/tests/react/.babelrc | 3 + packages/file-upload/tests/react/index.html | 41 +++++++ packages/file-upload/tests/react/index.js | 13 +++ .../file-upload/tests/react/webpack.config.js | 19 ++++ packages/file-upload/tests/site/index.html | 54 +++++++++ packages/file-upload/tests/site/test.scss | 8 ++ 16 files changed, 545 insertions(+) create mode 100644 packages/file-upload/CHANGELOG.md create mode 100644 packages/file-upload/LICENSE create mode 100644 packages/file-upload/README.md create mode 100644 packages/file-upload/package.json create mode 100644 packages/file-upload/src/js/react.js create mode 100644 packages/file-upload/src/sass/_dependencies.scss create mode 100644 packages/file-upload/src/sass/_globals.scss create mode 100644 packages/file-upload/src/sass/_module.scss create mode 100644 packages/file-upload/src/sass/_print.scss create mode 100644 packages/file-upload/tests/index.html create mode 100644 packages/file-upload/tests/react/.babelrc create mode 100644 packages/file-upload/tests/react/index.html create mode 100644 packages/file-upload/tests/react/index.js create mode 100644 packages/file-upload/tests/react/webpack.config.js create mode 100644 packages/file-upload/tests/site/index.html create mode 100644 packages/file-upload/tests/site/test.scss diff --git a/packages/file-upload/CHANGELOG.md b/packages/file-upload/CHANGELOG.md new file mode 100644 index 000000000..e9319b330 --- /dev/null +++ b/packages/file-upload/CHANGELOG.md @@ -0,0 +1,34 @@ +@gov.au/file-upload CHANGELOG +====================== + +> Part of the [gov.au components](https://github.com/govau/design-system-components/) ecosystem. + + +## Contents + +* [Versions](#install) +* [Release History](#release-history) + + +---------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +## Versions + +* [v0.1.0 - 💥 Initial version](#v010) + + +---------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +## Release History + +### v0.1.0 + +- 💥 Initial version + + +**[⬆ back to top](#contents)** + + +# }; diff --git a/packages/file-upload/LICENSE b/packages/file-upload/LICENSE new file mode 100644 index 000000000..c7dff0c0c --- /dev/null +++ b/packages/file-upload/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Commonwealth of Australia + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/file-upload/README.md b/packages/file-upload/README.md new file mode 100644 index 000000000..87f407a0b --- /dev/null +++ b/packages/file-upload/README.md @@ -0,0 +1,83 @@ +@gov.au/file-upload +============ + +> Select and upload a file + + +## Contents + +* [Install](#install) +* [Dependency graph](#dependency-graph) +* [Tests](#tests) +* [Release History](#release-history) +* [License](#license) + + +---------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +## Install + + +```shell +yarn add @gov.au/file-upload +``` + +```shell +npm install @gov.au/file-upload --save-dev +``` + + +**[⬆ back to top](#contents)** + + +---------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +## Dependency graph + +```shell +file-upload +├─ core +└─ form + └─ core +``` + + +**[⬆ back to top](#contents)** + + +---------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +## Tests + +The visual test: https://auds.service.gov.au/packages/file-upload/tests/site/ + + +**[⬆ back to top](#contents)** + + +---------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +## Release History + +* v0.1.0 - 💥 Initial version + + +**[⬆ back to top](#contents)** + + +---------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +## License + +Copyright (c) Commonwealth of Australia. +Licensed under [MIT](https://raw.githubusercontent.com/govau/design-system-components/packages/core/master/LICENSE). + + +**[⬆ back to top](#contents)** + +# }; diff --git a/packages/file-upload/package.json b/packages/file-upload/package.json new file mode 100644 index 000000000..bc49f1732 --- /dev/null +++ b/packages/file-upload/package.json @@ -0,0 +1,106 @@ +{ + "name": "@gov.au/file-upload", + "version": "0.1.0", + "description": "Select and upload a file", + "keywords": [ + "auds", + "pancake", + "pancake-module", + "sass", + "scss", + "css", + "gov.au", + "Commonwealth of Australia", + "design guide", + "design system" + ], + "scripts": { + "postinstall": "pancake", + "test:a11y": "node ../../scripts/a11y.js", + "test:helper": "node ../../scripts/helper.js test", + "test": "npm-run-all --parallel test:*", + "prepublish": "npm run test:helper && npm run build:pre", + "build:pre": "node ../../scripts/helper.js precompile publish", + "build:js": "node ../../scripts/helper.js compile", + "build:react": "cd tests/react/ && webpack", + "build": "npm run build:pre && npm run build:js && npm run build:react", + "serve": "browser-sync tests --files \"tests/**/*.html, tests/**/*.css, tests/**/*.js\"", + "watch:js": "onchange \"src/js/*.js\" -- npm run build:js", + "watch:jsx": "onchange \"src/js/react.js\" \"tests/react/index.js\" -- npm run build", + "watch:sass": "onchange \"src/sass/*.scss\" \"tests/site/test.scss\" -- npm run build", + "watch": "npm run build && npm-run-all --parallel serve watch:*" + }, + "pancake": { + "pancake-module": { + "version": "1.0.0", + "plugins": [ + "@gov.au/pancake-sass", + "@gov.au/pancake-react", + "@gov.au/pancake-json" + ], + "sass": { + "path": "lib/sass/_module.scss", + "sass-versioning": true + }, + "react": { + "path": "lib/js/react.js" + } + } + }, + "main": "lib/js/react.es5.js", + "dependencies": { + "@gov.au/pancake": "~1", + "@gov.au/pancake-sass": "~2", + "@gov.au/pancake-react": "~1", + "@gov.au/pancake-json": "~1", + + "@gov.au/core": "^3.0.0", + "@gov.au/form": "^0.1.0" + }, + "peerDependencies": { + "@gov.au/core": "^3.0.0", + "@gov.au/form": "^0.1.0" + }, + "devDependencies": { + "@babel/core": "^7.3.4", + "babel-loader": "^8.0.5", + "@babel/preset-react": "^7.0.0", + "@babel/preset-env": "^7.3.4", + "browser-sync": "^2.26.3", + "npm-run-all": "^4.1.5", + "onchange": "^5.2.0", + "react": "^16.8.4", + "react-dom": "^16.8.4", + "webpack": "^4.29.6", + "webpack-cli": "^3.2.3" + }, + "files": [ + "lib/*" + ], + "engines": { + "node": ">=0.12.0", + "npm": "^3.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/govau/design-system-components.git" + }, + "homepage": "https://designsystem.gov.au/components/file-upload", + "bugs": { + "url": "https://github.com/govau/design-system-components/issues", + "email": "designsystem@digital.gov.au" + }, + "author": { + "name": "Commonwealth of Australia, DTA", + "email": "designsystem@digital.gov.au", + "url": "https://www.dta.gov.au/" + }, + "contributors": [ + { + "name": "Adam Zerella", + "email": "hello@adamzerella.com", + "url": "https://adamzerella.com" + } + ], + "license": "MIT" +} \ No newline at end of file diff --git a/packages/file-upload/src/js/react.js b/packages/file-upload/src/js/react.js new file mode 100644 index 000000000..acd17615a --- /dev/null +++ b/packages/file-upload/src/js/react.js @@ -0,0 +1,45 @@ +/*! [replace-name] v[replace-version] */ +/*************************************************************************************************************************************************************** + * + * file-upload function + * + * Select and upload a file + * + **************************************************************************************************************************************************************/ + +import React from 'react'; +import PropTypes from 'prop-types'; + + +/** + * The file upload component + * + * @param {string} id - The label ID, required + * @param {string} name - The input name to match the ID, required + * @param {string} text - Text of the label, required + * @param {object} attributeOptions - Any other attribute options + */ +const AUfileUpload = ( { id, name, text, ...attributeOptions } ) => ( +
+ + +
+); + + +AUfileUpload.propTypes = { + /** + * + */ + id: PropTypes.string, + /** + * + */ + name: PropTypes.string, +}; + + +AUfileUpload.defaultProps = {}; + + +export default AUfileUpload; diff --git a/packages/file-upload/src/sass/_dependencies.scss b/packages/file-upload/src/sass/_dependencies.scss new file mode 100644 index 000000000..103176d56 --- /dev/null +++ b/packages/file-upload/src/sass/_dependencies.scss @@ -0,0 +1,6 @@ +//dependencies +@import '../../../core/src/sass/_module.scss'; +@import '../../../form/src/sass/_module.scss'; + +//this module +@import '_module.scss'; diff --git a/packages/file-upload/src/sass/_globals.scss b/packages/file-upload/src/sass/_globals.scss new file mode 100644 index 000000000..d70f9634b --- /dev/null +++ b/packages/file-upload/src/sass/_globals.scss @@ -0,0 +1,25 @@ +/*! [replace-name] v[replace-version] */ + +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +// file-upload module globals +// Select and upload a file +// +// Content: +// - Sass versioning +// - Global variables: none so far +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- + +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +// SASS VERSIONING +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +$name: "[replace-name]"; +$version: "[replace-version]"; +$dependencies: ( + [replace-dependencies] +); + +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +// GLOBAL VARIABLES +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- + +// Boy it sure is quiet here. diff --git a/packages/file-upload/src/sass/_module.scss b/packages/file-upload/src/sass/_module.scss new file mode 100644 index 000000000..d58ee4a09 --- /dev/null +++ b/packages/file-upload/src/sass/_module.scss @@ -0,0 +1,23 @@ +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +// file-upload module +// Select and upload a file +// +// Content: +// - sass-versioning +// - globals +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +@import '_globals.scss'; +@import '_print.scss'; + +.au-file-upload{ + + .au-label { + margin-bottom: 0.25rem; + } + + .au-file-input { + display: block; + } +} \ No newline at end of file diff --git a/packages/file-upload/src/sass/_print.scss b/packages/file-upload/src/sass/_print.scss new file mode 100644 index 000000000..1debce1fc --- /dev/null +++ b/packages/file-upload/src/sass/_print.scss @@ -0,0 +1,11 @@ +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +// file-upload module +// Select and upload a file +// +// Content: +// - print styles +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +@media print { +} diff --git a/packages/file-upload/tests/index.html b/packages/file-upload/tests/index.html new file mode 100644 index 000000000..4adc7465b --- /dev/null +++ b/packages/file-upload/tests/index.html @@ -0,0 +1,53 @@ + + + + + + + + + + + + + Test: File upload + + + + + + + + + + + ← back to all modules + +

Test: File upload

+ + + + + diff --git a/packages/file-upload/tests/react/.babelrc b/packages/file-upload/tests/react/.babelrc new file mode 100644 index 000000000..c3a044b15 --- /dev/null +++ b/packages/file-upload/tests/react/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["@babel/preset-react", "@babel/preset-env"] +} \ No newline at end of file diff --git a/packages/file-upload/tests/react/index.html b/packages/file-upload/tests/react/index.html new file mode 100644 index 000000000..5f068d87a --- /dev/null +++ b/packages/file-upload/tests/react/index.html @@ -0,0 +1,41 @@ + + + + + + + + + + + + + Test: File upload + + + + + + + + + + ← back to the module index + +

Test: File upload

+ +
+ + + + diff --git a/packages/file-upload/tests/react/index.js b/packages/file-upload/tests/react/index.js new file mode 100644 index 000000000..d8a577829 --- /dev/null +++ b/packages/file-upload/tests/react/index.js @@ -0,0 +1,13 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; + +import AUfileUpload from './file-upload'; + + +ReactDOM.render( +
+ +
, + + document.getElementById('root'), +); diff --git a/packages/file-upload/tests/react/webpack.config.js b/packages/file-upload/tests/react/webpack.config.js new file mode 100644 index 000000000..404e6d8e4 --- /dev/null +++ b/packages/file-upload/tests/react/webpack.config.js @@ -0,0 +1,19 @@ +const path = require( 'path' ); + +module.exports = { + entry: './index.js', + mode: 'development', + output: { + filename: './bundle.js', + path: path.resolve( __dirname ) + }, + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + use: 'babel-loader', + }, + ], + }, +}; diff --git a/packages/file-upload/tests/site/index.html b/packages/file-upload/tests/site/index.html new file mode 100644 index 000000000..39b1ce4d9 --- /dev/null +++ b/packages/file-upload/tests/site/index.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + + Test: File upload + + + + + + + + + + + ← back to the module index + +

Test: File upload

+ +
+ + +
+ + + + diff --git a/packages/file-upload/tests/site/test.scss b/packages/file-upload/tests/site/test.scss new file mode 100644 index 000000000..139d589bd --- /dev/null +++ b/packages/file-upload/tests/site/test.scss @@ -0,0 +1,8 @@ +//dependencies +@import '../../src/sass/_dependencies.scss'; + +//testing includes +@import '../../../form/src/sass/_module.scss'; + +//styling all test files +@import '../../../../.templates/test-assets/_style.scss'; From 37ac7023ea45e46416e1d767290de5c11f9a223d Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Fri, 5 Apr 2019 11:50:23 +1100 Subject: [PATCH 2/4] Added file-upload to README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index cdcaee5a9..6614edca2 100644 --- a/README.md +++ b/README.md @@ -285,6 +285,22 @@ All components have to work on the below browsers: ---------- +
+ @gov.au/file-upload +
npm install @gov.au/file-upload
+
See the visual test file for file-upload +
See the readme file for file-upload

+ Dependencies: +
+ +```shell +├─ core +└─ form + └─ core +``` +---------- +
+
@gov.au/footer
npm install @gov.au/footer
From ad005d47b6a6875a657c14e17350428bee167e59 Mon Sep 17 00:00:00 2001 From: "Adam A. Zerella" Date: Mon, 8 Apr 2019 09:48:31 +1000 Subject: [PATCH 3/4] Added prop type jsdocs and required --- packages/file-upload/src/js/react.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/file-upload/src/js/react.js b/packages/file-upload/src/js/react.js index acd17615a..c6bdcadee 100644 --- a/packages/file-upload/src/js/react.js +++ b/packages/file-upload/src/js/react.js @@ -29,13 +29,17 @@ const AUfileUpload = ( { id, name, text, ...attributeOptions } ) => ( AUfileUpload.propTypes = { /** - * + * The file input ID */ - id: PropTypes.string, + id: PropTypes.string.isRequired, /** - * + * The label name to match the ID */ - name: PropTypes.string, + name: PropTypes.string.isRequired, + /** + * The label text description + */ + text: PropTypes.string.isRequired, }; From 2766da02ea328bf5e84d7fa37fdb71003439967d Mon Sep 17 00:00:00 2001 From: sukhrajghuman Date: Wed, 10 Apr 2019 09:32:06 +1000 Subject: [PATCH 4/4] update react and sass --- auds.json | 2 +- packages/file-upload/src/js/react.js | 13 ++++--------- packages/file-upload/src/sass/_module.scss | 13 +++---------- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/auds.json b/auds.json index 3cd9d10a6..cdf945e19 100644 --- a/auds.json +++ b/auds.json @@ -1 +1 @@ -{"@gov.au/core":{"name":"@gov.au/core","version":"3.4.0","peerDependencies":{},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/accordion":{"name":"@gov.au/accordion","version":"7.0.7","peerDependencies":{"@gov.au/animate":"^1.0.0","@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-js","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"js":{"path":"lib/js/module.js"},"react":{"path":"lib/js/react.js"}}},"@gov.au/animate":{"name":"@gov.au/animate","version":"1.0.12","peerDependencies":{},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-js","@gov.au/pancake-json"],"js":{"path":"lib/js/module.js"},"sass":{"path":false,"sass-versioning":true}}},"@gov.au/body":{"name":"@gov.au/body","version":"2.1.1","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/breadcrumbs":{"name":"@gov.au/breadcrumbs","version":"3.0.4","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/buttons":{"name":"@gov.au/buttons","version":"3.0.6","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/callout":{"name":"@gov.au/callout","version":"3.0.1","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/control-input":{"name":"@gov.au/control-input","version":"3.0.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/cta-link":{"name":"@gov.au/cta-link","version":"2.1.9","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/direction-links":{"name":"@gov.au/direction-links","version":"2.1.9","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/footer":{"name":"@gov.au/footer","version":"3.0.4","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/grid-12":{"name":"@gov.au/grid-12","version":"2.0.9","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/header":{"name":"@gov.au/header","version":"4.1.11","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/headings":{"name":"@gov.au/headings","version":"2.0.10","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/inpage-nav":{"name":"@gov.au/inpage-nav","version":"3.0.5","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/keyword-list":{"name":"@gov.au/keyword-list","version":"3.0.4","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/link-list":{"name":"@gov.au/link-list","version":"3.0.5","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/main-nav":{"name":"@gov.au/main-nav","version":"1.0.6","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/animate":"^1.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-js","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"js":{"path":"lib/js/module.js"},"react":{"path":"lib/js/react.js"}}},"@gov.au/page-alerts":{"name":"@gov.au/page-alerts","version":"2.1.2","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/progress-indicator":{"name":"@gov.au/progress-indicator","version":"3.1.6","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/responsive-media":{"name":"@gov.au/responsive-media","version":"2.0.13","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/select":{"name":"@gov.au/select","version":"2.0.10","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/side-nav":{"name":"@gov.au/side-nav","version":"5.0.7","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/animate":"^1.0.0","@gov.au/accordion":"^7.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-js","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"js":{"path":"lib/js/module.js"},"react":{"path":"lib/js/react.js"}}},"@gov.au/skip-link":{"name":"@gov.au/skip-link","version":"2.0.15","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/tags":{"name":"@gov.au/tags","version":"3.1.6","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/text-inputs":{"name":"@gov.au/text-inputs","version":"2.1.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}}} +{"@gov.au/core":{"name":"@gov.au/core","version":"3.4.0","peerDependencies":{},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/accordion":{"name":"@gov.au/accordion","version":"7.0.7","peerDependencies":{"@gov.au/animate":"^1.0.0","@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-js","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"js":{"path":"lib/js/module.js"},"react":{"path":"lib/js/react.js"}}},"@gov.au/animate":{"name":"@gov.au/animate","version":"1.0.12","peerDependencies":{},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-js","@gov.au/pancake-json"],"js":{"path":"lib/js/module.js"},"sass":{"path":false,"sass-versioning":true}}},"@gov.au/body":{"name":"@gov.au/body","version":"2.1.1","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/breadcrumbs":{"name":"@gov.au/breadcrumbs","version":"3.0.4","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/buttons":{"name":"@gov.au/buttons","version":"3.0.6","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/callout":{"name":"@gov.au/callout","version":"3.0.1","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/control-input":{"name":"@gov.au/control-input","version":"3.0.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/cta-link":{"name":"@gov.au/cta-link","version":"2.1.9","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/direction-links":{"name":"@gov.au/direction-links","version":"2.1.9","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/file-upload":{"name":"@gov.au/file-upload","version":"0.1.0","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/form":"^0.1.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/footer":{"name":"@gov.au/footer","version":"3.0.4","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/form":{"name":"@gov.au/form","version":"0.1.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/grid-12":{"name":"@gov.au/grid-12","version":"2.0.9","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/header":{"name":"@gov.au/header","version":"4.1.11","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/headings":{"name":"@gov.au/headings","version":"2.0.10","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/inpage-nav":{"name":"@gov.au/inpage-nav","version":"3.0.5","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/keyword-list":{"name":"@gov.au/keyword-list","version":"3.0.4","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/link-list":{"name":"@gov.au/link-list","version":"3.0.5","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/main-nav":{"name":"@gov.au/main-nav","version":"1.0.6","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/animate":"^1.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-js","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"js":{"path":"lib/js/module.js"},"react":{"path":"lib/js/react.js"}}},"@gov.au/page-alerts":{"name":"@gov.au/page-alerts","version":"2.1.2","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/progress-indicator":{"name":"@gov.au/progress-indicator","version":"3.1.6","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/responsive-media":{"name":"@gov.au/responsive-media","version":"2.0.13","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true}}},"@gov.au/select":{"name":"@gov.au/select","version":"2.0.10","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/side-nav":{"name":"@gov.au/side-nav","version":"5.0.7","peerDependencies":{"@gov.au/core":"^3.0.0","@gov.au/animate":"^1.0.0","@gov.au/accordion":"^7.0.0","@gov.au/link-list":"^3.0.0","@gov.au/body":"^2.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-js","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"js":{"path":"lib/js/module.js"},"react":{"path":"lib/js/react.js"}}},"@gov.au/skip-link":{"name":"@gov.au/skip-link","version":"2.0.15","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/tags":{"name":"@gov.au/tags","version":"3.1.6","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}},"@gov.au/text-inputs":{"name":"@gov.au/text-inputs","version":"2.1.0","peerDependencies":{"@gov.au/core":"^3.0.0"},"pancake-module":{"version":"1.0.0","plugins":["@gov.au/pancake-sass","@gov.au/pancake-react","@gov.au/pancake-json"],"sass":{"path":"lib/sass/_module.scss","sass-versioning":true},"react":{"path":"lib/js/react.js"}}}} \ No newline at end of file diff --git a/packages/file-upload/src/js/react.js b/packages/file-upload/src/js/react.js index c6bdcadee..a70ece30e 100644 --- a/packages/file-upload/src/js/react.js +++ b/packages/file-upload/src/js/react.js @@ -13,16 +13,15 @@ import PropTypes from 'prop-types'; /** * The file upload component - * + * * @param {string} id - The label ID, required - * @param {string} name - The input name to match the ID, required * @param {string} text - Text of the label, required * @param {object} attributeOptions - Any other attribute options */ -const AUfileUpload = ( { id, name, text, ...attributeOptions } ) => ( -
+const AUfileUpload = ( { id, text, ...attributeOptions } ) => ( +
- +
); @@ -32,10 +31,6 @@ AUfileUpload.propTypes = { * The file input ID */ id: PropTypes.string.isRequired, - /** - * The label name to match the ID - */ - name: PropTypes.string.isRequired, /** * The label text description */ diff --git a/packages/file-upload/src/sass/_module.scss b/packages/file-upload/src/sass/_module.scss index d58ee4a09..22ab039b5 100644 --- a/packages/file-upload/src/sass/_module.scss +++ b/packages/file-upload/src/sass/_module.scss @@ -11,13 +11,6 @@ @import '_globals.scss'; @import '_print.scss'; -.au-file-upload{ - - .au-label { - margin-bottom: 0.25rem; - } - - .au-file-input { - display: block; - } -} \ No newline at end of file +.au-file-input { + @include AU-fontgrid( sm, 'nospace' ); +}