@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/index.js CHANGED
@@ -46885,11 +46885,11 @@ var Snackbar = e.forwardRef(function (_a, ref) {
46885
46885
  Snackbar.displayName = 'Snackbar';
46886
46886
 
46887
46887
  var Shortcut = function (_a) {
46888
- 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"]);
46888
+ 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"]);
46889
46889
  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),
46890
46890
  blocked && (e.createElement("div", { className: "ods-shortcut__blocked" },
46891
46891
  e.createElement(At, null))),
46892
- !blocked && count ? (e.createElement(Badge, { className: "ods-shortcut__badge", variation: "small", color: disabled ? 'neutral' : 'alert', count: count })) : null,
46892
+ !blocked && (count || badge) ? (e.createElement(Badge, { className: "ods-shortcut__badge", variation: "small", color: disabled ? 'neutral' : 'alert', count: count }, badge)) : null,
46893
46893
  !blocked && tag && orientation === 'vertical' && (e.createElement(Tag, { className: "ods-shortcut__tag", variant: "highlight", type: "important" }, tag)),
46894
46894
  e.createElement("div", { className: classNames('ods-shortcut__content', "ods-shortcut__content--".concat(orientation)) },
46895
46895
  e.createElement("div", { className: "ods-shortcut__icon" }, icon),
@@ -46925,16 +46925,21 @@ CardListItem.displayName = 'CardListItem';
46925
46925
  var Options = function (_a) {
46926
46926
  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;
46927
46927
  var columns = multiChoice ? Math.ceil(options.length / 5) : 1;
46928
+ var isMultiArray = Array.isArray(selectedOptions);
46928
46929
  return (e.createElement("div", { className: "ods-chips__options", "data-testid": "ods-chips-option" },
46929
46930
  e.createElement("div", { className: classNames('ods-chips__options--content', "ods-chips__options--content--columns-".concat(columns)) }, options.map(function (_a) {
46930
46931
  var label = _a.label, value = _a.value;
46931
- return (e.createElement("button", { key: label, type: "button", value: value, onClick: function () { return onSelect(label, value); }, className: classNames('ods-chips__options--option', {
46932
- 'ods-chips__options--option--selected': !multiChoice &&
46933
- !Array.isArray(selectedOptions) &&
46934
- selectedOptions.value === value,
46935
- }) },
46936
- multiChoice && Array.isArray(selectedOptions) && (e.createElement(Checkbox, { checked: !!selectedOptions.find(function (option) { return option.value === value; }), readOnly: true })),
46937
- label));
46932
+ if (multiChoice && isMultiArray) {
46933
+ var isSelected_1 = selectedOptions.some(function (option) { return option.value === value; });
46934
+ return (e.createElement("div", { key: value, className: classNames('ods-chips__options--option', 'ods-chips__options--option-container', {
46935
+ 'ods-chips__options--option--selected': isSelected_1,
46936
+ }) },
46937
+ e.createElement(Checkbox, { checked: isSelected_1, id: "chips-option-".concat(value), onClick: function () { return onSelect(label, value); }, readOnly: true, label: label })));
46938
+ }
46939
+ var isSelected = !multiChoice && !isMultiArray && selectedOptions.value === value;
46940
+ return (e.createElement("button", { key: value, type: "button", value: value, onClick: function () { return onSelect(label, value); }, className: classNames('ods-chips__options--option', {
46941
+ 'ods-chips__options--option--selected': isSelected,
46942
+ }) }, label));
46938
46943
  })),
46939
46944
  multiChoice && (e.createElement("div", { className: "ods-chips__options--footer" },
46940
46945
  e.createElement("button", { type: "button", onClick: clearOptions, className: "ods-btn ods-btn--sm ods-btn--text" }, clearLabel),