@eclass/ui-kit 1.54.9 → 1.54.10

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.
@@ -3330,6 +3330,26 @@ function Footer({
3330
3330
  });
3331
3331
  }
3332
3332
  Footer.displayName = "Footer";
3333
+ function useEnterNavigate() {
3334
+ useEffect(() => {
3335
+ const handleKeyDown = (e2) => {
3336
+ var _a, _b;
3337
+ if (e2.key === "Enter") {
3338
+ const active = document.activeElement;
3339
+ const role = active == null ? void 0 : active.getAttribute("role");
3340
+ const href = active == null ? void 0 : active.getAttribute("data-href");
3341
+ const isFocusableLink = ((_a = active == null ? void 0 : active.classList) == null ? void 0 : _a.contains("chakra-linkbox")) || ((_b = active == null ? void 0 : active.classList) == null ? void 0 : _b.contains("focusable-link"));
3342
+ if (role === "link" && href != null && isFocusableLink) {
3343
+ window.location.href = href;
3344
+ }
3345
+ }
3346
+ };
3347
+ window.addEventListener("keydown", handleKeyDown);
3348
+ return () => {
3349
+ window.removeEventListener("keydown", handleKeyDown);
3350
+ };
3351
+ }, []);
3352
+ }
3333
3353
  const CourseBoxContext = React.createContext({});
3334
3354
  function WithRipples$1({
3335
3355
  enabled,
@@ -3345,9 +3365,10 @@ function BoxTraditional({
3345
3365
  data,
3346
3366
  modalPaymentText
3347
3367
  }) {
3348
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
3368
+ var _a, _b, _c, _d, _e, _f, _g;
3349
3369
  const isClickable = isCourseActive((_b = (_a = data.action) == null ? void 0 : _a.enabled) != null ? _b : false, (_c = data.Profile) == null ? void 0 : _c.id);
3350
3370
  const hasHref = !!((_d = data.action) == null ? void 0 : _d.href);
3371
+ useEnterNavigate();
3351
3372
  const cssActive = {
3352
3373
  boxShadow: `0 2px 7px 0 ${vars("colors-neutral-silverSand")}`
3353
3374
  };
@@ -3355,6 +3376,7 @@ function BoxTraditional({
3355
3376
  value: data,
3356
3377
  children: /* @__PURE__ */ jsx(LinkBox, {
3357
3378
  as: "article",
3379
+ className: "focusable-link",
3358
3380
  border: vars("borders-light"),
3359
3381
  borderRadius: vars("radii-big"),
3360
3382
  cursor: isClickable ? "pointer" : "default",
@@ -3365,10 +3387,11 @@ function BoxTraditional({
3365
3387
  _focusWithin: {
3366
3388
  boxShadow: `0 0 0 3px ${vars("colors-alert-deepSkyBlue")} inset`
3367
3389
  },
3368
- tabIndex: !hasHref && isClickable ? 0 : void 0,
3369
- role: "link",
3390
+ tabIndex: 0,
3391
+ role: hasHref ? "link" : void 0,
3392
+ "data-href": hasHref ? (_e = data.action) == null ? void 0 : _e.href : void 0,
3370
3393
  children: /* @__PURE__ */ jsx(WithRipples$1, {
3371
- enabled: isCourseActive((_f = (_e = data.action) == null ? void 0 : _e.enabled) != null ? _f : false, (_g = data.Profile) == null ? void 0 : _g.id),
3394
+ enabled: isClickable,
3372
3395
  children: /* @__PURE__ */ jsxs(Flex, {
3373
3396
  direction: "column",
3374
3397
  justify: "space-between",
@@ -3376,8 +3399,11 @@ function BoxTraditional({
3376
3399
  children: [/* @__PURE__ */ jsxs(Box, {
3377
3400
  className: "CourseList-TraditionalBox",
3378
3401
  children: [isClickable && hasHref && /* @__PURE__ */ jsx(LinkOverlay, {
3379
- href: (_h = data.action) == null ? void 0 : _h.href,
3380
- isExternal: (_i = data.action) == null ? void 0 : _i.targetBlank
3402
+ className: "course-link-overlay",
3403
+ bg: "gray",
3404
+ href: (_f = data.action) == null ? void 0 : _f.href,
3405
+ isExternal: (_g = data.action) == null ? void 0 : _g.targetBlank,
3406
+ tabIndex: -1
3381
3407
  }), /* @__PURE__ */ jsx(Header$1, {}), /* @__PURE__ */ jsx(Section, {})]
3382
3408
  }), /* @__PURE__ */ jsx(Footer, {
3383
3409
  modalPaymentText
@@ -6200,6 +6226,7 @@ const GoToCalendar = ({
6200
6226
  const activeBg = (_a = vars("colors-main-deepSkyBlue")) != null ? _a : "#0189FF";
6201
6227
  const hoverBg = "rgba(96, 121, 142, 0.8)";
6202
6228
  return /* @__PURE__ */ jsx(MenuButton, {
6229
+ tabIndex: -1,
6203
6230
  onClick: () => onlyToCalendar && onClick && onClick(),
6204
6231
  position: "relative",
6205
6232
  sx: {