From b82093c087bbd1b8b37b35c3fb2e24f51b97b351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=CA=9C=C9=AA=E1=B4=8D=E1=B4=9C=CA=80=E1=B4=80=20Yu=CC=84?= Date: Fri, 19 Sep 2025 13:12:58 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#71163=20fix(styled?= =?UTF-8?q?-system):=20fix=20conditionals=20to=20make=20it=20work=20with?= =?UTF-8?q?=20`exactOptionalPropertyTypes:=20true`=20by=20@yuhr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/styled-system/index.d.ts | 7 ++++--- types/styled-system/tsconfig.json | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/types/styled-system/index.d.ts b/types/styled-system/index.d.ts index c2867b27796d61c..108d5b3c6e23bba 100644 --- a/types/styled-system/index.d.ts +++ b/types/styled-system/index.d.ts @@ -37,9 +37,10 @@ export type ResponsiveValue< ThemeType extends Theme = RequiredTheme, > = T | null | Array | { [key in ThemeValue<"breakpoints", ThemeType> & string | number]?: T }; -export type ThemeValue = ThemeType[K] extends TVal[] ? number - : ThemeType[K] extends Record ? E - : ThemeType[K] extends ObjectOrArray ? F +export type ThemeValue = NonNullable extends TVal[] + ? number + : NonNullable extends Record ? E + : NonNullable extends ObjectOrArray ? F : never; export interface SpaceProps> { diff --git a/types/styled-system/tsconfig.json b/types/styled-system/tsconfig.json index 04e6619e130f33b..528d4dfd7512781 100644 --- a/types/styled-system/tsconfig.json +++ b/types/styled-system/tsconfig.json @@ -11,7 +11,8 @@ "strictFunctionTypes": true, "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "exactOptionalPropertyTypes": true }, "files": [ "index.d.ts",