@eclass/ui-kit 1.58.4 → 1.59.1

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.
Files changed (42) hide show
  1. package/dist/atoms/Icons/Calendar.d.ts +7 -0
  2. package/dist/atoms/Icons/Calendar.d.ts.map +1 -0
  3. package/dist/atoms/Icons/index.d.ts +1 -0
  4. package/dist/atoms/Icons/index.d.ts.map +1 -1
  5. package/dist/eclass-ui-kit.es.js +617 -3
  6. package/dist/eclass-ui-kit.es.js.map +1 -1
  7. package/dist/eclass-ui-kit.umd.js +30 -30
  8. package/dist/eclass-ui-kit.umd.js.map +1 -1
  9. package/dist/index.d.ts +2 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/molecules/Avatar/Avatar.d.ts +11 -0
  12. package/dist/molecules/Avatar/Avatar.d.ts.map +1 -0
  13. package/dist/molecules/Avatar/Avatar.types.d.ts +19 -0
  14. package/dist/molecules/Avatar/Avatar.types.d.ts.map +1 -0
  15. package/dist/molecules/Avatar/index.d.ts +3 -0
  16. package/dist/molecules/Avatar/index.d.ts.map +1 -0
  17. package/dist/molecules/index.d.ts +1 -0
  18. package/dist/molecules/index.d.ts.map +1 -1
  19. package/dist/organisms/User/Dropdown/Icons/AcademicHistorialIcon.d.ts +3 -0
  20. package/dist/organisms/User/Dropdown/Icons/AcademicHistorialIcon.d.ts.map +1 -0
  21. package/dist/organisms/User/Dropdown/Icons/CalendarIcon.d.ts +3 -0
  22. package/dist/organisms/User/Dropdown/Icons/CalendarIcon.d.ts.map +1 -0
  23. package/dist/organisms/User/Dropdown/Icons/CoursesIcon.d.ts +3 -0
  24. package/dist/organisms/User/Dropdown/Icons/CoursesIcon.d.ts.map +1 -0
  25. package/dist/organisms/User/Dropdown/Icons/ProfileIcon.d.ts +3 -0
  26. package/dist/organisms/User/Dropdown/Icons/ProfileIcon.d.ts.map +1 -0
  27. package/dist/organisms/User/Dropdown/hooks/useHideBackgroundOnMobile.d.ts +10 -0
  28. package/dist/organisms/User/Dropdown/hooks/useHideBackgroundOnMobile.d.ts.map +1 -0
  29. package/dist/organisms/User/Dropdown/hooks/useTooltipToggleDelay.d.ts +2 -0
  30. package/dist/organisms/User/Dropdown/hooks/useTooltipToggleDelay.d.ts.map +1 -0
  31. package/dist/organisms/User/Dropdown/utils/focusMenuWithKeys.d.ts +3 -0
  32. package/dist/organisms/User/Dropdown/utils/focusMenuWithKeys.d.ts.map +1 -0
  33. package/dist/organisms/User/Dropdown/utils/getIconToRender.d.ts +4 -0
  34. package/dist/organisms/User/Dropdown/utils/getIconToRender.d.ts.map +1 -0
  35. package/dist/organisms/User/UserDropdown.d.ts +25 -0
  36. package/dist/organisms/User/UserDropdown.d.ts.map +1 -0
  37. package/dist/organisms/User/index.d.ts +2 -0
  38. package/dist/organisms/User/index.d.ts.map +1 -0
  39. package/dist/organisms/User/menuProfileStyle.d.ts +49 -0
  40. package/dist/organisms/User/menuProfileStyle.d.ts.map +1 -0
  41. package/dist/tsconfig.types.tsbuildinfo +1 -1
  42. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { BaseProps } from './Base';
3
+ export declare function Calendar(props: BaseProps): JSX.Element;
4
+ export declare namespace Calendar {
5
+ var displayName: string;
6
+ }
7
+ //# sourceMappingURL=Calendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/atoms/Icons/Calendar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAQ,SAAS,EAAE,MAAM,QAAQ,CAAA;AACxC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAYtD;yBAZe,QAAQ"}
@@ -1,6 +1,7 @@
1
1
  export * from './AcademicRecord';
2
2
  export * from './AlertInfo';
3
3
  export * from './ArrowRight';
4
+ export * from './Calendar';
4
5
  export * from './Certificate';
5
6
  export * from './CircularCheck';
6
7
  export * from './CircularInformation';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atoms/Icons/index.tsx"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atoms/Icons/index.tsx"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA"}
@@ -1,6 +1,6 @@
1
- import { extendTheme, Box, CircularProgress, Icon, Button, useMediaQuery, Tooltip, Flex, Stack, Center, Image, Text as Text$1, HStack, Heading, List, ListItem, Link, Modal as Modal$1, ModalContent as ModalContent$1, ModalHeader, ModalCloseButton, ModalBody, ModalFooter, ModalOverlay, useDisclosure, LinkBox, LinkOverlay, MenuButton, MenuGroup, Menu, MenuList } from "@chakra-ui/react";
1
+ import { extendTheme, Box, CircularProgress, Icon, Button, useMediaQuery, Tooltip, Flex, Stack, Center, Image, Text as Text$1, HStack, Heading, List, ListItem, Link, Modal as Modal$1, ModalContent as ModalContent$1, ModalHeader, ModalCloseButton, ModalBody, ModalFooter, ModalOverlay, useDisclosure, LinkBox, LinkOverlay, MenuButton, MenuGroup, Menu, MenuList, MenuItem } from "@chakra-ui/react";
2
2
  import * as React$1 from "react";
