Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit c4a040a

Browse files
docs: Fix and finalize all READMEs and package.json files (#98)
- Add instructions to main README to get up and running quickly - Amend Contributing guidelines to point to overall Material Components Contributing guidelines - Ensure that all package.json files for components have repository, license, and description keys. - Add installation instructions for every component README
1 parent 649e836 commit c4a040a

File tree

45 files changed

+301
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+301
-111
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Contributing to Material Components Web (MDC-Web)
22

3-
We'd love for you to contribute to our source code and to make Material Components Web even better than it is today! Here are the guidelines we'd like you to follow:
3+
We'd love for you to contribute and make Material Components for the web even better than it is today!
4+
Here are the guidelines we'd like you to follow:
45

56

6-
- [Code of Conduct](#code-of-conduct)
7+
- [General Contributing Guidelines](#general-contributing-guidelines)
78
- [Development Process](#development-process)
89
- [Setting up your development environment](#setting-up-your-development-environment)
910
- [Building Components](#building-components)
@@ -12,17 +13,13 @@ We'd love for you to contribute to our source code and to make Material Componen
1213
- [Linting / Testing / Coverage Enforcement](#linting--testing--coverage-enforcement)
1314
- [Running Tests across browsers](#running-tests-across-browsers)
1415
- [Coding Style](#coding-style)
15-
- [Signing the CLA](#signing-the-cla)
1616
- [Submitting Pull Requests](#submitting-pull-requests)
1717
- [Releasing MDC-Web](#releasing-mdc-web)
18-
- [Questions / Problems](#questions--problems)
19-
- [Issues / Bugs](#issues--bugs)
2018
- ["What's the core team up to?"](#whats-the-core-team-up-to)
2119

22-
## Code of Conduct
20+
## General Contributing Guidelines
2321

24-
We follow the [Material Components Code of Conduct](https://github.com/material-components/material-components/blob/develop/CONDUCT.md), and expect the same from all of our
25-
community members.
22+
The Material Components contributing policies and procedures can be found in the main Material Components documentation repository’s [contributing page](https://github.com/material-components/material-components/blob/develop/CONTRIBUTING.md).
2623

2724
## Development Process
2825

@@ -103,19 +100,9 @@ Alternatively, you can run `npm run test:watch` and manually open browsers / use
103100

104101
Our entire coding style is enforced automatically through the use of linters. Check out our [eslint config](https://github.com/material-components/material-components-web/blob/master/.eslintrc.yaml) (heavily influenced by [Google's Javascript Styleguide][js-style-guide]) as well as our [stylelint config][css-style-guide] (heavily annotated, with justifications for each rule) for further details.
105102

106-
### Signing the CLA
107-
108-
Please sign our Contributor License Agreement (CLA) before sending pull requests. For any code
109-
changes to be accepted, the CLA must be signed. It's a quick process, we promise!
110-
111-
* For individuals we have a [simple click-through form][individual-cla].
112-
* For corporations we'll need you to
113-
[print, sign and one of scan+email, fax or mail the form][corporate-cla].
114-
115-
116103
### Submitting Pull Requests
117104

118-
We prefer small, incremental changes over large, sweeping ones, so please try to adhere to this when submitting PRs. Also, make sure you're following our commit message conventions (which are the same as [angular's](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit)); our `commit-msg` hook should automatically enforce this. We also support [commitizen](https://www.npmjs.com/package/commitizen), which you can
105+
When submitting PRs, make sure you're following our commit message conventions (which are the same as [angular's](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit)); our `commit-msg` hook should automatically enforce this. We also support [commitizen](https://www.npmjs.com/package/commitizen), which you can
119106
use to auto-format commit messages for you.
120107

121108
If you've done some experimental work on your branch/fork and committed these via `git commit --no-verify`, you can rebase them into one correctly-formatted commit before submitting.
@@ -124,10 +111,6 @@ Finally, it helps to make sure that your branch/fork is up to date with what's c
124111

125112
> **NOTE**: Please do _not merge_ master into your branch. _Always_ `pull --rebase` instead. This ensures a linear history by always putting the work you've done after the work that's already on master, regardless of the date in which those commits were made.
126113
127-
To submit code, open a PR for your fork/branch against `master`.
128-
129-
Once you've submitted a PR, it'll be assigned to a core team member for review. If all CI tests pass and you get a `LGTM` from a reviewer, your code will be merged into master.
130-
131114
### Releasing MDC-Web
132115

133116
> NOTE: This section is for collaborators only. Contributors without repo write access can ignore
@@ -148,40 +131,12 @@ To release MDC-Web, you should perform the following steps.
148131
current release of the overarching `material-components-web` library, and commit those changes.
149132
4. Push the changelog changes to master, and call it a day!
150133

151-
## Questions / Problems
152-
153-
If you have questions about how to use Material Components Web, please direct these to [StackOverflow][stackoverflow] and use the `material-components-web` tag.
154-
155-
If you feel that we're missing an important bit of documentation, feel free to
156-
file an issue so we can help. Here's an example to get you started:
157-
158-
```
159-
Component (if any):
160-
161-
What are you trying to do or find out more about?
162-
163-
Where have you looked?
164-
165-
Where did you expect to find this information?
166-
```
167-
168-
## Issues / Bugs
169-
170-
If you find a bug in the source code or a mistake in the documentation, you can help us by
171-
submitting an issue to our [GitHub Repository][github]. Even better, you can submit a Pull Request with a fix. Before submitting issues, please ensure that you've read through our [issue template](https://github.com/material-components/material-components-web/blob/master/.github/ISSUE_TEMPLATE.md) to ensure a fast and helpful response from the maintainers.
172-
173134
## "What's the core team up to?"
174135

175136
The core team maintains a [public Pivotal Tracker](https://www.pivotaltracker.com/n/projects/1664011) (**tracker** for short) which details all the items we're working on within our current two-week [iteration](https://www.agilealliance.org/glossary/iteration/). This tracker mirrors in what's in our GH issues. It is used _purely for planning and prioritization purposes, **not** for discussions or community issue filing_. That being said, it's a great place to look at the overall state of our project as well as some the big ticket issues we're working on.
176137

177138
Each tracker story contains a link to its corresponding GH issue within its description. Each GH issue present in tracker is tagged with an `in-tracker` label. This will hopefully make it easy to move between the two if so desired.
178139

179140

180-
[github]: https://github.com/material-components/material-components-web
181-
[individual-cla]: http://code.google.com/legal/individual-cla-v1.0.html
182-
[corporate-cla]: http://code.google.com/legal/corporate-cla-v1.0.html
183141
[js-style-guide]: https://google.github.io/styleguide/jsguide.html
184142
[css-style-guide]: https://github.com/material-components/material-components-web/blob/master/.stylelintrc.yaml
185-
[jsbin]: http://jsbin.com/
186-
[stackoverflow]: http://stackoverflow.com/questions/tagged/material-components-web
187-
[global-gitignore]: https://help.github.com/articles/ignoring-files/#create-a-global-gitignore

README.md

Lines changed: 117 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Material Components for the web
22

3-
Material Components for the web (MDC-Web) help developers execute [Material Design](https://www.material.io).
3+
Material Components for the web (MDC-Web) help developers execute [Material Design](https://www.material.io).
44
Developed by a core team of engineers and UX designers at Google, these components enable a reliable development workflow to build beautiful and functional web projects.
55

66
Material Components for the web is the successor to [Material Design Lite](https://getmdl.io/), and has 3 high-level goals:
@@ -9,18 +9,114 @@ Material Components for the web is the successor to [Material Design Lite](https
99
- Best-in-class performance and adherence to the [Material Design guidelines](https://material.google.com)
1010
- Seamless integration with other JS frameworks and libraries
1111

12-
## Useful Links
12+
## Quick start
1313

14-
- [Developer's Guide](docs/developer.md)
15-
- [All Components](packages/)
16-
- [Demos](demos/)
17-
- [Framework Integration Examples](framework-examples/)
18-
- [Contributing](CONTRIBUTING.md)
19-
- [MDC-Web on Stack Overflow](https://stackoverflow.com/questions/tagged/material-components+web)
20-
- [Material.io](https://www.material.io) (external site)
21-
- [Material Design Guidelines](https://material.google.com) (external site)
14+
Install the library
15+
16+
```
17+
npm install --save material-components-web
18+
```
19+
20+
Then simply include the correct files, write some HTML, and call `mdc.autoInit()` within a closing
21+
`<script>` tag.
22+
23+
```html
24+
<!DOCTYPE html>
25+
<html class="mdc-typography">
26+
<head>
27+
<title>Material Components for the web</title>
28+
<link rel="stylesheet"
29+
href="node_modules/material-components-web/dist/material-components-web.css">
30+
</head>
31+
<body>
32+
<h2 class="mdc-typography--display2">Hello, Material Components!</h2>
33+
<div class="mdc-textfield" data-mdc-auto-init="MDCTextfield">
34+
<input type="text" class="mdc-textfield__input" id="demo-input">
35+
<label for="demo-input" class="mdc-textfield__label">Tell us how you feel!</label>
36+
</div>
37+
<script src="node_modules/material-components-web/dist/material-components-web.js"></script>
38+
<script>mdc.autoInit()</script>
39+
</body>
40+
</html>
41+
```
42+
43+
That's all there is to it! This is the easiest way to get up and running with Material Components
44+
for web. Check out our [Getting Started guide](./docs/getting-started.md) for a more in-depth
45+
introduction to the library.
46+
47+
## Installing invidual components
48+
49+
MDC-Web is modular by design. Each component lives within its own packages under the
50+
[@material npm scope](https://www.npmjs.com/~material).
51+
52+
```
53+
npm install --save @material/button @material/card @material/textfield @material/typography
54+
```
55+
56+
All our components can be found in the [packages](./packages) directory. Each component has a
57+
README documenting installation and usage.
58+
59+
## Including components
60+
61+
### Javascript
62+
63+
If you are using a module loader such as Webpack or SystemJS to load your JS modules, you can simply
64+
`import` every component you need from `material-components-web` and use it as such.
65+
66+
```js
67+
import {checkbox as mdcCheckbox} from 'material-components-web';
68+
69+
const {MDCCheckbox, MDCCheckboxFoundation} = mdcCheckbox;
70+
// Use MDCCheckbox and/or MDCCheckboxFoundation
71+
```
2272

23-
## Getting Started
73+
You can do the same with individual components
74+
75+
```js
76+
import {MDCCheckbox, MDCCheckboxFoundation} from '@material/checkbox';
77+
// Use MDCCheckbox and/or MDCCheckboxFoundation
78+
```
79+
80+
We also provide [UMD](http://bob.yexley.net/umd-javascript-that-runs-anywhere/) bundles for both `material-components-web` as
81+
well as all individual components.
82+
83+
```js
84+
const {checkbox: mdcCheckbox} = require('material-components-web/dist/material-components-web');
85+
// Use mdcCheckbox
86+
87+
const {MDCCheckbox, MDCCheckboxFoundation} = require('@material/checkbox/dist/mdc.checkbox');
88+
// Use MDCCheckbox, MDCCheckboxFoundation
89+
```
90+
91+
When no module system is used, every component is added under the global `mdc` namespace. This
92+
occurs regardless of whether or not the entire library or the individual components are used.
93+
94+
Every component also ships with a minified version of its UMD bundle, which can be found at
95+
`dist/mdc.COMPONENT.min.js`.
96+
97+
### CSS
98+
99+
All components which include styles provide them at `dist/mdc.COMPONENT.css`, as well as a
100+
complementary minified version at `dist/mdc.COMPONENT.min.css`. Note that _CSS files for a
101+
component's dependencies are not included within the component's CSS file_, so if you are using
102+
individual components you'll have to include each separately.
103+
104+
Each component also comes with a Sass source file that can be included in your application's Sass
105+
106+
```scss
107+
// Using the whole library
108+
@import 'material-components-web';
109+
110+
// Using individual components / mixins
111+
@import '@material/checkbox';
112+
@import '@material/typography';
113+
@import '@material/elevation/mixins'; // Mixins for elevation.
114+
```
115+
116+
> NOTE: The components' sass files expect that the `node_modules` directory containing the
117+
`@material` scope folder is present on the sass include path.
118+
119+
## Running the demos
24120

25121
Setup the repo:
26122

@@ -37,6 +133,16 @@ npm run dev
37133
open http://localhost:8080
38134
```
39135

136+
## Useful Links
137+
138+
- [Developer's Guide](docs/developer.md)
139+
- [All Components](packages/)
140+
- [Demos](demos/)
141+
- [Framework Integration Examples](framework-examples/)
142+
- [Contributing](CONTRIBUTING.md)
143+
- [Material.io](https://www.material.io) (external site)
144+
- [Material Design Guidelines](https://material.google.com) (external site)
145+
40146
## Browser Support
41147

42148
- Chrome

packages/material-components-web/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ sibling packages up into one comprehensive library for convenience.
55

66
## Installation
77

8-
> Installation via npm will be available post-alpha.
8+
```
9+
npm install --save material-components-web
10+
```
911

1012
## Usage
1113

packages/material-components-web/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
22
"name": "material-components-web",
3-
"description": "Production-quality UI components for the web platform",
3+
"description": "Modular and customizable Material Design UI components for the web",
44
"version": "0.1.0",
55
"license": "Apache-2.0",
66
"main": "index.js",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/material-components/material-components-web"
10+
},
711
"dependencies": {
812
"@material/animation": "^0.1.0",
913
"@material/auto-init": "^0.1.0",

packages/mdc-animation/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ mdc-animation is a sass / css library which provides variables, mixins, and clas
44

55
## Installation
66

7-
> Note: Installation via the npm registry will be available after alpha.
7+
```
8+
npm install --save @material/animation
9+
```
810

911
## Usage
1012

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"name": "@material/animation",
3-
"description": "Animation Variables and Mixins for Material Design",
3+
"description": "Animation Variables and Mixins used by Material Components for the web",
44
"version": "0.1.0",
55
"license": "Apache-2.0",
6-
"devDependencies": {}
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/material-components/material-components-web.git"
9+
}
710
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"name": "@material/auto-init",
3+
"description": "Declarative, easy-to-use auto-initialization for Material Components for the web",
34
"version": "0.1.0",
45
"main": "index.js",
56
"license": "Apache-2.0",
6-
"description": "data-mdc-auto-init=<globalComponentName>"
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/material-components/material-components-web.git"
10+
}
711
}

packages/mdc-base/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Most of the time, you shouldn't need to depend on `mdc-base` directly. It is use
88

99
First install the module:
1010

11-
> NOTE: Installation via the npm registry will be available after alpha.
11+
```
12+
npm install --save @material/base
13+
```
1214

1315
Then include it in your code in one of the following ways:
1416

packages/mdc-base/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"name": "@material/base",
3-
"description": "The set of base classes for Material Components Web",
3+
"description": "The set of base classes for Material Components for the web",
44
"version": "0.1.0",
55
"license": "Apache-2.0",
6-
"main": "index.js"
6+
"main": "index.js",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/material-components/material-components-web.git"
10+
}
711
}

packages/mdc-button/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ The MDC Button component is a spec-aligned button component adhering to the
77

88
## Installation
99

10-
> Note: Installation via the npm registry will be available after alpha.
10+
```
11+
npm install --save @material/button
12+
```
1113

1214
## Usage
1315

0 commit comments

Comments
 (0)