@pnkx-lib/ui 1.9.415 → 1.9.416

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.
@@ -240,18 +240,24 @@ const SidebarV2 = ({ menu, children }) => {
240
240
  ),
241
241
  isDropwdown && openDropdownMenu === subMenu.path && subMenu.children?.map((dropdownItem) => {
242
242
  const joinPaths = (...paths) => {
243
- return "/" + paths.filter(Boolean).map((p) => p.replace(/^\/|\/$/g, "")).join("/");
243
+ return paths.filter(Boolean).map((p) => p.replace(/^\/+|\/+$/g, "")).join("/");
244
244
  };
245
245
  const path = joinPaths(
246
246
  moduleMenu.path,
247
247
  subMenu.path,
248
248
  dropdownItem.path
249
249
  );
250
- const activeSubmenu = pathName.startsWith(path);
250
+ const ensureLeadingSlash = (path2) => {
251
+ if (!path2) return "/";
252
+ const matchPath = path2.startsWith("/") ? path2 : "/" + path2;
253
+ return matchPath;
254
+ };
255
+ const pathFinal = ensureLeadingSlash(path);
256
+ const activeSubmenu = pathName.startsWith(pathFinal);
251
257
  return /* @__PURE__ */ jsxs(
252
258
  Link,
253
259
  {
254
- to: path,
260
+ to: pathFinal,
255
261
  className: twMerge(
256
262
  "px-4 py-2 mt-1 items-center gap-2 flex text-sm hover:bg-[#E5F4FF] hover:text-[#007BE5]",
257
263
  activeSubmenu ? "!text-[#007BE5] !bg-[#E5F4FF]" : "text-[#1F1F1F]"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnkx-lib/ui",
3
3
  "private": false,
4
- "version": "1.9.415",
4
+ "version": "1.9.416",
5
5
  "type": "module",
6
6
  "main": "./es/index.js",
7
7
  "module": "./es/index.js",