@eclass/ui-kit 1.63.1 → 1.64.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.
@@ -3503,8 +3503,21 @@ function BoxTraditional({
3503
3503
  modalPaymentText
3504
3504
  }) {
3505
3505
  var _a, _b, _c, _d, _e, _f, _g;
3506
- const isClickable = isCourseActive((_b = (_a = data.action) == null ? void 0 : _a.enabled) != null ? _b : false, (_c = data.Profile) == null ? void 0 : _c.id);
3507
- const hasHref = !!((_d = data.action) == null ? void 0 : _d.href);
3506
+ const hasCustomClick = data.onClick !== void 0;
3507
+ const isClickable = hasCustomClick || isCourseActive((_b = (_a = data.action) == null ? void 0 : _a.enabled) != null ? _b : false, (_c = data.Profile) == null ? void 0 : _c.id);
3508
+ const hasHref = !hasCustomClick && !!((_d = data.action) == null ? void 0 : _d.href);
3509
+ const handleClick = (event) => {
3510
+ var _a2;
3511
+ event.preventDefault();
3512
+ (_a2 = data.onClick) == null ? void 0 : _a2.call(data, data);
3513
+ };
3514
+ const handleKeyDown = (event) => {
3515
+ var _a2;
3516
+ if (event.key === "Enter" || event.key === " ") {
3517
+ event.preventDefault();
3518
+ (_a2 = data.onClick) == null ? void 0 : _a2.call(data, data);
3519
+ }
3520
+ };
3508
3521
  useEnterNavigate();
3509
3522
  const cssActive = {
3510
3523
  boxShadow: `0 2px 7px 0 ${vars("colors-neutral-silverSand")}`
@@ -3524,8 +3537,9 @@ function BoxTraditional({
3524
3537
  boxShadow: `0 0 0 3px ${vars("colors-alert-deepSkyBlue")} inset`
3525
3538
  },
3526
3539
  tabIndex: 0,
3527
- role: hasHref ? "link" : void 0,
3540
+ role: hasHref ? "link" : hasCustomClick ? "button" : void 0,
3528
3541
  "data-href": hasHref ? (_e = data.action) == null ? void 0 : _e.href : void 0,
3542
+ onKeyDown: hasCustomClick ? handleKeyDown : void 0,
3529
3543
  children: /* @__PURE__ */ jsx(WithRipples$1, {
3530
3544
  enabled: isClickable,
3531
3545
  children: /* @__PURE__ */ jsxs(Flex, {
@@ -3534,11 +3548,13 @@ function BoxTraditional({
3534
3548
  h: "100%",
3535
3549
  children: [/* @__PURE__ */ jsxs(Box, {
3536
3550
  className: "CourseList-TraditionalBox",
3537
- children: [isClickable && hasHref && /* @__PURE__ */ jsx(LinkOverlay, {
3551
+ children: [isClickable && (hasHref || hasCustomClick) && /* @__PURE__ */ jsx(LinkOverlay, {
3538
3552
  className: "course-link-overlay",
3553
+ "data-testid": "course-link-overlay",
3539
3554
  bg: "gray",
3540
- href: (_f = data.action) == null ? void 0 : _f.href,
3541
- isExternal: (_g = data.action) == null ? void 0 : _g.targetBlank,
3555
+ href: hasHref ? (_f = data.action) == null ? void 0 : _f.href : void 0,
3556
+ isExternal: hasHref && ((_g = data.action) == null ? void 0 : _g.targetBlank),
3557
+ onClick: hasCustomClick ? handleClick : void 0,
3542
3558
  tabIndex: -1
3543
3559
  }), /* @__PURE__ */ jsx(Header$1, {}), /* @__PURE__ */ jsx(Section, {})]
3544
3560
  }), /* @__PURE__ */ jsx(Footer, {
@@ -3550,6 +3566,8 @@ function BoxTraditional({
3550
3566
  });
3551
3567
  }
3552
3568
  BoxTraditional.displayName = "BoxTraditional";
3569
+ const StyledLinkBox = LinkBox;
3570
+ const StyledLinkOverlay = LinkOverlay;
3553
3571
  function WithRipples({
3554
3572
  enabled,
3555
3573
  children
@@ -3567,14 +3585,29 @@ function BoxImage({
3567
3585
  size = "large",
3568
3586
  m: m2
3569
3587
  }) {
3570
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
3588
+ var _a, _b, _c, _d, _e, _f, _g;
3589
+ const hasCustomClick = (data == null ? void 0 : data.onClick) !== void 0;
3590
+ const isClickable = hasCustomClick || isCourseActive((_b = (_a = data == null ? void 0 : data.action) == null ? void 0 : _a.enabled) != null ? _b : false, (_c = data == null ? void 0 : data.Profile) == null ? void 0 : _c.id);
3591
+ const hasHref = !hasCustomClick && !!((_d = data == null ? void 0 : data.action) == null ? void 0 : _d.href);
3592
+ const handleClick = (event) => {
3593
+ var _a2;
3594
+ event.preventDefault();
3595
+ (_a2 = data == null ? void 0 : data.onClick) == null ? void 0 : _a2.call(data, data);
3596
+ };
3597
+ const handleKeyDown = (event) => {
3598
+ var _a2;
3599
+ if (event.key === "Enter" || event.key === " ") {
3600
+ event.preventDefault();
3601
+ (_a2 = data == null ? void 0 : data.onClick) == null ? void 0 : _a2.call(data, data);
3602
+ }
3603
+ };
3571
3604
  const boxHeight = {
3572
3605
  large: "286px",
3573
3606
  small: "197px"
3574
3607
  };
3575
3608
  return /* @__PURE__ */ jsx(WithRipples, {
3576
- enabled: isCourseActive((_b = (_a = data == null ? void 0 : data.action) == null ? void 0 : _a.enabled) != null ? _b : false, (_c = data == null ? void 0 : data.Profile) == null ? void 0 : _c.id),
3577
- children: /* @__PURE__ */ jsxs(LinkBox, {
3609
+ enabled: isClickable,
3610
+ children: /* @__PURE__ */ jsxs(StyledLinkBox, {
3578
3611
  className: "CourseList-ImageBox",
3579
3612
  _focusVisible: {
3580
3613
  boxShadow: `0 0 0 3px ${vars("colors-alert-deepSkyBlue")} inset`
@@ -3601,9 +3634,14 @@ function BoxImage({
3601
3634
  }
3602
3635
  }
3603
3636
  },
3604
- children: [!(data == null ? void 0 : data.hasFinanzeFreezed) && isCourseActive((_e = (_d = data == null ? void 0 : data.action) == null ? void 0 : _d.enabled) != null ? _e : false, (_f = data == null ? void 0 : data.Profile) == null ? void 0 : _f.id) && /* @__PURE__ */ jsx(LinkOverlay, {
3605
- href: (_g = data == null ? void 0 : data.action) == null ? void 0 : _g.href,
3606
- isExternal: (_h = data == null ? void 0 : data.action) == null ? void 0 : _h.targetBlank,
3637
+ "aria-label": hasCustomClick ? title : void 0,
3638
+ role: hasCustomClick ? "button" : void 0,
3639
+ onKeyDown: hasCustomClick ? handleKeyDown : void 0,
3640
+ children: [(hasCustomClick || !(data == null ? void 0 : data.hasFinanzeFreezed)) && isClickable && (hasHref || hasCustomClick) && /* @__PURE__ */ jsx(StyledLinkOverlay, {
3641
+ "data-testid": "course-link-overlay",
3642
+ href: hasHref ? (_e = data == null ? void 0 : data.action) == null ? void 0 : _e.href : void 0,
3643
+ isExternal: hasHref && ((_f = data == null ? void 0 : data.action) == null ? void 0 : _f.targetBlank),
3644
+ onClick: hasCustomClick ? handleClick : void 0,
3607
3645
  tabIndex: -1
3608
3646
  }), /* @__PURE__ */ jsxs(Box, {
3609
3647
  className: "textBox",
@@ -3620,7 +3658,7 @@ function BoxImage({
3620
3658
  marginBlockEnd: "0",
3621
3659
  margin: "0",
3622
3660
  children: title
3623
- }), (_i = data == null ? void 0 : data.information) == null ? void 0 : _i.map((item, index2) => item.icon === "certificate" && /* @__PURE__ */ jsx(Box, {
3661
+ }), (_g = data == null ? void 0 : data.information) == null ? void 0 : _g.map((item, index2) => item.icon === "certificate" && /* @__PURE__ */ jsx(Box, {
3624
3662
  as: "p",
3625
3663
  className: "certificateText",
3626
3664
  fontSize: "14px",
@@ -9568,7 +9606,7 @@ const StandardBackground = ({
9568
9606
  })]
9569
9607
  });
9570
9608
  };
9571
- const StyledText$2 = Text$1;
9609
+ const StyledText$3 = Text$1;
9572
9610
  const StyledLink$1 = Link;
9573
9611
  const Resources = ({
9574
9612
  id,
@@ -9650,7 +9688,7 @@ const Resources = ({
9650
9688
  gap: "8px",
9651
9689
  padding: "1rem",
9652
9690
  children: [/* @__PURE__ */ jsx(Box, {
9653
- children: /* @__PURE__ */ jsx(StyledText$2, {
9691
+ children: /* @__PURE__ */ jsx(StyledText$3, {
9654
9692
  fontFamily: "Roboto",
9655
9693
  fontWeight: "700",
9656
9694
  lineHeight: "21px",
@@ -9660,7 +9698,7 @@ const Resources = ({
9660
9698
  children: resourceTitle
9661
9699
  })
9662
9700
  }), /* @__PURE__ */ jsx(Box, {
9663
- children: /* @__PURE__ */ jsx(StyledText$2, {
9701
+ children: /* @__PURE__ */ jsx(StyledText$3, {
9664
9702
  fontFamily: "Roboto",
9665
9703
  fontWeight: "400",
9666
9704
  lineHeight: "14px",
@@ -9673,7 +9711,7 @@ const Resources = ({
9673
9711
  display: "flex",
9674
9712
  alignItems: "center",
9675
9713
  justifyContent: "center",
9676
- children: /* @__PURE__ */ jsxs(StyledText$2, {
9714
+ children: /* @__PURE__ */ jsxs(StyledText$3, {
9677
9715
  fontFamily: "Roboto",
9678
9716
  fontWeight: "500",
9679
9717
  fontSize: "14px",
@@ -11288,9 +11326,9 @@ function CustomCloseIcon(props) {
11288
11326
  })
11289
11327
  });
11290
11328
  }
11291
- const StyledImage$1 = Image;
11292
- const StyledFlex$2 = Flex;
11293
- const StyledText$1 = Text$1;
11329
+ const StyledImage$2 = Image;
11330
+ const StyledFlex$3 = Flex;
11331
+ const StyledText$2 = Text$1;
11294
11332
  const StyledDivider = Divider;
11295
11333
  const StyledLink = Link;
11296
11334
  const InitialShareContent = ({
@@ -11298,26 +11336,26 @@ const InitialShareContent = ({
11298
11336
  onLeaveReview
11299
11337
  }) => {
11300
11338
  return /* @__PURE__ */ jsxs(Fragment, {
11301
- children: [/* @__PURE__ */ jsxs(StyledFlex$2, {
11339
+ children: [/* @__PURE__ */ jsxs(StyledFlex$3, {
11302
11340
  direction: "column",
11303
11341
  gap: "16px",
11304
11342
  alignItems: "center",
11305
- children: [/* @__PURE__ */ jsx(StyledImage$1, {
11343
+ children: [/* @__PURE__ */ jsx(StyledImage$2, {
11306
11344
  w: "70px",
11307
11345
  h: "70px",
11308
11346
  alt: "cotill\xF3n de celebraci\xF3n",
11309
11347
  src: "https://cdn.eclass.com/vendors/apps/front_v8/assets/Common/celebration.webp"
11310
- }), /* @__PURE__ */ jsxs(StyledFlex$2, {
11348
+ }), /* @__PURE__ */ jsxs(StyledFlex$3, {
11311
11349
  flexDir: "column",
11312
11350
  gap: "8px",
11313
- children: [/* @__PURE__ */ jsx(StyledText$1, {
11351
+ children: [/* @__PURE__ */ jsx(StyledText$2, {
11314
11352
  as: "h6",
11315
11353
  fontSize: "xl",
11316
11354
  fontWeight: "bold",
11317
11355
  color: vars("colors-neutral-darkCharcoal"),
11318
11356
  m: "0",
11319
11357
  children: "\xA1Qu\xE9 bueno que quieras compartirlo!"
11320
- }), /* @__PURE__ */ jsx(StyledText$1, {
11358
+ }), /* @__PURE__ */ jsx(StyledText$2, {
11321
11359
  fontSize: "md",
11322
11360
  color: vars("colors-neutral-darkCharcoal"),
11323
11361
  mb: "0",
@@ -11327,14 +11365,14 @@ const InitialShareContent = ({
11327
11365
  }), /* @__PURE__ */ jsx(BtnPrimary, {
11328
11366
  onClick: handleLinkedinClick,
11329
11367
  children: "Continuar a LinkedIn"
11330
- }), /* @__PURE__ */ jsxs(StyledFlex$2, {
11368
+ }), /* @__PURE__ */ jsxs(StyledFlex$3, {
11331
11369
  align: "center",
11332
11370
  width: "100%",
11333
11371
  gap: "16px",
11334
11372
  children: [/* @__PURE__ */ jsx(StyledDivider, {
11335
11373
  borderColor: vars("colors-neutral-platinum"),
11336
11374
  m: "0"
11337
- }), /* @__PURE__ */ jsx(StyledText$1, {
11375
+ }), /* @__PURE__ */ jsx(StyledText$2, {
11338
11376
  fontSize: "sm",
11339
11377
  color: vars("colors-neutral-gray"),
11340
11378
  whiteSpace: "nowrap",
@@ -11344,14 +11382,14 @@ const InitialShareContent = ({
11344
11382
  borderColor: vars("colors-neutral-platinum"),
11345
11383
  m: "0"
11346
11384
  })]
11347
- }), /* @__PURE__ */ jsx(StyledText$1, {
11385
+ }), /* @__PURE__ */ jsx(StyledText$2, {
11348
11386
  as: "p",
11349
11387
  fontSize: "md",
11350
11388
  fontWeight: "700",
11351
11389
  color: vars("colors-neutral-darkCharcoal"),
11352
11390
  mb: "0",
11353
11391
  children: "\xBFQu\xE9 tal fue aprender con nosotros?"
11354
- }), /* @__PURE__ */ jsxs(StyledFlex$2, {
11392
+ }), /* @__PURE__ */ jsxs(StyledFlex$3, {
11355
11393
  align: "center",
11356
11394
  justify: "center",
11357
11395
  gap: "8px",
@@ -11373,14 +11411,14 @@ const InitialShareContent = ({
11373
11411
  })]
11374
11412
  });
11375
11413
  };
11376
- const StyledImage = Image;
11377
- const StyledFlex$1 = Flex;
11378
- const StyledText = Text$1;
11414
+ const StyledImage$1 = Image;
11415
+ const StyledFlex$2 = Flex;
11416
+ const StyledText$1 = Text$1;
11379
11417
  const AfterShareContent = ({
11380
11418
  onClose,
11381
11419
  onLeaveReview
11382
11420
  }) => {
11383
- return /* @__PURE__ */ jsxs(StyledFlex$1, {
11421
+ return /* @__PURE__ */ jsxs(StyledFlex$2, {
11384
11422
  flexDir: "column",
11385
11423
  alignItems: "center",
11386
11424
  gap: "16px",
@@ -11394,19 +11432,19 @@ const AfterShareContent = ({
11394
11432
  p: "0"
11395
11433
  }
11396
11434
  },
11397
- children: [/* @__PURE__ */ jsx(StyledImage, {
11435
+ children: [/* @__PURE__ */ jsx(StyledImage$1, {
11398
11436
  w: "70px",
11399
11437
  h: "70px",
11400
11438
  alt: "cotill\xF3n de celebraci\xF3n",
11401
11439
  src: "https://cdn.eclass.com/vendors/apps/front_v8/assets/Common/celebration.webp"
11402
- }), /* @__PURE__ */ jsx(StyledText, {
11440
+ }), /* @__PURE__ */ jsx(StyledText$1, {
11403
11441
  as: "h6",
11404
11442
  fontSize: "xl",
11405
11443
  fontWeight: "bold",
11406
11444
  color: vars("colors-neutral-darkCharcoal"),
11407
11445
  m: "0",
11408
11446
  children: "\xBFYa lo compartiste en LinkedIn?"
11409
- }), /* @__PURE__ */ jsxs(StyledText, {
11447
+ }), /* @__PURE__ */ jsxs(StyledText$1, {
11410
11448
  fontSize: "md",
11411
11449
  fontWeight: "400",
11412
11450
  color: vars("colors-neutral-darkCharcoal"),
@@ -11430,7 +11468,7 @@ const AfterShareContent = ({
11430
11468
  };
11431
11469
  const StyledModalContent = ModalContent$1;
11432
11470
  const StyledIconButton = IconButton;
11433
- const StyledFlex = Flex;
11471
+ const StyledFlex$1 = Flex;
11434
11472
  const ShareAndReviewModal = ({
11435
11473
  isOpen,
11436
11474
  onClose,
@@ -11486,7 +11524,7 @@ const ShareAndReviewModal = ({
11486
11524
  _focusVisible: {
11487
11525
  boxShadow: `0 0 0 3px ${vars("colors-alert-deepSkyBlue")} inset`
11488
11526
  }
11489
- }), /* @__PURE__ */ jsx(StyledFlex, {
11527
+ }), /* @__PURE__ */ jsx(StyledFlex$1, {
11490
11528
  direction: "column",
11491
11529
  align: "center",
11492
11530
  textAlign: "center",
@@ -11502,5 +11540,57 @@ const ShareAndReviewModal = ({
11502
11540
  })]
11503
11541
  });
11504
11542
  };
11505
- 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, ShareAndReviewModal, TinyAlert, UserDropdown, UserWay, UserWayCookie, dataFake, maxWidthCoursesList, theme, useFlashNotification, vars };
11543
+ const StyledText = Text$1;
11544
+ const StyledFlex = Flex;
11545
+ const StyledImage = Image;
11546
+ const SimpleCourseBox = ({
11547
+ img,
11548
+ courseName,
11549
+ icon,
11550
+ label
11551
+ }) => {
11552
+ return /* @__PURE__ */ jsxs(StyledFlex, {
11553
+ alignItems: "center",
11554
+ justifyContent: "space-between",
11555
+ p: "16px 0",
11556
+ borderBottom: `1px solid ${vars("colors-neutral-platinum")}`,
11557
+ children: [/* @__PURE__ */ jsxs(StyledFlex, {
11558
+ gap: "24px",
11559
+ alignItems: "center",
11560
+ children: [/* @__PURE__ */ jsx(StyledImage, {
11561
+ src: img,
11562
+ w: "150px",
11563
+ h: "74px",
11564
+ borderRadius: "10px"
11565
+ }), /* @__PURE__ */ jsxs(StyledFlex, {
11566
+ flexDirection: "column",
11567
+ gap: "8px",
11568
+ justifyContent: "center",
11569
+ children: [/* @__PURE__ */ jsx("strong", {
11570
+ children: courseName
11571
+ }), icon && label && /* @__PURE__ */ jsxs(StyledText, {
11572
+ m: "0",
11573
+ fontSize: "14px",
11574
+ lineHeight: "19px",
11575
+ display: "flex",
11576
+ gap: "10px",
11577
+ maxW: "395px",
11578
+ sx: {
11579
+ svg: {
11580
+ verticalAlign: "top"
11581
+ }
11582
+ },
11583
+ children: [/* @__PURE__ */ jsx(IconSelection, {
11584
+ type: icon
11585
+ }), " ", label]
11586
+ })]
11587
+ })]
11588
+ }), /* @__PURE__ */ jsx(Box, {
11589
+ children: /* @__PURE__ */ jsx(ArrowRight, {
11590
+ color: "#60798E"
11591
+ })
11592
+ })]
11593
+ });
11594
+ };
11595
+ 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, ShareAndReviewModal, SimpleCourseBox, TinyAlert, UserDropdown, UserWay, UserWayCookie, dataFake, maxWidthCoursesList, theme, useFlashNotification, vars };
11506
11596
  //# sourceMappingURL=eclass-ui-kit.es.js.map