@eclass/ui-kit 1.7.7 → 1.9.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.
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { BaseProps } from './Base';
3
+ export declare function TinyAlertError(props: BaseProps): JSX.Element;
4
+ export declare namespace TinyAlertError {
5
+ var displayName: string;
6
+ }
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { BaseProps } from './Base';
3
+ export declare function TinyAlertInfo(props: BaseProps): JSX.Element;
4
+ export declare namespace TinyAlertInfo {
5
+ var displayName: string;
6
+ }
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { BaseProps } from './Base';
3
+ export declare function TinyAlertSuccess(props: BaseProps): JSX.Element;
4
+ export declare namespace TinyAlertSuccess {
5
+ var displayName: string;
6
+ }
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { BaseProps } from './Base';
3
+ export declare function TinyAlertWarning(props: BaseProps): JSX.Element;
4
+ export declare namespace TinyAlertWarning {
5
+ var displayName: string;
6
+ }
@@ -5,3 +5,7 @@ export * from './CircularCheck';
5
5
  export * from './CircularInformation';
6
6
  export * from './Profile';
7
7
  export * from './Schedule';
8
+ export * from './TinyAlertInfo';
9
+ export * from './TinyAlertError';
10
+ export * from './TinyAlertWarning';
11
+ export * from './TinyAlertSuccess';
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ export interface props {
3
+ status: 'success' | 'error' | 'info' | 'warning' | 'answered' | 'pending' | 'omitted' | 'new';
4
+ text?: string;
5
+ margin?: string;
6
+ }
7
+ /**
8
+ * Componente que retorna un label con distintos tipos de estado y muestra un texto por defecto en caso de que el mensaje no se especifique.
9
+ *
10
+ * @example
11
+ * <TinyAlert status="info" />
12
+ */
13
+ export declare function TinyAlert({ status, text, margin }: props): JSX.Element | null;
14
+ export declare namespace TinyAlert {
15
+ var displayName: string;
16
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './Label/Label';
2
2
  export * from './Progress/Progress';
3
3
  export * from './Ripples/Ripples';
4
+ export * from './TinyAlert/TinyAlert';
@@ -26527,6 +26527,199 @@ function Schedule(props) {
26527
26527
  }));
26528
26528
  }
26529
26529
  Schedule.displayName = "Schedule";