3
- import React__default, { useEffect, useCallback, useState } from "react";
3
+ import React__default, { useEffect, useState, useCallback, useRef } from "react";
4
4
  const main = {
5
5
  deepSkyBlue: "#0189FF",
6
6
  azureRadiance: "#017BE5",
@@ -620,6 +620,22 @@ function ArrowRight(props) {
620
620
  });
621
621
  }
622
622
  ArrowRight.displayName = "ArrowRight";
623
+ function Calendar$1(props) {
624
+ return /* @__PURE__ */ jsx(Base, {
625
+ ...props,
626
+ title: "Calendar",
627
+ children: /* @__PURE__ */ jsxs("g", {
628
+ fill: "#B0CFE0",
629
+ children: [/* @__PURE__ */ jsx("path", {
630
+ fill: "#B0CFE0",
631
+ d: "M15 2h-2V0h-2v2H9V0H7v2H5V0H3v2H1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1zm-1 12H2V5h12v9z"
632
+ }), /* @__PURE__ */ jsx("path", {
633
+ d: "M4 7h2v2H4zM7 7h2v2H7zM4 10h2v2H4zM7 10h2v2H7zM10 7h2v2h-2zM10 10h2v2h-2z"
634
+ })]
635
+ })
636
+ });
637
+ }
638
+ Calendar$1.displayName = "Calendar";
623
639
  function Certificate(props) {
624
640
  return /* @__PURE__ */ jsxs(Base, {
625
641
  ...props,
@@ -1323,6 +1339,7 @@ var index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
1323
1339
  AcademicRecord,
1324
1340
  AlertInfo,
1325
1341
  ArrowRight,
1342
+ Calendar: Calendar$1,
1326
1343
  Certificate,
1327
1344
  CircularCheck,
1328
1345
  CircularInformation,
@@ -6741,6 +6758,104 @@ function skipAttributesToProps(node2) {
6741
6758
  })(lib$3);
6742
6759
  var HTMLReactParser = /* @__PURE__ */ getDefaultExportFromCjs(lib$3);
6743
6760
  var ReactParser = HTMLReactParser.default || HTMLReactParser;
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)];
6769
+ };
6770
+ const getInitials = (fullName) => fullName.split(" ").map((word) => word[0]).slice(0, 2).join("").toUpperCase();
6771
+ const Avatar = ({
6772
+ fullName,
6773
+ userId,
6774
+ picture,
6775
+ size = 50,
6776
+ fontSize = 14,
6777
+ alt = "Avatar",
6778
+ id,
6779
+ borderDecoration = false
6780
+ }) => {
6781
+ const [bgColor, setBgColor] = useState("");
6782
+ const [imageValid, setImageValid] = useState(false);
6783
+ useEffect(() => {
6784
+ setBgColor(getColorByUserId(userId));
6785
+ }, [userId]);
6786
+ const wrapperStyle = {
6787
+ alignItems: "center",
6788
+ backgroundColor: (fullName == null ? void 0 : fullName.length) === 0 ? "#fff" : bgColor,
6789
+ border: borderDecoration ? `3px solid #0189FF` : "none",
6790
+ borderRadius: "50%",
6791
+ display: "flex",
6792
+ flexShrink: 0,
6793
+ height: `${size}px`,
6794
+ justifyContent: "center",
6795
+ margin: 0,
6796
+ overflow: "hidden",
6797
+ width: `${size}px`,
6798
+ boxSizing: "border-box"
6799
+ };
6800
+ const initialsStyle = {
6801
+ color: "#fff",
6802
+ fontFamily: "Roboto, sans-serif",
6803
+ fontSize: `${fontSize}px`,
6804
+ fontWeight: "bold",
6805
+ lineHeight: "30px",
6806
+ textTransform: "uppercase"
6807
+ };
6808
+ const imgStyle = {
6809
+ height: "100%",
6810
+ width: "100%",
6811
+ objectFit: "cover",
6812
+ display: "block"
6813
+ };
6814
+ if (!fullName || fullName.length === 0) {
6815
+ return /* @__PURE__ */ jsx("figure", {
6816
+ style: wrapperStyle,
6817
+ "data-testid": "Avatar",
6818
+ "aria-hidden": "true",
6819
+ id
6820
+ });
6821
+ }
6822
+ if (picture) {
6823
+ return /* @__PURE__ */ jsxs("figure", {
6824
+ style: wrapperStyle,
6825
+ "data-testid": "Avatar",
6826
+ role: "presentation",
6827
+ children: [!imageValid && /* @__PURE__ */ jsx("span", {
6828
+ style: initialsStyle,
6829
+ id,
6830
+ "aria-hidden": "true",
6831
+ children: getInitials(fullName)
6832
+ }), /* @__PURE__ */ jsx("img", {
6833
+ src: picture,
6834
+ alt,
6835
+ id: imageValid ? id : void 0,
6836
+ role: "presentation",
6837
+ style: {
6838
+ ...imgStyle,
6839
+ display: imageValid ? "block" : "none"
6840
+ },
6841
+ onLoad: () => setImageValid(true),
6842
+ onError: () => setImageValid(false)
6843
+ })]
6844
+ });
6845
+ }
6846
+ return /* @__PURE__ */ jsx("figure", {
6847
+ style: wrapperStyle,
6848
+ "data-testid": "Avatar",
6849
+ role: "presentation",
6850
+ children: bgColor ? /* @__PURE__ */ jsx("span", {
6851
+ style: initialsStyle,
6852
+ id,
6853
+ "aria-hidden": "true",
6854
+ children: getInitials(fullName)
6855
+ }) : null
6856
+ });
6857
+ };
6858
+ Avatar.displayName = "Avatar";
6744
6859
  const alertStates = {
6745
6860
  success: {
6746
6861
  icon: /* @__PURE__ */ jsx(SuccessWhite, {}),
@@ -10367,5 +10482,504 @@ const EventsList = ({
10367
10482
  })]
10368
10483
  });
