@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/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.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
+
12
+ # [1.60.0](https://github.com/ocean-ds/ocean-web/compare/v1.59.3...v1.60.0) (2024-06-13)
13
+
14
+ ### Features
15
+
16
+ - add tag size variant ([#1104](https://github.com/ocean-ds/ocean-web/issues/1104)) ([90e4a71](https://github.com/ocean-ds/ocean-web/commit/90e4a716c21902069d4260c0e6e71bf62f8f48c7))
17
+
6
18
  ## [1.59.2](https://github.com/ocean-ds/ocean-web/compare/v1.59.1...v1.59.2) (2024-06-05)
7
19
 
8
20
  ### Bug Fixes
@@ -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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,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;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/Tag/Tag.d.ts CHANGED
@@ -1,13 +1,18 @@
1
1
  import React from 'react';
2
- export declare type TagProps = {
3
- type?: 'positive' | 'warning' | 'negative' | 'neutral' | 'neutral-02' | 'neutral-03' | 'default';
2
+ export declare type BaseTagProps = {
3
+ size?: 'small' | 'medium';
4
4
  icon?: React.ReactElement;
5
5
  setIconOff?: boolean;
6
6
  } & React.ComponentPropsWithoutRef<'div'>;
7
- declare const Tag: React.ForwardRefExoticComponent<{
8
- type?: "positive" | "warning" | "negative" | "neutral" | "neutral-02" | "neutral-03" | "default" | undefined;
9
- icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
10
- setIconOff?: boolean | undefined;
11
- } & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
7
+ declare type DefaultType = {
8
+ variant?: 'default';
9
+ type?: 'positive' | 'warning' | 'negative' | 'neutral' | 'neutral-02' | 'neutral-03' | 'default';
10
+ } & BaseTagProps;
11
+ declare type HighlightType = {
12
+ variant: 'highlight';
13
+ type: 'important' | 'neutral';
14
+ } & BaseTagProps;
15
+ export declare type TagProps = DefaultType | HighlightType;
16
+ declare const Tag: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<HTMLDivElement>>;
12
17
  export default Tag;
13
18
  //# sourceMappingURL=Tag.d.ts.map
package/Tag/Tag.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../src/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,oBAAY,QAAQ,GAAG;IAKrB,IAAI,CAAC,EACD,UAAU,GACV,SAAS,GACT,UAAU,GACV,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,SAAS,CAAC;IAId,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAI1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAE1C,QAAA,MAAM,GAAG;;;;kLAsBR,CAAC;AAIF,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../src/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,oBAAY,YAAY,GAAG;IAIzB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAI1B,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAI1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAE1C,aAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;IAIpB,IAAI,CAAC,EACD,UAAU,GACV,SAAS,GACT,UAAU,GACV,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,SAAS,CAAC;CACf,GAAG,YAAY,CAAC;AAEjB,aAAK,aAAa,GAAG;IACnB,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,WAAW,GAAG,SAAS,CAAC;CAC/B,GAAG,YAAY,CAAC;AAEjB,oBAAY,QAAQ,GAAG,WAAW,GAAG,aAAa,CAAC;AAEnD,QAAA,MAAM,GAAG,iFAyCR,CAAC;AAIF,eAAe,GAAG,CAAC"}
package/index.es.js CHANGED
@@ -253,8 +253,14 @@ var TagIcon = e.memo(function (_a) {
253
253
  TagIcon.displayName = 'TagIcon';
254
254
 
255
255
  var Tag = e.forwardRef(function (_a, ref) {
256
- 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"]);
257
- return (e.createElement("div", __assign$2({ ref: ref, role: "Tag", className: classNames('ods-tag', "ods-tag--".concat(type), className) }, rest),
256
+ 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"]);
257
+ var hasIcon = (type === 'positive' ||
258
+ type === 'warning' ||
259
+ type === 'negative' ||
260
+ icon) &&
261
+ !setIconOff;
262
+ var isHighlight = variant === 'highlight';
263
+ return (e.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),
258
264
  !setIconOff && e.createElement(TagIcon, { type: type, icon: icon }),
259
265
  e.createElement("div", { className: "ods-tag__content" }, children)));
260
266
  });
@@ -47737,7 +47743,7 @@ var Breadcrumb = forwardRef(function (_a, ref) {
47737
47743
  Breadcrumb.displayName = 'Breadcrumb';
47738
47744
 
47739
47745
  var Drawer = function (_a) {
47740
- 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;
47741
47747
  var drawerRef = useRef(null);
47742
47748
  var handleOverlayClose = function (event) {
47743
47749
  if (event.target === event.currentTarget) {
@@ -47750,10 +47756,10 @@ var Drawer = function (_a) {
47750
47756
  return null;
47751
47757
  var position = anchorEl.current.getBoundingClientRect();
47752
47758
  if (align === 'right') {
47753
- var size = window.innerWidth - position.left;
47759
+ var positionSize = window.innerWidth - position.left;
47754
47760
  return {
47755
- width: "".concat(size, "px"),
47756
- right: "".concat(size, "px"),
47761
+ width: "".concat(positionSize, "px"),
47762
+ right: "".concat(positionSize, "px"),
47757
47763
  left: 'auto'
47758
47764
  };
47759
47765
  }
@@ -47775,7 +47781,7 @@ var Drawer = function (_a) {
47775
47781
  attachDrawer();
47776
47782
  }, [anchorEl, drawerRef, attachDrawer]);
47777
47783
  return (e.createElement("div", { className: classNames('ods-overlay', open && 'ods-overlay--open'), "aria-hidden": "true", onClick: handleOverlayClose, ref: drawerRef, "data-testid": "drawer-overlay" },
47778
- 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 },
47779
47785
  e.createElement("div", { className: classNames('ods-drawer__content--header', "ods-drawer__content--header--".concat(iconAlignment)) },
47780
47786
  e.createElement(Button$1, { type: "button", onClick: onDrawerClose }, headerIcon)),
47781
47787
  children)));