From a111937d00f919cbb7cc39a50120bc4f11ca7cda Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 8 May 2025 12:43:50 +0100 Subject: [PATCH] Iterate --- modules/banner/element-web/package.json | 3 +- modules/banner/element-web/src/Banner.tsx | 8 ++--- modules/banner/element-web/src/Logo.tsx | 2 +- modules/banner/element-web/src/Menu.tsx | 2 +- .../element-web/src/Univention/navigation.ts | 2 +- modules/banner/element-web/src/theme.ts | 29 +++++++++++++++++++ 6 files changed, 38 insertions(+), 8 deletions(-) diff --git a/modules/banner/element-web/package.json b/modules/banner/element-web/package.json index 85ac88a46b..bdc07531a0 100644 --- a/modules/banner/element-web/package.json +++ b/modules/banner/element-web/package.json @@ -6,7 +6,8 @@ "main": "lib/index.js", "scripts": { "prepare": "vite build", - "lint:ts": "tsc --noEmit", + "lint:types": "tsc --noEmit", + "lint:codestyle": "echo 'handled by lint:eslint'", "test": "echo no tests yet" }, "devDependencies": { diff --git a/modules/banner/element-web/src/Banner.tsx b/modules/banner/element-web/src/Banner.tsx index 4ad63827ab..2d957f9b6e 100644 --- a/modules/banner/element-web/src/Banner.tsx +++ b/modules/banner/element-web/src/Banner.tsx @@ -16,11 +16,11 @@ import { theme } from "./theme"; import Logo from "./Logo.tsx"; const Root = styled.nav` - background-color: ${({ theme }) => theme.compound.color.bgCanvasDefault}; - border-bottom: ${({ theme }) => theme.navbar.border}; - height: ${({ theme }) => theme.navbar.height}; + background-color: ${({ theme }): string => theme.compound.color.bgCanvasDefault}; + border-bottom: ${({ theme }): string => theme.navbar.border}; + height: ${({ theme }): string => theme.navbar.height}; display: grid; - grid-template-columns: ${({ theme }) => `${theme.navbar.triggerWidth} auto`}; + grid-template-columns: ${({ theme }): string => `${theme.navbar.triggerWidth} auto`}; gap: 24px; `; diff --git a/modules/banner/element-web/src/Logo.tsx b/modules/banner/element-web/src/Logo.tsx index 48840486ca..0866bf802c 100644 --- a/modules/banner/element-web/src/Logo.tsx +++ b/modules/banner/element-web/src/Logo.tsx @@ -14,7 +14,7 @@ const Anchor = styled.a` `; const Image = styled.img` - height: ${({ theme }) => theme.navbar.logoHeight}; + height: ${({ theme }): string => theme.navbar.logoHeight}; align-self: center; `; diff --git a/modules/banner/element-web/src/Menu.tsx b/modules/banner/element-web/src/Menu.tsx index 9ca1763858..033bc78f9d 100644 --- a/modules/banner/element-web/src/Menu.tsx +++ b/modules/banner/element-web/src/Menu.tsx @@ -39,7 +39,7 @@ const SidebarHeading = styled.div` const Launcher = styled.button` align-items: center; border: none; - color: ${({ theme }) => theme.compound.color.textPrimary}; + color: ${({ theme }): string => theme.compound.color.textPrimary}; cursor: pointer; display: flex; diff --git a/modules/banner/element-web/src/Univention/navigation.ts b/modules/banner/element-web/src/Univention/navigation.ts index 8443d2951f..96b035d3ed 100644 --- a/modules/banner/element-web/src/Univention/navigation.ts +++ b/modules/banner/element-web/src/Univention/navigation.ts @@ -13,7 +13,7 @@ import { StaticConfig } from "../config"; * Univention Central Navigation API * https://docs.software-univention.de/nubus-kubernetes-customization/1.x/en/api/central-navigation.html */ -export const UniventionCentralNavigation = z.object({ +const UniventionCentralNavigation = z.object({ categories: z.array( z.object({ identifier: z.string(), diff --git a/modules/banner/element-web/src/theme.ts b/modules/banner/element-web/src/theme.ts index 4eec071127..300cf1924a 100644 --- a/modules/banner/element-web/src/theme.ts +++ b/modules/banner/element-web/src/theme.ts @@ -14,6 +14,35 @@ const iconOnSolidPrimary = "var(--cpd-color-icon-on-solid-primary)"; const bodyMdSemibold = "var(--cpd-font-body-md-semibold)"; +declare module "styled-components" { + export interface DefaultTheme { + compound: { + color: { + bgCanvasDefault: string; + textActionAccent: string; + textPrimary: string; + iconOnSolidPrimary: string; + }; + font: { + bodyMdSemibold: string; + }; + }; + color: { + accent: string; + }; + navbar: { + border: string; + boxShadow: string; + height: string; + triggerWidth: string; + logoHeight: string; + }; + menu: { + width: string; + }; + } +} + export const theme: DefaultTheme = { compound: { color: {