@useblu/ocean-react 1.59.2 → 1.60.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.
package/index.js CHANGED
@@ -262,8 +262,14 @@ var TagIcon = e__default["default"].memo(function (_a) {
262
262
  TagIcon.displayName = 'TagIcon';
263
263
 
264
264
  var Tag = e__default["default"].forwardRef(function (_a, ref) {
265
- var children = _a.children, _b = _a.type, type = _b === void 0 ? 'default' : _b, className = _a.className, icon = _a.icon, _c = _a.setIconOff, setIconOff = _c === void 0 ? false : _c, rest = __rest$2(_a, ["children", "type", "className", "icon", "setIconOff"]);
266
- return (e__default["default"].createElement("div", __assign$2({ ref: ref, role: "Tag", className: classNames('ods-tag', "ods-tag--".concat(type), className) }, rest),
265
+ var children = _a.children, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, _c = _a.type, type = _c === void 0 ? 'default' : _c, _d = _a.size, size = _d === void 0 ? 'medium' : _d, className = _a.className, icon = _a.icon, _e = _a.setIconOff, setIconOff = _e === void 0 ? false : _e, rest = __rest$2(_a, ["children", "variant", "type", "size", "className", "icon", "setIconOff"]);
266
+ var hasIcon = (type === 'positive' ||
267
+ type === 'warning' ||
268
+ type === 'negative' ||
269
+ icon) &&
270
+ !setIconOff;
271
+ var isHighlight = variant === 'highlight';
272
+ return (e__default["default"].createElement("div", __assign$2({ ref: ref, role: "Tag", className: classNames('ods-tag', "ods-tag--".concat(size), hasIcon && "ods-tag--".concat(size, "__with-icon"), isHighlight ? "ods-tag--".concat(variant, "__").concat(type) : "ods-tag--".concat(type), className) }, rest),
267
273
  !setIconOff && e__default["default"].createElement(TagIcon, { type: type, icon: icon }),
268
274
  e__default["default"].createElement("div", { className: "ods-tag__content" }, children)));
269
275
  });