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 +5 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +5 -6
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -4377,8 +4377,8 @@ var Tags = function (_a) {
|
|
|
4377
4377
|
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"};
|
|
4378
4378
|
|
|
4379
4379
|
var Component$D = function (_a) {
|
|
4380
|
-
var className = _a.className,
|
|
4381
|
-
var
|
|
4380
|
+
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;
|
|
4381
|
+
var _d = useState(''), isSelected = _d[0], setIsSelected = _d[1];
|
|
4382
4382
|
var isColorDark = function (color) {
|
|
4383
4383
|
var hex = color.replace('#', '');
|
|
4384
4384
|
var r = parseInt(hex.substring(0, 2), 16);
|
|
@@ -4398,17 +4398,16 @@ var Component$D = function (_a) {
|
|
|
4398
4398
|
setIsSelected(id.toString());
|
|
4399
4399
|
}, [currentSelect, isSelected, onChange]);
|
|
4400
4400
|
var selectStyles = useMemo(function () {
|
|
4401
|
-
var textColor = isColorDark(color || '#FFFFFF') ? '#FFFFFF' : '#000000';
|
|
4402
4401
|
if (isSelected || currentSelect) {
|
|
4403
4402
|
return {
|
|
4404
|
-
backgroundColor: color
|
|
4405
|
-
color:
|
|
4403
|
+
backgroundColor: color,
|
|
4404
|
+
color: isColorDark(color || '#FFFFFF') ? '#FFFFFF' : '#000000',
|
|
4406
4405
|
border: 'none'
|
|
4407
4406
|
};
|
|
4408
4407
|
}
|
|
4409
4408
|
return {
|
|
4410
4409
|
backgroundColor: baseColor,
|
|
4411
|
-
color:
|
|
4410
|
+
color: isColorDark(baseColor || '#FFFFFF') ? '#FFFFFF' : '#000000'
|
|
4412
4411
|
};
|
|
4413
4412
|
}, [baseColor, color, currentSelect, isSelected]);
|
|
4414
4413
|
return (React.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));
|