Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
louy committed Oct 10, 2015
2 parents 3cd46aa + 2b6c3f7 commit 0a3fa60
Show file tree
Hide file tree
Showing 177 changed files with 4,767 additions and 2,007 deletions.
93 changes: 48 additions & 45 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
{
"env": {
"es6": true,
"browser": true,
"node": true
},
"rules": {
"comma-dangle": [2, "always-multiline"],
"no-var": 2,
"eqeqeq": [2, "allow-null"],
"eol-last": 2,
"yoda": 2,
"no-unused-expressions": 2,
"dot-notation": 2,
"dot-location": [2, "property"],
"no-undef": 2,
"comma-spacing": 2,
"jsx-quotes": [2, "prefer-double"],
env:
es6: true
browser: true
node: true

"key-spacing": 0,
"no-underscore-dangle": 0,
"no-shadow": 0,
"no-shadow-restricted-names": 0,
"no-extend-native": 0,
"curly": 0,
"new-cap": 0,
"quotes": 0,
"semi-spacing": 0,
"space-unary-ops": 0,
"space-infix-ops": 0,
"consistent-return": 0,
"strict": 0,
rules:
# Errors
comma-dangle: [2, always-multiline]
no-var: 2
eqeqeq: [2, allow-null]
eol-last: 2
yoda: 2
no-unused-expressions: 2
dot-notation: 2
dot-location: [2, property]
no-undef: 2
comma-spacing: 2
jsx-quotes: [2, prefer-double]

"react/jsx-boolean-value": 0,
"react/jsx-curly-spacing": 2,
"react/jsx-max-props-per-line": [2, {maximum: 4}],
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-undef": 2,
},
"parser": "babel-eslint",
"plugins": [
"react"
],
"ecmaFeatures": {
"jsx": true
}
}
# Disabled
key-spacing: 0
no-underscore-dangle: 0
no-shadow: 0
no-shadow-restricted-names: 0
no-extend-native: 0
curly: 0
new-cap: 0
quotes: 0
semi-spacing: 0
space-unary-ops: 0
space-infix-ops: 0
consistent-return: 0
strict: 0

# React
react/jsx-curly-spacing: 2
react/jsx-max-props-per-line: [2, {maximum: 4}]
react/jsx-no-duplicate-props: 2
react/jsx-no-undef: 2

# React disabled
react/jsx-boolean-value: 0

parser: babel-eslint

plugins:
- react

ecmaFeatures:
jsx: true
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,62 @@
## 0.12.3
###### _Oct 7, 2015_

