@eclass/ui-kit 1.59.5 → 1.59.7

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.
@@ -6759,18 +6759,18 @@ function skipAttributesToProps(node2) {
6759
6759
  var HTMLReactParser = /* @__PURE__ */ getDefaultExportFromCjs(lib$3);
6760
6760
  var ReactParser = HTMLReactParser.default || HTMLReactParser;
6761
6761
  const AVATAR_COLORS = ["#0076ba", "#229f9c", "#2cb26b", "#30baed", "#95569e", "#9bc03a", "#d84315", "#f5a623", "#f6712f", "#ff6363"];
6762
- const getColorByUserId = (userId) => {
6763
- if (userId >= 0) {
6764
- const digits = userId.toString().split("");
6765
- const position = parseInt(digits[digits.length - 1], 10);
6766
- return AVATAR_COLORS[position];
6767
- }
6768
- return AVATAR_COLORS[Math.floor(Math.random() * AVATAR_COLORS.length)];
6762
+ const getColorIndex = (fullName) => {
6763
+ var _a;
6764
+ const trimmedNameLength = (_a = fullName == null ? void 0 : fullName.trim().length) != null ? _a : 0;
6765
+ return trimmedNameLength % 10;
6766
+ };
6767
+ const getAvatarColor = (fullName) => {
6768
+ const position = getColorIndex(fullName);
6769
+ return AVATAR_COLORS[position];
6769
6770
  };
6770
6771
  const getInitials = (fullName) => fullName.split(" ").map((word) => word[0]).slice(0, 2).join("").toUpperCase();
6771
6772
  const Avatar = ({
6772
6773
  fullName,
6773
- userId,
6774
6774
  picture,
6775
6775
  size = 50,
6776
6776
  fontSize = 14,
@@ -6781,8 +6781,8 @@ const Avatar = ({
6781
6781
  const [bgColor, setBgColor] = useState("");
6782
6782
  const [imageValid, setImageValid] = useState(false);
6783
6783
  useEffect(() => {
6784
- setBgColor(getColorByUserId(userId));
6785
- }, [userId]);
6784
+ setBgColor(getAvatarColor(fullName));
6785
+ }, [fullName]);
6786
6786
  const wrapperStyle = {
6787
6787
  alignItems: "center",
6788
6788
  backgroundColor: (fullName == null ? void 0 : fullName.length) === 0 ? "#fff" : bgColor,
@@ -10595,6 +10595,10 @@ const useHideBackgroundOnMobile = (isOpen) => {
10595
10595
  footer.style.display = isOpen ? "none" : "";
10596
10596
  }
10597
10597
  } else {
10598
+ const browse = document.querySelector(".browse");
10599
+ if (browse) {
10600
+ browse.style.display = isOpen ? "none" : "";
10601
+ }
10598
10602
  const mainElement = document.querySelector(".main");
10599
10603
  if (!mainElement)
10600
10604
  return;
@@ -10619,6 +10623,10 @@ const useHideBackgroundOnMobile = (isOpen) => {
10619
10623
  footer.style.display = "";
10620
10624
  }
10621
10625
  } else {
10626
+ const browse = document.querySelector(".browse");
10627
+ if (browse) {
10628
+ browse.style.display = "";
10629
+ }
10622
10630
  const mainElement = document.querySelector(".main");
10623
10631
  if (mainElement) {
10624
10632
  const firstChild = mainElement.firstElementChild;
@@ -10916,6 +10924,8 @@ const UserDropdown = ({
10916
10924
  borderRadius: !isMobile ? "10px" : "0",
10917
10925
  bg: vars("colors-neutral-white"),
10918
10926
  ">button, >a": {
10927
+ borderTop: "none",
10928
+ borderInline: "none",
10919
10929
  borderBottom: isMobile ? `solid 1px ${vars("colors-neutral-platinum")}` : void 0
10920
10930
  }
10921
10931
  },