diff --git a/lib/components/AppBar.js b/lib/components/AppBar.js index f533d42..ea48c80 100644 --- a/lib/components/AppBar.js +++ b/lib/components/AppBar.js @@ -1,4 +1,4 @@ -Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;} var HeaderRow=function HeaderRow(_ref){var children=_ref.children,style=_ref.style,other=_objectWithoutProperties(_ref,['children','style']);return( -_react2.default.createElement(_reactNative.View,_extends({style:[styles.base].concat(style)},other), +_react2.default.createElement(_reactNative.View,_extends({style:[styles.base].concat(style)},other,{__source:{fileName:_jsxFileName,lineNumber:8}}), _react2.default.Children.map(children,function(child,i){return( i===0? diff --git a/lib/components/DataTable/Row.js b/lib/components/DataTable/Row.js index 415e00b..e809306 100644 --- a/lib/components/DataTable/Row.js +++ b/lib/components/DataTable/Row.js @@ -1,11 +1,11 @@ -Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;} var HeaderRow=function HeaderRow(_ref){var children=_ref.children,style=_ref.style,other=_objectWithoutProperties(_ref,['children','style']);return( -_react2.default.createElement(_reactNative.View,_extends({style:[styles.base].concat(style)},other), +_react2.default.createElement(_reactNative.View,_extends({style:[styles.base].concat(style)},other,{__source:{fileName:_jsxFileName,lineNumber:8}}), _react2.default.Children.map(children,function(child,i){return( i===0? diff --git a/lib/components/DataTable/index.js b/lib/components/DataTable/index.js index ed50e8d..5465aa2 100644 --- a/lib/components/DataTable/index.js +++ b/lib/components/DataTable/index.js @@ -1,4 +1,4 @@ -Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;} @@ -41,7 +41,7 @@ fontSize:SIZE, lineHeight:SIZE}]. concat(style)}, -other), +other,{__source:{fileName:_jsxFileName,lineNumber:33}}), name, children)); @@ -56,7 +56,7 @@ Icon.propTypes={ name:_propTypes2.default.string.isRequired, children:_propTypes2.default.node, -style:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.array])};exports.default= +style:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.array,_propTypes2.default.number])};exports.default= Icon; diff --git a/lib/components/List.js b/lib/components/List.js index 9770d9f..bfcc61e 100644 --- a/lib/components/List.js +++ b/lib/components/List.js @@ -1,4 +1,4 @@ -Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i0; return( -_react2.default.createElement(_reactNative.View,null, +_react2.default.createElement(_reactNative.View,{__source:{fileName:_jsxFileName,lineNumber:126}}, _react2.default.createElement(_index.TouchableRipple,{ style:styles.touchable, onMouseEnter:function onMouseEnter(){return _this3.setState({hovered:true});}, onMouseLeave:function onMouseLeave(){return _this3.setState({hovered:false});}, -onPress:onPress}, +onPress:onPress,__source:{fileName:_jsxFileName,lineNumber:127}}, _react2.default.createElement(_reactNative.Animated.View,_extends({ css:styles.body, style:[ (0,_uranium.animate)(['backgroundColor'],styles.body,styles.hovered,this._hoverAV)]. concat(style)}, -otherWithoutCustomProps), +otherWithoutCustomProps,{__source:{fileName:_jsxFileName,lineNumber:132}}), leftIcon&& _react2.default.createElement(_index.Icon,{ name:leftIcon, style:[ styles.leftIcon, -active&&styles.active]}), +active&&styles.active],__source:{fileName:_jsxFileName,lineNumber:139}}), _react2.default.createElement(_index.Subheading,{ @@ -149,7 +149,7 @@ active&&styles.active, thereIsSomethingOnTheRight&&styles.primaryTextGivenRightEl], numberOfLines:1, -ellipsizeMode:'tail'}, +ellipsizeMode:'tail',__source:{fileName:_jsxFileName,lineNumber:146}}, primaryText), secondaryText&& @@ -158,7 +158,7 @@ numberOfLines:secondaryTextLines, ellipsizeMode:'tail', style:[ styles.secondaryText, -rightIcon&&styles.secondaryTextGivenRightEl]}, +rightIcon&&styles.secondaryTextGivenRightEl],__source:{fileName:_jsxFileName,lineNumber:156}}, secondaryText), @@ -167,7 +167,7 @@ rightText&& _react2.default.createElement(_index.Caption,{ numberOfLines:1, ellipsizeMode:'tail', -css:styles.rightText}, +css:styles.rightText,__source:{fileName:_jsxFileName,lineNumber:167}}, rightText), @@ -181,7 +181,7 @@ rightText&&styles.rightIconGivenRightText], style:(0,_uranium.animate)( styles.expandIconCollapsed, styles.expandIconExpanded, -this._expandIconAV)}), +this._expandIconAV),__source:{fileName:_jsxFileName,lineNumber:175}}), rightIcon&& @@ -190,12 +190,12 @@ _react2.default.createElement(_index.Icon,{ name:rightIcon, css:[ styles.rightIcon, -rightText&&styles.rightIconGivenRightText]}): +rightText&&styles.rightIconGivenRightText],__source:{fileName:_jsxFileName,lineNumber:189}}): _react2.default.createElement(_reactNative.View,{ css:[ styles.rightIcon, -rightText&&styles.rightIconGivenRightText]}, +rightText&&styles.rightIconGivenRightText],__source:{fileName:_jsxFileName,lineNumber:195}}, rightIcon))), @@ -208,7 +208,7 @@ style:[ styles.nestedList, (0,_uranium.animate)('maxHeight',0,childrenCount*72+40,this._expandHeightAV), (0,_uranium.animate)('opacity',0,1,this._expandOpacityAV), -this.state.fullyExpanded&&{maxHeight:undefined}]}, +this.state.fullyExpanded&&{maxHeight:undefined}],__source:{fileName:_jsxFileName,lineNumber:206}}, children))); @@ -258,7 +258,7 @@ expanded:_propTypes2.default.bool, children:_propTypes2.default.node, -style:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.array]), +style:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.array,_propTypes2.default.number]), onPress:_propTypes2.default.func, diff --git a/lib/components/NavigationDrawer.js b/lib/components/NavigationDrawer.js index dfaf5fa..164af9b 100644 --- a/lib/components/NavigationDrawer.js +++ b/lib/components/NavigationDrawer.js @@ -1,4 +1,4 @@ -Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;} @@ -29,8 +29,8 @@ _react2.default.createElement(_index.TouchableRipple,_extends({ rippleCentered:true, rippleSpread:0.34, style:[styles.base].concat(style)}, -other), -_react2.default.createElement(_index.Icon,{name:name,style:iconStyle}))); +other,{__source:{fileName:_jsxFileName,lineNumber:28}}), +_react2.default.createElement(_index.Icon,{name:name,style:iconStyle,__source:{fileName:_jsxFileName,lineNumber:33}}))); }; @@ -44,7 +44,7 @@ name:_propTypes2.default.string.isRequired, -style:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.array]), +style:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.array,_propTypes2.default.number]), diff --git a/lib/components/buttons/RaisedButton.js b/lib/components/buttons/RaisedButton.js index f0d2e72..2229a78 100644 --- a/lib/components/buttons/RaisedButton.js +++ b/lib/components/buttons/RaisedButton.js @@ -1,4 +1,4 @@ -Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}return target;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}exports.default= function(component){ var WrappedComponent=component; @@ -17,27 +18,26 @@ return component(this.props,this.context); ConnectTheme=function(_Component2){_inherits(ConnectTheme,_Component2);function ConnectTheme(){var _ref;var _temp,_this2,_ret;_classCallCheck(this,ConnectTheme);for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return _ret=(_temp=(_this2=_possibleConstructorReturn(this,(_ref=ConnectTheme.__proto__||Object.getPrototypeOf(ConnectTheme)).call.apply(_ref,[this].concat(args))),_this2),_this2. _node=null,_temp),_possibleConstructorReturn(_this2,_ret);}_createClass(ConnectTheme,[{key:'render',value:function render() -{var _this3=this; +{var _this3=this;var _props= +this.props,mergeTheme=_props.mergeTheme,rest=_objectWithoutProperties(_props,['mergeTheme']); return( _react2.default.createElement(WrappedComponent,_extends({}, -this.props,{ +rest,{ ref:function ref(c){_this3._node=c;}, -theme:this.context.theme||_index.themes.light}))); +theme:(0,_merge2.default)(this.context.theme||_index.themes.light,mergeTheme||{}),__source:{fileName:_jsxFileName,lineNumber:24}}))); }}]);return ConnectTheme;}(_react.Component); -ConnectTheme.displayName='ConnectTheme('+( -_react.Component.displayName||_react.Component.name||'Component')+')'; +ConnectTheme.propTypes={ +mergeTheme:_propTypes2.default.object}; -ConnectTheme.contextTypes=_extends({}, -ConnectTheme.contextTypes,{ -theme:_propTypes2.default.object}); +ConnectTheme.displayName='ConnectTheme('+( +_react.Component.displayName||_react.Component.name||'Component')+')'; -ConnectTheme.childContextTypes=_extends({}, -ConnectTheme.childContextTypes,{ -theme:_propTypes2.default.object}); +ConnectTheme.contextTypes={ +theme:_propTypes2.default.object}; return ConnectTheme; diff --git a/package.json b/package.json index 2153fd5..b55917f 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,6 @@ }, "peerDependencies": { "prop-types": "^15.5.10", - "react": "^15.6.1" + "react": "^16.0.0" } } diff --git a/src/components/DataTable/Cell.js b/src/components/DataTable/Cell.js index fd0f8d0..a764891 100644 --- a/src/components/DataTable/Cell.js +++ b/src/components/DataTable/Cell.js @@ -17,7 +17,7 @@ const Cell = ({ children, style, ...other }) => { Cell.propTypes = { children: PropTypes.node, - style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + style: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), } export default Cell diff --git a/src/components/DataTable/HeaderCell.js b/src/components/DataTable/HeaderCell.js index c0f13b0..45d40a3 100644 --- a/src/components/DataTable/HeaderCell.js +++ b/src/components/DataTable/HeaderCell.js @@ -17,7 +17,7 @@ const HeaderCell = ({ children, style, ...other }) => { HeaderCell.propTypes = { children: PropTypes.node, - style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + style: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), } export default HeaderCell diff --git a/src/components/Dialog.js b/src/components/Dialog.js index 0eb8950..3faa8b6 100644 --- a/src/components/Dialog.js +++ b/src/components/Dialog.js @@ -104,7 +104,7 @@ Dialog.propTypes = { * The contents of the dialog */ children: PropTypes.node.isRequired, - style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + style: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), } Dialog.defaultProps = { diff --git a/src/components/Icon.js b/src/components/Icon.js index 2bf5831..b30a744 100644 --- a/src/components/Icon.js +++ b/src/components/Icon.js @@ -56,7 +56,7 @@ Icon.propTypes = { name: PropTypes.string.isRequired, children: PropTypes.node, - style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + style: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), } export default Icon diff --git a/src/components/ListItem.js b/src/components/ListItem.js index afd6bca..9c8f004 100644 --- a/src/components/ListItem.js +++ b/src/components/ListItem.js @@ -258,7 +258,7 @@ ListItem.propTypes = { * and expandable. */ children: PropTypes.node, - style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + style: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), onPress: PropTypes.func, // connectTheme diff --git a/src/components/NavigationDrawer.js b/src/components/NavigationDrawer.js index 675d68b..70eea4a 100644 --- a/src/components/NavigationDrawer.js +++ b/src/components/NavigationDrawer.js @@ -109,11 +109,11 @@ NavigationDrawer.propTypes = { * Will open the drawer if set to true. */ open: PropTypes.bool, - style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + style: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), /** * The style of the menu. */ - menuStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + menuStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), /** * Callback for when the overlay is pressed */ diff --git a/src/components/TextField.js b/src/components/TextField.js index fc55684..450f8f4 100644 --- a/src/components/TextField.js +++ b/src/components/TextField.js @@ -209,11 +209,11 @@ TextField.propTypes = { /** * The style passed to the React Native TextInput */ - textInputStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + textInputStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), /** * The style passed to the placeholder. */ - placeholderStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + placeholderStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), /** * Passed through to the underlying TextInput. */ @@ -225,7 +225,7 @@ TextField.propTypes = { /** * The style of the containing View. */ - style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + style: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), } TextField.defaultProps = { diff --git a/src/components/TouchableRipple.js b/src/components/TouchableRipple.js index 58f577d..910fe5b 100644 --- a/src/components/TouchableRipple.js +++ b/src/components/TouchableRipple.js @@ -72,7 +72,7 @@ const TouchableRipple = createReactClass({ * a single element. */ children: PropTypes.node, - style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + style: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), }, mixins: [Touchable.Mixin], diff --git a/src/components/buttons/FlatButton.js b/src/components/buttons/FlatButton.js index 8c29498..7383fc5 100644 --- a/src/components/buttons/FlatButton.js +++ b/src/components/buttons/FlatButton.js @@ -73,7 +73,7 @@ Button.propTypes = { /** * The style of the button text. Only applies if props.children isn't passed. */ - textStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + textStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), // connectTheme theme: PropTypes.object.isRequired, diff --git a/src/components/buttons/FloatingActionButton.js b/src/components/buttons/FloatingActionButton.js index ffc5cde..bca35ae 100644 --- a/src/components/buttons/FloatingActionButton.js +++ b/src/components/buttons/FloatingActionButton.js @@ -82,7 +82,7 @@ FloatingActionButton.propTypes = { * Usually an */ children: PropTypes.node, - style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + style: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), onPressIn: PropTypes.func, onPressOut: PropTypes.func, diff --git a/src/components/buttons/IconToggle.js b/src/components/buttons/IconToggle.js index 6611d1b..39bb096 100644 --- a/src/components/buttons/IconToggle.js +++ b/src/components/buttons/IconToggle.js @@ -44,7 +44,7 @@ IconToggle.propTypes = { /** * The style of the containing TouchableRipple (which is a View) */ - style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + style: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), /** * The style of the Icon element */ diff --git a/src/components/buttons/RaisedButton.js b/src/components/buttons/RaisedButton.js index b1b15a6..46850b1 100644 --- a/src/components/buttons/RaisedButton.js +++ b/src/components/buttons/RaisedButton.js @@ -81,7 +81,7 @@ RaisedButton.propTypes = { /** * The style of the button text. Only applies if props.children isn't passed. */ - textStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + textStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.number]), // connectTheme theme: PropTypes.object.isRequired, diff --git a/src/theme/connectTheme.js b/src/theme/connectTheme.js index 11eae92..532b2b3 100644 --- a/src/theme/connectTheme.js +++ b/src/theme/connectTheme.js @@ -1,5 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' +import merge from 'lodash/merge' import { themes } from '../index' export default component => { @@ -18,25 +19,24 @@ export default component => { _node = null render() { + const { mergeTheme, ...rest } = this.props return ( { this._node = c }} - theme={this.context.theme || themes.light} /> + theme={merge(this.context.theme || themes.light, mergeTheme || {})} /> ) } } + ConnectTheme.propTypes = { + mergeTheme: PropTypes.object, + } + ConnectTheme.displayName = `ConnectTheme(${Component.displayName || Component.name || 'Component'})` ConnectTheme.contextTypes = { - ...ConnectTheme.contextTypes, - theme: PropTypes.object, - } - - ConnectTheme.childContextTypes = { - ...ConnectTheme.childContextTypes, theme: PropTypes.object, }