stylized-component
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -1,3 +0,3 @@ | ||
export { Theme } from './Theme'; | ||
export { StyledComponent, styleId } from './StyledComponent'; | ||
export { ThemeProvider, ThemeProps } from './ThemeProvider'; | ||
export { StylizedComponent } from './components/StylizedComponent'; | ||
export { ThemeProvider } from './components/ThemeProvider'; | ||
export { Button } from './components/Button'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var StyledComponent_1 = require("./StyledComponent"); | ||
exports.StyledComponent = StyledComponent_1.StyledComponent; | ||
exports.styleId = StyledComponent_1.styleId; | ||
var ThemeProvider_1 = require("./ThemeProvider"); | ||
var StylizedComponent_1 = require("./components/StylizedComponent"); | ||
exports.StylizedComponent = StylizedComponent_1.StylizedComponent; | ||
var ThemeProvider_1 = require("./components/ThemeProvider"); | ||
exports.ThemeProvider = ThemeProvider_1.ThemeProvider; | ||
var Button_1 = require("./components/Button"); | ||
exports.Button = Button_1.Button; | ||
//# sourceMappingURL=index.js.map |
@@ -5,3 +5,3 @@ /// <reference types="react" /> | ||
import { ThemeContext } from './ThemeProvider'; | ||
export declare abstract class StyledComponent<Style, Props extends Style, State> extends Component<Props, State> { | ||
export declare class StyledComponent<Style, Props extends Style, State> extends Component<Props, State> { | ||
static contextTypes: { | ||
@@ -14,3 +14,4 @@ theme: PropTypes.Requireable<any>; | ||
constructor(props: Props, context: ThemeContext); | ||
componentWillReceiveProps(nextProps: Props): void; | ||
} | ||
export declare const styleId: (key: string) => (target: Function) => void; |
@@ -27,2 +27,6 @@ "use strict"; | ||
} | ||
StyledComponent.prototype.componentWillReceiveProps = function (nextProps) { | ||
var contextStyle = _.get(this.context, ['theme', this.styleId]); | ||
this.style = _.extend(contextStyle, nextProps); | ||
}; | ||
StyledComponent.contextTypes = { | ||
@@ -29,0 +33,0 @@ theme: PropTypes.object, |
@@ -0,1 +1,4 @@ | ||
export interface Themes { | ||
[key: string]: Theme; | ||
} | ||
export interface Theme { | ||
@@ -2,0 +5,0 @@ [key: string]: ThemeStyle; |
@@ -21,3 +21,4 @@ /// <reference types="react" /> | ||
getChildContext(): ThemeContext; | ||
componentWillReceiveProps(nextProps: Props): void; | ||
render(): JSX.Element; | ||
} |
@@ -27,2 +27,5 @@ "use strict"; | ||
}; | ||
ThemeProvider.prototype.componentWillReceiveProps = function (nextProps) { | ||
this.theme = nextProps.theme; | ||
}; | ||
ThemeProvider.prototype.render = function () { | ||
@@ -29,0 +32,0 @@ return React.createElement("div", null, this.props.children); |
{ | ||
"name": "stylized-component", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "A design prototype", | ||
@@ -17,5 +17,7 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@types/color": "^2.0.0", | ||
"@types/lodash": "^4.14.85", | ||
"@types/prop-types": "^15.5.2", | ||
"@types/react": "^16.0.7", | ||
"color": "^2.0.1", | ||
"lodash": "^4.17.4", | ||
@@ -22,0 +24,0 @@ "prop-types": "^15.5.2", |
@@ -1,3 +0,3 @@ | ||
export { Theme } from './Theme'; | ||
export { StyledComponent, styleId } from './StyledComponent'; | ||
export { ThemeProvider, ThemeProps } from './ThemeProvider'; | ||
export { StylizedComponent } from './components/StylizedComponent'; | ||
export { ThemeProvider } from './components/ThemeProvider'; | ||
export { Button } from './components/Button'; |
@@ -0,1 +1,5 @@ | ||
export interface Themes { | ||
[key: string]: Theme; | ||
} | ||
export interface Theme { | ||
@@ -2,0 +6,0 @@ [key: string]: ThemeStyle; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29138
53
598
8
+ Added@types/color@^2.0.0
+ Addedcolor@^2.0.1
+ Added@types/color@2.0.5(transitive)
+ Added@types/color-convert@2.0.4(transitive)
+ Added@types/color-name@1.1.5(transitive)
+ Addedcolor@2.0.1(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcolor-string@1.9.1(transitive)
+ Addedis-arrayish@0.3.2(transitive)
+ Addedsimple-swizzle@0.2.2(transitive)