@useblu/ocean-react 1.113.0 → 1.113.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.113.2](https://github.com/ocean-ds/ocean-web/compare/v1.113.1...v1.113.2) (2025-12-03)
7
+
8
+ ### Bug Fixes
9
+
10
+ - chip multi select ([#1203](https://github.com/ocean-ds/ocean-web/issues/1203)) ([9943a81](https://github.com/ocean-ds/ocean-web/commit/9943a8160f8ab40eb8d325475c080d3ad7e32ffb))
11
+
12
+ ## [1.113.1](https://github.com/ocean-ds/ocean-web/compare/v1.113.0...v1.113.1) (2025-11-26)
13
+
14
+ ### Bug Fixes
15
+
16
+ - adjust shortcut badge ([#1196](https://github.com/ocean-ds/ocean-web/issues/1196)) ([5005da6](https://github.com/ocean-ds/ocean-web/commit/5005da6d1dca4c4a64e53b13fd763224037b3d1f))
17
+
6
18
  # [1.113.0](https://github.com/ocean-ds/ocean-web/compare/v1.112.1...v1.113.0) (2025-10-22)
7
19
 
8
20
  ### Features
@@ -1 +1 @@
1
- {"version":3,"file":"Options.d.ts","sourceRoot":"","sources":["../../src/Chips/Options.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,UAAU,QAAQ;IAChB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1B,eAAe,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAiE9C,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Options.d.ts","sourceRoot":"","sources":["../../src/Chips/Options.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,UAAU,QAAQ;IAChB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1B,eAAe,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAwF9C,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -18,8 +18,9 @@ export type ShortcutProps = {
18
18
  blocked?: boolean;
19
19
  disabled?: boolean;
20
20
  fullWidth?: boolean;
21
+ badge?: string;
21
22
  orientation?: 'horizontal' | 'vertical';
22
23
  } & ExclusiveTagOrCount & React.ComponentPropsWithoutRef<'div'>;
23
- declare const Shortcut: ({ icon, label, description, size, blocked, disabled, fullWidth, orientation, count, tag, ...rest }: ShortcutProps) => React.ReactElement;
24
+ declare const Shortcut: ({ icon, label, description, size, blocked, disabled, fullWidth, orientation, count, badge, tag, ...rest }: ShortcutProps) => React.ReactElement;
24
25
  export default Shortcut;
25
26
  //# 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;AAM1B,KAAK,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhD,KAAK,mBAAmB,GACpB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GAC9B;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEnC,MAAM,MAAM,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,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC,GAAG,mBAAmB,GACrB,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAExC,QAAA,MAAM,QAAQ,GAAI,oGAYf,aAAa,KAAG,KAAK,CAAC,YA+DxB,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;AAM1B,KAAK,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhD,KAAK,mBAAmB,GACpB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GAC9B;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAEnC,MAAM,MAAM,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,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC,GAAG,mBAAmB,GACrB,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAExC,QAAA,MAAM,QAAQ,GAAI,2GAaf,aAAa,KAAG,KAAK,CAAC,YAiExB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
package/index.es.js CHANGED
@@ -46883,11 +46883,11 @@ var Snackbar = e.forwardRef(function (_a, ref) {
46883
46883
  Snackbar.displayName = 'Snackbar';
46884
46884
 
46885
46885
  var Shortcut = function (_a) {
46886
- 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, _e = _a.fullWidth, fullWidth = _e === void 0 ? false : _e, _f = _a.orientation, orientation = _f === void 0 ? 'horizontal' : _f, count = _a.count, tag = _a.tag, rest = __rest$1(_a, ["icon", "label", "description", "size", "blocked", "disabled", "fullWidth", "orientation", "count", "tag"]);
46886
+ 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, _e = _a.fullWidth, fullWidth = _e === void 0 ? false : _e, _f = _a.orientation, orientation = _f === void 0 ? 'horizontal' : _f, count = _a.count, badge = _a.badge, tag = _a.tag, rest = __rest$1(_a, ["icon", "label", "description", "size", "blocked", "disabled", "fullWidth", "orientation", "count", "badge", "tag"]);
46887
46887
  return (e.createElement("div", __assign$1({ className: classNames('ods-shortcut', "ods-shortcut--".concat(size), blocked && 'ods-shortcut--blocked', disabled && 'ods-shortcut--disabled', fullWidth && 'ods-shortcut--full-width', count && 'ods-shortcut--with-badge', "ods-shortcut--".concat(orientation)) }, rest),
46888
46888
  blocked && (e.createElement("div", { className: "ods-shortcut__blocked" },
46889
46889
  e.createElement(At, null))),
46890
- !blocked && count ? (e.createElement(Badge, { className: "ods-shortcut__badge", variation: "small", color: disabled ? 'neutral' : 'alert', count: count })) : null,
46890
+ !blocked && (count || badge) ? (e.createElement(Badge, { className: "ods-shortcut__badge", variation: "small", color: disabled ? 'neutral' : 'alert', count: count }, badge)) : null,
46891
46891
  !blocked && tag && orientation === 'vertical' && (e.createElement(Tag, { className: "ods-shortcut__tag", variant: "highlight", type: "important" }, tag)),
46892
46892
  e.createElement("div", { className: classNames('ods-shortcut__content', "ods-shortcut__content--".concat(orientation)) },
46893
46893
  e.createElement("div", { className: "ods-shortcut__icon" }, icon),
@@ -46923,16 +46923,21 @@ CardListItem.displayName = 'CardListItem';
46923
46923
  var Options = function (_a) {
46924
46924
  var options = _a.options, selectedOptions = _a.selectedOptions, clearLabel = _a.clearLabel, filterLabel = _a.filterLabel, multiChoice = _a.multiChoice, onSelect = _a.onSelect, filterOptions = _a.filterOptions, clearOptions = _a.clearOptions;
46925
46925
  var columns = multiChoice ? Math.ceil(options.length / 5) : 1;
46926
+ var isMultiArray = Array.isArray(selectedOptions);
46926
46927
  return (e.createElement("div", { className: "ods-chips__options", "data-testid": "ods-chips-option" },
46927
46928
  e.createElement("div", { className: classNames('ods-chips__options--content', "ods-chips__options--content--columns-".concat(columns)) }, options.map(function (_a) {
46928
46929
  var label = _a.label, value = _a.value;
46929
- return (e.createElement("button", { key: label, type: "button", value: value, onClick: function () { return onSelect(label, value); }, className: classNames('ods-chips__options--option', {
46930
- 'ods-chips__options--option--selected': !multiChoice &&
46931
- !Array.isArray(selectedOptions) &&
46932
- selectedOptions.value === value,
46933
- }) },
46934
- multiChoice && Array.isArray(selectedOptions) && (e.createElement(Checkbox, { checked: !!selectedOptions.find(function (option) { return option.value === value; }), readOnly: true })),
46935
- label));
46930
+ if (multiChoice && isMultiArray) {
46931
+ var isSelected_1 = selectedOptions.some(function (option) { return option.value === value; });
46932
+ return (e.createElement("div", { key: value, className: classNames('ods-chips__options--option', 'ods-chips__options--option-container', {
46933
+ 'ods-chips__options--option--selected': isSelected_1,
46934
+ }) },
46935
+ e.createElement(Checkbox, { checked: isSelected_1, id: "chips-option-".concat(value), onClick: function () { return onSelect(label, value); }, readOnly: true, label: label })));
46936
+ }
46937
+ var isSelected = !multiChoice && !isMultiArray && selectedOptions.value === value;
46938
+ return (e.createElement("button", { key: value, type: "button", value: value, onClick: function () { return onSelect(label, value); }, className: classNames('ods-chips__options--option', {
46939
+ 'ods-chips__options--option--selected': isSelected,
46940
+ }) }, label));
46936
46941
  })),
46937
46942
  multiChoice && (e.createElement("div", { className: "ods-chips__options--footer" },
46938
46943
  e.createElement("button", { type: "button", onClick: clearOptions, className: "ods-btn ods-btn--sm ods-btn--text" }, clearLabel),