@commonsku/styles 1.16.2 → 1.16.3
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.
- package/dist/index.es.js +7 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1319,16 +1319,18 @@ var themeOptions = {
|
|
|
1319
1319
|
},
|
|
1320
1320
|
};
|
|
1321
1321
|
function getColor(color, def) {
|
|
1322
|
+
var _a;
|
|
1322
1323
|
if (!color) {
|
|
1323
1324
|
return '';
|
|
1324
1325
|
}
|
|
1325
|
-
return _.get(colors, color, _.get(colors, def || '', def));
|
|
1326
|
+
return (_a = _.get(colors, color, _.get(colors, def || '', def))) !== null && _a !== void 0 ? _a : '';
|
|
1326
1327
|
}
|
|
1327
1328
|
function getFontStyle(value, def) {
|
|
1329
|
+
var _a;
|
|
1328
1330
|
if (!value) {
|
|
1329
1331
|
return '';
|
|
1330
1332
|
}
|
|
1331
|
-
return _.get(fontStyles, value, _.get(fontStyles, def || '', def));
|
|
1333
|
+
return (_a = _.get(fontStyles, value, _.get(fontStyles, def || '', def))) !== null && _a !== void 0 ? _a : '';
|
|
1332
1334
|
}
|
|
1333
1335
|
function getThemeColor(props, color, fallbackColor) {
|
|
1334
1336
|
return getThemeProperty(props, 'colors', color, fallbackColor);
|
|
@@ -1344,6 +1346,7 @@ function getThemeFontFamily(props, fallbackValue) {
|
|
|
1344
1346
|
return getThemeProperty(props, 'fontFamily', fallbackValue);
|
|
1345
1347
|
}
|
|
1346
1348
|
function getThemeProperty(props, prop, value, fallbackValue) {
|
|
1349
|
+
var _a, _b;
|
|
1347
1350
|
if (_.get(props, "theme.".concat(prop), null)) {
|
|
1348
1351
|
if (_.isObject(props.theme[prop]) && _.get(props.theme, "".concat(prop, ".").concat(value), null)) {
|
|
1349
1352
|
return _.get(props.theme, "".concat(prop, ".").concat(value), null);
|
|
@@ -1353,7 +1356,7 @@ function getThemeProperty(props, prop, value, fallbackValue) {
|
|
|
1353
1356
|
}
|
|
1354
1357
|
}
|
|
1355
1358
|
else if (_.get(themeOptions, "".concat(prop, ".").concat(value), null)) {
|
|
1356
|
-
return _.get(themeOptions, "".concat(prop, ".").concat(value)
|
|
1359
|
+
return (_a = _.get(themeOptions, "".concat(prop, ".").concat(value))) !== null && _a !== void 0 ? _a : '';
|
|
1357
1360
|
}
|
|
1358
1361
|
switch (prop) {
|
|
1359
1362
|
case 'fontStyles':
|
|
@@ -1363,7 +1366,7 @@ function getThemeProperty(props, prop, value, fallbackValue) {
|
|
|
1363
1366
|
case 'colors':
|
|
1364
1367
|
return getColor(value, fallbackValue);
|
|
1365
1368
|
case 'fontFamily':
|
|
1366
|
-
return _.get(themeOptions.fontFamilies, "".concat(value, ".fontFamily"), fallbackValue || themeOptions.fontFamily);
|
|
1369
|
+
return (_b = _.get(themeOptions.fontFamilies, "".concat(value, ".fontFamily"), fallbackValue || themeOptions.fontFamily)) !== null && _b !== void 0 ? _b : '';
|
|
1367
1370
|
default:
|
|
1368
1371
|
return '';
|
|
1369
1372
|
}
|