@rocket.chat/fuselage 0.32.0-dev.142 → 0.32.0-dev.145
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.
|
@@ -16614,6 +16614,7 @@ var getForegroundColor = function (type) {
|
|
|
16614
16614
|
return ["--rcx-color-foreground-" + type, color];
|
|
16615
16615
|
};
|
|
16616
16616
|
var paletteColorRegex = /^(neutral|primary|info|success|warning|danger)-(\d+)(-(\d+))?$/;
|
|
16617
|
+
var cssSupportsVariable = (0,_rocket_chat_css_supports__WEBPACK_IMPORTED_MODULE_0__.cssSupports)('(--foo: bar)');
|
|
16617
16618
|
var color = (0,_rocket_chat_memo__WEBPACK_IMPORTED_MODULE_3__.memoize)(function (value) {
|
|
16618
16619
|
if (typeof value !== 'string') {
|
|
16619
16620
|
return;
|
|
@@ -16628,20 +16629,32 @@ var color = (0,_rocket_chat_memo__WEBPACK_IMPORTED_MODULE_3__.memoize)(function
|
|
|
16628
16629
|
invariant__WEBPACK_IMPORTED_MODULE_4___default()(isPaletteColorGrade(grade), 'invalid color grade');
|
|
16629
16630
|
invariant__WEBPACK_IMPORTED_MODULE_4___default()(isPaletteColorAlpha(alpha), 'invalid color alpha');
|
|
16630
16631
|
var _b = __read(getPaletteColor(type, grade, alpha), 2), customProperty = _b[0], color_1 = _b[1];
|
|
16631
|
-
if (customProperty &&
|
|
16632
|
+
if (customProperty && cssSupportsVariable) {
|
|
16632
16633
|
return "var(" + customProperty + ", " + color_1 + ")";
|
|
16633
16634
|
}
|
|
16634
16635
|
return color_1;
|
|
16635
16636
|
}
|
|
16636
|
-
if (value === 'surface') {
|
|
16637
|
-
if (
|
|
16638
|
-
return
|
|
16637
|
+
if (value === 'surface' || value === 'surface-light') {
|
|
16638
|
+
if (cssSupportsVariable) {
|
|
16639
|
+
return "var(--rcx-color-surface-light, " + _rocket_chat_fuselage_tokens_colors_json__WEBPACK_IMPORTED_MODULE_1__.white + ")";
|
|
16639
16640
|
}
|
|
16640
|
-
return
|
|
16641
|
+
return _rocket_chat_fuselage_tokens_colors_json__WEBPACK_IMPORTED_MODULE_1__.white;
|
|
16642
|
+
}
|
|
16643
|
+
if (value === 'surface-tint') {
|
|
16644
|
+
if (cssSupportsVariable) {
|
|
16645
|
+
return "var(--rcx-color-surface-tint, " + _rocket_chat_fuselage_tokens_colors_json__WEBPACK_IMPORTED_MODULE_1__.n100 + ")";
|
|
16646
|
+
}
|
|
16647
|
+
return _rocket_chat_fuselage_tokens_colors_json__WEBPACK_IMPORTED_MODULE_1__.n100;
|
|
16648
|
+
}
|
|
16649
|
+
if (value === 'surface-neutral') {
|
|
16650
|
+
if (cssSupportsVariable) {
|
|
16651
|
+
return "var(--rcx-color-surface-neutral, " + _rocket_chat_fuselage_tokens_colors_json__WEBPACK_IMPORTED_MODULE_1__.n400 + ")";
|
|
16652
|
+
}
|
|
16653
|
+
return _rocket_chat_fuselage_tokens_colors_json__WEBPACK_IMPORTED_MODULE_1__.n400;
|
|
16641
16654
|
}
|
|
16642
16655
|
if (isForegroundColorRef(value)) {
|
|
16643
16656
|
var _c = __read(getForegroundColor(value), 2), customProperty = _c[0], color_2 = _c[1];
|
|
16644
|
-
if (customProperty &&
|
|
16657
|
+
if (customProperty && cssSupportsVariable) {
|
|
16645
16658
|
return "var(" + customProperty + ", " + color_2 + ")";
|
|
16646
16659
|
}
|
|
16647
16660
|
return color_2;
|
|
@@ -16687,7 +16700,7 @@ var fontFamily = (0,_rocket_chat_memo__WEBPACK_IMPORTED_MODULE_3__.memoize)(func
|
|
|
16687
16700
|
var fontFamily = _rocket_chat_fuselage_tokens_dist_typography_json__WEBPACK_IMPORTED_MODULE_2__.fontFamilies[value]
|
|
16688
16701
|
.map(function (fontFace) { return (fontFace.includes(' ') ? "'" + fontFace + "'" : fontFace); })
|
|
16689
16702
|
.join(', ');
|
|
16690
|
-
if (
|
|
16703
|
+
if (cssSupportsVariable) {
|
|
16691
16704
|
return "var(--rcx-font-family-" + value + ", " + fontFamily + ")";
|
|
16692
16705
|
}
|
|
16693
16706
|
return fontFamily;
|