From 341a39a2e0bac31fb489977a07444119dda82c22 Mon Sep 17 00:00:00 2001 From: ankit-tailor Date: Tue, 7 Nov 2023 19:42:40 +0530 Subject: [PATCH 1/2] fix: utility props typings --- packages/react/src/types.ts | 69 ++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/packages/react/src/types.ts b/packages/react/src/types.ts index d7c16f41..1f13e541 100644 --- a/packages/react/src/types.ts +++ b/packages/react/src/types.ts @@ -840,8 +840,7 @@ export type PropsCombinations = export type UtilityProps< GenericComponentStyles, Variants, - GenericComponentProps, - Tokens = GSConfig['tokens'] + GenericComponentProps > = Omit< TokenizedRNStyleProps>, keyof GenericComponentProps @@ -851,41 +850,41 @@ export type UtilityProps< keyof GenericComponentProps > & Partial<{ - //@ts-ignore - [key in PropsCombinations]?: Aliases[LastPart] extends keyof GetRNStyles - ? //@ts-ignore - PropertyTokenType[Aliases[LastPart]] extends 'sizes' - ? - | WithSizeNegativeValue - //@ts-ignore - | ExtendRNStyle]> - : //@ts-ignore - PropertyTokenType[Aliases[LastPart]] extends 'space' - ? - | WithNegativeValue< - StringifyToken< - //@ts-expect-error - keyof Tokens[PropertyTokenType[Aliases[LastPart]]] + [key in PropsCombinations]?: LastPart extends keyof Aliases + ? Aliases[LastPart] extends keyof GetRNStyles + ? PropertyTokenType[Aliases[LastPart]] extends 'sizes' + ? + | WithSizeNegativeValue + | ExtendRNStyle]> + : PropertyTokenType[Aliases[LastPart]] extends 'space' + ? + | WithNegativeValue< + StringifyToken< + keyof GSConfig['tokens'][PropertyTokenType[Aliases[LastPart]]] + > + > + | ExtendRNStyle< + GetRNStyles, + Aliases[LastPart] + > + : + | StringifyToken< + keyof GSConfig['tokens'][PropertyTokenType[Aliases[LastPart]]] + > + | ExtendRNStyle< + GetRNStyles, + Aliases[LastPart] > - > - | ExtendRNStyle< - GetRNStyles, - //@ts-ignore - Aliases[LastPart] - > - : - | StringifyToken< - //@ts-ignore - keyof Tokens[PropertyTokenType[Aliases[LastPart]]] - > - | ExtendRNStyle< - GetRNStyles, - //@ts-ignore - Aliases[LastPart] - > - : never; + : never + : any; }> & - VerbosedUtilityProps; + Partial< + VerbosedUtilityProps< + GenericComponentStyles, + Variants, + GenericComponentProps + > + >; // & // Partial<{ // [key in `$${IState | PLATFORMS | IMediaQueries}-${string}`]?: any; From b9556a9fb18340ced55b6c53bf40f51b900a8350 Mon Sep 17 00:00:00 2001 From: ankit-tailor Date: Tue, 7 Nov 2023 19:51:16 +0530 Subject: [PATCH 2/2] v1.0.14 --- packages/react/CHANGELOG.md | 6 ++++++ packages/react/package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index a0fa76a0..682382ba 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @gluestack-style/react +## 1.0.14 + +### Patch Changes + +- Fixed utility props typings [PR](https://github.com/gluestack/gluestack-style/pull/524) + ## 1.0.13 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index 047a82ab..5a08558d 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,7 +1,7 @@ { "name": "@gluestack-style/react", "description": "A universal & performant styling library for React Native, Next.js & React", - "version": "1.0.13", + "version": "1.0.14", "keywords": [ "React Native", "Next.js",