);
- },
-});
+ }
+}
export default PropTypeDescription;
diff --git a/docs/src/app/components/pages/Home.js b/docs/src/app/components/pages/Home.js
index 9cb114587d8979..790ee4a0ad6ed2 100644
--- a/docs/src/app/components/pages/Home.js
+++ b/docs/src/app/components/pages/Home.js
@@ -1,22 +1,22 @@
-import React, {createClass, PropTypes} from 'react';
+import React, {Component, PropTypes} from 'react';
import HomeFeature from './HomeFeature';
import FullWidthSection from '../FullWidthSection';
import RaisedButton from 'material-ui/RaisedButton';
-import styleResizable from 'material-ui/utils/styleResizable';
+import withWidth, {LARGE} from 'material-ui/utils/withWidth';
import spacing from 'material-ui/styles/spacing';
import typography from 'material-ui/styles/typography';
import lightBaseTheme from 'material-ui/styles/baseThemes/lightBaseTheme';
import {cyan500, grey200, darkWhite} from 'material-ui/styles/colors';
-const HomePage = createClass({
+class HomePage extends Component {
- contextTypes: {
- router: PropTypes.object.isRequired,
- },
+ static propTypes = {
+ width: PropTypes.number.isRequired,
+ };
- mixins: [
- styleResizable,
- ],
+ static contextTypes = {
+ router: PropTypes.object.isRequired,
+ };
homePageHero() {
const styles = {
@@ -73,7 +73,7 @@ const HomePage = createClass({
styles.h2 = Object.assign({}, styles.h1, styles.h2);
- if (this.isDeviceSize(styleResizable.statics.Sizes.LARGE)) {
+ if (this.props.width === LARGE) {
styles.tagline = Object.assign({}, styles.tagline, styles.taglineWhenLarge);
styles.h1 = Object.assign({}, styles.h1, styles.h1WhenLarge);
styles.h2 = Object.assign({}, styles.h2, styles.h2WhenLarge);
@@ -100,7 +100,7 @@ const HomePage = createClass({
);
- },
+ }
homePurpose() {
const styles = {
@@ -138,7 +138,7 @@ const HomePage = createClass({
and making it better in the coming months.
);
- },
+ }
homeFeatures() {
const styles = {maxWidth: 906};
@@ -164,7 +164,7 @@ const HomePage = createClass({
/>
);
- },
+ }
homeContribute() {
const styles = {
@@ -198,11 +198,11 @@ const HomePage = createClass({
/>
);
- },
+ }
- handleTouchTapDemo() {
+ handleTouchTapDemo = () => {
this.context.router.push('/components');
- },
+ };
render() {
const style = {
@@ -217,8 +217,7 @@ const HomePage = createClass({
{this.homeContribute()}
);
- },
-
-});
+ }
+}
-export default HomePage;
+export default withWidth()(HomePage);
diff --git a/docs/src/app/components/pages/HomeFeature.js b/docs/src/app/components/pages/HomeFeature.js
index f029da56f2b74b..682248d7dfba1e 100644
--- a/docs/src/app/components/pages/HomeFeature.js
+++ b/docs/src/app/components/pages/HomeFeature.js
@@ -1,36 +1,31 @@
-import React, {createClass, PropTypes} from 'react';
+import React, {Component, PropTypes} from 'react';
import {Link} from 'react-router';
-import styleResizable from 'material-ui/utils/styleResizable';
+import withWidth, {MEDIUM, LARGE} from 'material-ui/utils/withWidth';
import spacing from 'material-ui/styles/spacing';
import transitions from 'material-ui/styles/transitions';
import typography from 'material-ui/styles/typography';
import {grey200} from 'material-ui/styles/colors';
import Paper from 'material-ui/Paper';
-const HomeFeature = createClass({
+class HomeFeature extends Component {
- propTypes: {
+ static propTypes = {
firstChild: PropTypes.bool,
heading: PropTypes.string,
img: PropTypes.string,
lastChild: PropTypes.bool,
route: PropTypes.string,
- },
+ width: PropTypes.number.isRequired,
+ };
- mixins: [styleResizable],
+ static defaultProps = {
+ firstChild: false,
+ lastChild: false,
+ };
- getDefaultProps() {
- return {
- firstChild: false,
- lastChild: false,
- };
- },
-
- getInitialState() {
- return {
- zDepth: 0,
- };
- },
+ state = {
+ zDepth: 0,
+ };
getStyles() {
const desktopGutter = spacing.desktopGutter;
@@ -76,8 +71,7 @@ const HomeFeature = createClass({
},
};
- if (this.isDeviceSize(styleResizable.statics.Sizes.MEDIUM) ||
- this.isDeviceSize(styleResizable.statics.Sizes.LARGE)) {
+ if (this.props.width === MEDIUM || this.props.width === LARGE) {
styles.root = Object.assign(
styles.root,
styles.rootWhenMedium,
@@ -87,19 +81,19 @@ const HomeFeature = createClass({
}
return styles;
- },
+ }
- handleMouseEnter() {
+ handleMouseEnter = () => {
this.setState({
zDepth: 4,
});
- },
+ };
- handleMouseLeave() {
+ handleMouseLeave = () => {
this.setState({
zDepth: 0,
});
- },
+ };
render() {
const styles = this.getStyles();
@@ -120,8 +114,7 @@ const HomeFeature = createClass({
);
- },
-
-});
+ }
+}
-export default HomeFeature;
+export default withWidth()(HomeFeature);
diff --git a/docs/src/app/components/pages/components/AppBar/Page.js b/docs/src/app/components/pages/components/AppBar/Page.js
index 7fe7502e2442b4..01100ddf523902 100644
--- a/docs/src/app/components/pages/components/AppBar/Page.js
+++ b/docs/src/app/components/pages/components/AppBar/Page.js
@@ -12,7 +12,7 @@ import AppBarExampleIconButton from './ExampleIconButton';
import appBarExampleIconButtonCode from '!raw!./ExampleIconButton';
import AppBarExampleIconMenu from './ExampleIconMenu';
import appBarExampleIconMenuCode from '!raw!./ExampleIconMenu';
-import appBarCode from '!raw!material-ui/lib/AppBar/AppBar';
+import appBarCode from '!raw!material-ui/AppBar/AppBar';
const descriptions = {
icon: 'A simple example of `AppBar` with an icon on the right. ' +
diff --git a/docs/src/app/components/pages/components/AutoComplete/Page.js b/docs/src/app/components/pages/components/AutoComplete/Page.js
index 4fe1d66fa7a7fd..2afeec5d0c41c3 100644
--- a/docs/src/app/components/pages/components/AutoComplete/Page.js
+++ b/docs/src/app/components/pages/components/AutoComplete/Page.js
@@ -6,7 +6,7 @@ import PropTypeDescription from '../../../PropTypeDescription';
import MarkdownElement from '../../../MarkdownElement';
import autoCompleteReadmeText from './README';
-import autoCompleteCode from '!raw!material-ui/lib/AutoComplete/AutoComplete';
+import autoCompleteCode from '!raw!material-ui/AutoComplete/AutoComplete';
import AutoCompleteExampleSimple from './ExampleSimple';
import autoCompleteExampleSimpleCode from '!raw!./ExampleSimple';
import AutoCompleteExampleDataSources from './ExampleDataSources';
diff --git a/docs/src/app/components/pages/components/Avatar/Page.js b/docs/src/app/components/pages/components/Avatar/Page.js
index b79ba04b10df7e..2c96e2fce9f1e2 100644
--- a/docs/src/app/components/pages/components/Avatar/Page.js
+++ b/docs/src/app/components/pages/components/Avatar/Page.js
@@ -8,7 +8,7 @@ import MarkdownElement from '../../../MarkdownElement';
import avatarReadmeText from './README';
import AvatarExampleSimple from './ExampleSimple';
import avatarExampleSimpleCode from '!raw!./ExampleSimple';
-import avatarCode from '!raw!material-ui/lib/Avatar/Avatar';
+import avatarCode from '!raw!material-ui/Avatar/Avatar';
const description = 'Examples of `Avatar` using an image, [Font Icon](/#/components/font-icon), ' +
'[SVG Icon](/#/components/svg-icon) and "Letter" (string), with and without custom colors.';
diff --git a/docs/src/app/components/pages/components/Badge/Page.js b/docs/src/app/components/pages/components/Badge/Page.js
index 2c2e4353dce0c2..9c53cadf230b2b 100644
--- a/docs/src/app/components/pages/components/Badge/Page.js
+++ b/docs/src/app/components/pages/components/Badge/Page.js
@@ -10,7 +10,7 @@ import BadgeExampleSimple from './ExampleSimple';
import badgeExampleSimpleCode from '!raw!./ExampleSimple';
import BadgeExampleContent from './ExampleContent';
import badgeExampleContentCode from '!raw!./ExampleContent';
-import badgeCode from '!raw!material-ui/lib/Badge/Badge';
+import badgeCode from '!raw!material-ui/Badge/Badge';
const descriptions = {
simple: 'Two examples of badges containing text, using primary and secondary colors. ' +
diff --git a/docs/src/app/components/pages/components/Card/Page.js b/docs/src/app/components/pages/components/Card/Page.js
index af27af75d7bd51..e467bbc1ae2f36 100644
--- a/docs/src/app/components/pages/components/Card/Page.js
+++ b/docs/src/app/components/pages/components/Card/Page.js
@@ -13,12 +13,12 @@ import CardExampleWithoutAvatar from './ExampleWithoutAvatar';
import cardExampleControlledCode from '!raw!./ExampleControlled';
import CardExampleControlled from './ExampleControlled';
-import cardCode from '!raw!material-ui/lib/Card/Card';
-import cardActionsCode from '!raw!material-ui/lib/Card/CardActions';
-import cardHeaderCode from '!raw!material-ui/lib/Card/CardHeader';
-import cardMediaCode from '!raw!material-ui/lib/Card/CardMedia';
-import cardTextCode from '!raw!material-ui/lib/Card/CardText';
-import cardTitleCode from '!raw!material-ui/lib/Card/CardTitle';
+import cardCode from '!raw!material-ui/Card/Card';
+import cardActionsCode from '!raw!material-ui/Card/CardActions';
+import cardHeaderCode from '!raw!material-ui/Card/CardHeader';
+import cardMediaCode from '!raw!material-ui/Card/CardMedia';
+import cardTextCode from '!raw!material-ui/Card/CardText';
+import cardTitleCode from '!raw!material-ui/Card/CardTitle';
const descriptions = {
avatar: 'A `Card` containing each of the card components: `CardHeader` (with avatar), `CardMedia` (with overlay), ' +
diff --git a/docs/src/app/components/pages/components/Checkbox/Page.js b/docs/src/app/components/pages/components/Checkbox/Page.js
index 895338ad504bf6..775dbc87bac937 100644
--- a/docs/src/app/components/pages/components/Checkbox/Page.js
+++ b/docs/src/app/components/pages/components/Checkbox/Page.js
@@ -6,7 +6,7 @@ import PropTypeDescription from '../../../PropTypeDescription';
import MarkdownElement from '../../../MarkdownElement';
import checkboxReadmeText from './README';
-import checkboxCode from '!raw!material-ui/lib/Checkbox/Checkbox';
+import checkboxCode from '!raw!material-ui/Checkbox/Checkbox';
import CheckboxExampleSimple from './ExampleSimple';
import checkboxExampleSimpleCode from '!raw!./ExampleSimple';
diff --git a/docs/src/app/components/pages/components/CircularProgress/Page.js b/docs/src/app/components/pages/components/CircularProgress/Page.js
index 2ae34dee0ea3ea..044acf73df7cf0 100644
--- a/docs/src/app/components/pages/components/CircularProgress/Page.js
+++ b/docs/src/app/components/pages/components/CircularProgress/Page.js
@@ -6,7 +6,7 @@ import PropTypeDescription from '../../../PropTypeDescription';
import MarkdownElement from '../../../MarkdownElement';
import circleProgressReadmeText from './README';
-import circleProgressCode from '!raw!material-ui/lib/CircularProgress/CircularProgress';
+import circleProgressCode from '!raw!material-ui/CircularProgress/CircularProgress';
import CircleProgressExampleSimple from './ExampleSimple';
import circleProgressExampleSimpleCode from '!raw!./ExampleSimple';
import CircleProgressExampleDeterminate from './ExampleDeterminate';
diff --git a/docs/src/app/components/pages/components/DatePicker/Page.js b/docs/src/app/components/pages/components/DatePicker/Page.js
index b696f5d13ddafd..51a28f0824e1d9 100644
--- a/docs/src/app/components/pages/components/DatePicker/Page.js
+++ b/docs/src/app/components/pages/components/DatePicker/Page.js
@@ -18,7 +18,7 @@ import DatePickerExampleDisableDates from './ExampleDisableDates';
import datePickerExampleDisableDatesCode from '!raw!./ExampleDisableDates';
import DatePickerExampleInternational from './ExampleInternational';
import datePickerExampleInternationalCode from '!raw!./ExampleInternational';
-import datePickerCode from '!raw!material-ui/lib/DatePicker/DatePicker';
+import datePickerCode from '!raw!material-ui/DatePicker/DatePicker';
const descriptions = {
simple: 'The Date Picker defaults to a portrait dialog. The `mode` property can be set to `landscape`. You can ' +
diff --git a/docs/src/app/components/pages/components/Dialog/Page.js b/docs/src/app/components/pages/components/Dialog/Page.js
index 32d6844ef80517..94ea2c09ac106c 100644
--- a/docs/src/app/components/pages/components/Dialog/Page.js
+++ b/docs/src/app/components/pages/components/Dialog/Page.js
@@ -18,7 +18,7 @@ import DialogExampleScrollable from './ExampleScrollable';
import DialogExampleScrollableCode from '!raw!./ExampleScrollable';
import DialogExampleAlert from './ExampleAlert';
import DialogExampleAlertCode from '!raw!./ExampleAlert';
-import dialogCode from '!raw!material-ui/lib/Dialog/Dialog';
+import dialogCode from '!raw!material-ui/Dialog/Dialog';
const DialogPage = () => (
diff --git a/docs/src/app/components/pages/components/Divider/Page.js b/docs/src/app/components/pages/components/Divider/Page.js
index 26aec67d81e2c0..95fc5a8062f742 100644
--- a/docs/src/app/components/pages/components/Divider/Page.js
+++ b/docs/src/app/components/pages/components/Divider/Page.js
@@ -12,7 +12,7 @@ import DividerExampleList from './ExampleList';
import dividerExampleListCode from '!raw!./ExampleList';
import DividerExampleMenu from './ExampleMenu';
import dividerExampleMenuCode from '!raw!./ExampleMenu';
-import dividerCode from '!raw!material-ui/lib/Divider/Divider';
+import dividerCode from '!raw!material-ui/Divider/Divider';
const descriptions = {
simple: 'Here, `Divider` is used to separate [TextField](/#/components/text-field) components. ' +
diff --git a/docs/src/app/components/pages/components/Drawer/Page.js b/docs/src/app/components/pages/components/Drawer/Page.js
index 56220cf1755828..594ddecfdf06fc 100644
--- a/docs/src/app/components/pages/components/Drawer/Page.js
+++ b/docs/src/app/components/pages/components/Drawer/Page.js
@@ -12,7 +12,7 @@ import DrawerUndockedExample from './ExampleUndocked';
import drawerUndockedExampleCode from '!raw!./ExampleUndocked';
import DrawerOpenSecondaryExample from './ExampleOpenSecondary';
import drawerOpenSecondaryExampleCode from '!raw!./ExampleOpenSecondary';
-import drawerCode from '!raw!material-ui/lib/Drawer/Drawer';
+import drawerCode from '!raw!material-ui/Drawer/Drawer';
const descriptions = {
simple: 'A simple controlled `Drawer`. The Drawer is `docked` by default, ' +
diff --git a/docs/src/app/components/pages/components/DropDownMenu/Page.js b/docs/src/app/components/pages/components/DropDownMenu/Page.js
index 2befddfae825ee..f6f5a6f9bf91b8 100644
--- a/docs/src/app/components/pages/components/DropDownMenu/Page.js
+++ b/docs/src/app/components/pages/components/DropDownMenu/Page.js
@@ -14,7 +14,7 @@ import DropDownMenuLongMenuExample from './ExampleLongMenu';
import dropDownMenuLongMenuExampleCode from '!raw!./ExampleLongMenu';
import DropDownMenuLabeledExample from './ExampleLabeled';
import dropDownMenuLabeledExampleCode from '!raw!./ExampleLabeled';
-import dropDownMenuCode from '!raw!material-ui/lib/DropDownMenu/DropDownMenu';
+import dropDownMenuCode from '!raw!material-ui/DropDownMenu/DropDownMenu';
const descriptions = {
simple: '`DropDownMenu` is implemented as a controlled component, with the current selection set through the ' +
diff --git a/docs/src/app/components/pages/components/FlatButton/Page.js b/docs/src/app/components/pages/components/FlatButton/Page.js
index 49415393e2724c..d1d9b6f305aa4d 100644
--- a/docs/src/app/components/pages/components/FlatButton/Page.js
+++ b/docs/src/app/components/pages/components/FlatButton/Page.js
@@ -12,7 +12,7 @@ import flatButtonExampleComplexCode from '!raw!./ExampleComplex';
import FlatButtonExampleComplex from './ExampleComplex';
import flatButtonExampleIconCode from '!raw!./ExampleIcon';
import FlatButtonExampleIcon from './ExampleIcon';
-import flatButtonCode from '!raw!material-ui/lib/FlatButton/FlatButton';
+import flatButtonCode from '!raw!material-ui/FlatButton/FlatButton';
const descriptions = {
simple: '`FlatButton` with default color, `primary`, `secondary` and and `disabled` props applied.',
diff --git a/docs/src/app/components/pages/components/FloatingActionButton/Page.js b/docs/src/app/components/pages/components/FloatingActionButton/Page.js
index 7ac9065aa92c9d..a42a50b6c99d0e 100644
--- a/docs/src/app/components/pages/components/FloatingActionButton/Page.js
+++ b/docs/src/app/components/pages/components/FloatingActionButton/Page.js
@@ -8,7 +8,7 @@ import MarkdownElement from '../../../MarkdownElement';
import floatingButtonReadmeText from './README';
import floatingButtonExampleSimpleCode from '!raw!./ExampleSimple';
import FloatingButtonExampleSimple from './ExampleSimple';
-import floatingButtonCode from '!raw!material-ui/lib/FloatingActionButton/FloatingActionButton';
+import floatingButtonCode from '!raw!material-ui/FloatingActionButton/FloatingActionButton';
const descriptions = {
simple: 'Default size and `mini` FABs, in primary (default), `secondary` and `disabled` colors.',
diff --git a/docs/src/app/components/pages/components/FontIcon/Page.js b/docs/src/app/components/pages/components/FontIcon/Page.js
index 06de100874f3ce..a389413c100394 100644
--- a/docs/src/app/components/pages/components/FontIcon/Page.js
+++ b/docs/src/app/components/pages/components/FontIcon/Page.js
@@ -5,7 +5,7 @@ import CodeExample from '../../../CodeExample';
import PropTypeDescription from '../../../PropTypeDescription';
import MarkdownElement from '../../../MarkdownElement';
-import iconCode from '!raw!material-ui/lib/FontIcon/FontIcon';
+import iconCode from '!raw!material-ui/FontIcon/FontIcon';
import iconReadmeText from './README';
import IconExampleSimple from './ExampleSimple';
import iconExampleSimpleCode from '!raw!./ExampleSimple';
diff --git a/docs/src/app/components/pages/components/GridList/Page.js b/docs/src/app/components/pages/components/GridList/Page.js
index d2f7b1406465b2..0506a65f712189 100644
--- a/docs/src/app/components/pages/components/GridList/Page.js
+++ b/docs/src/app/components/pages/components/GridList/Page.js
@@ -10,8 +10,8 @@ import gridListExampleSimpleCode from '!raw!./ExampleSimple';
import GridListExampleSimple from './ExampleSimple';
import gridListExampleComplexCode from '!raw!./ExampleComplex';
import GridListExampleComplex from './ExampleComplex';
-import gridListCode from '!raw!material-ui/lib/GridList/GridList';
-import gridTileCode from '!raw!material-ui/lib/GridList/GridTile';
+import gridListCode from '!raw!material-ui/GridList/GridList';
+import gridTileCode from '!raw!material-ui/GridList/GridTile';
const descriptions = {
simple: 'A simple example of a scrollable `GridList` containing a [Subheader](/#/components/subheader).',
diff --git a/docs/src/app/components/pages/components/IconButton/Page.js b/docs/src/app/components/pages/components/IconButton/Page.js
index 12dcc23a579c79..63e9b7089a469f 100644
--- a/docs/src/app/components/pages/components/IconButton/Page.js
+++ b/docs/src/app/components/pages/components/IconButton/Page.js
@@ -5,7 +5,7 @@ import CodeExample from '../../../CodeExample';
import PropTypeDescription from '../../../PropTypeDescription';
import MarkdownElement from '../../../MarkdownElement';
-import iconButtonCode from '!raw!material-ui/lib/IconButton/IconButton';
+import iconButtonCode from '!raw!material-ui/IconButton/IconButton';
import iconButtonReadmeText from './README';
import iconButtonExampleSimpleCode from '!raw!./ExampleSimple';
import IconButtonExampleSimple from './ExampleSimple';
diff --git a/docs/src/app/components/pages/components/IconMenu/Page.js b/docs/src/app/components/pages/components/IconMenu/Page.js
index d426bd0f0682d7..bb77a43bbc4a5a 100644
--- a/docs/src/app/components/pages/components/IconMenu/Page.js
+++ b/docs/src/app/components/pages/components/IconMenu/Page.js
@@ -14,7 +14,7 @@ import IconMenuExampleScrollable from './ExampleScrollable';
import iconMenuExampleScrollableCode from '!raw!./ExampleScrollable';
import IconMenuExampleNested from './ExampleNested';
import iconMenuExampleNestedCode from '!raw!./ExampleNested';
-import iconMenuCode from '!raw!material-ui/lib/IconMenu/IconMenu';
+import iconMenuCode from '!raw!material-ui/IconMenu/IconMenu';
const descriptions = {
simple: 'Simple Icon Menus demonstrating some of the layouts possible using the `anchorOrigin` and `' +
diff --git a/docs/src/app/components/pages/components/LinearProgress/Page.js b/docs/src/app/components/pages/components/LinearProgress/Page.js
index ebd71a1f42d8e9..23a9c2df5fa9fb 100644
--- a/docs/src/app/components/pages/components/LinearProgress/Page.js
+++ b/docs/src/app/components/pages/components/LinearProgress/Page.js
@@ -10,7 +10,7 @@ import LinearProgressExampleSimple from './ExampleSimple';
import linearProgressExampleSimpleCode from '!raw!./ExampleSimple';
import LinearProgressExampleDeterminate from './ExampleDeterminate';
import linearProgressExampleDeterminateCode from '!raw!./ExampleDeterminate';
-import linearProgressCode from '!raw!material-ui/lib/LinearProgress/LinearProgress';
+import linearProgressCode from '!raw!material-ui/LinearProgress/LinearProgress';
const descriptions = {
indeterminate: 'By default, the indicator animates continuously.',
diff --git a/docs/src/app/components/pages/components/List/Page.js b/docs/src/app/components/pages/components/List/Page.js
index 26471da23f2699..154c4545e3efe5 100644
--- a/docs/src/app/components/pages/components/List/Page.js
+++ b/docs/src/app/components/pages/components/List/Page.js
@@ -24,8 +24,8 @@ import listExampleMessagesCode from '!raw!./ExampleMessages';
import ListExampleMessages from './ExampleMessages';
import listExampleSelectableCode from '!raw!./ExampleSelectable';
import ListExampleSelectable from './ExampleSelectable';
-import listCode from '!raw!material-ui/lib/List/List';
-import listItemCode from '!raw!material-ui/lib/List/ListItem';
+import listCode from '!raw!material-ui/List/List';
+import listItemCode from '!raw!material-ui/List/ListItem';
const descriptions = {
simple: 'A simple `List` with left and right [SVG icons](/#/components/svg-icon).',
diff --git a/docs/src/app/components/pages/components/Menu/Page.js b/docs/src/app/components/pages/components/Menu/Page.js
index 383909146f8113..8978c589b541b4 100644
--- a/docs/src/app/components/pages/components/Menu/Page.js
+++ b/docs/src/app/components/pages/components/Menu/Page.js
@@ -16,8 +16,8 @@ import MenuExampleSecondary from './ExampleSecondary';
import menuExampleSecondaryCode from '!raw!./ExampleSecondary';
import MenuExampleNested from './ExampleNested';
import menuExampleNestedCode from '!raw!./ExampleNested';
-import menuCode from '!raw!material-ui/lib/Menu/Menu';
-import menuItemCode from '!raw!material-ui/lib/MenuItem/MenuItem';
+import menuCode from '!raw!material-ui/Menu/Menu';
+import menuItemCode from '!raw!material-ui/MenuItem/MenuItem';
const descriptions = {
simple: 'Two simple examples. The menu widths adjusts to accommodate the content in keyline increments.',
diff --git a/docs/src/app/components/pages/components/Paper/Page.js b/docs/src/app/components/pages/components/Paper/Page.js
index 64013299fef050..ec88e7267ec489 100644
--- a/docs/src/app/components/pages/components/Paper/Page.js
+++ b/docs/src/app/components/pages/components/Paper/Page.js
@@ -12,7 +12,7 @@ import PaperExampleRounded from './ExampleRounded';
import paperExampleRoundedCode from '!raw!./ExampleRounded';
import PaperExampleCircle from './ExampleCircle';
import paperExampleCircleCode from '!raw!./ExampleCircle';
-import paperCode from '!raw!material-ui/lib/Paper/Paper';
+import paperCode from '!raw!material-ui/Paper/Paper';
const descriptions = {
simple: 'Paper examples showing the range of `zDepth`.',
diff --git a/docs/src/app/components/pages/components/Popover/Page.js b/docs/src/app/components/pages/components/Popover/Page.js
index b918bf9101d780..c95a7bb3785ef2 100644
--- a/docs/src/app/components/pages/components/Popover/Page.js
+++ b/docs/src/app/components/pages/components/Popover/Page.js
@@ -13,7 +13,7 @@ import popoverExampleAnimationCode from '!raw!./ExampleAnimation';
import PopoverExampleConfigurable from './ExampleConfigurable';
import popoverExampleConfigurableCode from '!raw!./ExampleConfigurable';
import popoverNoteText from './NOTE';
-import popoverCode from '!raw!material-ui/lib/Popover/Popover';
+import popoverCode from '!raw!material-ui/Popover/Popover';
const descriptions = {
simple: 'A simple example showing a Popover containing a [Menu](http://localhost:3000/#/components/menu). ' +
diff --git a/docs/src/app/components/pages/components/RadioButton/Page.js b/docs/src/app/components/pages/components/RadioButton/Page.js
index 1fcbc3c969ab20..36add4495d3675 100644
--- a/docs/src/app/components/pages/components/RadioButton/Page.js
+++ b/docs/src/app/components/pages/components/RadioButton/Page.js
@@ -8,8 +8,8 @@ import MarkdownElement from '../../../MarkdownElement';
import radioButtonReadmeText from './README';
import RadioButtonExampleSimple from './ExampleSimple';
import radioButtonExampleSimpleCode from '!raw!./ExampleSimple';
-import radioButtonCode from '!raw!material-ui/lib/RadioButton/RadioButton';
-import radioButtonGroupCode from '!raw!material-ui/lib/RadioButton/RadioButtonGroup';
+import radioButtonCode from '!raw!material-ui/RadioButton/RadioButton';
+import radioButtonGroupCode from '!raw!material-ui/RadioButton/RadioButtonGroup';
const description = 'The second button is selected by default using the `defaultSelected` property of ' +
'`RadioButtonGroup`. The third button is disabled using the `disabled` property of `RadioButton`. The final ' +
diff --git a/docs/src/app/components/pages/components/RaisedButton/Page.js b/docs/src/app/components/pages/components/RaisedButton/Page.js
index 5f7a19b4d5d5a4..265ab21fc22aec 100644
--- a/docs/src/app/components/pages/components/RaisedButton/Page.js
+++ b/docs/src/app/components/pages/components/RaisedButton/Page.js
@@ -12,7 +12,7 @@ import raisedButtonExampleComplexCode from '!raw!./ExampleComplex';
import RaisedButtonExampleComplex from './ExampleComplex';
import raisedButtonExampleIconCode from '!raw!./ExampleIcon';
import RaisedButtonExampleIcon from './ExampleIcon';
-import raisedButtonCode from '!raw!material-ui/lib/RaisedButton/RaisedButton';
+import raisedButtonCode from '!raw!material-ui/RaisedButton/RaisedButton';
const descriptions = {
simple: '`RaisedButton` with default color, `primary`, `secondary` and and `disabled` props applied.',
diff --git a/docs/src/app/components/pages/components/RefreshIndicator/Page.js b/docs/src/app/components/pages/components/RefreshIndicator/Page.js
index a8c2d0b21362a4..5aebb2fc81de77 100644
--- a/docs/src/app/components/pages/components/RefreshIndicator/Page.js
+++ b/docs/src/app/components/pages/components/RefreshIndicator/Page.js
@@ -10,7 +10,7 @@ import RefreshIndicatorExampleReady from './ExampleReady';
import refreshIndicatorExampleReadyCode from '!raw!./ExampleReady';
import RefreshIndicatorExampleLoading from './ExampleLoading';
import refreshIndicatorExampleLoadingCode from '!raw!./ExampleLoading';
-import refreshIndicatorCode from '!raw!material-ui/lib/RefreshIndicator/RefreshIndicator';
+import refreshIndicatorCode from '!raw!material-ui/RefreshIndicator/RefreshIndicator';
const descriptions = {
ready: 'The `ready` status can be used in response to a pull-to-refresh action, with the `percentage` tracking ' +
diff --git a/docs/src/app/components/pages/components/SelectField/Page.js b/docs/src/app/components/pages/components/SelectField/Page.js
index 2a37390d9ea261..9f35cd6797d78e 100644
--- a/docs/src/app/components/pages/components/SelectField/Page.js
+++ b/docs/src/app/components/pages/components/SelectField/Page.js
@@ -16,7 +16,7 @@ import SelectFieldExampleFloatingLabel from './ExampleFloatingLabel';
import selectFieldExampleFloatingLabelCode from '!raw!./ExampleFloatingLabel';
import SelectFieldExampleError from './ExampleError';
import selectFieldExampleErrorCode from '!raw!./ExampleError';
-import selectFieldCode from '!raw!material-ui/lib/SelectField/SelectField';
+import selectFieldCode from '!raw!material-ui/SelectField/SelectField';
const descriptions = {
simple: '`SelectField` is implemented as a controlled component, with the current selection set through the ' +
diff --git a/docs/src/app/components/pages/components/Slider/Page.js b/docs/src/app/components/pages/components/Slider/Page.js
index 030cc541a74948..a17c57d6b513e8 100644
--- a/docs/src/app/components/pages/components/Slider/Page.js
+++ b/docs/src/app/components/pages/components/Slider/Page.js
@@ -14,7 +14,7 @@ import SliderExampleStep from './ExampleStep';
import sliderExampleStepCode from '!raw!./ExampleStep';
import SliderExampleControlled from './ExampleControlled';
import sliderExampleControlledCode from '!raw!./ExampleControlled';
-import sliderCode from '!raw!material-ui/lib/Slider/Slider';
+import sliderCode from '!raw!material-ui/Slider/Slider';
const descriptions = {
simple: 'The `defaultValue` property sets the initial position of the slider. The slider appearance changes when ' +
diff --git a/docs/src/app/components/pages/components/Snackbar/Page.js b/docs/src/app/components/pages/components/Snackbar/Page.js
index b11f31cb006978..ea8c9e2fed2c5d 100644
--- a/docs/src/app/components/pages/components/Snackbar/Page.js
+++ b/docs/src/app/components/pages/components/Snackbar/Page.js
@@ -12,7 +12,7 @@ import SnackbarExampleAction from './ExampleAction';
import SnackbarExampleActionCode from '!raw!./ExampleAction';
import SnackbarExampleTwice from './ExampleTwice';
import SnackbarExampleTwiceCode from '!raw!./ExampleTwice';
-import SnackbarCode from '!raw!material-ui/lib/Snackbar/Snackbar';
+import SnackbarCode from '!raw!material-ui/Snackbar/Snackbar';
const descriptions = {
simple: '`Snackbar` is a controlled component, and is displayed when `open` is `true`. Click away from the ' +
diff --git a/docs/src/app/components/pages/components/Subheader/Page.js b/docs/src/app/components/pages/components/Subheader/Page.js
index 480f7362b138cb..97541ca167978d 100644
--- a/docs/src/app/components/pages/components/Subheader/Page.js
+++ b/docs/src/app/components/pages/components/Subheader/Page.js
@@ -12,7 +12,7 @@ import listExampleFoldersCode from '!raw!../List/ExampleFolders';
import ListExampleFolders from '../List/ExampleFolders';
import gridListExampleSimpleCode from '!raw!../GridList/ExampleSimple';
import GridListExampleSimple from '../GridList/ExampleSimple';
-import subheaderCode from '!raw!material-ui/lib/Subheader/Subheader';
+import subheaderCode from '!raw!material-ui/Subheader/Subheader';
const descriptions = {
simpleList: 'Subheader used in a simple [List](/#/components/list).',
diff --git a/docs/src/app/components/pages/components/SvgIcon/Page.js b/docs/src/app/components/pages/components/SvgIcon/Page.js
index c60a6e1b6ef726..b022d7d445a030 100644
--- a/docs/src/app/components/pages/components/SvgIcon/Page.js
+++ b/docs/src/app/components/pages/components/SvgIcon/Page.js
@@ -10,7 +10,7 @@ import IconExampleSimple from './ExampleSimple';
import iconExampleSimpleCode from '!raw!./ExampleSimple';
import IconExampleIcons from './ExampleIcons';
import iconExampleIconsCode from '!raw!./ExampleIcons';
-import iconCode from '!raw!material-ui/lib/SvgIcon/SvgIcon';
+import iconCode from '!raw!material-ui/SvgIcon/SvgIcon';
const descriptions = {
custom: 'This example uses a custom svg icon. The third example has a `hoverColor` defined.',
diff --git a/docs/src/app/components/pages/components/Table/Page.js b/docs/src/app/components/pages/components/Table/Page.js
index 584e91ec676a66..01a59c91cc2849 100644
--- a/docs/src/app/components/pages/components/Table/Page.js
+++ b/docs/src/app/components/pages/components/Table/Page.js
@@ -11,13 +11,13 @@ import tableExampleSimpleCode from '!raw!./ExampleSimple';
import TableExampleComplex from './ExampleComplex';
import tableExampleComplexCode from '!raw!./ExampleComplex';
-import tableCode from '!raw!material-ui/lib/Table/Table';
-import tableRowCode from '!raw!material-ui/lib/Table/TableRow';
-import tableRowColumnCode from '!raw!material-ui/lib/Table/TableRowColumn';
-import tableHeaderCode from '!raw!material-ui/lib/Table/TableHeader';
-import tableHeaderColumnCode from '!raw!material-ui/lib/Table/TableHeaderColumn';
-import tableBodyCode from '!raw!material-ui/lib/Table/TableBody';
-import tableFooterCode from '!raw!material-ui/lib/Table/TableFooter';
+import tableCode from '!raw!material-ui/Table/Table';
+import tableRowCode from '!raw!material-ui/Table/TableRow';
+import tableRowColumnCode from '!raw!material-ui/Table/TableRowColumn';
+import tableHeaderCode from '!raw!material-ui/Table/TableHeader';
+import tableHeaderColumnCode from '!raw!material-ui/Table/TableHeaderColumn';
+import tableBodyCode from '!raw!material-ui/Table/TableBody';
+import tableFooterCode from '!raw!material-ui/Table/TableFooter';
const descriptions = {
simple: 'A simple table demonstrating the hierarchy of the `Table` component and its sub-components.',
diff --git a/docs/src/app/components/pages/components/Tabs/Page.js b/docs/src/app/components/pages/components/Tabs/Page.js
index f310aaf5a8914e..d3c53bc1874a8d 100644
--- a/docs/src/app/components/pages/components/Tabs/Page.js
+++ b/docs/src/app/components/pages/components/Tabs/Page.js
@@ -16,8 +16,8 @@ import tabsExampleIconCode from '!raw!./ExampleIcon';
import TabsExampleIcon from './ExampleIcon';
import tabsExampleIconTextCode from '!raw!./ExampleIconText';
import TabsExampleIconText from './ExampleIconText';
-import tabsCode from '!raw!material-ui/lib/Tabs/Tabs';
-import tabCode from '!raw!material-ui/lib/Tabs/Tab';
+import tabsCode from '!raw!material-ui/Tabs/Tabs';
+import tabCode from '!raw!material-ui/Tabs/Tab';
const descriptions = {
simple: 'A simple example of Tabs. The third tab demonstrates the `onActive` property of `Tab`.',
diff --git a/docs/src/app/components/pages/components/TextField/Page.js b/docs/src/app/components/pages/components/TextField/Page.js
index 4a426803e7638c..07557594a8a5fc 100644
--- a/docs/src/app/components/pages/components/TextField/Page.js
+++ b/docs/src/app/components/pages/components/TextField/Page.js
@@ -16,7 +16,7 @@ import TextFieldExampleDisabled from './ExampleDisabled';
import textFieldExampleDisabledCode from '!raw!./ExampleDisabled';
import TextFieldExampleControlled from './ExampleControlled';
import textFieldExampleControlledCode from '!raw!./ExampleControlled';
-import textFieldCode from '!raw!material-ui/lib/TextField/TextField';
+import textFieldCode from '!raw!material-ui/TextField/TextField';
const descriptions = {
simple: 'Examples demonstrating key Text Field features.',
diff --git a/docs/src/app/components/pages/components/TimePicker/Page.js b/docs/src/app/components/pages/components/TimePicker/Page.js
index 2ffda2acad7a4d..449d2abb0639dd 100644
--- a/docs/src/app/components/pages/components/TimePicker/Page.js
+++ b/docs/src/app/components/pages/components/TimePicker/Page.js
@@ -12,7 +12,7 @@ import TimePickerExampleComplex from './ExampleComplex';
import timePickerExampleComplexCode from '!raw!./ExampleComplex';
import TimePickerExampleInternational from './ExampleInternational';
import timePickerExampleInternationalCode from '!raw!./ExampleInternational';
-import timePickerCode from '!raw!material-ui/lib/TimePicker/TimePicker';
+import timePickerCode from '!raw!material-ui/TimePicker/TimePicker';
const descriptions = {
simple: 'Time Picker supports 12 hour and 24 hour formats. In 12 hour format the AM and PM indicators toggle the ' +
diff --git a/docs/src/app/components/pages/components/Toggle/Page.js b/docs/src/app/components/pages/components/Toggle/Page.js
index 321366a592ea8e..7830ebb64fd75b 100644
--- a/docs/src/app/components/pages/components/Toggle/Page.js
+++ b/docs/src/app/components/pages/components/Toggle/Page.js
@@ -8,7 +8,7 @@ import MarkdownElement from '../../../MarkdownElement';
import toggleReadmeText from './README';
import ToggleExampleSimple from './ExampleSimple';
import toggleExampleSimpleCode from '!raw!./ExampleSimple';
-import toggleCode from '!raw!material-ui/lib/Toggle/Toggle';
+import toggleCode from '!raw!material-ui/Toggle/Toggle';
const description = 'The second example is selected by default using the `defaultToggled` property. The third ' +
'example is disabled using the `disabled` property. The final example uses the `labelPosition` property to ' +
diff --git a/docs/src/app/components/pages/customization/Colors.js b/docs/src/app/components/pages/customization/Colors.js
index 77e9fd5ff8a7e3..afc6206593f6ce 100644
--- a/docs/src/app/components/pages/customization/Colors.js
+++ b/docs/src/app/components/pages/customization/Colors.js
@@ -1,16 +1,21 @@
-import React, {createClass} from 'react';
+import React, {Component, PropTypes} from 'react';
import Title from 'react-title-component';
-import styleResizable from 'material-ui/utils/styleResizable';
+import withWidth, {MEDIUM, LARGE} from 'material-ui/utils/withWidth';
import ClearFix from 'material-ui/internal/ClearFix';
import {getContrastRatio} from 'material-ui/utils/colorManipulator';
import typography from 'material-ui/styles/typography';
import * as colors from 'material-ui/styles/colors';
-const ColorsPage = createClass({
+const mainColors = [
+ 'Red', 'Pink', 'Purple', 'Deep Purple', 'Indigo', 'Blue', 'Light Blue',
+ 'Cyan', 'Teal', 'Green', 'Light Green', 'Lime', 'Yellow', 'Amber', 'Orange',
+ 'Deep Orange',
+];
- mixins: [
- styleResizable,
- ],
+class ColorsPage extends Component {
+ static propTypes = {
+ width: PropTypes.number.isRequired,
+ };
getStyles() {
const styles = {
@@ -54,16 +59,16 @@ const ColorsPage = createClass({
},
};
- if (this.isDeviceSize(styleResizable.statics.Sizes.LARGE)) {
+ if (this.props.width === LARGE) {
styles.colorGroup = Object.assign(styles.colorGroup, styles.colorGroupWhenLarge);
- } else if (this.isDeviceSize(styleResizable.statics.Sizes.MEDIUM)) {
+ } else if (this.props.width === MEDIUM) {
styles.colorGroup = Object.assign(styles.colorGroup, styles.colorGroupWhenMedium);
} else {
styles.colorGroup = Object.assign(styles.colorGroup, styles.colorGroupWhenSmall);
}
return styles;
- },
+ }
getColorGroup(styles, color, showAltPalette) {
const mainPalette = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
@@ -88,7 +93,7 @@ const ColorsPage = createClass({
{React.Children.toArray(colors)}
);
- },
+ }
getColorBlock(styles, colorName, colorValue, colorTitle) {
const bgColorText = colorName + colorValue;
@@ -119,7 +124,7 @@ const ColorsPage = createClass({
{this.getColorName(styles, bgColorText, bgColor)}
);
- },
+ }
getColorName(styles, text, colorValue) {
return (
@@ -128,15 +133,11 @@ const ColorsPage = createClass({
{colorValue.toUpperCase()}