diff --git a/lib/components/Tab.js b/lib/components/Tab.js index 51090143ed..510fc43763 100644 --- a/lib/components/Tab.js +++ b/lib/components/Tab.js @@ -24,6 +24,7 @@ module.exports = React.createClass({ selected: PropTypes.bool, disabled: PropTypes.bool, panelId: PropTypes.string, + style: PropTypes.object, children: PropTypes.oneOfType([ PropTypes.array, PropTypes.object, @@ -60,6 +61,7 @@ module.exports = React.createClass({ } )} role="tab" + style={this.props.style} id={this.props.id} aria-selected={this.props.selected ? 'true' : 'false'} aria-expanded={this.props.selected ? 'true' : 'false'} diff --git a/lib/components/TabList.js b/lib/components/TabList.js index 2f98267b11..0ea5625555 100644 --- a/lib/components/TabList.js +++ b/lib/components/TabList.js @@ -6,6 +6,7 @@ module.exports = React.createClass({ propTypes: { className: PropTypes.string, + style: PropTypes.object, children: PropTypes.oneOfType([ PropTypes.object, PropTypes.array @@ -20,6 +21,7 @@ module.exports = React.createClass({ this.props.className )} role="tablist" + style={this.props.style} > {this.props.children} diff --git a/lib/components/TabPanel.js b/lib/components/TabPanel.js index 7ed7888b06..b2d638733c 100644 --- a/lib/components/TabPanel.js +++ b/lib/components/TabPanel.js @@ -1,5 +1,6 @@ import React, {PropTypes} from 'react'; import cx from 'classnames'; +import objectAssign from 'object-assign'; module.exports = React.createClass({ displayName: 'TabPanel', @@ -9,6 +10,7 @@ module.exports = React.createClass({ selected: PropTypes.bool, id: PropTypes.string, tabId: PropTypes.string, + style: PropTypes.object, children: PropTypes.oneOfType([ PropTypes.array, PropTypes.object, @@ -45,7 +47,7 @@ module.exports = React.createClass({ role="tabpanel" id={this.props.id} aria-labelledby={this.props.tabId} - style={{display: this.props.selected ? null : 'none'}} + style={objectAssign({}, this.props.style, {display: this.props.selected ? null : 'none'})} > {children} diff --git a/lib/components/Tabs.js b/lib/components/Tabs.js index ad99d53fbe..f2c89755ac 100644 --- a/lib/components/Tabs.js +++ b/lib/components/Tabs.js @@ -26,7 +26,8 @@ module.exports = React.createClass({ onSelect: PropTypes.func, focus: PropTypes.bool, children: childrenPropType, - forceRenderTabPanel: PropTypes.bool + forceRenderTabPanel: PropTypes.bool, + style: PropTypes.object }, childContextTypes: { @@ -304,6 +305,7 @@ module.exports = React.createClass({ this.props.className )} onClick={this.handleClick} + style={this.props.style} onKeyDown={this.handleKeyDown} > {this.getChildren()} diff --git a/package.json b/package.json index 0f28abbc1e..2d21cb4b9b 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ }, "dependencies": { "classnames": "^2.2", - "js-stylesheet": "^0.0.1" + "js-stylesheet": "^0.0.1", + "object-assign": "^4.0.1" } -} \ No newline at end of file +}