@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
- var path = propValue;
836
- if (!propValue.startsWith("@theme:")) path = "@theme:".concat(path);
837
- var valueFromPath = (0, _ThemeProvider.getValueFromPath)(path, tokenTheme) || {};
838
- Object.keys(valueFromPath).map(function (k) {
839
- result += "".concat(k, ":").concat(valueFromPath[k], ";");
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) result = "".concat(content).concat(propName, ":").concat(_valueFromPath, ";");else if ((0, _canI.canIExecuteClientCode)()) console.warn("Design token ".concat(propValue, " not found in theme."));
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) result = "".concat(content).concat(propName, ":").concat(_valueFromPalette, ";");else if ((0, _canI.canIExecuteClientCode)()) console.warn("Palette color ".concat(propValue, " not found in theme."));
849
- } else if (propValue) result = "".concat(content).concat(propName, ":").concat(propValue, ";");
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
  }, ""), "}");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@front10/helpers",
3
- "version": "2.0.18",
3
+ "version": "2.0.19",
4
4
  "description": "Helpers for front10 components",
5
5
  "source": "src/index.js",
6
6
  "main": "dist/front10-helpers.js",