From f9841a044a5da329ebf09f8e54a504b4b5943246 Mon Sep 17 00:00:00 2001 From: Esther Schmitz Date: Wed, 15 Oct 2025 14:38:45 +0200 Subject: [PATCH 1/2] chore(carbon): remove classnames dependency --- apps/carbon/package.json | 1 - .../components/Navigation/NavigationItem.tsx | 19 +++++++++++++------ pnpm-lock.yaml | 8 -------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/apps/carbon/package.json b/apps/carbon/package.json index 1353dde851..3304be8420 100644 --- a/apps/carbon/package.json +++ b/apps/carbon/package.json @@ -29,7 +29,6 @@ "@cloudoperators/juno-ui-components": "workspace:*", "@tailwindcss/vite": "4.1.13", "@vitejs/plugin-react": "4.7.0", - "classnames": "2.5.1", "react": "19.1.0", "react-dom": "19.1.0", "react-error-boundary": "3.1.4", diff --git a/apps/carbon/src/components/Navigation/NavigationItem.tsx b/apps/carbon/src/components/Navigation/NavigationItem.tsx index 4d5c5b3b62..032112f74c 100644 --- a/apps/carbon/src/components/Navigation/NavigationItem.tsx +++ b/apps/carbon/src/components/Navigation/NavigationItem.tsx @@ -5,7 +5,6 @@ import React from "react" import { Stack } from "@cloudoperators/juno-ui-components" -import classNames from "classnames" import { Link, useRoute } from "wouter" import SupernovaIcon from "../../assets/juno_supernova.svg?react" import DoopIcon from "../../assets/juno_doop.svg?react" @@ -24,11 +23,19 @@ const AppIcon = ({ name }: { name: string }) => { const Border = () =>
-const getClassName = (isActive: boolean) => - classNames("relative px-5 py-3 cursor-pointer", { - "bg-theme-global-bg text-white": isActive, - "hover:text-theme-high": !isActive, - }) +const getClassName = (isActive: boolean) => { + return ` + relative + px-5 + py-3 + cursor-pointer + + ${isActive + ? "bg-theme-global-bg text-white" + : "hover:text-theme-high" + } + ` +} type NavigationItemProps = { name: string diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c8e111f58e..785067f2bb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,9 +60,6 @@ importers: '@vitejs/plugin-react': specifier: 4.7.0 version: 4.7.0(vite@7.1.7(@types/node@24.3.2)(jiti@2.5.1)(lightningcss@1.30.1)(sass@1.81.1)(terser@5.39.2)(tsx@4.19.4)(yaml@2.8.0)) - classnames: - specifier: 2.5.1 - version: 2.5.1 react: specifier: 19.1.0 version: 19.1.0 @@ -4075,9 +4072,6 @@ packages: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} - classnames@2.5.1: - resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==} - clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} @@ -11230,8 +11224,6 @@ snapshots: ci-info@3.9.0: {} - classnames@2.5.1: {} - clean-stack@2.2.0: {} cli-cursor@3.1.0: From 0fcad82bcf6ceb4241f62d499a3446ff90f68adc Mon Sep 17 00:00:00 2001 From: Esther Schmitz Date: Wed, 15 Oct 2025 14:40:04 +0200 Subject: [PATCH 2/2] chore(carbon): refactor classnames usage to vanilla js --- apps/carbon/src/components/Navigation/NavigationItem.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/carbon/src/components/Navigation/NavigationItem.tsx b/apps/carbon/src/components/Navigation/NavigationItem.tsx index 032112f74c..2f5c30a889 100644 --- a/apps/carbon/src/components/Navigation/NavigationItem.tsx +++ b/apps/carbon/src/components/Navigation/NavigationItem.tsx @@ -30,10 +30,7 @@ const getClassName = (isActive: boolean) => { py-3 cursor-pointer - ${isActive - ? "bg-theme-global-bg text-white" - : "hover:text-theme-high" - } + ${isActive ? "bg-theme-global-bg text-white" : "hover:text-theme-high"} ` }