@eclass/ui-kit 1.54.8 → 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.
@@ -1870,6 +1870,11 @@ const NavBarButton = ({
1870
1870
  className: "nav-bar-button",
1871
1871
  id: isAccessibility ? "UserWayButton" : "",
1872
1872
  onClick: isAccessibility ? triggerWidget : onClick,
1873
+ _focusVisible: {
1874
+ outline: `3px solid ${vars("colors-alert-deepSkyBlue")}`,
1875
+ borderRadius: "2px"
1876
+ },
1877
+ tabIndex: 0,
1873
1878
  sx: {
1874
1879
  alignItems: "center",
1875
1880
  background: "none !important",
@@ -1918,9 +1923,11 @@ const NavBarButton = ({
1918
1923
  },
1919
1924
  children: [/* @__PURE__ */ jsx(Box, {
1920
1925
  className: "nav-bar-icon",
1926
+ tabIndex: -1,
1921
1927
  children: buttonType[type].icon
1922
1928
  }), !isMobile && /* @__PURE__ */ jsx(Box, {
1923
1929
  className: "nav-bar-text",
1930
+ tabIndex: -1,
1924
1931
  children: buttonType[type].text
1925
1932
  })]
1926
1933
  });
@@ -3280,11 +3287,8 @@ function Footer({
3280
3287
  p: "1rem",
3281
3288
  borderTop: "1px solid",
3282
3289
  borderTopColor: vars("colors-neutral-platinum"),
3283
- tabIndex: 0,
3284
- className: "footerButtonBox",
3285
3290
  children: [isCourseActive(action.enabled, Profile2 == null ? void 0 : Profile2.id) ? /* @__PURE__ */ jsxs(Fragment, {
3286
3291
  children: [hasFinanzeFreezed && modalPaymentText ? /* @__PURE__ */ jsx(Box, {
3287
- className: "uno",
3288
3292
  color: vars("colors-main-deepSkyBlue"),
3289
3293
  backgroundColor: "transparent",
3290
3294
  fontWeight: "500",
@@ -3300,7 +3304,6 @@ function Footer({
3300
3304
  fontSize: "1rem !important",
3301
3305
  children: action.text
3302
3306
  }) : /* @__PURE__ */ jsx(Text, {
3303
- className: "dos",
3304
3307
  color: vars("colors-main-deepSkyBlue"),
3305
3308
  fontWeight: "500",
3306
3309
  mr: action.hasIcon ? "1.5rem" : "0",
@@ -3312,7 +3315,6 @@ function Footer({
3312
3315
  color: vars("colors-main-deepSkyBlue")
3313
3316
  })]
3314
3317
  }) : /* @__PURE__ */ jsx(Text, {
3315
- className: "tres",
3316
3318
  fontWeight: "500",
3317
3319
  lineHeight: "1.172rem",
3318
3320
  color: vars("colors-neutral-spanishGrey"),
@@ -3328,6 +3330,26 @@ function Footer({
3328
3330
  });
3329
3331
  }
3330
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
+ }
3331
3353
  const CourseBoxContext = React.createContext({});
3332
3354
  function WithRipples$1({
3333
3355
  enabled,
@@ -3343,37 +3365,45 @@ function BoxTraditional({
3343
3365
  data,
3344
3366
  modalPaymentText
3345
3367
  }) {
3346
- var _a, _b, _c, _d, _e, _f, _g, _h;
3368
+ var _a, _b, _c, _d, _e, _f, _g;
3369
+ const isClickable = isCourseActive((_b = (_a = data.action) == null ? void 0 : _a.enabled) != null ? _b : false, (_c = data.Profile) == null ? void 0 : _c.id);
3370
+ const hasHref = !!((_d = data.action) == null ? void 0 : _d.href);
3371
+ useEnterNavigate();
3347
3372
  const cssActive = {
3348
3373
  boxShadow: `0 2px 7px 0 ${vars("colors-neutral-silverSand")}`
3349
3374
  };
3350
3375
  return /* @__PURE__ */ jsx(CourseBoxContext.Provider, {
3351
3376
  value: data,
3352
3377
  children: /* @__PURE__ */ jsx(LinkBox, {
3353
- className: "linkBoxTraditional",
3354
3378
  as: "article",
3379
+ className: "focusable-link",
3355
3380
  border: vars("borders-light"),
3356
3381
  borderRadius: vars("radii-big"),
3357
- cursor: "pointer",
3382
+ cursor: isClickable ? "pointer" : "default",
3358
3383
  transition: "box-shadow .3s",
3359
- _active: cssActive,
3360
- _hover: cssActive,
3361
3384
  overflow: "hidden",
3385
+ _hover: cssActive,
3386
+ _active: cssActive,
3387
+ _focusWithin: {
3388
+ boxShadow: `0 0 0 3px ${vars("colors-alert-deepSkyBlue")} inset`
3389
+ },
3362
3390
  tabIndex: 0,
3363
- role: "link",
3391
+ role: hasHref ? "link" : void 0,
3392
+ "data-href": hasHref ? (_e = data.action) == null ? void 0 : _e.href : void 0,
3364
3393
  children: /* @__PURE__ */ jsx(WithRipples$1, {
3365
- enabled: isCourseActive((_b = (_a = data.action) == null ? void 0 : _a.enabled) != null ? _b : false, (_c = data.Profile) == null ? void 0 : _c.id),
3394
+ enabled: isClickable,
3366
3395
  children: /* @__PURE__ */ jsxs(Flex, {
3367
3396
  direction: "column",
3368
3397
  justify: "space-between",
3369
3398
  h: "100%",
3370
3399
  children: [/* @__PURE__ */ jsxs(Box, {
3371
3400
  className: "CourseList-TraditionalBox",
3372
- 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, {
3373
- href: (_g = data.action) == null ? void 0 : _g.href,
3374
- isExternal: (_h = data.action) == null ? void 0 : _h.targetBlank,
3375
- tabIndex: -1,
3376
- className: "linkOverlay"
3401
+ children: [isClickable && hasHref && /* @__PURE__ */ jsx(LinkOverlay, {
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
3377
3407
  }), /* @__PURE__ */ jsx(Header$1, {}), /* @__PURE__ */ jsx(Section, {})]
3378
3408
  }), /* @__PURE__ */ jsx(Footer, {
3379
3409
  modalPaymentText
@@ -6196,6 +6226,7 @@ const GoToCalendar = ({
6196
6226
  const activeBg = (_a = vars("colors-main-deepSkyBlue")) != null ? _a : "#0189FF";
6197
6227
  const hoverBg = "rgba(96, 121, 142, 0.8)";
6198
6228
  return /* @__PURE__ */ jsx(MenuButton, {
6229
+ tabIndex: -1,
6199
6230
  onClick: () => onlyToCalendar && onClick && onClick(),
6200
6231
  position: "relative",
6201
6232
  sx: {