Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] reorg internal modules #3682

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/src/app/AppRoutes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import {
} from 'react-router';

// Here we define all our material-ui ReactComponents.
import Master from './components/master';
import Home from './components/pages/home';
import Master from './components/Master';
import Home from './components/pages/Home';

import Prerequisites from './components/pages/get-started/Prerequisites';
import Installation from './components/pages/get-started/Installation';
import Usage from './components/pages/get-started/Usage';
import Examples from './components/pages/get-started/Examples';
import ServerRendering from './components/pages/get-started/ServerRendering';

import Colors from './components/pages/customization/colors';
import Themes from './components/pages/customization/themes';
import Colors from './components/pages/customization/Colors';
import Themes from './components/pages/customization/Themes';
import InlineStyles from './components/pages/customization/InlineStyles';

import AppBarPage from './components/pages/components/AppBar/Page';
Expand Down
18 changes: 7 additions & 11 deletions docs/src/app/components/AppLeftNav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ import Divider from 'material-ui/lib/divider';
import Subheader from 'material-ui/lib/Subheader';
import DropDownMenu from 'material-ui/lib/DropDownMenu';
import MenuItem from 'material-ui/lib/menus/menu-item';
import {SelectableContainerEnhance} from 'material-ui/lib/hoc/selectable-enhance';
import {
Spacing,
Typography,
} from 'material-ui/lib/styles';
import zIndex from 'material-ui/lib/styles/zIndex';
import {SelectableContainerEnhance} from 'material-ui/lib/lists/selectable-enhance';
import {spacing, typography, zIndex} from 'material-ui/lib/styles';
import {cyan500} from 'material-ui/lib/styles/colors';

