oolib 2.239.0 → 2.240.0
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.
|
@@ -29,8 +29,8 @@ var mixins_1 = require("../../../../../themes/mixins");
|
|
|
29
29
|
var white = themes_1.colors.white;
|
|
30
30
|
var STYLED_UI_TAG_DF = (0, styled_components_1.default)(Typo2_1.UI_TAG_DF)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), mixins_1.ellipsis);
|
|
31
31
|
var TagDisplay = function (_a) {
|
|
32
|
-
var id = _a.id, display = _a.display, size = _a.size, tagColor = _a.tagColor, textColor = _a.textColor, fill = _a.fill, icon = _a.icon, _b = _a.colorPreset, colorPreset = _b === void 0 ? 'default' : _b, weight = _a.weight;
|
|
33
|
-
return (react_1.default.createElement(Tag_1.Tag, { weight: weight, id: id, display: display, icon: icon, size: size, fill: fill, style: __assign(__assign(__assign({ padding: "0.25rem 0.5rem", borderRadius: "4px", color: white }, (0, getTagDisplayStyles_1.getTagDisplayStyles)({ colorPreset: colorPreset })), (tagColor ? { backgroundColor: tagColor } : {})), (textColor ? { color: textColor } : {})), typo: STYLED_UI_TAG_DF }));
|
|
32
|
+
var id = _a.id, display = _a.display, size = _a.size, tagColor = _a.tagColor, textColor = _a.textColor, fill = _a.fill, icon = _a.icon, badgeColor = _a.badgeColor, _b = _a.colorPreset, colorPreset = _b === void 0 ? 'default' : _b, weight = _a.weight;
|
|
33
|
+
return (react_1.default.createElement(Tag_1.Tag, { weight: weight, id: id, display: display, icon: icon, badgeColor: badgeColor, size: size, fill: fill, style: __assign(__assign(__assign({ padding: "0.25rem 0.5rem", borderRadius: "4px", color: white }, (0, getTagDisplayStyles_1.getTagDisplayStyles)({ colorPreset: colorPreset })), (tagColor ? { backgroundColor: tagColor } : {})), (textColor ? { color: textColor } : {})), typo: STYLED_UI_TAG_DF }));
|
|
34
34
|
};
|
|
35
35
|
exports.TagDisplay = TagDisplay;
|
|
36
36
|
var templateObject_1;
|
|
@@ -45,12 +45,12 @@ var colorFromPreset = function (colorPreset) {
|
|
|
45
45
|
* Selected → `fill` background, `textOnFill` text, `fill` border.
|
|
46
46
|
*/
|
|
47
47
|
var TagSelect = function (_a) {
|
|
48
|
-
var id = _a.id, display = _a.display, value = _a.value, _b = _a.size, size = _b === void 0 ? "S" : _b, _c = _a.isSelected, isSelected = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, icon = _a.icon, weight = _a.weight, colorPreset = _a.colorPreset, color = _a.color, onClick = _a.onClick, style = _a.style;
|
|
48
|
+
var id = _a.id, display = _a.display, value = _a.value, _b = _a.size, size = _b === void 0 ? "S" : _b, _c = _a.isSelected, isSelected = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, icon = _a.icon, badgeColor = _a.badgeColor, weight = _a.weight, colorPreset = _a.colorPreset, color = _a.color, onClick = _a.onClick, style = _a.style;
|
|
49
49
|
var base = colorPreset ? colorFromPreset(colorPreset) : DEFAULT_COLOR;
|
|
50
50
|
var c = __assign(__assign({}, base), (color || {}));
|
|
51
51
|
return (react_1.default.createElement(styled_1.StyledTagSelect, { bgColor: isSelected ? c.fill : "transparent", borderColor: isSelected ? c.fill : c.outline, disabled: disabled, onClick: function () {
|
|
52
52
|
return !disabled && onClick && onClick({ display: display, value: value, isSelected: !isSelected });
|
|
53
53
|
}, style: style },
|
|
54
|
-
react_1.default.createElement(TagDisplay_1.TagDisplay, { id: id, display: display, size: size, icon: icon, weight: weight, tagColor: "transparent", textColor: isSelected ? c.textOnFill : c.text })));
|
|
54
|
+
react_1.default.createElement(TagDisplay_1.TagDisplay, { id: id, display: display, size: size, icon: icon, badgeColor: badgeColor, weight: weight, tagColor: "transparent", textColor: isSelected ? c.textOnFill : c.text })));
|
|
55
55
|
};
|
|
56
56
|
exports.TagSelect = TagSelect;
|