stylized-component
Advanced tools
Comparing version 0.0.9 to 0.0.10
export { Theme } from './Theme'; | ||
export { StyledComponent, themeKey } from './StyledComponent'; | ||
export { StyledComponent, styleId } from './StyledComponent'; | ||
export { ThemeProvider, ThemeProps } from './ThemeProvider'; |
@@ -5,5 +5,5 @@ "use strict"; | ||
exports.StyledComponent = StyledComponent_1.StyledComponent; | ||
exports.themeKey = StyledComponent_1.themeKey; | ||
exports.styleId = StyledComponent_1.styleId; | ||
var ThemeProvider_1 = require("./ThemeProvider"); | ||
exports.ThemeProvider = ThemeProvider_1.ThemeProvider; | ||
//# sourceMappingURL=index.js.map |
@@ -11,5 +11,5 @@ /// <reference types="react" /> | ||
style: Partial<Styles>; | ||
themeKey: string; | ||
styleId: string; | ||
constructor(props: Props, context: ThemeProviderContext); | ||
} | ||
export declare const themeKey: (key: string) => (target: Function) => void; | ||
export declare const styleId: (key: string) => (target: Function) => void; |
@@ -24,3 +24,3 @@ "use strict"; | ||
var propStyle = _.extend({}, props); | ||
var contextStyle = _.get(context, "theme.overrides['" + _this.themeKey + "']"); | ||
var contextStyle = _.get(context, "theme['" + _this.styleId + "']"); | ||
_this.style = _.extend(contextStyle, propStyle); | ||
@@ -35,7 +35,7 @@ return _this; | ||
exports.StyledComponent = StyledComponent; | ||
exports.themeKey = function (key) { | ||
exports.styleId = function (key) { | ||
return function (target) { | ||
target.prototype.themeKey = key; | ||
target.prototype.styleId = key; | ||
}; | ||
}; | ||
//# sourceMappingURL=StyledComponent.js.map |
export interface Theme { | ||
overrides?: ComponentThemes; | ||
[key: string]: Style; | ||
} | ||
export interface ComponentTheme { | ||
export interface Style { | ||
dangerouslyOverrideCss?: CSSStyleDeclaration; | ||
[prop: string]: any; | ||
} | ||
export interface ComponentThemes { | ||
[key: string]: ComponentTheme; | ||
} |
{ | ||
"name": "stylized-component", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "A design prototype", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
export { Theme } from './Theme'; | ||
export { StyledComponent, themeKey } from './StyledComponent'; | ||
export { StyledComponent, styleId } from './StyledComponent'; | ||
export { ThemeProvider, ThemeProps } from './ThemeProvider'; |
@@ -15,3 +15,3 @@ import * as _ from 'lodash'; | ||
style: Partial<Styles>; | ||
themeKey: string; | ||
styleId: string; | ||
@@ -25,3 +25,3 @@ constructor(props: Props, context: ThemeProviderContext) { | ||
const propStyle: Partial<Styles> = _.extend({}, props); | ||
const contextStyle = _.get(context, `theme.overrides['${this.themeKey}']`); | ||
const contextStyle = _.get(context, `theme['${this.styleId}']`); | ||
this.style = _.extend(contextStyle, propStyle); | ||
@@ -31,6 +31,6 @@ } | ||
export const themeKey = (key: string) => { | ||
export const styleId = (key: string) => { | ||
return function (target: Function) { | ||
target.prototype.themeKey = key; | ||
target.prototype.styleId = key; | ||
}; | ||
}; |
export interface Theme { | ||
overrides?: ComponentThemes; | ||
[key: string]: Style; | ||
} | ||
export interface ComponentTheme { | ||
export interface Style { | ||
dangerouslyOverrideCss?: CSSStyleDeclaration; | ||
[prop: string]: any; | ||
} | ||
export interface ComponentThemes { | ||
[key: string]: ComponentTheme; | ||
} |
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
14537
305