Skip to content

Commit

Permalink
feat(theme): custom mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
artyorsh authored Mar 25, 2019
1 parent 51cdf68 commit f1abf83
Show file tree
Hide file tree
Showing 103 changed files with 9,713 additions and 9,107 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@
},
"dependencies": {
"eva": "github:akveo/eva",
"hoist-non-react-statics": "^3.2.1"
"hoist-non-react-statics": "^3.2.1",
"lodash.merge": "^4.6.1"
},
"devDependencies": {
"@babel/core": "^7.1.2",
"@babel/runtime": "^7.1.2",
"@types/jest": "^23.3.8",
"@types/lodash.merge": "^4.6.6",
"@types/react": "^16.4.18",
"@types/react-native": "^0.57.7",
"@types/react-navigation": "^2.13.7",
Expand Down
192 changes: 192 additions & 0 deletions src/framework/theme/common/mapping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
{
"version": 1.0,
"components": {
"Radio": {
"meta": {
"scope": "all",
"parameters": {
"width": {
"type": "number"
},
"height": {
"type": "number"
},
"borderRadius": {
"type": "number"
},
"borderWidth": {
"type": "number"
},
"borderColor": {
"type": "string"
},
"textColor": {
"type": "string"
},
"textMarginLeft": {
"type": "number"
},
"textFontSize": {
"type": "number"
},
"textFontWeight": {
"type": "string"
},
"selectWidth": {
"type": "number"
},
"selectHeight": {
"type": "number"
},
"selectBorderRadius": {
"type": "number"
},
"selectBackgroundColor": {
"type": "string"
},
"highlightWidth": {
"type": "number"
},
"highlightHeight": {
"type": "number"
},
"highlightBorderRadius": {
"type": "number"
},
"highlightBackgroundColor": {
"type": "string"
}
},
"appearances": {
"default": {
"default": true
}
},
"variantGroups": {
"status": {
"error": {
"default": false
}
},
"size": {
"small": {
"default": false
},
"medium": {
"default": true
},
"large": {
"default": false
}
}
},
"states": {
"checked": {
"default": false,
"priority": 0,
"scope": "all"
},
"disabled": {
"default": false,
"priority": 1,
"scope": "all"
},
"active": {
"default": false,
"priority": 2,
"scope": "all"
}
}
},
"appearances": {
"default": {
"mapping": {
"borderWidth": 2,
"borderColor": "gray-primary",
"textColor": "text-primary",
"textFontWeight": "500",
"selectBackgroundColor": "transparent",
"highlightBackgroundColor": "transparent",
"state": {
"active": {
"borderColor": "gray-dark",
"highlightBackgroundColor": "gray-light"
},
"checked": {
"borderColor": "blue-primary",
"selectBackgroundColor": "blue-primary"
},
"disabled": {
"borderColor": "gray-light",
"textColor": "gray-300"
},
"checked.active": {
"borderColor": "blue-dark"
},
"checked.disabled": {
"selectBackgroundColor": "gray-primary"
}
}
},
"variantGroups": {
"status": {
"error": {
"borderColor": "pink-primary",
"state": {
"checked": {
"borderColor": "pink-primary",
"selectBackgroundColor": "pink-primary"
},
"checked.active": {
"borderColor": "pink-primary"
}
}
}
},
"size": {
"small": {
"width": 30,
"height": 30,
"borderRadius": 15,
"textMarginLeft": 10,
"textFontSize": 14,
"selectWidth": 20,
"selectHeight": 20,
"selectBorderRadius": 10,
"highlightWidth": 50,
"highlightHeight": 50,
"highlightBorderRadius": 25
},
"medium": {
"width": 36,
"height": 36,
"borderRadius": 18,
"textMarginLeft": 12,
"textFontSize": 16,
"selectWidth": 24,
"selectHeight": 24,
"selectBorderRadius": 12,
"highlightWidth": 60,
"highlightHeight": 60,
"highlightBorderRadius": 30
},
"large": {
"width": 42,
"height": 42,
"borderRadius": 21,
"textMarginLeft": 14,
"textFontSize": 18,
"selectWidth": 28,
"selectHeight": 28,
"selectBorderRadius": 14,
"highlightWidth": 70,
"highlightHeight": 70,
"highlightBorderRadius": 35
}
}
}
}
}
}
}
}
Loading

0 comments on commit f1abf83

Please sign in to comment.