magneto365.ui 2.43.4 → 2.43.5

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/dist/cjs/index.js CHANGED
@@ -4386,8 +4386,8 @@ var Tags = function (_a) {
4386
4386
  var styles$z = {"magneto-ui-toggle-button":"mg_toggle_button_magneto-ui-toggle-button_nfgc1","toggle-button-selected":"mg_toggle_button_toggle-button-selected_nfgc1"};
4387
4387
 
4388
4388
  var Component$D = function (_a) {
4389
- var className = _a.className, color = _a.color, onChange = _a.onChange, id = _a.id, name = _a.name, currentSelect = _a.currentSelect, _b = _a.baseColor, baseColor = _b === void 0 ? 'transparent' : _b;
4390
- var _c = React.useState(''), isSelected = _c[0], setIsSelected = _c[1];
4389
+ var className = _a.className, _b = _a.color, color = _b === void 0 ? 'blue' : _b, onChange = _a.onChange, id = _a.id, name = _a.name, currentSelect = _a.currentSelect, _c = _a.baseColor, baseColor = _c === void 0 ? 'transparent' : _c;
4390
+ var _d = React.useState(''), isSelected = _d[0], setIsSelected = _d[1];
4391
4391
  var isColorDark = function (color) {
4392
4392
  var hex = color.replace('#', '');
4393
4393
  var r = parseInt(hex.substring(0, 2), 16);
@@ -4407,17 +4407,16 @@ var Component$D = function (_a) {
4407
4407
  setIsSelected(id.toString());
4408
4408
  }, [currentSelect, isSelected, onChange]);
4409
4409
  var selectStyles = React.useMemo(function () {
4410
- var textColor = isColorDark(color || '#FFFFFF') ? '#FFFFFF' : '#000000';
4411
4410
  if (isSelected || currentSelect) {
4412
4411
  return {
4413
- backgroundColor: color || '#F0F1F3',
4414
- color: textColor,
4412
+ backgroundColor: color,
4413
+ color: isColorDark(color || '#FFFFFF') ? '#FFFFFF' : '#000000',
4415
4414
  border: 'none'
4416
4415
  };
4417
4416
  }
4418
4417
  return {
4419
4418
  backgroundColor: baseColor,
4420
- color: textColor
4419
+ color: isColorDark(baseColor || '#FFFFFF') ? '#FFFFFF' : '#000000'
4421
4420
  };
4422
4421
  }, [baseColor, color, currentSelect, isSelected]);
4423
4422
  return (React__default["default"].createElement("button", { className: "".concat(styles$z["".concat(classMUI, "-toggle-button")], " ").concat(className || '', " ").concat(isSelected || currentSelect ? styles$z['toggle-button-selected'] : ''), style: __assign({}, selectStyles), onClick: function () { return handleClick({ id: id, name: name }); }, type: "button" }, name));