10369
10484
  };
10370
- export { Alert, Btn, BtnLink, BtnPrimary, BtnSecondary, BtnTertiary, CalendarDropdown, CourseList, CourseStatus, Eventos, EventsList, FlashNotification, index$1 as Icons, Label, Modal, ModalAlert, ModalAlertButtons, ModalAlertNew, ModalButtons, ModalContent, ModalMultiple, NavBarButton, NewTooltip, Progress, Resources, Ripples, TinyAlert, UserWay, UserWayCookie, dataFake, maxWidthCoursesList, theme, useFlashNotification, vars };
10485
+ const profileStyle = {
10486
+ header: {
10487
+ background: vars("colors-neutral-davysGrey"),
10488
+ fontFamily: "Roboto",
10489
+ fontSize: "15px",
10490
+ fontWeight: "500",
10491
+ margin: "0",
10492
+ padding: "0 20px 15px",
10493
+ color: vars("colors-neutral-white")
10494
+ },
10495
+ logout: {
10496
+ background: vars("colors-neutral-white"),
10497
+ border: "none",
10498
+ color: vars("colors-alert-deepSkyBlue"),
10499
+ fontFamily: "Roboto",
10500
+ fontSize: "14px",
10501
+ fontWeight: "500",
10502
+ justifyContent: "center",
10503
+ padding: "14px 20px",
10504
+ width: "-webkit-fill-available",
10505
+ _hover: {
10506
+ background: vars("colors-neutral-cultured"),
10507
+ MenuItemShadow: "none",
10508
+ boxShadow: "none",
10509
+ textDecoration: "none"
10510
+ },
10511
+ _focus: {
10512
+ boxShadow: `0 0 0 3px ${vars("colors-icon-deepSkyBlue")} inset`
10513
+ }
10514
+ },
10515
+ items: {
10516
+ background: vars("colors-neutral-white"),
10517
+ borderBottom: `solid 1px ${vars("colors-neutral-platinum")}`,
10518
+ color: vars("colors-neutral-spanishGrey"),
10519
+ fontWeight: "500",
10520
+ fontSize: "12px",
10521
+ textTransform: "uppercase",
10522
+ _focus: {
10523
+ boxShadow: `0 0 0 3px ${vars("colors-icon-deepSkyBlue")} inset`
10524
+ },
10525
+ _hover: {
10526
+ background: vars("colors-neutral-cultured"),
10527
+ boxShadow: "none",
10528
+ color: vars("colors-neutral-spanishGrey"),
10529
+ textDecoration: "none"
10530
+ }
10531
+ }
10532
+ };
10533
+ function focusMenuWithKeys(event, menuListRef) {
10534
+ if (!menuListRef.current)
10535
+ return;
10536
+ const focusableItems = Array.from(
10537
+ menuListRef.current.querySelectorAll('[role="menuitem"]:not([disabled])')
10538
+ );
10539
+ if (!focusableItems.length)
10540
+ return;
10541
+ const currentIndex = focusableItems.findIndex((item) => item === document.activeElement);
10542
+ const firstIndex = 0;
10543
+ const lastIndex = focusableItems.length - 1;
10544
+ let nextIndex = -1;
10545
+ if (event.key === "ArrowDown") {
10546
+ event.preventDefault();
10547
+ nextIndex = currentIndex === -1 ? firstIndex : (currentIndex + 1) % focusableItems.length;
10548
+ }
10549
+ if (event.key === "ArrowUp") {
10550
+ event.preventDefault();
10551
+ nextIndex = currentIndex === -1 ? lastIndex : (currentIndex - 1 + focusableItems.length) % focusableItems.length;
10552
+ }
10553
+ if (event.key === "Tab") {
10554
+ if (event.shiftKey) {
10555
+ if (currentIndex > firstIndex) {
10556
+ event.preventDefault();
10557
+ nextIndex = currentIndex - 1;
10558
+ }
10559
+ } else {
10560
+ if (currentIndex < lastIndex) {
10561
+ event.preventDefault();
10562
+ nextIndex = currentIndex + 1;
10563
+ }
10564
+ }
10565
+ }
10566
+ if (nextIndex >= 0) {
10567
+ focusableItems[nextIndex].focus();
10568
+ }
10569
+ }
10570
+ function useTooltipToggleDelay(isMenuOpen, setTooltipDisabled, delay = 300) {
10571
+ useEffect(() => {
10572
+ if (isMenuOpen) {
10573
+ setTooltipDisabled(true);
10574
+ } else {
10575
+ const timer = setTimeout(() => setTooltipDisabled(false), delay);
10576
+ return () => clearTimeout(timer);
10577
+ }
10578
+ }, [isMenuOpen, setTooltipDisabled, delay]);
10579
+ }
10580
+ const useHideBackgroundOnMobile = (isOpen) => {
10581
+ const [isMobile] = useMediaQuery("(max-width: 480px)");
10582
+ useEffect(() => {
10583
+ if (!isMobile)
10584
+ return;
10585
+ if (isOpen) {
10586
+ document.body.style.overflow = "hidden";
10587
+ } else {
10588
+ document.body.style.overflow = "";
10589
+ }
10590
+ const viewContainer = document.getElementById("ViewContainer");
10591
+ if (viewContainer) {
10592
+ viewContainer.style.display = isOpen ? "none" : "";
10593
+ } else {
10594
+ const mainElement = document.querySelector(".main");
10595
+ if (!mainElement)
10596
+ return;
10597
+ const firstChild = mainElement.firstElementChild;
10598
+ if (!firstChild || !(firstChild instanceof HTMLElement))
10599
+ return;
10600
+ const headerElement = firstChild.querySelector("header.header");
10601
+ if (!headerElement)
10602
+ return;
10603
+ const targetElement = headerElement.nextElementSibling;
10604
+ if (!targetElement || !(targetElement instanceof HTMLElement))
10605
+ return;
10606
+ targetElement.style.display = isOpen ? "none" : "";
10607
+ }
10608
+ return () => {
10609
+ document.body.style.overflow = "";
10610
+ const viewContainer2 = document.getElementById("ViewContainer");
10611
+ if (viewContainer2) {
10612
+ viewContainer2.style.display = "";
10613
+ } else {
10614
+ const mainElement = document.querySelector(".main");
10615
+ if (mainElement) {
10616
+ const firstChild = mainElement.firstElementChild;
10617
+ if (firstChild instanceof HTMLElement) {
10618
+ const headerElement = firstChild.querySelector("header.header");
10619
+ if (headerElement) {
10620
+ const targetElement = headerElement.nextElementSibling;
10621
+ if (targetElement instanceof HTMLElement) {
10622
+ targetElement.style.display = "";
10623
+ }
10624
+ }
10625
+ }
10626
+ }
10627
+ }
10628
+ };
10629
+ }, [isMobile, isOpen]);
10630
+ return isMobile;
10631
+ };
10632
+ const CoursesIcon = () => /* @__PURE__ */ jsxs("svg", {
10633
+ width: "45",
10634
+ height: "45",
10635
+ viewBox: "0 0 45 45",
10636
+ fill: "none",
10637
+ xmlns: "http://www.w3.org/2000/svg",
10638
+ children: [/* @__PURE__ */ jsx("circle", {
10639
+ cx: "22.5",
10640
+ cy: "22.5",
10641
+ r: "22.5",
10642
+ fill: "#E0EEFA"
10643
+ }), /* @__PURE__ */ jsx("path", {
10644
+ fillRule: "evenodd",
10645
+ clipRule: "evenodd",
10646
+ d: "M7 38C9.20914 38 11 36.2091 11 34C11 31.7909 9.20914 30 7 30C4.79086 30 3 31.7909 3 34C3 36.2091 4.79086 38 7 38Z",
10647
+ fill: "#0189FF"
10648
+ }), /* @__PURE__ */ jsx("path", {
10649
+ fillRule: "evenodd",
10650
+ clipRule: "evenodd",
10651
+ d: "M23 37C24.6569 37 26 35.6569 26 34C26 32.3431 24.6569 31 23 31C21.3431 31 20 32.3431 20 34C20 35.6569 21.3431 37 23 37Z",
10652
+ fill: "#1EBDAF",
10653
+ stroke: "#1EBDAF",
10654
+ strokeWidth: "2"
10655
+ }), /* @__PURE__ */ jsx("path", {
10656
+ fillRule: "evenodd",
10657
+ clipRule: "evenodd",
10658
+ d: "M7 34C7 33.4477 7.44772 33 8 33L36 33C36.5523 33 37 33.4477 37 34C37 34.5523 36.5523 35 36 35L8 35C7.44772 35 7 34.5523 7 34Z",
10659
+ fill: "#08044F"
10660
+ }), /* @__PURE__ */ jsx("path", {
10661
+ fillRule: "evenodd",
10662
+ clipRule: "evenodd",
10663
+ d: "M35 34C35 31.7909 36.7909 30 39 30C41.2091 30 43 31.7909 43 34C43 36.2091 41.2091 38 39 38C36.7909 38 35 36.2091 35 34ZM39 32C37.8954 32 37 32.8954 37 34C37 35.1046 37.8954 36 39 36C40.1046 36 41 35.1046 41 34C41 32.8954 40.1046 32 39 32Z",
10664
+ fill: "#08044F"
10665
+ }), /* @__PURE__ */ jsx("path", {
10666
+ d: "M2 12C2 10.8954 2.89543 10 4 10H19C20.1046 10 21 10.8954 21 12V22H2V12Z",
10667
+ fill: "#FF554D"
10668
+ }), /* @__PURE__ */ jsx("path", {
10669
+ d: "M25 12C25 10.8954 25.8954 10 27 10H42C43.1046 10 44 10.8954 44 12V22H25V12Z",
10670
+ fill: "#FFBC27"
10671
+ }), /* @__PURE__ */ jsx("path", {
10672
+ fillRule: "evenodd",
10673
+ clipRule: "evenodd",
10674
+ d: "M19 20H4L4 24H19V20ZM2 18V24C2 25.1046 2.89543 26 4 26H19C20.1046 26 21 25.1046 21 24V18H2Z",
10675
+ fill: "#08044F"
10676
+ }), /* @__PURE__ */ jsx("path", {
10677
+ fillRule: "evenodd",
10678
+ clipRule: "evenodd",
10679
+ d: "M42 20H27L27 24H42V20ZM25 18V24C25 25.1046 25.8954 26 27 26H42C43.1046 26 44 25.1046 44 24V18H25Z",
10680
+ fill: "#08044F"
10681
+ })]
10682
+ });
10683
+ const AcademicHistorialIcon = () => /* @__PURE__ */ jsxs("svg", {
10684
+ width: "45",
10685
+ height: "45",
10686
+ viewBox: "0 0 45 45",
10687
+ fill: "none",
10688
+ xmlns: "http://www.w3.org/2000/svg",
10689
+ role: "AcademicHistorialIcon",
10690
+ children: [/* @__PURE__ */ jsx("circle", {
10691
+ cx: "22.5",
10692
+ cy: "22.5",
10693
+ r: "22.5",
10694
+ fill: "#E0EEFA"
10695
+ }), /* @__PURE__ */ jsx("path", {
10696
+ d: "M11 8H4C3.44772 8 3 8.44772 3 9V14C3 14.5523 3.44772 15 4 15H11C11.5523 15 12 14.5523 12 14V9C12 8.44772 11.5523 8 11 8Z",
10697
+ fill: "#FFBC27"
10698
+ }), /* @__PURE__ */ jsx("path", {
10699
+ d: "M40 8H17C16.4477 8 16 8.44772 16 9V14C16 14.5523 16.4477 15 17 15H40C40.5523 15 41 14.5523 41 14V9C41 8.44772 40.5523 8 40 8Z",
10700
+ fill: "#0189FF"
10701
+ }), /* @__PURE__ */ jsx("rect", {
10702
+ x: "4",
10703
+ y: "8",
10704
+ width: "37",
10705
+ height: "26",
10706
+ rx: "1",
10707
+ stroke: "#08044F",
10708
+ strokeWidth: "2"
10709
+ }), /* @__PURE__ */ jsx("path", {
10710
+ d: "M15 35L15 39",
10711
+ stroke: "#08044F",
10712
+ strokeWidth: "2",
10713
+ strokeLinecap: "square"
10714
+ }), /* @__PURE__ */ jsx("path", {
10715
+ d: "M30 35L30 40",
10716
+ stroke: "#08044F",
10717
+ strokeWidth: "2",
10718
+ strokeLinecap: "round"
10719
+ }), /* @__PURE__ */ jsx("path", {
10720
+ d: "M13 40L32 40",
10721
+ stroke: "#08044F",
10722
+ strokeWidth: "2",
10723
+ strokeLinecap: "round"
10724
+ }), /* @__PURE__ */ jsx("path", {
10725
+ d: "M31 19H14C13.4477 19 13 19.4477 13 20V22C13 22.5523 13.4477 23 14 23H31C31.5523 23 32 22.5523 32 22V20C32 19.4477 31.5523 19 31 19Z",
10726
+ fill: "#1EBDAF"
10727
+ }), /* @__PURE__ */ jsx("path", {
10728
+ d: "M31 26H14C13.4477 26 13 26.4477 13 27V29C13 29.5523 13.4477 30 14 30H31C31.5523 30 32 29.5523 32 29V27C32 26.4477 31.5523 26 31 26Z",
10729
+ fill: "#FF554D"
10730
+ }), /* @__PURE__ */ jsx("path", {
10731
+ d: "M4 15L41 15",
10732
+ stroke: "#08044F",
10733
+ strokeWidth: "2",
10734
+ strokeLinecap: "round"
10735
+ })]
10736
+ });
10737
+ const ProfileIcon = () => /* @__PURE__ */ jsxs("svg", {
10738
+ width: "45",
10739
+ height: "45",
10740
+ role: "ProfileIcon",
10741
+ viewBox: "0 0 45 45",
10742
+ fill: "none",
10743
+ xmlns: "http://www.w3.org/2000/svg",
10744
+ children: [/* @__PURE__ */ jsx("circle", {
10745
+ cx: "22.5",
10746
+ cy: "22.5",
10747
+ r: "22.5",
10748
+ fill: "#E0EEFA"
10749
+ }), /* @__PURE__ */ jsx("path", {
10750
+ d: "M-1.74846e-07 29L-4.37114e-08 32C-1.95703e-08 32.5523 0.447715 33 1 33L14 33C14.5523 33 15 32.5523 15 32L15 29C15 28.4477 14.5523 28 14 28L1 28C0.447715 28 -1.98987e-07 28.4477 -1.74846e-07 29Z",
10751
+ fill: "#0189FF"
10752
+ }), /* @__PURE__ */ jsx("path", {
10753
+ d: "M5 22L5 25C5 25.5523 5.44772 26 6 26L14 26C14.5523 26 15 25.5523 15 25L15 22C15 21.4477 14.5523 21 14 21L6 21C5.44772 21 5 21.4477 5 22Z",
10754
+ fill: "#FF554D"
10755
+ }), /* @__PURE__ */ jsx("path", {
10756
+ d: "M-1.74846e-07 15L-4.37114e-08 18C-1.95703e-08 18.5523 0.447715 19 1 19L14 19C14.5523 19 15 18.5523 15 18L15 15C15 14.4477 14.5523 14 14 14L1 14C0.447715 14 -1.98987e-07 14.4477 -1.74846e-07 15Z",
10757
+ fill: "#FFBC27"
10758
+ }), /* @__PURE__ */ jsx("path", {
10759
+ fillRule: "evenodd",
10760
+ clipRule: "evenodd",
10761
+ d: "M11 10C11 8.89543 11.8954 8 13 8H38C39.1046 8 40 8.89543 40 10V36C40 37.1046 39.1046 38 38 38H13C11.8954 38 11 37.1046 11 36V10ZM38 10L13 10V36H38V10Z",
10762
+ fill: "#08044F"
10763
+ }), /* @__PURE__ */ jsx("rect", {
10764
+ x: "20",
10765
+ y: "13",
10766
+ width: "11",
10767
+ height: "8",
10768
+ rx: "1",
10769
+ fill: "#1EBDAF"
10770
+ }), /* @__PURE__ */ jsx("path", {
10771
+ fillRule: "evenodd",
10772
+ clipRule: "evenodd",
10773
+ d: "M18 18.5C18 14.3579 21.3579 11 25.5 11C29.6421 11 33 14.3579 33 18.5C33 22.6421 29.6421 26 25.5 26C21.3579 26 18 22.6421 18 18.5ZM25.5 13C22.4624 13 20 15.4624 20 18.5C20 21.5376 22.4624 24 25.5 24C28.5376 24 31 21.5376 31 18.5C31 15.4624 28.5376 13 25.5 13Z",
10774
+ fill: "#08044F"
10775
+ }), /* @__PURE__ */ jsx("path", {
10776
+ fillRule: "evenodd",
10777
+ clipRule: "evenodd",
10778
+ d: "M17.1824 32.4242C19.0622 29.7548 22.078 28 25.5 28C28.922 28 31.9378 29.7548 33.8176 32.4242C34.1356 32.8758 34.0273 33.4996 33.5758 33.8176C33.1242 34.1356 32.5004 34.0273 32.1824 33.5758C30.6413 31.3874 28.2115 30 25.5 30C22.7885 30 20.3587 31.3874 18.8176 33.5758C18.4997 34.0273 17.8758 34.1356 17.4243 33.8176C16.9727 33.4996 16.8644 32.8758 17.1824 32.4242Z",
10779
+ fill: "#08044F"
10780
+ })]
10781
+ });
10782
+ const CalendarIcon = () => {
10783
+ return /* @__PURE__ */ jsxs("svg", {
10784
+ xmlns: "http://www.w3.org/2000/svg",
10785
+ width: 45,
10786
+ height: 45,
10787
+ fill: "none",
10788
+ children: [/* @__PURE__ */ jsx("circle", {
10789
+ cx: 22.5,
10790
+ cy: 22.5,
10791
+ r: 22.5,
10792
+ fill: "#E0EEFA"
10793
+ }), /* @__PURE__ */ jsx("path", {
10794
+ fill: "#FF554D",
10795
+ d: "M29 30a3 3 0 1 0 6 0 3 3 0 0 0-6 0Z"
10796
+ }), /* @__PURE__ */ jsx("path", {
10797
+ fill: "#1EBDAF",
10798
+ d: "M19.5 30a3 3 0 1 0 6 0 3 3 0 0 0-6 0Z"
10799
+ }), /* @__PURE__ */ jsx("path", {
10800
+ fill: "#F5A623",
10801
+ d: "M10 30a3 3 0 1 0 6 0 3 3 0 0 0-6 0Z"
10802
+ }), /* @__PURE__ */ jsx("path", {
10803
+ fill: "#08044F",
10804
+ fillRule: "evenodd",
10805
+ d: "M10 22a3 3 0 1 1 6 0 3 3 0 0 1-6 0Zm3-1a1 1 0 1 0 0 2 1 1 0 0 0 0-2ZM29 22a3 3 0 1 1 6 0 3 3 0 0 1-6 0Zm3-1a1 1 0 1 0 0 2 1 1 0 0 0 0-2ZM19.5 22a3 3 0 1 1 6 0 3 3 0 0 1-6 0Zm3-1a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",
10806
+ clipRule: "evenodd"
10807
+ }), /* @__PURE__ */ jsx("path", {
10808
+ fill: "#0189FF",
10809
+ d: "M4 8a2 2 0 0 1 2-2h33a2 2 0 0 1 2 2v9H4V8Z"
10810
+ }), /* @__PURE__ */ jsx("path", {
10811
+ fill: "#08044F",
10812
+ fillRule: "evenodd",
10813
+ d: "M6 13v24h33V13H6Zm-1-2a1 1 0 0 0-1 1v25a2 2 0 0 0 2 2h33a2 2 0 0 0 2-2V12a1 1 0 0 0-1-1H5Z",
10814
+ clipRule: "evenodd"
10815
+ }), /* @__PURE__ */ jsx("path", {
10816
+ fill: "#08044F",
10817
+ fillRule: "evenodd",
10818
+ d: "M11 15a1 1 0 0 1-1-1V9a1 1 0 1 1 2 0v5a1 1 0 0 1-1 1ZM34 15a1 1 0 0 1-1-1V9a1 1 0 1 1 2 0v5a1 1 0 0 1-1 1ZM22.5 15a1 1 0 0 1-1-1V9a1 1 0 1 1 2 0v5a1 1 0 0 1-1 1Z",
10819
+ clipRule: "evenodd"
10820
+ })]
10821
+ });
10822
+ };
10823
+ const getMenuItemIcon = (type) => {
10824
+ switch (type) {
10825
+ case "courses":
10826
+ return /* @__PURE__ */ jsx(CoursesIcon, {});
10827
+ case "calendar":
10828
+ return /* @__PURE__ */ jsx(CalendarIcon, {});
10829
+ case "academic-history":
10830
+ return /* @__PURE__ */ jsx(AcademicHistorialIcon, {});
10831
+ case "profile":
10832
+ return /* @__PURE__ */ jsx(ProfileIcon, {});
10833
+ case "logout":
10834
+ return null;
10835
+ default:
10836
+ return null;
10837
+ }
10838
+ };
10839
+ const StyledMenuButton = MenuButton;
10840
+ const StyledMenuList = MenuList;
10841
+ const StyledHeading = Heading;
10842
+ const StyledMenuItem = MenuItem;
10843
+ const UserDropdown = ({
10844
+ userInfo,
10845
+ menuItems,
10846
+ isOpen: controlledIsOpen,
10847
+ onOpen: controlledOnOpen,
10848
+ onClose: controlledOnClose
10849
+ }) => {
10850
+ var _a;
10851
+ const [internalIsOpen, setInternalIsOpen] = useState(false);
10852
+ const isOpen = controlledIsOpen != null ? controlledIsOpen : internalIsOpen;
10853
+ const onOpen = controlledOnOpen != null ? controlledOnOpen : () => setInternalIsOpen(true);
10854
+ const onClose = controlledOnClose != null ? controlledOnClose : () => setInternalIsOpen(false);
10855
+ const isMobile = useHideBackgroundOnMobile(isOpen);
10856
+ const [isTooltipDisabled, setTooltipDisabled] = useState(false);
10857
+ useTooltipToggleDelay(isOpen, setTooltipDisabled);
10858
+ const menuListRef = useRef(null);
10859
+ const handleArrowKeyFocus = (event) => {
10860
+ focusMenuWithKeys(event, menuListRef);
10861
+ };
10862
+ return /* @__PURE__ */ jsx(Box, {
10863
+ "aria-label": "Mi perfil",
10864
+ "data-menu": "profile",
10865
+ position: "relative",
10866
+ sx: {
10867
+ "&::after": {
10868
+ borderColor: `transparent transparent ${(_a = vars("colors-neutral-davysGrey")) != null ? _a : "#5C5C5C"} transparent`,
10869
+ borderStyle: "solid",
10870
+ borderWidth: "0 11px 10px 11px",
10871
+ content: '""',
10872
+ display: isOpen ? "block" : "none",
10873
+ height: "0",
10874
+ right: "4px",
10875
+ position: "absolute",
10876
+ top: "30px",
10877
+ width: "0"
10878
+ },
10879
+ ">div": {
10880
+ left: isMobile ? "0 !important" : "auto",
10881
+ position: isMobile ? "fixed !important" : "absolute",
10882
+ top: isMobile ? "52px !important" : "auto",
10883
+ transform: isMobile ? "none !important" : "auto"
10884
+ },
10885
+ ".chakra-menu__menu-list": {
10886
+ animation: "none !important",
10887
+ background: vars("colors-neutral-davysGrey"),
10888
+ borderRadius: isMobile ? "0" : "10px",
10889
+ boxShadow: isMobile ? "none" : "rgba(47, 47, 47, 0.2) -1px 6px 40px 0px",
10890
+ maxHeight: isMobile ? "calc(100vh - 62px)" : "auto",
10891
+ opacity: "1 !important",
10892
+ overflowY: isMobile ? "auto" : "hidden",
10893
+ padding: "15px 0 0",
10894
+ position: "absolute",
10895
+ right: isMobile ? "auto" : "-8px",
10896
+ top: isMobile ? "3px !important" : "auto",
10897
+ transform: "none !important",
10898
+ transition: "none !important",
10899
+ width: isMobile ? "100vw" : "290px"
10900
+ },
10901
+ ".content": {
10902
+ height: isMobile ? "100%" : "auto",
10903
+ borderRadius: !isMobile ? "10px" : "0",
10904
+ bg: vars("colors-neutral-white"),
10905
+ ">button": {
10906
+ borderBottom: isMobile ? `solid 1px ${vars("colors-neutral-platinum")}` : "none"
10907
+ }
10908
+ },
10909
+ ".css-r6z5ec": {
10910
+ zIndex: "4"
10911
+ }
10912
+ },
10913
+ children: /* @__PURE__ */ jsx(Menu, {
10914
+ autoSelect: false,
10915
+ placement: "bottom-end",
10916
+ isOpen,
10917
+ onOpen,
10918
+ onClose,
10919
+ children: () => /* @__PURE__ */ jsxs(Fragment, {
10920
+ children: [/* @__PURE__ */ jsx(NewTooltip, {
10921
+ label: "Mi perfil",
10922
+ isDisabled: isTooltipDisabled,
10923
+ children: /* @__PURE__ */ jsx(StyledMenuButton, {
10924
+ background: "transparent",
10925
+ border: "transparent",
10926
+ height: "30px",
10927
+ lineHeight: "0",
10928
+ p: "0",
10929
+ _focusVisible: {
10930
+ boxShadow: `0 0 0 3px ${vars("colors-alert-deepSkyBlue")}`,
10931
+ borderRadius: "50%"
10932
+ },
10933
+ children: /* @__PURE__ */ jsx(Avatar, {
10934
+ fullName: userInfo.name,
10935
+ userId: userInfo.id,
10936
+ picture: userInfo.picture,
10937
+ size: 30,
10938
+ fontSize: 14,
10939
+ id: "CrossAvatar"
10940
+ })
10941
+ })
10942
+ }), /* @__PURE__ */ jsxs(StyledMenuList, {
10943
+ ref: menuListRef,
10944
+ tabIndex: -1,
10945
+ onKeyDown: handleArrowKeyFocus,
10946
+ borderWidth: "0",
10947
+ "aria-hidden": true,
10948
+ children: [/* @__PURE__ */ jsx(StyledHeading, {
10949
+ sx: profileStyle.header,
10950
+ textAlign: "start",
10951
+ children: userInfo.name
10952
+ }), /* @__PURE__ */ jsx(Box, {
10953
+ className: "content",
10954
+ children: menuItems.map((item) => {
10955
+ const {
10956
+ label,
10957
+ type,
10958
+ href,
10959
+ onClick
10960
+ } = item;
10961
+ const view = getMenuItemIcon(type);
10962
+ const isLogout = type === "logout";
10963
+ return /* @__PURE__ */ jsx(StyledMenuItem, {
10964
+ "aria-label": onClick ? "Bot\xF3n" : `V\xEDnculo, ${label}`,
10965
+ as: isLogout || onClick ? "button" : Link,
10966
+ href: onClick ? void 0 : href,
10967
+ onClick,
10968
+ icon: view ? /* @__PURE__ */ jsx(Fragment, {
10969
+ children: view
10970
+ }) : void 0,
10971
+ padding: isMobile ? "15px 20px" : "10px 20px",
10972
+ sx: isLogout ? profileStyle.logout : profileStyle.items,
10973
+ borderRadius: isLogout && !isMobile ? "0 0 10px 10px" : void 0,
10974
+ height: isLogout && isMobile ? "60px" : "auto",
10975
+ children: label
10976
+ }, label);
10977
+ })
10978
+ })]
10979
+ })]
10980
+ })
10981
+ })
10982
+ });
10983
+ };
10984
+ export { Alert, Btn, BtnLink, BtnPrimary, BtnSecondary, BtnTertiary, CalendarDropdown, CourseList, CourseStatus, Eventos, EventsList, FlashNotification, index$1 as Icons, Label, Modal, ModalAlert, ModalAlertButtons, ModalAlertNew, ModalButtons, ModalContent, ModalMultiple, NavBarButton, NewTooltip, Progress, Resources, Ripples, TinyAlert, UserDropdown, UserWay, UserWayCookie, dataFake, maxWidthCoursesList, theme, useFlashNotification, vars };
10371
10985
  //# sourceMappingURL=eclass-ui-kit.es.js.map