@eclass/ui-kit 1.59.6 → 1.60.0

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 (31) hide show
  1. package/dist/atoms/Icons/Remote.d.ts +7 -0
  2. package/dist/atoms/Icons/Remote.d.ts.map +1 -0
  3. package/dist/atoms/Icons/Time.d.ts +7 -0
  4. package/dist/atoms/Icons/Time.d.ts.map +1 -0
  5. package/dist/atoms/Icons/index.d.ts +2 -0
  6. package/dist/atoms/Icons/index.d.ts.map +1 -1
  7. package/dist/eclass-ui-kit.es.js +184 -13
  8. package/dist/eclass-ui-kit.es.js.map +1 -1
  9. package/dist/eclass-ui-kit.umd.js +30 -30
  10. package/dist/eclass-ui-kit.umd.js.map +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/molecules/Avatar/Avatar.d.ts +2 -2
  14. package/dist/molecules/Avatar/Avatar.d.ts.map +1 -1
  15. package/dist/molecules/Avatar/Avatar.types.d.ts +2 -2
  16. package/dist/molecules/Avatar/Avatar.types.d.ts.map +1 -1
  17. package/dist/molecules/Buttons/BtnTertiary.d.ts +1 -1
  18. package/dist/molecules/Buttons/BtnTertiary.d.ts.map +1 -1
  19. package/dist/organisms/Calendar/Dropdown/CalendarDropdown/Components/EventsGroup.d.ts.map +1 -1
  20. package/dist/organisms/Calendar/Dropdown/types.d.ts +1 -0
  21. package/dist/organisms/Calendar/EventsList/EventsList.d.ts +2 -1
  22. package/dist/organisms/Calendar/EventsList/EventsList.d.ts.map +1 -1
  23. package/dist/organisms/Modals/Modal/ModalCard.d.ts +7 -0
  24. package/dist/organisms/Modals/Modal/ModalCard.d.ts.map +1 -0
  25. package/dist/organisms/Modals/Modal/ModalSimple.d.ts +4 -0
  26. package/dist/organisms/Modals/Modal/ModalSimple.d.ts.map +1 -0
  27. package/dist/organisms/Modals/index.d.ts +2 -0
  28. package/dist/organisms/Modals/index.d.ts.map +1 -1
  29. package/dist/organisms/Modals/types.d.ts +17 -0
  30. package/dist/tsconfig.types.tsbuildinfo +1 -1
  31. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { BaseProps } from './Base';
3
+ export declare function Remote(props: BaseProps): JSX.Element;
4
+ export declare namespace Remote {
5
+ var displayName: string;
6
+ }
7
+ //# sourceMappingURL=Remote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Remote.d.ts","sourceRoot":"","sources":["../../../src/atoms/Icons/Remote.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAQ,SAAS,EAAE,MAAM,QAAQ,CAAA;AAExC,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CASpD;yBATe,MAAM"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { BaseProps } from './Base';
3
+ export declare function Time(props: BaseProps): JSX.Element;
4
+ export declare namespace Time {
5
+ var displayName: string;
6
+ }
7
+ //# sourceMappingURL=Time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../../src/atoms/Icons/Time.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAQ,SAAS,EAAE,MAAM,QAAQ,CAAA;AAExC,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CASlD;yBATe,IAAI"}
@@ -11,7 +11,9 @@ export * from './GoBack';
11
11
  export * from './Multimedia';
12
12
  export * from './Loader';
13
13
  export * from './Profile';
14
+ export * from './Remote';
14
15
  export * from './Schedule';
16
+ export * from './Time';
15
17
  export * from './TinyAlertInfo';
16
18
  export * from './TinyAlertError';
17
19
  export * from './TinyAlertWarning';
@@ -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;AAC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c,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"}
@@ -799,6 +799,20 @@ function Profile(props) {
799
799
  });
800
800
  }
801
801
  Profile.displayName = "Profile";