26530
+ function TinyAlertInfo(props) {
26531
+ return /* @__PURE__ */ jsxs(Base, __spreadProps(__spreadValues({}, props), {
26532
+ w: "12px",
26533
+ h: "12px",
26534
+ viewBox: "0 0 12 12",
26535
+ children: [/* @__PURE__ */ jsx("circle", {
26536
+ cx: "6",
26537
+ cy: "6",
26538
+ r: "6",
26539
+ fill: "#0189FF"
26540
+ }), /* @__PURE__ */ jsx("path", {
26541
+ d: "M7 6H5V10H7V6Z",
26542
+ fill: "white"
26543
+ }), /* @__PURE__ */ jsx("path", {
26544
+ d: "M6 4C6.55228 4 7 3.55228 7 3C7 2.44772 6.55228 2 6 2C5.44772 2 5 2.44772 5 3C5 3.55228 5.44772 4 6 4Z",
26545
+ fill: "white"
26546
+ })]
26547
+ }));
26548
+ }
26549
+ TinyAlertInfo.displayName = "TinyAlertInfo";
26550
+ function TinyAlertError(props) {
26551
+ return /* @__PURE__ */ jsxs(Base, __spreadProps(__spreadValues({}, props), {
26552
+ w: "12px",
26553
+ h: "12px",
26554
+ viewBox: "0 0 12 12",
26555
+ children: [/* @__PURE__ */ jsxs("g", {
26556
+ clipPath: "url(#clip0_2165_6683)",
26557
+ children: [/* @__PURE__ */ jsx("circle", {
26558
+ cx: "6",
26559
+ cy: "6",
26560
+ r: "6",
26561
+ fill: "#CC0000"
26562
+ }), /* @__PURE__ */ jsx("path", {
26563
+ fillRule: "evenodd",
26564
+ clipRule: "evenodd",
26565
+ d: "M3.87867 2.46447L2.46446 3.87868L4.58578 6L2.46446 8.12132L3.87867 9.53553L5.99999 7.41421L8.12131 9.53553L9.53553 8.12132L7.41421 6L9.53553 3.87868L8.12131 2.46447L5.99999 4.58579L3.87867 2.46447Z",
26566
+ fill: "white"
26567
+ })]
26568
+ }), /* @__PURE__ */ jsx("defs", {
26569
+ children: /* @__PURE__ */ jsx("clipPath", {
26570
+ id: "clip0_2165_6683",
26571
+ children: /* @__PURE__ */ jsx("rect", {
26572
+ width: "12px",
26573
+ height: "12px",
26574
+ fill: "white"
26575
+ })
26576
+ })
26577
+ })]
26578
+ }));
26579
+ }
26580
+ TinyAlertError.displayName = "TinyAlertError";
26581
+ function TinyAlertWarning(props) {
26582
+ return /* @__PURE__ */ jsxs(Base, __spreadProps(__spreadValues({}, props), {
26583
+ w: "12px",
26584
+ h: "12px",
26585
+ viewBox: "0 0 12 12",
26586
+ children: [/* @__PURE__ */ jsx("circle", {
26587
+ cx: "6",
26588
+ cy: "6",
26589
+ r: "6",
26590
+ fill: "#F5A623"
26591
+ }), /* @__PURE__ */ jsx("path", {
26592
+ d: "M5 6L7 6L7 2L5 2L5 6Z",
26593
+ fill: "white"
26594
+ }), /* @__PURE__ */ jsx("path", {
26595
+ d: "M6 8C5.44771 8 5 8.44772 5 9C5 9.55228 5.44772 10 6 10C6.55228 10 7 9.55228 7 9C7 8.44772 6.55228 8 6 8Z",
26596
+ fill: "white"
26597
+ })]
26598
+ }));
26599
+ }
26600
+ TinyAlertWarning.displayName = "TinyAlertWarning";
26601
+ function TinyAlertSuccess(props) {
26602
+ return /* @__PURE__ */ jsxs(Base, __spreadProps(__spreadValues({}, props), {
26603
+ w: "12px",
26604
+ h: "12px",
26605
+ viewBox: "0 0 12 12",
26606
+ children: [/* @__PURE__ */ jsxs("g", {
26607
+ clipPath: "url(#clip0_2191_1138)",
26608
+ children: [/* @__PURE__ */ jsx("circle", {
26609
+ cx: "6",
26610
+ cy: "6",
26611
+ r: "6",
26612
+ fill: "#28A745"
26613
+ }), /* @__PURE__ */ jsx("path", {
26614
+ fillRule: "evenodd",
26615
+ clipRule: "evenodd",
26616
+ d: "M3.41421 5.53549L2 6.94971L3.41421 8.36392L4.82843 9.77813L9.77817 4.82839L8.36396 3.41417L4.82843 6.94971L3.41421 5.53549Z",
26617
+ fill: "white"
26618
+ })]
26619
+ }), /* @__PURE__ */ jsx("defs", {
26620
+ children: /* @__PURE__ */ jsx("clipPath", {
26621
+ id: "clip0_2191_1138",
26622
+ children: /* @__PURE__ */ jsx("rect", {
26623
+ width: "12",
26624
+ height: "12",
26625
+ fill: "white"
26626
+ })
26627
+ })
26628
+ })]
26629
+ }));
26630
+ }
26631
+ TinyAlertSuccess.displayName = "TinyAlertSuccess";
26632
+ function TinyAlert({
26633
+ status,
26634
+ text,
26635
+ margin = "0"
26636
+ }) {
26637
+ const alerts = {
26638
+ success: {
26639
+ icon: /* @__PURE__ */ jsx(TinyAlertSuccess, {}),
26640
+ text: "Success",
26641
+ bg: vars("colors-alert-ice"),
26642
+ color: vars("colors-neutral-darkCharcoal")
26643
+ },
26644
+ error: {
26645
+ icon: /* @__PURE__ */ jsx(TinyAlertError, {}),
26646
+ text: "Error",
26647
+ bg: vars("colors-alert-veryLightPinkThree"),
26648
+ color: vars("colors-neutral-darkCharcoal")
26649
+ },
26650
+ info: {
26651
+ icon: /* @__PURE__ */ jsx(TinyAlertInfo, {}),
26652
+ text: "Info",
26653
+ bg: vars("colors-alert-veryLightBlue"),
26654
+ color: vars("colors-neutral-darkCharcoal")
26655
+ },
26656
+ warning: {
26657
+ icon: /* @__PURE__ */ jsx(TinyAlertWarning, {}),
26658
+ text: "Warning",
26659
+ bg: vars("colors-alert-pale"),
26660
+ color: vars("colors-neutral-darkCharcoal")
26661
+ },
26662
+ answered: {
26663
+ icon: void 0,
26664
+ text: "Answered",
26665
+ bg: vars("colors-main-blueGrey"),
26666
+ color: vars("colors-neutral-white")
26667
+ },
26668
+ omitted: {
26669
+ icon: void 0,
26670
+ text: "Omitted",
26671
+ bg: vars("colors-main-ziggurat"),
26672
+ color: vars("colors-neutral-darkCharcoal")
26673
+ },
26674
+ pending: {
26675
+ icon: void 0,
26676
+ text: "Pending",
26677
+ bg: vars("colors-neutral-cultured"),
26678
+ color: vars("colors-neutral-darkCharcoal")
26679
+ },
26680
+ new: {
26681
+ icon: void 0,
26682
+ text: "New answer",
26683
+ bg: "#FF7A14",
26684
+ color: vars("colors-neutral-white")
26685
+ }
26686
+ };
26687
+ if (!alerts[status]) {
26688
+ return null;
26689
+ }
26690
+ return /* @__PURE__ */ jsxs(Box, {
26691
+ margin,
26692
+ "data-testid": "TinyAlert-Box",
26693
+ backgroundColor: alerts[status].bg,
26694
+ display: "flex",
26695
+ flexDirection: "row",
26696
+ alignItems: "center",
26697
+ padding: ".125em .25em",
26698
+ gap: ".25rem",
26699
+ width: "fit-content",
26700
+ borderRadius: ".25rem",
26701
+ children: [alerts[status].icon && /* @__PURE__ */ jsx(Box, {
26702
+ lineHeight: 0,
26703
+ sx: {
26704
+ ">svg": {
26705
+ margin: 0
26706
+ }
26707
+ },
26708
+ children: alerts[status].icon
26709
+ }), /* @__PURE__ */ jsx(Box, {
26710
+ as: "span",
26711
+ color: alerts[status].color,
26712
+ fontSize: ".75rem",
26713
+ fontStyle: "normal",
26714
+ fontWeight: "400",
26715
+ fontFamily: "Roboto",
26716
+ lineHeight: ".875rem",
26717
+ margin: "0",
26718
+ children: text != null ? text : alerts[status].text
26719
+ })]
26720
+ });
26721
+ }
26722
+ TinyAlert.displayName = "TinyAlert";
26530
26723
  const STUDENT = 4;
