Skip to content

Commit

Permalink
Merge branch 'master' into cursor-styling-for-disabled-components
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Shulipa committed May 16, 2016
2 parents 15e4a22 + e7d1fa6 commit 74cec1d
Show file tree
Hide file tree
Showing 1,017 changed files with 1,798 additions and 124 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ check out the [docs folder](https://github.com/callemall/material-ui/tree/master
We'd greatly appreciate any [contribution](https://github.com/callemall/material-ui/blob/master/CONTRIBUTING.md)
you make. :)

## Thanks

[<img src="https://www.browserstack.com/images/mail/browserstack-logo-footer.png" width="120">](https://www.browserstack.com/)
Thank you to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to test `material-ui` in real browsers.

## License
This project is licensed under the terms of the
[MIT license](https://github.com/callemall/material-ui/blob/master/LICENSE)
2 changes: 2 additions & 0 deletions docs/src/app/AppRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import AutoCompletePage from './components/pages/components/AutoComplete/Page';
import AvatarPage from './components/pages/components/Avatar/Page';
import BadgePage from './components/pages/components/Badge/Page';
import CardPage from './components/pages/components/Card/Page';
import ChipPage from './components/pages/components/Chip/Page';
import CircularProgressPage from './components/pages/components/CircularProgress/Page';
import CheckboxPage from './components/pages/components/Checkbox/Page';
import DatePicker from './components/pages/components/DatePicker/Page';
Expand Down Expand Up @@ -98,6 +99,7 @@ const AppRoutes = (
<Route path="avatar" component={AvatarPage} />
<Route path="badge" component={BadgePage} />
<Route path="card" component={CardPage} />
<Route path="chip" component={ChipPage} />
<Route path="circular-progress" component={CircularProgressPage} />
<Route path="checkbox" component={CheckboxPage} />
<Route path="date-picker" component={DatePicker} />
Expand Down
3 changes: 2 additions & 1 deletion docs/src/app/components/AppNavDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class AppNavDrawer extends Component {
docked={docked}
open={open}
onRequestChange={onRequestChangeNavDrawer}
containerStyle={{zIndex: zIndex.navDrawer - 100}}
containerStyle={{zIndex: zIndex.drawer - 100}}
>
<div style={styles.logo} onTouchTap={this.handleTouchTapHeader}>
Material-UI
Expand Down Expand Up @@ -181,6 +181,7 @@ class AppNavDrawer extends Component {
]}
/>,
<ListItem primaryText="Card" value="/components/card" />,
<ListItem primaryText="Chip" value="/components/chip" />,
<ListItem primaryText="Date Picker" value="/components/date-picker" />,
<ListItem primaryText="Dialog" value="/components/dialog" />,
<ListItem primaryText="Divider" value="/components/divider" />,
Expand Down
22 changes: 20 additions & 2 deletions docs/src/app/components/Master.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ class Master extends Component {
color: lightWhite,
maxWidth: 356,
},
browserstack: {
display: 'flex',
alignItems: 'flex-start',
justifyContent: 'center',
margin: '25px 15px 0',
padding: 0,
color: lightWhite,
lineHeight: '25px',
fontSize: 12,
},
browserstackLogo: {
margin: '0 3px',
},
iconButton: {
color: darkWhite,
},
Expand Down Expand Up @@ -163,7 +176,6 @@ class Master extends Component {
<IconButton
iconClassName="muidocs-icon-custom-github"
href="https://github.com/callemall/material-ui"
linkButton={true}
/>
}
style={styles.appBar}
Expand Down Expand Up @@ -205,8 +217,14 @@ class Master extends Component {
iconStyle={styles.iconButton}
iconClassName="muidocs-icon-custom-github"
href="https://github.com/callemall/material-ui"
linkButton={true}
/>
<p style={prepareStyles(styles.browserstack)}>
{'Thank you to '}
<a href="https://www.browserstack.com" style={prepareStyles(styles.browserstackLogo)} target="_blank">
<img src="http://www.browserstack.com/images/layout/logo.png" height="25" width="auto" />
</a>
{' for providing real browser testing infrastructure.'}
</p>
</FullWidthSection>
</div>
);
Expand Down
2 changes: 0 additions & 2 deletions docs/src/app/components/pages/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class HomePage extends Component {
className="demo-button"
label="Demo"
onTouchTap={this.handleTouchTapDemo}
linkButton={true}
style={styles.demoStyle}
labelStyle={styles.label}
/>
Expand Down Expand Up @@ -192,7 +191,6 @@ class HomePage extends Component {
<RaisedButton
label="GitHub"
primary={true}
linkButton={true}
href="https://github.com/callemall/material-ui"
style={styles.button}
/>
Expand Down
61 changes: 61 additions & 0 deletions docs/src/app/components/pages/components/Chip/ExampleArray.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import React from 'react';
import Chip from 'material-ui/Chip';

/**
* An example of rendering multiple Chips from an array of values. Deleting a chip removes it from the array.
* Note that since no `onTouchTap` property is defined, the Chip can be focused, but does not gain depth
* while clicked or touched.
*/
export default class ChipExampleArray extends React.Component {

constructor(props) {
super(props);
this.state = {chipData: [
{key: 0, label: 'Angular'},
{key: 1, label: 'JQuery'},
{key: 2, label: 'Polymer'},
{key: 3, label: 'ReactJS'},
]};
this.styles = {
chip: {
margin: 4,
},
wrapper: {
display: 'flex',
flexWrap: 'wrap',
},
};
}

handleRequestDelete = (key) => {
if (key === 3) {
alert('Why would you want to delete React?! :)');
return;
}

this.chipData = this.state.chipData;
const chipToDelete = this.chipData.map((chip) => chip.key).indexOf(key);
this.chipData.splice(chipToDelete, 1);
this.setState({chipData: this.chipData});
};

renderChip(data) {
return (
<Chip
key={data.key}
onRequestDelete={() => this.handleRequestDelete(data.key)}
style={this.styles.chip}
>
{data.label}
</Chip>
);
}

render() {
return (
<div style={this.styles.wrapper}>
{this.state.chipData.map(this.renderChip, this)}
</div>
);
}
}
105 changes: 105 additions & 0 deletions docs/src/app/components/pages/components/Chip/ExampleSimple.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import React from 'react';
import Avatar from 'material-ui/Avatar';
import Chip from 'material-ui/Chip';
import FontIcon from 'material-ui/FontIcon';
import SvgIconFace from 'material-ui/svg-icons/action/face';
import {blue300, indigo900} from 'material-ui/styles/colors';

const styles = {
chip: {
margin: 4,
},
wrapper: {
display: 'flex',
flexWrap: 'wrap',
},
};

function handleRequestDelete() {
alert('You clicked the delete button.');
}

function handleTouchTap() {
alert('You clicked the Chip.');
}

/**
* Examples of Chips, using an image [Avatar](/#/components/font-icon), [Font Icon](/#/components/font-icon) Avatar,
* [SVG Icon](/#/components/svg-icon) Avatar, "Letter" (string) Avatar, and with custom colors.
*
* Chips with the `onRequestDelete` property defined will display a delete icon.
*/
export default class ChipExampleSimple extends React.Component {

render() {
return (
<div style={styles.wrapper}>

<Chip
style={styles.chip}
>
Text Chip
</Chip>

<Chip
onRequestDelete={handleRequestDelete}
onTouchTap={handleTouchTap}
style={styles.chip}
>
Deletable Text Chip
</Chip>

<Chip
onTouchTap={handleTouchTap}
style={styles.chip}
>
<Avatar src="images/uxceo-128.jpg" />
Image Avatar Chip
</Chip>

<Chip
onRequestDelete={handleRequestDelete}
onTouchTap={handleTouchTap}
style={styles.chip}
>
<Avatar src="images/ok-128.jpg" />
Deletable Avatar Chip
</Chip>

<Chip
onTouchTap={handleTouchTap}
style={styles.chip}
>
<Avatar icon={<FontIcon className="material-icons">perm_identity</FontIcon>} />
FontIcon Avatar Chip
</Chip>

<Chip
onRequestDelete={handleRequestDelete}
onTouchTap={handleTouchTap}
style={styles.chip}
>
<Avatar color="#444" icon={<SvgIconFace />} />
SvgIcon Avatar Chip
</Chip>

<Chip onTouchTap={handleTouchTap} style={styles.chip}>
<Avatar size={32}>A</Avatar>
Text Avatar Chip
</Chip>

<Chip
backgroundColor={blue300}
onRequestDelete={handleRequestDelete}
onTouchTap={handleTouchTap}
style={styles.chip}
>
<Avatar size={32} color={blue300} backgroundColor={indigo900}>
MB
</Avatar>
Colored Chip
</Chip>
</div>
);
}
}
35 changes: 35 additions & 0 deletions docs/src/app/components/pages/components/Chip/Page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';
import Title from 'react-title-component';

import CodeExample from '../../../CodeExample';
import PropTypeDescription from '../../../PropTypeDescription';
import MarkdownElement from '../../../MarkdownElement';

import chipReadmeText from './README';
import ChipExampleSimple from './ExampleSimple';
import chipExampleSimpleCode from '!raw!./ExampleSimple';
import ChipExampleArray from './ExampleArray';
import chipExampleArrayCode from '!raw!./ExampleArray';
import chipCode from '!raw!material-ui/Chip/Chip';

const ChipPage = () => (
<div>
<Title render={(previousTitle) => `Chip - ${previousTitle}`} />
<MarkdownElement text={chipReadmeText} />
<CodeExample
code={chipExampleSimpleCode}
title="Example Chips"
>
<ChipExampleSimple />
</CodeExample>
<CodeExample
code={chipExampleArrayCode}
title="Example array"
>
<ChipExampleArray />
</CodeExample>
<PropTypeDescription code={chipCode} />
</div>
);

export default ChipPage;
10 changes: 10 additions & 0 deletions docs/src/app/components/pages/components/Chip/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Chip

[Chips](https://www.google.com/design/spec/components/chips.html)
represent complex entities in small blocks, such as a contact.

While included here as a standalone component, the most common use will
be in some form of input, so some of the behaviour demonstrated is not
shown in context.

### Examples
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const FlatButtonExampleComplex = () => (

<FlatButton
label="GitHub Link"
linkButton={true}
href="https://github.com/callemall/material-ui"
secondary={true}
icon={<FontIcon className="muidocs-icon-custom-github" />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const FlatButtonExampleIcon = () => (
style={style}
/>
<FlatButton
linkButton={true}
href="https://github.com/callemall/material-ui"
secondary={true}
icon={<FontIcon className="muidocs-icon-custom-github" />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const RaisedButtonExampleComplex = () => (
/>
<RaisedButton
label="Github Link"
linkButton={true}
href="https://github.com/callemall/material-ui"
secondary={true}
style={styles.button}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const RaisedButtonExampleIcon = () => (
style={style}
/>
<RaisedButton
linkButton={true}
href="https://github.com/callemall/material-ui"
secondary={true}
icon={<FontIcon className="muidocs-icon-custom-github" />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const getStyles = () => {
};

/**
* This is similiar to the horizontal non-linear example, except the
* This is similar to the horizontal non-linear example, except the
* `<Step>` components are being controlled manually via individual props.
*
* An enhancement made possible by this functionality (shown below),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import FlatButton from 'material-ui/FlatButton';
/**
* Non-linear steppers allow users to enter a multi-step flow at any point.
*
* This example is similiar to the regular horizontal stepper, except steps are no longer
* This example is similar to the regular horizontal stepper, except steps are no longer
* automatically set to `disabled={true}` based on the `activeStep` prop.
*
* We've used the `<StepButton>` here to demonstrate clickable step labels.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class InlineStyles extends React.Component {
</CodeExample>
<p>
If you would like to add additional styling via CSS, pass in the
class name via the className prop. The className prop is similiar to
class name via the className prop. The className prop is similar to
the style prop in that it only applies to the root element. Note that
CSS properties defined inline are given priority over those defined
in a CSS class. Take a look at a component&#39;s <code>getStyles
Expand Down
4 changes: 2 additions & 2 deletions docs/src/app/components/pages/customization/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ implemented in a hierarchical manner.
### Predefined themes

We ship two base themes with Material-UI: light and dark. They are located
under [`material-ui/lib/styles/baseThemes/`](https://github.com/callemall/material-ui/blob/master/src/styles/baseThemes/).
under [`material-ui/styles/baseThemes/`](https://github.com/callemall/material-ui/blob/master/src/styles/baseThemes/).
Custom themes may be defined similarly.
The [`lightBaseTheme`](https://github.com/callemall/material-ui/blob/master/src/styles/baseThemes/lightBaseTheme.js)
is the default so you will not need to do anything to use it.
Expand Down Expand Up @@ -188,7 +188,7 @@ until another render is triggered for that component leaving your application
in a moody state.

To see what are the values you can override, use the
[source](https://github.com/callemall/material-ui/blob/master/src/getMuiTheme.js).
[source](https://github.com/callemall/material-ui/blob/master/src/styles/getMuiTheme.js).
The `lightBaseTheme` object looks like this (these are the defaults):

```js
Expand Down
Loading

0 comments on commit 74cec1d

Please sign in to comment.