Skip to content

Commit

Permalink
Merge pull request #585 from mmrtnz/css-individual
Browse files Browse the repository at this point in the history
Allows requiring individual components
  • Loading branch information
Hai Nguyen committed Apr 27, 2015
2 parents ad91b6d + 4eff2c6 commit 383b820
Show file tree
Hide file tree
Showing 17 changed files with 65 additions and 30 deletions.
1 change: 1 addition & 0 deletions src/date-picker/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./date-picker');
12 changes: 9 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,27 @@ module.exports = {
Mixins: {
Classable: require('./mixins/classable'),
ClickAwayable: require('./mixins/click-awayable'),
WindowListenable: require('./mixins/window-listenable')
WindowListenable: require('./mixins/window-listenable'),
StylePropable: require('./mixins/style-propable')
},
Paper: require('./paper'),
RadioButton: require('./radio-button'),
RadioButtonGroup: require('./radio-button-group'),
RaisedButton: require('./raised-button'),
Slider: require('./slider'),
SvgIcon: require('./svg-icons/svg-icon'),
SvgIcon: require('./svg-icon'),
Icons: {
NavigationMenu: require('./svg-icons/navigation-menu'),
NavigationChevronLeft: require('./svg-icons/navigation-chevron-left'),
NavigationChevronRight: require('./svg-icons/navigation-chevron-right')
},
Styles: {
AutoPrefix: require('./styles/auto-prefix'),
Colors: require('./styles/colors'),
Spacing: require('./styles/spacing'),
ThemeManager: require('./styles/theme-manager')
ThemeManager: require('./styles/theme-manager'),
Transitions: require('./styles/transitions'),
Typography: require('./styles/typography')
},
Snackbar: require('./snackbar'),
Tab: require('./tabs/tab'),
Expand All @@ -53,5 +57,7 @@ module.exports = {
KeyCode: require('./utils/key-code'),
KeyLine: require('./utils/key-line'),
ColorManipulator: require('./utils/color-manipulator'),
Extend: require('./utils/extend'),
UniqueId: require('./utils/unique-id')
}
};
6 changes: 6 additions & 0 deletions src/menu/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
Menu: require('./menu'),
MenuItem: require('./menu-item'),
LinkMenuItem: require('./link-menu-item'),
SubheaderMenuItem: require('./subheader-menu-item')
};
6 changes: 6 additions & 0 deletions src/mixins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
Classable: require('./classable'),
ClickAwayable: require('./click-awayable'),
WindowListenable: require('./window-listenable'),
StylePropable: require('./style-propable')
};
8 changes: 8 additions & 0 deletions src/styles/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
AutoPrefix: require('./auto-prefix'),
Colors: require('./colors'),
Spacing: require('./spacing'),
ThemeManager: require('./theme-manager'),
Transitions: require('./transitions'),
Typography: require('./typography')
};
26 changes: 7 additions & 19 deletions src/svg-icons/svg-icon.jsx → src/svg-icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,18 @@ var SvgIcon = React.createClass({
theme: React.PropTypes.object
},

getInitialState: function() {
return {
isHovered: false,
};
},

getTheme: function() {
return this.context.theme.palette;
},

getStyles: function() {
var styles = {
root: {
display: 'inline-block',
height: '24px',
width: '24px',
userSelect: 'none',
fill: this.getTheme().textColor
},
rootWhenHovered: {

}
return {
display: 'inline-block',
height: '24px',
width: '24px',
userSelect: 'none',
fill: this.getTheme().textColor
};
return styles;
},

render: function() {
Expand All @@ -48,7 +36,7 @@ var SvgIcon = React.createClass({
{...other}
viewBox="0 0 24 24"
style={this.mergeAndPrefix(
this.getStyles().root,
this.getStyles(),
this.props.style)}>
{this.props.children}
</svg>
Expand Down
2 changes: 1 addition & 1 deletion src/svg-icons/drop-down-arrow.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var React = require('react');
var SvgIcon = require('./svg-icon');
var SvgIcon = require('../svg-icon');

var DropDownArrow = React.createClass({

Expand Down
2 changes: 1 addition & 1 deletion src/svg-icons/navigation-chevron-left.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var React = require('react');
var SvgIcon = require('./svg-icon');
var SvgIcon = require('../svg-icon');

var NavigationChevronLeft = React.createClass({

Expand Down
2 changes: 1 addition & 1 deletion src/svg-icons/navigation-chevron-right.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var React = require('react');
var SvgIcon = require('./svg-icon');
var SvgIcon = require('../svg-icon');

var NavigationChevronLeft = React.createClass({

Expand Down
2 changes: 1 addition & 1 deletion src/svg-icons/navigation-menu.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var React = require('react');
var SvgIcon = require('./svg-icon');
var SvgIcon = require('../svg-icon');

var NavigationMenu = React.createClass({

Expand Down
2 changes: 1 addition & 1 deletion src/svg-icons/toggle-check-box-checked.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var React = require('react');
var SvgIcon = require('./svg-icon');
var SvgIcon = require('../svg-icon');

var ToggleCheckBoxChecked = React.createClass({

Expand Down
2 changes: 1 addition & 1 deletion src/svg-icons/toggle-check-box-outline-blank.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var React = require('react');
var SvgIcon = require('./svg-icon');
var SvgIcon = require('../svg-icon');

var ToggleCheckBoxOutlineBlank = React.createClass({

Expand Down
2 changes: 1 addition & 1 deletion src/svg-icons/toggle-radio-button-off.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var React = require('react');
var SvgIcon = require('./svg-icon');
var SvgIcon = require('../svg-icon');

var RadioButtonOff = React.createClass({

Expand Down
2 changes: 1 addition & 1 deletion src/svg-icons/toggle-radio-button-on.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var React = require('react');
var SvgIcon = require('./svg-icon');
var SvgIcon = require('../svg-icon');

var RadioButtonOn = React.createClass({

Expand Down
4 changes: 4 additions & 0 deletions src/tabs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
Tab: require('tab'),
Tabs: require('tabs')
};
6 changes: 6 additions & 0 deletions src/toolbar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
Toolbar: require('./toolbar'),
ToolbarGroup: require('./toolbar-group'),
ToolbarSeparator: require('./toolbar-separator'),
ToolbarTitle: require('./toolbar-title')
};
10 changes: 10 additions & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
CssEvent: require('./css-event'),
Dom: require('./dom'),
Events: require('./events'),
KeyCode: require('./key-code'),
KeyLine: require('./key-line'),
ColorManipulator: require('./color-manipulator'),
Extend: require('./extend'),
UniqueId: require('./unique-id')
};

0 comments on commit 383b820

Please sign in to comment.