@front10/helpers 2.0.18 → 2.0.19
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.
|
@@ -832,21 +832,48 @@ var buildClass = function buildClass(props) {
|
|
|
832
832
|
var result = content;
|
|
833
833
|
|
|
834
834
|
if (propName === "@theme") {
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
835
|
+
if (propValue && Array.isArray(propValue)) {
|
|
836
|
+
propValue.forEach(function (item) {
|
|
837
|
+
var result = content;
|
|
838
|
+
var newItem = item;
|
|
839
|
+
newItem = (0, _ThemeProvider.getValueFromPath)("@theme:".concat(newItem), tokenTheme) || {};
|
|
840
|
+
Object.keys(newItem).map(function (k) {
|
|
841
|
+
result += "".concat(k, ":").concat(newItem[k], ";");
|
|
842
|
+
});
|
|
843
|
+
content = result;
|
|
844
|
+
});
|
|
845
|
+
result = content;
|
|
846
|
+
} else {
|
|
847
|
+
var path = propValue;
|
|
848
|
+
|
|
849
|
+
if (!propValue.startsWith("@theme:")) {
|
|
850
|
+
path = "@theme:".concat(path);
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
var valueFromPath = (0, _ThemeProvider.getValueFromPath)(path, tokenTheme) || {};
|
|
854
|
+
Object.keys(valueFromPath).map(function (k) {
|
|
855
|
+
result += "".concat(k, ":").concat(valueFromPath[k], ";");
|
|
856
|
+
});
|
|
857
|
+
}
|
|
841
858
|
} else if (typeof propValue === "string" && propValue.startsWith("@theme:")) {
|
|
842
859
|
var _valueFromPath = (0, _ThemeProvider.getValueFromPath)(propValue, tokenTheme);
|
|
843
860
|
|
|
844
|
-
if (_valueFromPath)
|
|
861
|
+
if (_valueFromPath) {
|
|
862
|
+
result = "".concat(content).concat(propName, ":").concat(_valueFromPath, ";");
|
|
863
|
+
} else if ((0, _canI.canIExecuteClientCode)()) {
|
|
864
|
+
console.warn("Design token ".concat(propValue, " not found in theme."));
|
|
865
|
+
}
|
|
845
866
|
} else if (typeof propValue === "string" && propValue.includes("@palette:")) {
|
|
846
867
|
var _valueFromPalette = (0, _ThemeProvider.getFromPalette)(propValue, tokenTheme);
|
|
847
868
|
|
|
848
|
-
if (_valueFromPalette)
|
|
849
|
-
|
|
869
|
+
if (_valueFromPalette) {
|
|
870
|
+
result = "".concat(content).concat(propName, ":").concat(_valueFromPalette, ";");
|
|
871
|
+
} else if ((0, _canI.canIExecuteClientCode)()) {
|
|
872
|
+
console.warn("Palette color ".concat(propValue, " not found in theme."));
|
|
873
|
+
}
|
|
874
|
+
} else if (propValue) {
|
|
875
|
+
result = "".concat(content).concat(propName, ":").concat(propValue, ";");
|
|
876
|
+
}
|
|
850
877
|
|
|
851
878
|
return result;
|
|
852
879
|
}, ""), "}");
|