@front10/helpers 2.0.19 → 2.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -84,13 +84,13 @@ var initTheme = function initTheme(theme) {
84
84
  generatedStyles.push(generateTypographyStyles(theme.typography));
85
85
  }
86
86
 
87
- if (theme.colors) {
88
- generatedStyles.push(["button.fr-btn:disabled{\n background-color:".concat(theme.components && theme.components.button && theme.components.button.disabled && theme.components.button.disabled.bgColor ? theme.components.button.disabled.bgColor : "#d4d4d4", ";\n border-color:").concat(theme.components && theme.components.button && theme.components.button.disabled && theme.components.button.disabled.bgColor ? theme.components.button.disabled.bgColor : "#d4d4d4", ";\n color:").concat(theme.components && theme.components.button && theme.components.button.disabled && theme.components.button.disabled.bgColor ? theme.components.button.disabled.bgColor : "#afafaf", "\n }\n ")]);
89
- var themeColorsKeys = Object.keys(theme.colors);
87
+ if (theme.colors || theme.designTokens.colors) {
88
+ var colors = Boolean(theme.colors) ? theme.colors : theme.designTokens.colors;
89
+ var themeColorsKeys = Object.keys(colors);
90
90
 
91
91
  for (var index = 0; index < themeColorsKeys.length; index += 1) {
92
92
  var colorName = themeColorsKeys[index];
93
- var colorValue = theme.colors[themeColorsKeys[index]];
93
+ var colorValue = colors[themeColorsKeys[index]];
94
94
 
95
95
  if (colorValue !== "none") {
96
96
  (function () {
@@ -122,8 +122,8 @@ var initTheme = function initTheme(theme) {
122
122
  }
123
123
  }
124
124
 
125
- if (theme.colors.primary) {
126
- var primaryHover = (0, _Color.hexToRGBA)(theme.colors.primary, 0.25);
125
+ if (colors.primary) {
126
+ var primaryHover = (0, _Color.hexToRGBA)(colors.primary, 0.25);
127
127
  generatedStyles.push(".fr-focus:focus, .fr-form-control:focus, .fr-focus\\:focus{box-shadow: 0 0 0 0.2rem ".concat(primaryHover, ";outline: 0;}"));
128
128
  }
129
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@front10/helpers",
3
- "version": "2.0.19",
3
+ "version": "2.0.21",
4
4
  "description": "Helpers for front10 components",
5
5
  "source": "src/index.js",
6
6
  "main": "dist/front10-helpers.js",