From 12b4e952d5d39db589dd8b1a86aacdaf2ae165bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=20Gramn=C3=A6s=20Tjernshaugen?= Date: Sun, 5 Apr 2026 16:20:29 -0700 Subject: [PATCH] Solve ui react/typescript performance issues --- package.json | 8 + packages/config/tsconfig.json | 2 +- packages/ui/src/atoms/Button/Button.tsx | 31 +- packages/ui/src/atoms/Input/TextInput.tsx | 10 +- packages/ui/src/atoms/Typography/Link.tsx | 30 +- packages/ui/src/atoms/Typography/Text.tsx | 35 +- packages/ui/src/atoms/Typography/Title.tsx | 20 +- pnpm-lock.yaml | 645 +++++++++------------ 8 files changed, 349 insertions(+), 432 deletions(-) diff --git a/package.json b/package.json index a72d36ab43..665eb2bd50 100644 --- a/package.json +++ b/package.json @@ -53,5 +53,13 @@ "devDependencies": { "@biomejs/biome": "2.4.5", "typescript": "5.9.3" + }, + "pnpm": { + "overrides": { + "react": "19.2.4", + "react-dom": "19.2.4", + "@types/react": "19.2.14", + "@types/react-dom": "19.2.3" + } } } diff --git a/packages/config/tsconfig.json b/packages/config/tsconfig.json index f3eed8c56b..8f8a7e1091 100644 --- a/packages/config/tsconfig.json +++ b/packages/config/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "noErrorTruncation": true, + "noErrorTruncation": false, "target": "esnext", "module": "esnext", "moduleResolution": "bundler", diff --git a/packages/ui/src/atoms/Button/Button.tsx b/packages/ui/src/atoms/Button/Button.tsx index 92ba700fd9..4e9d1fde6d 100644 --- a/packages/ui/src/atoms/Button/Button.tsx +++ b/packages/ui/src/atoms/Button/Button.tsx @@ -1,9 +1,7 @@ import { type VariantProps, cva } from "cva" -import type { ComponentPropsWithRef, ElementType, PropsWithChildren, ReactNode } from "react" +import type { ElementType, HTMLAttributes, PropsWithChildren, ReactNode, Ref } from "react" import { cn } from "../../utils" -// Add variants, colors, or sizes in the arrays below -// to add them to the component export const BUTTON_VARIANTS = ["solid", "outline", "text", "unstyled"] as const export const BUTTON_COLORS = ["light", "dark", "brand", "blue", "red"] as const export const BUTTON_SIZES = ["sm", "md", "lg"] as const @@ -12,21 +10,23 @@ export type ButtonVariant = (typeof BUTTON_VARIANTS)[number] export type ButtonColor = (typeof BUTTON_COLORS)[number] export type ButtonSize = (typeof BUTTON_SIZES)[number] -export type ButtonProps = VariantProps & - PropsWithChildren & { - /** - * The HTML element to render the button as - * - * Defaults to an HTML