@useblu/ocean-react 1.60.0 → 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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
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.61.0](https://github.com/ocean-ds/ocean-web/compare/v1.60.0...v1.61.0) (2024-06-14)
7
+
8
+ ### Features
9
+
10
+ - drawer ([#1105](https://github.com/ocean-ds/ocean-web/issues/1105)) ([1c749e0](https://github.com/ocean-ds/ocean-web/commit/1c749e011aa19acf67f1deb0cc15e47618f40e3f))
11
+
6
12
  # [1.60.0](https://github.com/ocean-ds/ocean-web/compare/v1.59.3...v1.60.0) (2024-06-13)
7
13
 
8
14
  ### Features
@@ -9,7 +9,8 @@ interface DrawerProps {
9
9
  iconAlignment?: 'right' | 'left';
10
10
  anchorEl?: RefObject<HTMLDivElement> | null;
11
11
  onMouseOutDrawer?: (event?: MouseEvent<HTMLDivElement>) => void;
12
+ size?: 'small' | 'large';
12
13
  }
13
- declare const Drawer: ({ children, open, onDrawerClose, overlayClose, align, headerIcon, iconAlignment, anchorEl, onMouseOutDrawer, }: DrawerProps) => React.ReactElement;
14
+ declare const Drawer: ({ children, open, onDrawerClose, overlayClose, align, headerIcon, iconAlignment, anchorEl, onMouseOutDrawer, size, }: DrawerProps) => React.ReactElement;
14
15
  export default Drawer;
15
16
  //# sourceMappingURL=Drawer.d.ts.map
@@ -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,CAAC,SAAS,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,CAAC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CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAChE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,MAAM,yHAWT,WAAW,KAAG,MAAM,YA4EtB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -4,7 +4,8 @@ export interface SimpleDrawerProps {
4
4
  open?: boolean;
5
5
  align?: 'left' | 'right';
6
6
  iconAlignment?: 'left' | 'right';
7
+ size?: 'small' | 'large';
7
8
  }
8
- declare const SimpleDrawer: ({ children, open, align, iconAlignment, }: SimpleDrawerProps) => React.ReactElement;
9
+ declare const SimpleDrawer: ({ children, open, align, iconAlignment, size, }: SimpleDrawerProps) => React.ReactElement;
9
10
  export default SimpleDrawer;
10
11
  //# sourceMappingURL=AttachedDrawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttachedDrawer.d.ts","sourceRoot":"","sources":["../../../src/Drawer/examples/AttachedDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAKhD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAClC;AAED,QAAA,MAAM,YAAY,8CAKf,iBAAiB,KAAG,MAAM,YAqD5B,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"AttachedDrawer.d.ts","sourceRoot":"","sources":["../../../src/Drawer/examples/AttachedDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAKhD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,YAAY,oDAMf,iBAAiB,KAAG,MAAM,YAsD5B,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -4,7 +4,8 @@ export interface SimpleDrawerProps {
4
4
  open?: boolean;
5
5
  align?: 'left' | 'right';
6
6
  iconAlignment?: 'left' | 'right';
7
+ size?: 'small' | 'large';
7
8
  }
8
- declare const SimpleDrawer: ({ children, open, align, iconAlignment, }: SimpleDrawerProps) => React.ReactElement;
9
+ declare const SimpleDrawer: ({ children, open, align, iconAlignment, size, }: SimpleDrawerProps) => React.ReactElement;
9
10
  export default SimpleDrawer;
10
11
  //# sourceMappingURL=SimpleDrawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleDrawer.d.ts","sourceRoot":"","sources":["../../../src/Drawer/examples/SimpleDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAClC;AAED,QAAA,MAAM,YAAY,8CAKf,iBAAiB,KAAG,MAAM,YAuB5B,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"SimpleDrawer.d.ts","sourceRoot":"","sources":["../../../src/Drawer/examples/SimpleDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,YAAY,oDAMf,iBAAiB,KAAG,MAAM,YAwB5B,CAAC;AAEF,eAAe,YAAY,CAAC"}
package/index.es.js CHANGED
@@ -47743,7 +47743,7 @@ var Breadcrumb = forwardRef(function (_a, ref) {
47743
47743
  Breadcrumb.displayName = 'Breadcrumb';
47744
47744
 
47745
47745
  var Drawer = function (_a) {
47746
- 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;
47746
+ 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, _e = _a.size, size = _e === void 0 ? 'small' : _e;
47747
47747
  var drawerRef = useRef(null);
47748
47748
  var handleOverlayClose = function (event) {
47749
47749
  if (event.target === event.currentTarget) {
@@ -47756,10 +47756,10 @@ var Drawer = function (_a) {
47756
47756
  return null;
47757
47757
  var position = anchorEl.current.getBoundingClientRect();
47758
47758
  if (align === 'right') {
47759
- var size = window.innerWidth - position.left;
47759
+ var positionSize = window.innerWidth - position.left;
47760
47760
  return {
47761
- width: "".concat(size, "px"),
47762
- right: "".concat(size, "px"),
47761
+ width: "".concat(positionSize, "px"),
47762
+ right: "".concat(positionSize, "px"),
47763
47763
  left: 'auto'
47764
47764
  };
47765
47765
  }
@@ -47781,7 +47781,7 @@ var Drawer = function (_a) {
47781
47781
  attachDrawer();
47782
47782
  }, [anchorEl, drawerRef, attachDrawer]);
47783
47783
  return (e.createElement("div", { className: classNames('ods-overlay', open && 'ods-overlay--open'), "aria-hidden": "true", onClick: handleOverlayClose, ref: drawerRef, "data-testid": "drawer-overlay" },
47784
- e.createElement("div", { className: classNames('ods-drawer', open && 'ods-drawer--open', "ods-drawer--".concat(align)), onMouseLeave: onMouseOutDrawer },
47784
+ e.createElement("div", { className: classNames('ods-drawer', open && 'ods-drawer--open', "ods-drawer--".concat(align), "ods-drawer--".concat(size)), onMouseLeave: onMouseOutDrawer },
47785
47785
  e.createElement("div", { className: classNames('ods-drawer__content--header', "ods-drawer__content--header--".concat(iconAlignment)) },
47786
47786
  e.createElement(Button$1, { type: "button", onClick: onDrawerClose }, headerIcon)),
47787
47787
  children)));