##### Component Fixes / Enhancements
- Quick-fix version until react 0.14 support is somewhat stable
- Changed react dependency to ~0.13 in package.json (#1836)

## 0.12.2
###### _Oct 6, 2015_

##### General
- NEW GridList component and documentation! Thanks to @igorbt (#1320)

##### Component Fixes / Enhancements
- Added back canvasColor to theme palette (#1762)
- Added hintStyle prop to TextField (#1510)
- Add isScrollbarVisible function to table (#1539)
- Add rowsMax prop to EnhancedTextarea (#1562)
- Tab "item three" renamed on docs site (#1775)
- Fixed docs server to run on Windows (#1774)
- FlatButton now has a backgroundColor prop (#1561)
- Fixed DropdownMenu buggy value prop check (#1768)

## 0.12.1
###### _Sep 28, 2015_

##### Component Fixes / Enhancements
- Fix broken documentation site
- Fix theme display switch problem in doc (#1696)
- Fix typo in src/card-expandable.jsx (#1724)
- Fix broken link to v0.12.0 release tag
- Use correct require calls
- for react addons (#1729)
- for raw themes (#1742)
- Remove hard-coded color values from theme-manager
- Use consistent values from raw theme (#1746)

## 0.12.0
###### _Sep 25, 2015_

##### Breaking Changes
- Theming has been re-done so that material-ui components can be used without having to worry about passing a theme (all components implement a default theme) (#1662)
- There's now a concept of `mui theme` and `raw theme`, `mui theme` is produced from `raw theme`
- `ThemeManager` has been changed, no longer needs `new` in call
- `ThemeManager` produces `mui theme` from `raw theme`. Raw themes may be user-defined.
- Functions in `ThemeManager` allow to modify theme variables. Component-level styles may be overriden in the `mui theme`.
- See new documentation [here](http://material-ui.com/#/customization/themes)
- Function names in the context-pure mixin have been changed (#1711)
- `getContextProps()` has been changed to `getRelevantContextKeys()`

##### General
- Updated dependency of `react-tap-event-plugin` (#1714)

##### Component Fixes / Enhancements
- Dialog component (#1717)
- `actions` now has `id` property
- Fixed a bug in dialog where a faulty check caused an error in console
- Text field ipad scrolling in dialog

## 0.11.1
###### _Sep 15, 2015_

Expand Down
43 changes: 8 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,60 +41,33 @@ Material-UI was designed with the [Roboto](http://www.google.com/fonts/specimen/

## Usage

Once material-ui is included in your project, you can use the components this way:
Using material-ui components is very straightforward. Once material-ui is included in your project, you can use the components this way:

```js
// get constant references to React and Material-UI
// components, as we will not be modifying these
//Basic React component that renders a material-ui
//raised button with the text "Default"

const React = require('react');

// it is good practice to require only those components of
// Material-UI that your app needs, instead of requiring all of
// Material-UI. This will make your build process faster and
// your build output smaller

const RaisedButton = require('material-ui/lib/raised-button');

// see node_modules/material-ui/lib/index.js for a mapping of
// Material-UI components to require() calls

const MyAwesomeReactComponent = React.createClass({

childContextTypes: {
muiTheme: React.PropTypes.object
},

getChildContext() {
return {
muiTheme: ThemeManager.getCurrentTheme()
};
},

render() {
return (
<RaisedButton label="Default" />
);
}

},
});


module.exports = MyAwesomeReactComponent;

```

### Theme

**Please note that since v0.8.0, you also need to define a theme for components to start working.** For instructions on implementing and using themes, visit our [documentation](http://material-ui.com/#/customization/themes).

## Customization

Material-UI components have their styles defined inline. There are two approaches to overriding these styles:

* Override individual component styles via the `style` prop
* Define a Theme to apply overarching style changes
We have implemented a default theme to render all Material-UI components. Styling components to your liking is simple and hassle-free. This can be achieved in the following two ways:

This allows you to override variables used by components without having to modify material-ui source files directly.
* [Use a custom theme to style components](http://material-ui.com/#/customization/themes)
* [Override individual component styles via the `style` prop](http://material-ui.com/#/customization/inline-styles)

## Examples

Expand Down
5 changes: 3 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "material-ui-docs",
"version": "0.11.1",
"version": "0.12.3",
"description": "Documentation site for material-ui",
"repository": {
"type": "git",
Expand All @@ -9,7 +9,8 @@
"scripts": {
"prestart": "webpack-dev-server --config webpack-dev-server.config.js --progress --colors --inline",
"start": "open http://localhost:3000",
"build": "webpack --config webpack-production.config.js --progress --colors --profile"
"build": "webpack --config webpack-production.config.js --progress --colors --profile",
"prd": "webpack-dev-server --config webpack-production.config.js --progress --colors --profile"
},
"dependencies": {
"codemirror": "^5.5.0"
Expand Down
2 changes: 2 additions & 0 deletions docs/src/app/app-routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ let Cards = require('./components/pages/components/cards');
let DatePicker = require('./components/pages/components/date-picker');
let Dialog = require('./components/pages/components/dialog');
let DropDownMenu = require('./components/pages/components/drop-down-menu');
let GridList = require('./components/pages/components/grid-list');
let Icons = require('./components/pages/components/icons');
let IconButtons = require('./components/pages/components/icon-buttons');
let IconMenus = require('./components/pages/components/icon-menus');
Expand Down Expand Up @@ -79,6 +80,7 @@ let AppRoutes = (
<Route name="date-picker" handler={DatePicker} />
<Route name="dialog" handler={Dialog} />
<Route name="dropdown-menu" handler={DropDownMenu} />
<Route name="grid-list" handler={GridList} />
<Route name="icons" handler={Icons} />
<Route name="icon-buttons" handler={IconButtons} />
<Route name="icon-menus" handler={IconMenus} />
Expand Down
49 changes: 33 additions & 16 deletions docs/src/app/components/code-example/code-block.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
let React = require('react');
let { Styles } = require('material-ui');
let { Spacing } = Styles;
const React = require('react');
const { Styles } = require('material-ui');
const { Spacing } = Styles;


class CodeBlock extends React.Component {
const CodeBlock = React.createClass({

constructor() {
super();
this.componentDidMount = this.componentDidMount.bind(this);
}
contextTypes : {
muiTheme: React.PropTypes.object
},

//for passing default theme context to children
childContextTypes: {
muiTheme: React.PropTypes.object,
},

getChildContext () {
return {
muiTheme: this.state.muiTheme,
};
},

getInitialState () {
return {
muiTheme: this.context.muiTheme ? this.context.muiTheme : ThemeManager.getMuiTheme(DefaultRawTheme),
};
},

componentWillReceiveProps (nextProps, nextContext) {
let newMuiTheme = nextContext.muiTheme ? nextContext.muiTheme : this.state.muiTheme;
this.setState({muiTheme: newMuiTheme});
},

componentDidMount() {
var code = React.findDOMNode(this.refs.code);
Expand All @@ -21,21 +42,17 @@ class CodeBlock extends React.Component {
readOnly: true,
});
});
}
},

shouldComponentUpdate({children}, nextState){
return this.props.children !== children;
}
},

render() {
return (
<textarea ref="code" value={this.props.children} readOnly={true}/>
);
}
}

CodeBlock.contextTypes = {
muiTheme: React.PropTypes.object
}
},
});

module.exports = CodeBlock;
Loading

0 comments on commit 0a3fa60

Please sign in to comment.