enjanga-components-library 1.0.38 → 1.0.40

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.
package/dist/index.js CHANGED
@@ -1017,7 +1017,9 @@ var require_prop_types = __commonJS({
1017
1017
  var next_exports = {};
1018
1018
  __export(next_exports, {
1019
1019
  Image: () => default3__default.default,
1020
- Link: () => default2__default.default
1020
+ Link: () => default2__default.default,
1021
+ usePathname: () => navigation_star.usePathname,
1022
+ useSearchParams: () => navigation_star.useSearchParams
1021
1023
  });
1022
1024
  __reExport(next_exports, navigation_star__namespace);
1023
1025
 
@@ -1128,7 +1130,10 @@ var AppHeader = ({
1128
1130
  const labelOpenMenu = "Open menu";
1129
1131
  const labelSideNav = "Side navigation";
1130
1132
  const [visible, setVisible] = React4.useState(true);
1133
+ const searchParams = navigation_star.useSearchParams();
1134
+ const pathname = navigation_star.usePathname();
1131
1135
  const { activeBreakpoint } = useWindowBreakpoint();
1136
+ const isHomeRoute = pathname === "/" && !searchParams.has("section");
1132
1137
  React4.useEffect(() => {
1133
1138
  const handleOpen = () => {
1134
1139
  if (activeBreakpoint !== "sm" && activeBreakpoint !== "md") return;
@@ -1159,7 +1164,18 @@ var AppHeader = ({
1159
1164
  isActive: isSideNavExpanded
1160
1165
  }
1161
1166
  ),
1162
- /* @__PURE__ */ jsxRuntime.jsx(react.HeaderName, { prefix: "", as: default2__default.default, href: brandRoute, passHref: true, children: brand }),
1167
+ /* @__PURE__ */ jsxRuntime.jsx(
1168
+ react.HeaderName,
1169
+ {
1170
+ prefix: "",
1171
+ as: default2__default.default,
1172
+ href: brandRoute,
1173
+ passHref: true,
1174
+ isCurrentPage: isHomeRoute,
1175
+ className: isHomeRoute ? "cds--header__name--current" : "",
1176
+ children: brand
1177
+ }
1178
+ ),
1163
1179
  /* @__PURE__ */ jsxRuntime.jsx(react.HeaderNavigation, { "aria-label": brandLabel, children: navigation }),
1164
1180
  /* @__PURE__ */ jsxRuntime.jsx(
1165
1181
  react.SideNav,
package/dist/index.mjs CHANGED
@@ -2,6 +2,7 @@ import { Tile, ComposedModal, ModalHeader, ModalBody, ModalFooter, Button, Heade
2
2
  import default2 from 'next/link';
3
3
  import default3 from 'next/image';
4
4
  import * as navigation_star from 'next/navigation';
5
+ import { useSearchParams, usePathname } from 'next/navigation';
5
6
  import React4, { memo, useState, useRef, useEffect, useMemo } from 'react';
6
7
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
7
8
  import clsx2 from 'clsx';
@@ -989,7 +990,9 @@ var require_prop_types = __commonJS({
989
990
  var next_exports = {};
990
991
  __export(next_exports, {
991
992
  Image: () => default3,
992
- Link: () => default2
993
+ Link: () => default2,
994
+ usePathname: () => usePathname,
995
+ useSearchParams: () => useSearchParams
993
996
  });
994
997
  __reExport(next_exports, navigation_star);
995
998
 
@@ -1100,7 +1103,10 @@ var AppHeader = ({
1100
1103
  const labelOpenMenu = "Open menu";
1101
1104
  const labelSideNav = "Side navigation";
1102
1105
  const [visible, setVisible] = useState(true);
1106
+ const searchParams = useSearchParams();
1107
+ const pathname = usePathname();
1103
1108
  const { activeBreakpoint } = useWindowBreakpoint();
1109
+ const isHomeRoute = pathname === "/" && !searchParams.has("section");
1104
1110
  useEffect(() => {
1105
1111
  const handleOpen = () => {
1106
1112
  if (activeBreakpoint !== "sm" && activeBreakpoint !== "md") return;
@@ -1131,7 +1137,18 @@ var AppHeader = ({
1131
1137
  isActive: isSideNavExpanded
1132
1138
  }
1133
1139
  ),
1134
- /* @__PURE__ */ jsx(HeaderName, { prefix: "", as: default2, href: brandRoute, passHref: true, children: brand }),
1140
+ /* @__PURE__ */ jsx(
1141
+ HeaderName,
1142
+ {
1143
+ prefix: "",
1144
+ as: default2,
1145
+ href: brandRoute,
1146
+ passHref: true,
1147
+ isCurrentPage: isHomeRoute,
1148
+ className: isHomeRoute ? "cds--header__name--current" : "",
1149
+ children: brand
1150
+ }
1151
+ ),
1135
1152
  /* @__PURE__ */ jsx(HeaderNavigation, { "aria-label": brandLabel, children: navigation }),
1136
1153
  /* @__PURE__ */ jsx(
1137
1154
  SideNav,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enjanga-components-library",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "Reusable component library for Next.js 13+ projects with Carbon design system.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -74,7 +74,7 @@
74
74
  "clsx": "^2.1.1",
75
75
  "concurrently": "^9.1.2",
76
76
  "css-loader": "^7.1.2",
77
- "enjanga-core-setup": "^1.0.20",
77
+ "enjanga-core-setup": "^1.0.22",
78
78
  "react": "^19.0.0",
79
79
  "react-docgen-typescript": "^2.4.0",
80
80
  "react-dom": "^19.0.0",