const SelectableList = SelectableContainerEnhance(List);
Expand Down Expand Up @@ -98,15 +94,15 @@ const AppLeftNav = React.createClass({
logo: {
cursor: 'pointer',
fontSize: 24,
color: Typography.textFullWhite,
lineHeight: `${Spacing.desktopKeylineIncrement}px`,
fontWeight: Typography.fontWeightLight,
color: typography.textFullWhite,
lineHeight: `${spacing.desktopKeylineIncrement}px`,
fontWeight: typography.fontWeightLight,
backgroundColor: cyan500,
paddingLeft: Spacing.desktopGutter,
paddingLeft: spacing.desktopGutter,
marginBottom: 8,
},
version: {
paddingLeft: Spacing.desktopGutterLess,
paddingLeft: spacing.desktopGutterLess,
fontSize: 16,
},
},
Expand Down
4 changes: 2 additions & 2 deletions docs/src/app/components/CodeExample/CodeBlock.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import MarkdownElement from '../MarkdownElement';
import PureRenderMixin from 'react-addons-pure-render-mixin';
import Transitions from 'material-ui/lib/styles/transitions';
import transitions from 'material-ui/lib/styles/transitions';
import CodeBlockTitle from './CodeBlockTitle';

const styles = {
Expand All @@ -12,7 +12,7 @@ const styles = {
markdown: {
overflow: 'auto',
maxHeight: 1400,
transition: Transitions.create('max-height', '800ms', '0ms', 'ease-in-out'),
transition: transitions.create('max-height', '800ms', '0ms', 'ease-in-out'),
marginTop: 0,
marginBottom: 0,
},
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/components/CodeExample/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import CodeBlock from './CodeBlock';
import ClearFix from 'material-ui/lib/clearfix';
import ClearFix from 'material-ui/lib/internal/ClearFix';
import Paper from 'material-ui/lib/paper';

class CodeExample extends React.Component {
Expand Down
10 changes: 5 additions & 5 deletions docs/src/app/components/ComponentDoc.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {ClearFix, Styles} from 'material-ui';
import {ClearFix} from 'material-ui';
import ComponentInfo from './ComponentInfo';
const Typography = Styles.Typography;
import typography from 'styles/typography';

const ComponentDoc = React.createClass({

Expand Down Expand Up @@ -30,7 +30,7 @@ const ComponentDoc = React.createClass({
fontSize: 15,
letterSpacing: '0',
lineHeight: '24px',
color: Typography.textDarkBlack,
color: typography.textDarkBlack,
},
ol: {
fontSize: 13,
Expand All @@ -53,8 +53,8 @@ const ComponentDoc = React.createClass({
paddingTop: 16,
marginBottom: 12,
letterSpacing: '0',
fontWeight: Typography.fontWeightNormal,
color: Typography.textDarkBlack,
fontWeight: typography.fontWeightNormal,
color: typography.textDarkBlack,
},
};
},
Expand Down
16 changes: 8 additions & 8 deletions docs/src/app/components/ComponentInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {Mixins, Styles} from 'material-ui';

const {StyleResizable} = Mixins;
const {Typography, Spacing} = Styles;
const {typography, spacing} = Styles;

const ComponentInfo = React.createClass({

Expand All @@ -19,17 +19,17 @@ const ComponentInfo = React.createClass({
mixins: [StyleResizable],

getStyles() {
const desktopGutter = Spacing.desktopGutter;
const desktopGutter = spacing.desktopGutter;
const borderColor = this.context.muiTheme.rawTheme.palette.borderColor;
const styles = {
root: {
fontSize: 15,
letterSpacing: '0',
fontWeight: Typography.fontWeightNormal,
fontWeight: typography.fontWeightNormal,
lineHeight: '24px',
paddingTop: 3,
marginBottom: 13,
color: Typography.textDarkBlack,
color: typography.textDarkBlack,
width: '100%',
},
table: {
Expand All @@ -42,10 +42,10 @@ const ComponentInfo = React.createClass({
},
name: {
position: 'absolute',
fontWeight: Typography.fontWeightMedium,
fontWeight: typography.fontWeightMedium,
},
type: {
color: Typography.textLightBlack,
color: typography.textLightBlack,
paddingRight: desktopGutter,
},
header: {
Expand All @@ -65,8 +65,8 @@ const ComponentInfo = React.createClass({
paddingTop: 19,
marginBottom: 13,
letterSpacing: '0',
fontWeight: Typography.fontWeightMedium,
color: Typography.textDarkBlack,
fontWeight: typography.fontWeightMedium,
color: typography.textDarkBlack,
},
nameWhenMedium: {
position: 'inherit',
Expand Down
13 changes: 7 additions & 6 deletions docs/src/app/components/FullWidthSection.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import {ClearFix, Mixins, Styles} from 'material-ui';
const {StyleResizable} = Mixins;
const desktopGutter = Styles.Spacing.desktopGutter;
import ClearFix from 'material-ui/lib/internal/ClearFix';
import spacing from 'material-ui/lib/styles/spacing';
import styleResizable from 'material-ui/lib/utils/styleResizable';
const desktopGutter = spacing.desktopGutter;

const FullWidthSection = React.createClass({

Expand All @@ -14,7 +15,7 @@ const FullWidthSection = React.createClass({
},

mixins: [
StyleResizable,
styleResizable,
],

getDefaultProps() {
Expand Down Expand Up @@ -74,8 +75,8 @@ const FullWidthSection = React.createClass({
style={Object.assign(
styles.root,
style,
this.isDeviceSize(StyleResizable.statics.Sizes.SMALL) && styles.rootWhenSmall,
this.isDeviceSize(StyleResizable.statics.Sizes.LARGE) && styles.rootWhenLarge)}
this.isDeviceSize(styleResizable.statics.Sizes.SMALL) && styles.rootWhenSmall,
this.isDeviceSize(styleResizable.statics.Sizes.LARGE) && styles.rootWhenLarge)}
>
{content}
</ClearFix>
Expand Down
21 changes: 9 additions & 12 deletions docs/src/app/components/master.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import React from 'react';
import Title from 'react-title-component';

import AppBar from 'material-ui/lib/app-bar';
import IconButton from 'material-ui/lib/icon-button';
import {Spacing} from 'material-ui/lib/styles';
import {StyleResizable} from 'material-ui/lib/mixins';

import spacing from 'material-ui/lib/styles/spacing';
import styleResizable from 'material-ui/lib/utils/styleResizable';
import getMuiTheme from 'material-ui/lib/styles/getMuiTheme';
import {darkWhite, lightWhite, grey900} from 'material-ui/lib/styles/colors';

import AppLeftNav from './AppLeftNav';
import FullWidthSection from './FullWidthSection';

Expand Down Expand Up @@ -36,7 +33,7 @@ const Master = React.createClass({
},

mixins: [
StyleResizable,
styleResizable,
],

getInitialState() {
Expand Down Expand Up @@ -74,14 +71,14 @@ const Master = React.createClass({
top: 0,
},
root: {
paddingTop: Spacing.desktopKeylineIncrement,
paddingTop: spacing.desktopKeylineIncrement,
minHeight: 400,
},
content: {
margin: Spacing.desktopGutter,
margin: spacing.desktopGutter,
},
contentWhenMedium: {
margin: `${Spacing.desktopGutter * 2}px ${Spacing.desktopGutter * 3}px`,
margin: `${spacing.desktopGutter * 2}px ${spacing.desktopGutter * 3}px`,
},
footer: {
backgroundColor: grey900,
Expand All @@ -101,8 +98,8 @@ const Master = React.createClass({
},
};

if (this.isDeviceSize(StyleResizable.statics.Sizes.MEDIUM) ||
this.isDeviceSize(StyleResizable.statics.Sizes.LARGE)) {
if (this.isDeviceSize(styleResizable.statics.Sizes.MEDIUM) ||
this.isDeviceSize(styleResizable.statics.Sizes.LARGE)) {
styles.content = Object.assign(styles.content, styles.contentWhenMedium);
}

Expand Down Expand Up @@ -159,7 +156,7 @@ const Master = React.createClass({
let docked = false;
let showMenuIconButton = true;

if (this.isDeviceSize(StyleResizable.statics.Sizes.LARGE) && title !== '') {
if (this.isDeviceSize(styleResizable.statics.Sizes.LARGE) && title !== '') {
docked = true;
leftNavOpen = true;
showMenuIconButton = false;
Expand Down
25 changes: 13 additions & 12 deletions docs/src/app/components/pages/HomeFeature.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import {Link} from 'react-router';
import {Paper, Mixins, Styles} from 'material-ui';
import styleResizable from 'material-ui/lib/utils/styleResizable';
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/lib/styles/colors';

const {StyleResizable} = Mixins;
const {Spacing, Transitions, Typography} = Styles;
import Paper from 'material-ui/paper';

const HomeFeature = React.createClass({

Expand All @@ -16,7 +17,7 @@ const HomeFeature = React.createClass({
route: React.PropTypes.string,
},

mixins: [StyleResizable],
mixins: [styleResizable],

getDefaultProps() {
return {
Expand All @@ -32,11 +33,11 @@ const HomeFeature = React.createClass({
},

getStyles() {
const desktopGutter = Spacing.desktopGutter;
const desktopKeylineIncrement = Spacing.desktopKeylineIncrement;
const desktopGutter = spacing.desktopGutter;
const desktopKeylineIncrement = spacing.desktopKeylineIncrement;
const styles = {
root: {
transition: Transitions.easeOut(),
transition: transitions.easeOut(),
maxWidth: '300px',
margin: `0 auto ${desktopGutter}px auto`,
},
Expand All @@ -56,8 +57,8 @@ const HomeFeature = React.createClass({
paddingTop: 19,
marginBottom: 13,
letterSpacing: 0,
fontWeight: Typography.fontWeightMedium,
color: Typography.textDarkBlack,
fontWeight: typography.fontWeightMedium,
color: typography.textDarkBlack,
backgroundColor: grey200,
textAlign: 'center',
margin: 0,
Expand All @@ -76,8 +77,8 @@ const HomeFeature = React.createClass({
},
};

if (this.isDeviceSize(StyleResizable.statics.Sizes.MEDIUM) ||
this.isDeviceSize(StyleResizable.statics.Sizes.LARGE)) {
if (this.isDeviceSize(styleResizable.statics.Sizes.MEDIUM) ||
this.isDeviceSize(styleResizable.statics.Sizes.LARGE)) {
styles.root = Object.assign(
styles.root,
styles.rootWhenMedium,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import List from 'material-ui/lib/lists/list';
import ListItem from 'material-ui/lib/lists/list-item';
import Avatar from 'material-ui/lib/avatar';
import Subheader from 'material-ui/lib/Subheader';
import {SelectableContainerEnhance} from 'material-ui/lib/hoc/selectable-enhance';
import {SelectableContainerEnhance} from 'material-ui/lib/lists/selectable-enhance';
let SelectableList = SelectableContainerEnhance(List);

function wrapState(ComposedComponent) {
Expand Down
15 changes: 6 additions & 9 deletions docs/src/app/components/pages/customization/InlineStyles.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import React from 'react';
import Title from 'react-title-component';

import {Checkbox, Styles} from 'material-ui';
import Checkbox from 'material-ui/checkbox';
import CodeExample from '../../CodeExample';

const {Typography} = Styles;

import typography from 'material-ui/styles/typography';

class InlineStyles extends React.Component {
getStyles() {
Expand All @@ -16,17 +13,17 @@ class InlineStyles extends React.Component {
paddingTop: 16,
marginBottom: 12,
letterSpacing: '0',
fontWeight: Typography.fontWeightNormal,
color: Typography.textDarkBlack,
fontWeight: typography.fontWeightNormal,
color: typography.textDarkBlack,
},
title: {
fontSize: 20,
lineHeight: '28px',
paddingTop: 19,
marginBottom: 13,
letterSpacing: '0',
fontWeight: Typography.fontWeightMedium,
color: Typography.textDarkBlack,
fontWeight: typography.fontWeightMedium,
color: typography.textDarkBlack,
},
};
}
Expand Down
Loading