@useblu/ocean-react 1.59.2 → 1.61.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
  });
@@ -47746,7 +47752,7 @@ var Breadcrumb = e.forwardRef(function (_a, ref) {
47746
47752
  Breadcrumb.displayName = 'Breadcrumb';
47747
47753
 
47748
47754
  var Drawer = function (_a) {
47749
- var children = _a.children, open = _a.open, onDrawerClose = _a.onDrawerClose, overlayClose = _a.overlayClose, _b = _a.align, align = _b === void 0 ? 'right' : _b, _c = _a.headerIcon, headerIcon = _c === void 0 ? e__default["default"].createElement(ts, null) : _c, _d = _a.iconAlignment, iconAlignment = _d === void 0 ? 'right' : _d, anchorEl = _a.anchorEl, onMouseOutDrawer = _a.onMouseOutDrawer;
47755
+ var children = _a.children, open = _a.open, onDrawerClose = _a.onDrawerClose, overlayClose = _a.overlayClose, _b = _a.align, align = _b === void 0 ? 'right' : _b, _c = _a.headerIcon, headerIcon = _c === void 0 ? e__default["default"].createElement(ts, null) : _c, _d = _a.iconAlignment, iconAlignment = _d === void 0 ? 'right' : _d, anchorEl = _a.anchorEl, onMouseOutDrawer = _a.onMouseOutDrawer, _e = _a.size, size = _e === void 0 ? 'small' : _e;
47750
47756
  var drawerRef = e.useRef(null);
47751
47757
  var handleOverlayClose = function (event) {
47752
47758
  if (event.target === event.currentTarget) {
@@ -47759,10 +47765,10 @@ var Drawer = function (_a) {
47759
47765
  return null;
47760
47766
  var position = anchorEl.current.getBoundingClientRect();
47761
47767
  if (align === 'right') {
47762
- var size = window.innerWidth - position.left;
47768
+ var positionSize = window.innerWidth - position.left;
47763
47769
  return {
47764
- width: "".concat(size, "px"),
47765
- right: "".concat(size, "px"),
47770
+ width: "".concat(positionSize, "px"),
47771
+ right: "".concat(positionSize, "px"),
47766
47772
  left: 'auto'
47767
47773
  };
47768
47774
  }
@@ -47784,7 +47790,7 @@ var Drawer = function (_a) {
47784
47790
  attachDrawer();
47785
47791
  }, [anchorEl, drawerRef, attachDrawer]);
47786
47792
  return (e__default["default"].createElement("div", { className: classNames('ods-overlay', open && 'ods-overlay--open'), "aria-hidden": "true", onClick: handleOverlayClose, ref: drawerRef, "data-testid": "drawer-overlay" },
47787
- e__default["default"].createElement("div", { className: classNames('ods-drawer', open && 'ods-drawer--open', "ods-drawer--".concat(align)), onMouseLeave: onMouseOutDrawer },
47793
+ e__default["default"].createElement("div", { className: classNames('ods-drawer', open && 'ods-drawer--open', "ods-drawer--".concat(align), "ods-drawer--".concat(size)), onMouseLeave: onMouseOutDrawer },
47788
47794
  e__default["default"].createElement("div", { className: classNames('ods-drawer__content--header', "ods-drawer__content--header--".concat(iconAlignment)) },
47789
47795
  e__default["default"].createElement(Button$1, { type: "button", onClick: onDrawerClose }, headerIcon)),
47790
47796
  children)));