@hixme-ui/theme-props
Advanced tools
Comparing version 2.0.0-alpha.12 to 2.0.0-alpha.13
@@ -35,3 +35,3 @@ 'use strict'; | ||
var propGroup = theme[propName]; | ||
var propGroup = theme[propName] || {}; | ||
var foundProp = propGroup && (0, _keys2.default)(propGroup).find(function (prop) { | ||
@@ -38,0 +38,0 @@ return props[prop]; |
{ | ||
"name": "@hixme-ui/theme-props", | ||
"version": "2.0.0-alpha.12", | ||
"version": "2.0.0-alpha.13", | ||
"description": "hixme-ui theme props getters", | ||
@@ -79,3 +79,4 @@ "main": "lib/index.js", | ||
}, | ||
"license": "MIT" | ||
"license": "MIT", | ||
"gitHead": "1b45a26029ea2df95e5acd9d8589207d674f5d9e" | ||
} |
export function getThemePropsComposer(propName = 'colors', defaultValue = '') { | ||
return ({ theme = {}, ...props = {} } = {}, defaultValueOverride) => { | ||
const propGroup = theme[propName] | ||
const propGroup = theme[propName] || {} | ||
const foundProp = propGroup && Object.keys(propGroup).find(prop => props[prop]) | ||
@@ -5,0 +5,0 @@ return foundProp ? propGroup[foundProp] : defaultValueOverride || propGroup.default || defaultValue |
Sorry, the diff of this file is not supported yet
13585