802
+ function Remote(props) {
803
+ return /* @__PURE__ */ jsx(Base, {
804
+ ...props,
805
+ w: "16px",
806
+ h: "16px",
807
+ viewBox: "0 0 16 16",
808
+ title: "remote",
809
+ children: /* @__PURE__ */ jsx("path", {
810
+ d: "M15 11V4C15 2.864 14.136 2 13 2H3C1.864 2 1 2.864 1 4V11H0V12C0 13.105 0.895 14 2 14H14C15.105 14 16 13.105 16 12V11H15ZM3 4H13V11H3V4Z",
811
+ fill: "currentColor"
812
+ })
813
+ });
814
+ }
815
+ Remote.displayName = "Remote";
802
816
  function Schedule(props) {
803
817
  return /* @__PURE__ */ jsxs(Base, {
804
818
  ...props,
@@ -829,6 +843,20 @@ function Schedule(props) {
829
843
  });
830
844
  }
831
845
  Schedule.displayName = "Schedule";
846
+ function Time(props) {
847
+ return /* @__PURE__ */ jsx(Base, {
848
+ ...props,
849
+ w: "16px",
850
+ h: "16px",
851
+ viewBox: "0 0 16 16",
852
+ title: "Time",
853
+ children: /* @__PURE__ */ jsx("path", {
854
+ fill: "currentColor",
855
+ d: "M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm4 9H7V4h2v3h3v2z"
856
+ })
857
+ });
858
+ }
859
+ Time.displayName = "Time";
832
860
  function TinyAlertInfo(props) {
833
861
  return /* @__PURE__ */ jsxs(Base, {
834
862
  ...props,
@@ -1349,7 +1377,9 @@ var index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
1349
1377
  Multimedia,
1350
1378
  Loader,
1351
1379
  Profile,
1380
+ Remote,
1352
1381
  Schedule,
1382
+ Time,
1353
1383
  TinyAlertInfo,
1354
1384
  TinyAlertError,
1355
1385
  TinyAlertWarning,
@@ -1712,6 +1742,12 @@ function BtnTertiary({
1712
1742
  record: /* @__PURE__ */ jsx(AcademicRecord, {
1713
1743
  color: colorIcon
1714
1744
  }),
1745
+ time: /* @__PURE__ */ jsx(Time, {
1746
+ color: colorIcon
1747
+ }),
1748
+ remote: /* @__PURE__ */ jsx(Remote, {
1749
+ color: colorIcon
1750
+ }),
1715
1751
  noIcon: /* @__PURE__ */ jsx(Fragment, {})
1716
1752
  };
1717
1753
  let icon;
@@ -6759,18 +6795,18 @@ function skipAttributesToProps(node2) {
6759
6795
  var HTMLReactParser = /* @__PURE__ */ getDefaultExportFromCjs(lib$3);
6760
6796
  var ReactParser = HTMLReactParser.default || HTMLReactParser;
6761
6797
  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)];
6798
+ const getColorIndex = (fullName) => {
6799
+ var _a;
6800
+ const trimmedNameLength = (_a = fullName == null ? void 0 : fullName.trim().length) != null ? _a : 0;
6801
+ return trimmedNameLength % 10;
6802
+ };
6803
+ const getAvatarColor = (fullName) => {
6804
+ const position = getColorIndex(fullName);
6805
+ return AVATAR_COLORS[position];
6769
6806
  };
6770
6807
  const getInitials = (fullName) => fullName.split(" ").map((word) => word[0]).slice(0, 2).join("").toUpperCase();
6771
6808
  const Avatar = ({
6772
6809
  fullName,
6773
- userId,
6774
6810
  picture,
6775
6811
  size = 50,
6776
6812
  fontSize = 14,
@@ -6781,8 +6817,8 @@ const Avatar = ({
6781
6817
  const [bgColor, setBgColor] = useState("");
6782
6818
  const [imageValid, setImageValid] = useState(false);
6783
6819
  useEffect(() => {
6784
- setBgColor(getColorByUserId(userId));
6785
- }, [userId]);
6820
+ setBgColor(getAvatarColor(fullName));
6821
+ }, [fullName]);
6786
6822
  const wrapperStyle = {
6787
6823
  alignItems: "center",
6788
6824
  backgroundColor: (fullName == null ? void 0 : fullName.length) === 0 ? "#fff" : bgColor,
@@ -7658,6 +7694,102 @@ const Modal = ({
7658
7694
  })]
7659
7695
  });
7660
7696
  };
7697
+ const ModalCard = ({
7698
+ children,
7699
+ isOpen,
7700
+ onClose,
7701
+ closeOnOverlayClick = true,
7702
+ closeOnEsc = true
7703
+ }) => {
7704
+ const modalConfig = useModalConfig({
7705
+ closeOnOverlayClick,
7706
+ scrollBehavior: "outside",
7707
+ fixedButtons: false,
7708
+ withoutMargin: false
7709
+ });
7710
+ return /* @__PURE__ */ jsxs(Modal$1, {
7711
+ closeOnOverlayClick,
7712
+ closeOnEsc,
7713
+ isOpen,
7714
+ motionPreset: "scale",
7715
+ onClose,
7716
+ scrollBehavior: "outside",
7717
+ blockScrollOnMount: false,
7718
+ children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsx(ModalContent$1, {
7719
+ ...modalConfig.contentProps,
7720
+ maxW: "355px",
7721
+ minW: "355px",
7722
+ minH: "auto",
7723
+ overflow: "hidden",
7724
+ sx: {
7725
+ ...modalConfig.contentProps.sx,
7726
+ bgColor: vars("colors-neutral-white"),
7727
+ maxWidth: "355px"
7728
+ },
7729
+ children: /* @__PURE__ */ jsx(Box, {
7730
+ children
7731
+ })
7732
+ })]
7733
+ });
7734
+ };
7735
+ const ModalCardContent = ({
7736
+ children
7737
+ }) => {
7738
+ return /* @__PURE__ */ jsx(Box, {
7739
+ p: "32px",
7740
+ children
7741
+ });
7742
+ };
7743
+ const ModalSimple = ({
7744
+ children,
7745
+ isOpen,
7746
+ onClose,
7747
+ closeOnOverlayClick = true,
7748
+ closeOnEsc,
7749
+ withoutMargin = false
7750
+ }) => {
7751
+ const modalConfig = useModalConfig({
7752
+ closeOnOverlayClick,
7753
+ scrollBehavior: "outside",
7754
+ fixedButtons: false,
7755
+ withoutMargin
7756
+ });
7757
+ return /* @__PURE__ */ jsxs(Modal$1, {
7758
+ closeOnOverlayClick: modalConfig.closeOnOverlayClick,
7759
+ closeOnEsc: closeOnEsc != null ? closeOnEsc : modalConfig.closeOnEsc,
7760
+ isOpen,
7761
+ motionPreset: "scale",
7762
+ onClose,
7763
+ scrollBehavior: "outside",
7764
+ blockScrollOnMount: false,
7765
+ children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsxs(ModalContent$1, {
7766
+ ...modalConfig.contentProps,
7767
+ children: [/* @__PURE__ */ jsx(ModalCloseButton, {
7768
+ background: "transparent !important",
7769
+ border: "none",
7770
+ color: vars("colors-neutral-spanishGrey"),
7771
+ h: "12px",
7772
+ p: "22px",
7773
+ position: "absolute",
7774
+ right: 0,
7775
+ top: 0,
7776
+ w: "12px",
7777
+ zIndex: 2,
7778
+ _focus: {
7779
+ boxShadow: "none"
7780
+ },
7781
+ _focusVisible: {
7782
+ boxShadow: `inset 0 0 0 2px ${vars("colors-alert-deepSkyBlue")}, inset 0 0 0 4px ${vars("colors-neutral-white")}`
7783
+ }
7784
+ }), /* @__PURE__ */ jsx(Box, {
7785
+ "data-testid": "modal-simple-content",
7786
+ px: withoutMargin ? 0 : "24px",
7787
+ py: withoutMargin ? 0 : "32px",
7788
+ children
7789
+ })]
7790
+ })]
7791
+ });
7792
+ };
7661
7793
  const StyledModalFooter = ModalFooter;
7662
7794
  const StyledModalBody = ModalBody;
7663
7795
  const ModalButtons = ({
@@ -10082,6 +10214,7 @@ const EventsGroup = ({
10082
10214
  courseName: event.course.name,
10083
10215
  day: event.formatedDate.day,
10084
10216
  date: event.formatedDate.date,
10217
+ duration: event.duration_in_minutes,
10085
10218
  time: event.formatedDate.time,
10086
10219
  color: event.course_id && (colors2 == null ? void 0 : colors2[event.course_id]) ? colors2[event.course_id] : "#82504A",
10087
10220
  text: text2,
@@ -10377,6 +10510,7 @@ const EventsList = ({
10377
10510
  color,
10378
10511
  day,
10379
10512
  date,
10513
+ duration,
10380
10514
  name,
10381
10515
  hasNotification,
10382
10516
  onClick,
@@ -10391,6 +10525,7 @@ const EventsList = ({
10391
10525
  const border = `1px solid ${(_a = vars("colors-neutral-platinum")) != null ? _a : "#E8E8E8"}`;
10392
10526
  const hoverBg = (_b = vars("colors-neutral-cultured2")) != null ? _b : "#F8F8F8";
10393
10527
  const isClickable = Boolean(onClick);
10528
+ const showEventDuration = ["online", "in-person"].includes(type) && duration !== void 0 && duration > 0;
10394
10529
  const initOrEnd = ["end-course", "init-course", "init-course-flexible", "end-course-flexible"].includes(type);
10395
10530
  const dateTextStyle = {
10396
10531
  color: vars("colors-neutral-white"),
@@ -10401,10 +10536,18 @@ const EventsList = ({
10401
10536
  const detailTextStyle = {
10402
10537
  color: (_c = vars("colors-neutral-gray")) != null ? _c : "#808080",
10403
10538
  fontSize: "14px",
10404
- display: "inline",
10539
+ alignItems: "center",
10540
+ display: "flex",
10405
10541
  gap: "4px",
10406
10542
  lineHeight: "normal"
10407
10543
  };
10544
+ const eventIconStyle = {
10545
+ alignItems: "center",
10546
+ display: "inline-flex",
10547
+ height: "24px",
10548
+ justifyContent: "center",
10549
+ minWidth: "16px"
10550
+ };
10408
10551
  return /* @__PURE__ */ jsxs(Box, {
10409
10552
  className: "eventsList",
10410
10553
  borderTop: border,
@@ -10466,9 +10609,37 @@ const EventsList = ({
10466
10609
  }), showCourse && !initOrEnd && /* @__PURE__ */ jsxs(Box, {
10467
10610
  as: "span",
10468
10611
  sx: detailTextStyle,
10469
- children: [/* @__PURE__ */ jsx("strong", {
10612
+ children: [type === "cv-events" ? /* @__PURE__ */ jsx(Fragment, {}) : /* @__PURE__ */ jsx("strong", {
10470
10613
  children: text2 ? `${text2}:` : "Curso:"
10471
10614
  }), " ", courseName]
10615
+ }), showEventDuration && /* @__PURE__ */ jsxs(Box, {
10616
+ display: "flex",
10617
+ flexDirection: "row",
10618
+ gap: "8px",
10619
+ flexWrap: "wrap",
10620
+ children: [/* @__PURE__ */ jsxs(Box, {
10621
+ as: "span",
10622
+ sx: detailTextStyle,
10623
+ paddingRight: "8px",
10624
+ borderRight: `1px solid ${vars("colors-neutral-platinum")}`,
10625
+ children: [/* @__PURE__ */ jsx(Box, {
10626
+ as: "span",
10627
+ sx: eventIconStyle,
10628
+ children: /* @__PURE__ */ jsx(Remote, {
10629
+ color: vars("colors-main-ziggurat")
10630
+ })
10631
+ }), "Link clase online"]
10632
+ }), /* @__PURE__ */ jsxs(Box, {
10633
+ as: "span",
10634
+ sx: detailTextStyle,
10635
+ children: [/* @__PURE__ */ jsx(Box, {
10636
+ as: "span",
10637
+ sx: eventIconStyle,
10638
+ children: /* @__PURE__ */ jsx(Time, {
10639
+ color: vars("colors-main-ziggurat")
10640
+ })
10641
+ }), duration, " min"]
10642
+ })]
10472
10643
  }), showUnit && !initOrEnd && /* @__PURE__ */ jsx(Box, {
10473
10644
  display: "flex",
10474
10645
  gap: "4px",
@@ -11004,5 +11175,5 @@ const UserDropdown = ({
11004
11175
  })
11005
11176
  });
11006
11177
  };
11007
- 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 };
11178
+ export { Alert, Btn, BtnLink, BtnPrimary, BtnSecondary, BtnTertiary, CalendarDropdown, CourseList, CourseStatus, Eventos, EventsList, FlashNotification, index$1 as Icons, Label, Modal, ModalAlert, ModalAlertButtons, ModalAlertNew, ModalButtons, ModalCard, ModalCardContent, ModalContent, ModalMultiple, ModalSimple, NavBarButton, NewTooltip, Progress, Resources, Ripples, TinyAlert, UserDropdown, UserWay, UserWayCookie, dataFake, maxWidthCoursesList, theme, useFlashNotification, vars };
11008
11179
  //# sourceMappingURL=eclass-ui-kit.es.js.map