@useblu/ocean-react 1.46.0 → 1.46.2

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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.46.2](https://github.com/ocean-ds/ocean-web/compare/v1.46.1...v1.46.2) (2023-06-22)
7
+
8
+ ### Bug Fixes
9
+
10
+ - update CrossSellCad click event to be in button ([#1072](https://github.com/ocean-ds/ocean-web/issues/1072)) ([3e84280](https://github.com/ocean-ds/ocean-web/commit/3e842804981d95fa5821a0cdd07c123e4e63f956))
11
+
12
+ ## [1.46.1](https://github.com/ocean-ds/ocean-web/compare/v1.46.0...v1.46.1) (2023-06-16)
13
+
14
+ ### Bug Fixes
15
+
16
+ - adjust handle clicks on drawer and shortcut ([#1070](https://github.com/ocean-ds/ocean-web/issues/1070)) ([70870f0](https://github.com/ocean-ds/ocean-web/commit/70870f0932601df2551e15ccf5e5eed95a818666))
17
+
6
18
  # [1.46.0](https://github.com/ocean-ds/ocean-web/compare/v1.45.0...v1.46.0) (2023-06-08)
7
19
 
8
20
  ### Features
@@ -3,7 +3,7 @@ interface DrawerProps {
3
3
  children: React.ReactNode;
4
4
  open: boolean;
5
5
  onDrawerClose?(event: React.MouseEvent | React.KeyboardEvent): void;
6
- overlayClose: () => void;
6
+ overlayClose: (event?: MouseEvent<HTMLDivElement>) => void;
7
7
  headerIcon?: React.ReactNode;
8
8
  align?: 'right' | 'left';
9
9
  iconAlignment?: 'right' | 'left';
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/Drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,UAAU,EACV,SAAS,EAIV,MAAM,OAAO,CAAC;AAMf,UAAU,WAAW;IACnB,QAAQ,EAAE,KAAK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AgB,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;CACjE;AAED,QAAA,MAAM,MAAM,mHAUT,WAAW,KAAG,MAAM,YA4EtB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  declare type ShortcutSize = 'tiny' | 'small' | 'medium' | 'large';
3
- export interface ShortcutProps {
3
+ export declare type ShortcutProps = {
4
4
  icon: React.ReactNode;
5
5
  label: string;
6
6
  description?: string;
@@ -8,7 +8,7 @@ export interface ShortcutProps {
8
8
  blocked?: boolean;
9
9
  disabled?: boolean;
10
10
  count?: number;
11
- }
12
- declare const Shortcut: ({ icon, label, description, size, blocked, disabled, count, }: ShortcutProps) => React.ReactElement;
11
+ } & React.ComponentPropsWithoutRef<'div'>;
12
+ declare const Shortcut: ({ icon, label, description, size, blocked, disabled, count, ...rest }: ShortcutProps) => React.ReactElement;
13
13
  export default Shortcut;
14
14
  //# sourceMappingURL=Shortcut.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Shortcut.d.ts","sourceRoot":"","sources":["../../src/Shortcut/Shortcut.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,aAAK,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,QAAQ,kEAQX,aAAa,KAAG,MAAM,YA8CxB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Shortcut.d.ts","sourceRoot":"","sources":["../../src/Shortcut/Shortcut.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,aAAK,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE1D,oBAAY,aAAa,GAAG;IAC1B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAE1C,QAAA,MAAM,QAAQ,0EASX,aAAa,KAAG,MAAM,YA+CxB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
package/index.es.js CHANGED
@@ -25619,13 +25619,13 @@ Badge.displayName = 'Badge';
25619
25619
 
25620
25620
  var CrossSellCard = e.forwardRef(function (_a, ref) {
25621
25621
  var title = _a.title, className = _a.className, description = _a.description, imageSrc = _a.imageSrc, ctaText = _a.ctaText, ctaAction = _a.ctaAction, customIcon = _a.customIcon, rest = __rest$1(_a, ["title", "className", "description", "imageSrc", "ctaText", "ctaAction", "customIcon"]);
25622
- return (e.createElement("div", __assign$1({ ref: ref }, rest, { className: classNames('ods-cross-sell-card', className), onClick: ctaAction }),
25623
- e.createElement("a", { className: "ods-cross-sell-card__content", onClick: function () { return ctaAction; }, "data-testid": "cta-test" },
25622
+ return (e.createElement("div", __assign$1({ ref: ref }, rest, { className: classNames('ods-cross-sell-card', className) }),
25623
+ e.createElement("a", { className: "ods-cross-sell-card__content" },
25624
25624
  e.createElement("div", { className: "ods-cross-sell-card__information" },
25625
25625
  e.createElement("div", { className: "ods-cross-sell-card__title" }, title),
25626
25626
  e.createElement("div", { className: "ods-cross-sell-card__description" }, description)),
25627
25627
  imageSrc && (e.createElement("img", { className: "ods-cross-sell-card__image", alt: imageSrc, src: imageSrc }))),
25628
- e.createElement("button", { type: "button", className: "ods-cross-sell-card__cta" },
25628
+ e.createElement("button", { type: "button", className: "ods-cross-sell-card__cta", "data-testid": "cta-test", onClick: ctaAction },
25629
25629
  ctaText,
25630
25630
  ' ',
25631
25631
  e.createElement("span", { className: "ods-cross-sell-card__cta-icon" }, customIcon || e.createElement(ee, null)))));
@@ -46241,6 +46241,12 @@ Breadcrumb.displayName = 'Breadcrumb';
46241
46241
  var Drawer = function (_a) {
46242
46242
  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.createElement(ts, null) : _c, _d = _a.iconAlignment, iconAlignment = _d === void 0 ? 'right' : _d, anchorEl = _a.anchorEl, onMouseOutDrawer = _a.onMouseOutDrawer;
46243
46243
  var drawerRef = useRef(null);
46244
+ var handleOverlayClose = function (event) {
46245
+ if (event.target === event.currentTarget) {
46246
+ event.preventDefault();
46247
+ overlayClose(event);
46248
+ }
46249
+ };
46244
46250
  var getAnchorPosition = useCallback(function () {
46245
46251
  if (!(anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.current))
46246
46252
  return null;
@@ -46270,7 +46276,7 @@ var Drawer = function (_a) {
46270
46276
  useEffect(function () {
46271
46277
  attachDrawer();
46272
46278
  }, [anchorEl, drawerRef, attachDrawer]);
46273
- return (e.createElement("div", { className: classNames('ods-overlay', open && 'ods-overlay--open'), "aria-hidden": "true", onClick: overlayClose, ref: drawerRef },
46279
+ return (e.createElement("div", { className: classNames('ods-overlay', open && 'ods-overlay--open'), "aria-hidden": "true", onClick: handleOverlayClose, ref: drawerRef, "data-testId": "drawer-overlay" },
46274
46280
  e.createElement("div", { className: classNames('ods-drawer', open && 'ods-drawer--open', "ods-drawer--".concat(align)), onMouseLeave: onMouseOutDrawer },
46275
46281
  e.createElement("div", { className: classNames('ods-drawer__content--header', "ods-drawer__content--header--".concat(iconAlignment)) },
46276
46282
  e.createElement(Button$1, { type: "button", onClick: onDrawerClose }, headerIcon)),
@@ -46335,8 +46341,8 @@ var Snackbar = e.forwardRef(function (_a, ref) {
46335
46341
  Snackbar.displayName = 'Snackbar';
46336
46342
 
46337
46343
  var Shortcut = function (_a) {
46338
- var icon = _a.icon, label = _a.label, description = _a.description, _b = _a.size, size = _b === void 0 ? 'medium' : _b, _c = _a.blocked, blocked = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, count = _a.count;
46339
- return (e.createElement("div", { className: classNames('ods-shortcut', "ods-shortcut--".concat(size), blocked && 'ods-shortcut--blocked', disabled && 'ods-shortcut--disabled') },
46344
+ var icon = _a.icon, label = _a.label, description = _a.description, _b = _a.size, size = _b === void 0 ? 'medium' : _b, _c = _a.blocked, blocked = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, count = _a.count, rest = __rest$1(_a, ["icon", "label", "description", "size", "blocked", "disabled", "count"]);
46345
+ return (e.createElement("div", __assign$1({ className: classNames('ods-shortcut', "ods-shortcut--".concat(size), blocked && 'ods-shortcut--blocked', disabled && 'ods-shortcut--disabled') }, rest),
46340
46346
  blocked && (e.createElement("div", { className: "ods-shortcut__blocked" },
46341
46347
  e.createElement(jr, null))),
46342
46348
  count ? (e.createElement(Badge, { className: "ods-shortcut__badge", variation: "small", color: "alert", count: count })) : null,