@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.
- package/dist/eclass-ui-kit.es.js +20 -10
- package/dist/eclass-ui-kit.es.js.map +1 -1
- package/dist/eclass-ui-kit.umd.js +30 -30
- package/dist/eclass-ui-kit.umd.js.map +1 -1
- package/dist/molecules/Avatar/Avatar.d.ts +2 -2
- package/dist/molecules/Avatar/Avatar.d.ts.map +1 -1
- package/dist/molecules/Avatar/Avatar.types.d.ts +2 -2
- package/dist/molecules/Avatar/Avatar.types.d.ts.map +1 -1
- package/dist/organisms/User/Dropdown/hooks/useHideBackgroundOnMobile.d.ts.map +1 -1
- package/dist/organisms/User/UserDropdown.d.ts.map +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/eclass-ui-kit.es.js
CHANGED
|
@@ -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
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
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(
|
|
6785
|
-
}, [
|
|
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
|
},
|