26531
26724
  function Header() {
26532
26725
  const {
@@ -26792,18 +26985,64 @@ const dataStates = {
26792
26985
  dateStatus: __spreadProps(__spreadValues({}, dataBase.dateStatus), {
26793
26986
  hasDates: false
26794
26987
  }),
26795
- information: [
26988
+ information: null,
26989
+ action: __spreadProps(__spreadValues({}, dataBase.action), {
26990
+ href: "#",
26991
+ text: "Ver informaci\xF3n del curso"
26992
+ }),
26993
+ labels: []
26994
+ }),
26995
+ inscripcionFutura: __spreadProps(__spreadValues({}, dataBase), {
26996
+ id: 1,
26997
+ hasFinanzeFreezed: false,
26998
+ status: __spreadProps(__spreadValues({}, dataBase.status), {
26999
+ id: 1,
27000
+ name: "noHabilitado"
27001
+ }),
27002
+ progress: __spreadProps(__spreadValues({}, dataBase.progress), {
27003
+ label: "Podr\xE1s inscribirte a partir del 31 de marzo de 2022",
27004
+ icon: "circularInformation"
27005
+ }),
27006
+ dateStatus: __spreadProps(__spreadValues({}, dataBase.dateStatus), {
27007
+ hasDates: false
27008
+ }),
27009
+ information: null,
27010
+ action: __spreadProps(__spreadValues({}, dataBase.action), {
27011
+ href: "#",
27012
+ text: "Ver informaci\xF3n del curso"
27013
+ }),
27014
+ labels: [
26796
27015
  {
26797
- icon: "certificate",
26798
- text: "Certificado por ACHS",
26799
- href: null
27016
+ id: "NEW",
27017
+ text: "Nuevo"
26800
27018
  }
26801
- ],
27019
+ ]
27020
+ }),
27021
+ inscripcionFinalizo: __spreadProps(__spreadValues({}, dataBase), {
27022
+ id: 1,
27023
+ hasFinanzeFreezed: false,
27024
+ status: __spreadProps(__spreadValues({}, dataBase.status), {
27025
+ id: 1,
27026
+ name: "noHabilitado"
27027
+ }),
27028
+ progress: __spreadProps(__spreadValues({}, dataBase.progress), {
27029
+ label: "El per\xEDodo de inscripci\xF3n finaliz\xF3 el 31 de marzo de 2022",
27030
+ icon: "circularInformation"
27031
+ }),
27032
+ dateStatus: __spreadProps(__spreadValues({}, dataBase.dateStatus), {
27033
+ hasDates: false
27034
+ }),
27035
+ information: null,
26802
27036
  action: __spreadProps(__spreadValues({}, dataBase.action), {
26803
27037
  href: "#",
26804
27038
  text: "Ver informaci\xF3n del curso"
26805
27039
  }),
26806
- labels: []
27040
+ labels: [
27041
+ {
27042
+ id: "NEW",
27043
+ text: "Nuevo"
27044
+ }
27045
+ ]
26807
27046
  }),
26808
27047
  preInscripcion: __spreadProps(__spreadValues({}, dataBase), {
26809
27048
  logo: "https://cdn.eclass.com/img/productos/logos/logo-utec-square.jpg",
@@ -26843,7 +27082,7 @@ const dataStates = {
26843
27082
  name: "preInscripcion"
26844
27083
  }),
26845
27084
  progress: __spreadProps(__spreadValues({}, dataBase.progress), {
26846
- label: "La solicitud de inscripci\xF3n est\xE1 en proceso",
27085
+ label: "Estamos procesando tu solicitud de inscripci\xF3n",
26847
27086
  icon: "circularInformation"
26848
27087
  }),
26849
27088
  dateStatus: __spreadProps(__spreadValues({}, dataBase.dateStatus), {
@@ -27278,7 +27517,7 @@ const dataStates = {
27278
27517
  name: "pendiente"
27279
27518
  }),
27280
27519
  progress: __spreadProps(__spreadValues({}, dataBase.progress), {
27281
- label: "Curso finalizado en espera de nota",
27520
+ label: "\xA1Curso finalizado! Estamos calculando tu promedio final",
27282
27521
  icon: "circularInformation"
27283
27522
  }),
27284
27523
  dateStatus: {
@@ -27307,11 +27546,11 @@ const dataStates = {
27307
27546
  id: 16,
27308
27547
  hasFinanzeFreezed: false,
27309
27548
  status: __spreadProps(__spreadValues({}, dataBase.status), {
27310
- id: 9,
27311
- name: "terminado"
27549
+ id: 7,
27550
+ name: "QUALIFIED"
27312
27551
  }),
27313
27552
  progress: __spreadProps(__spreadValues({}, dataBase.progress), {
27314
- label: "Curso finalizado con nota",
27553
+ label: "Curso aprobado con nota",
27315
27554
  icon: "circularCheck",
27316
27555
  isApproved: true,
27317
27556
  finalGrade: "6,5"
@@ -27347,11 +27586,11 @@ const dataStates = {
27347
27586
  name: "Administrador"
27348
27587
  },
27349
27588
  status: __spreadProps(__spreadValues({}, dataBase.status), {
27350
- id: 9,
27351
- name: "terminado"
27589
+ id: 7,
27590
+ name: "QUALIFIED"
27352
27591
  }),
27353
27592
  progress: __spreadProps(__spreadValues({}, dataBase.progress), {
27354
- label: "Curso finalizado con nota",
27593
+ label: "Curso reprobado con nota",
27355
27594
  icon: "circularCheck",
27356
27595
  isApproved: false,
27357
27596
  finalGrade: "3,5"
@@ -27438,8 +27677,8 @@ function PaymentModal({
27438
27677
  };
27439
27678
  function OverlayTwo() {
27440
27679
  return /* @__PURE__ */ jsx(ModalOverlay, {
27441
- bg: "#ffffffc2",
27442
- opacity: ".8",
27680
+ bg: "#2F2F2F",
27681
+ opacity: "0.32 !important",
27443
27682
  backdropBlur: "2px"
27444
27683
  });
27445
27684
  }
@@ -27535,7 +27774,7 @@ function Footer({
27535
27774
  borderTop: "1px solid",
27536
27775
  borderTopColor: vars("colors-neutral-platinum"),
27537
27776
  children: [isCourseActive(action.enabled, Profile2 == null ? void 0 : Profile2.id) ? /* @__PURE__ */ jsxs(Fragment, {
27538
- children: [hasFinanzeFreezed ? /* @__PURE__ */ jsx(Button, {
27777
+ children: [hasFinanzeFreezed ? /* @__PURE__ */ jsx(Box, {
27539
27778
  color: vars("colors-main-deepSkyBlue"),
27540
27779
  backgroundColor: "transparent",
27541
27780
  fontWeight: "500",
@@ -27549,13 +27788,11 @@ function Footer({
27549
27788
  _active: cssButton,
27550
27789
  onClick: () => handleClick(),
27551
27790
  children: action.text
27552
- }) : /* @__PURE__ */ jsx(LinkOverlay, {
27553
- href: action.href,
27791
+ }) : /* @__PURE__ */ jsx(Text, {
27554
27792
  color: vars("colors-main-deepSkyBlue"),
27555
27793
  fontWeight: "500",
27556
27794
  mr: action.hasIcon ? "1.5rem" : "0",
27557
27795
  lineHeight: "1.172rem",
27558
- isExternal: action.targetBlank,
27559
27796
  children: action.text
27560
27797
  }), action.hasIcon && /* @__PURE__ */ jsx(ArrowRight, {
27561
27798
  color: vars("colors-main-deepSkyBlue")
@@ -27591,7 +27828,7 @@ function CourseBox({
27591
27828
  data,
27592
27829
  modalPaymentText
27593
27830
  }) {
27594
- var _a, _b, _c;
27831
+ var _a, _b, _c, _d, _e, _f, _g, _h;
27595
27832
  const cssActive = {
27596
27833
  boxShadow: `0 2px 7px 0 ${vars("colors-neutral-silverSand")}`
27597
27834
  };
@@ -27614,7 +27851,10 @@ function CourseBox({
27614
27851
  justify: "space-between",
27615
27852
  h: "100%",
27616
27853
  children: [/* @__PURE__ */ jsxs(Box, {
27617
- children: [/* @__PURE__ */ jsx(Header, {}), /* @__PURE__ */ jsx(Section, {})]
27854
+ children: [!data.hasFinanzeFreezed && isCourseActive((_e = (_d = data.action) == null ? void 0 : _d.enabled) != null ? _e : false, (_f = data.Profile) == null ? void 0 : _f.id) && /* @__PURE__ */ jsx(LinkOverlay, {
27855
+ href: (_g = data.action) == null ? void 0 : _g.href,
27856
+ isExternal: (_h = data.action) == null ? void 0 : _h.targetBlank
27857
+ }), /* @__PURE__ */ jsx(Header, {}), /* @__PURE__ */ jsx(Section, {})]
27618
27858
  }), /* @__PURE__ */ jsx(Footer, {
27619
27859
  modalPaymentText
27620
27860
  })]
@@ -27648,5 +27888,5 @@ function CourseList({
27648
27888
  });
27649
27889
  }
27650
27890
  CourseList.displayName = "CourseList";
27651
- export { CourseList, Label, Progress, Ripples, dataFake, maxWidthCoursesList, theme, vars };
27891
+ export { CourseList, Label, Progress, Ripples, TinyAlert, dataFake, maxWidthCoursesList, theme, vars };
27652
27892
  //# sourceMappingURL=eclass-ui-kit.es.js.map