bianic-ui 1.7.4-alpha.2 → 1.7.4-alpha.3

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
@@ -1738,11 +1738,15 @@ MenuContainer.defaultProps = {
1738
1738
  function MenuItem(_a) {
1739
1739
  var _b = _a.className, className = _b === void 0 ? '' : _b, label = _a.label, _c = _a.onClick, onClick = _c === void 0 ? function () { } : _c, _d = _a.caption, caption = _d === void 0 ? undefined : _d, _e = _a.isChecked, isChecked = _e === void 0 ? undefined : _e, _f = _a.onClose, onClose = _f === void 0 ? function () { } : _f, children = _a.children, props = __rest(_a, ["className", "label", "onClick", "caption", "isChecked", "onClose", "children"]);
1740
1740
  var _g = React$1.useState(false), isHovered = _g[0], setIsHovered = _g[1];
1741
+ var isWithChecked = isChecked !== undefined;
1742
+ var leftPadding = isWithChecked ? 'pl-[5px]' : 'pl-[10px]';
1743
+ var rightPadding = caption || children ? 'pr-[5px]' : 'pr-[10px]';
1744
+ var itemClass = "".concat(leftPadding, " ").concat(rightPadding, " ").concat(className);
1741
1745
  return (React$1.createElement("div", { className: "group/main relative cursor-pointer first:rounded-t-radius-sm first:pt-[6px] last:rounded-b-radius-sm last:pb-[6px] ".concat(!isHovered && 'z-10'), onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } },
1742
- React$1.createElement("div", __assign({ className: "relative z-10 flex items-center p-[5px] hover:bg-bia-blue-pastel ".concat(className, "}"), role: "button", tabIndex: 0, onClick: function (e) {
1746
+ React$1.createElement("div", __assign({ className: "relative z-10 flex items-center py-[5px] hover:bg-bia-blue-pastel ".concat(itemClass), role: "button", tabIndex: 0, onClick: function (e) {
1743
1747
  onClick(e);
1744
1748
  }, onKeyDown: function () { } }, props),
1745
- isChecked !== undefined && (React$1.createElement("div", { className: "mr-[5px] aspect-square w-[14px]" }, isChecked && React$1.createElement(TbCheck, { className: "text-primary-black", size: 14 }))),
1749
+ isWithChecked && (React$1.createElement("div", { className: "mr-[5px] aspect-square w-[14px]" }, isChecked && React$1.createElement(TbCheck, { className: "text-primary-black", size: 14 }))),
1746
1750
  React$1.createElement("span", { className: "whitespace-nowrap font-arial text-[11px] text-bia-black" }, label),
1747
1751
  React$1.createElement("div", { className: "ml-auto flex items-center" },
1748
1752
  children && (React$1.createElement(TbChevronRight, { className: "ml-[10px] text-bia-coolgrey" })),