@useblu/ocean-react 1.45.0 → 1.46.1
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 +12 -0
- package/Drawer/Drawer.d.ts +4 -3
- package/Drawer/Drawer.d.ts.map +1 -1
- package/Shortcut/Shortcut.d.ts +3 -3
- package/Shortcut/Shortcut.d.ts.map +1 -1
- package/index.es.js +11 -5
- package/index.es.js.map +1 -1
- package/index.js +11 -5
- package/index.js.map +1 -1
- package/package.json +1 -1
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.1](https://github.com/ocean-ds/ocean-web/compare/v1.46.0...v1.46.1) (2023-06-16)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- 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))
|
|
11
|
+
|
|
12
|
+
# [1.46.0](https://github.com/ocean-ds/ocean-web/compare/v1.45.0...v1.46.0) (2023-06-08)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- add mouse events on drawer ([#1069](https://github.com/ocean-ds/ocean-web/issues/1069)) ([f5bbd98](https://github.com/ocean-ds/ocean-web/commit/f5bbd98848df4f8e6a768240d7df2d6e70c3ae31))
|
|
17
|
+
|
|
6
18
|
# [1.45.0](https://github.com/ocean-ds/ocean-web/compare/v1.44.0...v1.45.0) (2023-06-02)
|
|
7
19
|
|
|
8
20
|
### Features
|
package/Drawer/Drawer.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import React, { RefObject } from 'react';
|
|
1
|
+
import React, { MouseEvent, RefObject } from 'react';
|
|
2
2
|
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';
|
|
10
10
|
anchorEl?: RefObject<HTMLDivElement> | null;
|
|
11
|
+
onMouseOutDrawer?: (event?: MouseEvent<HTMLDivElement>) => void;
|
|
11
12
|
}
|
|
12
|
-
declare const Drawer: ({ children, open, onDrawerClose, overlayClose, align, headerIcon, iconAlignment, anchorEl, }: DrawerProps) => React.ReactElement;
|
|
13
|
+
declare const Drawer: ({ children, open, onDrawerClose, overlayClose, align, headerIcon, iconAlignment, anchorEl, onMouseOutDrawer, }: DrawerProps) => React.ReactElement;
|
|
13
14
|
export default Drawer;
|
|
14
15
|
//# sourceMappingURL=Drawer.d.ts.map
|
package/Drawer/Drawer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/Drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
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,CAAC,SAAS,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;IACpE,YAAY,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC3D,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IAC5C,gBAAgB,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"}
|
package/Shortcut/Shortcut.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare type ShortcutSize = 'tiny' | 'small' | 'medium' | 'large';
|
|
3
|
-
export
|
|
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,
|
|
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
|
@@ -46239,8 +46239,14 @@ var Breadcrumb = forwardRef(function (_a, ref) {
|
|
|
46239
46239
|
Breadcrumb.displayName = 'Breadcrumb';
|
|
46240
46240
|
|
|
46241
46241
|
var Drawer = function (_a) {
|
|
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;
|
|
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,8 +46276,8 @@ 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:
|
|
46274
|
-
e.createElement("div", { className: classNames('ods-drawer', open && 'ods-drawer--open', "ods-drawer--".concat(align)) },
|
|
46279
|
+
return (e.createElement("div", { className: classNames('ods-overlay', open && 'ods-overlay--open'), "aria-hidden": "true", onClick: handleOverlayClose, ref: drawerRef, "data-testId": "drawer-overlay" },
|
|
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)),
|
|
46277
46283
|
children)));
|
|
@@ -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,
|