diff --git a/example/storybook/package.json b/example/storybook/package.json index 382bf597..47daba70 100644 --- a/example/storybook/package.json +++ b/example/storybook/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@expo/html-elements": "^0.4.2", - "@gluestack-style/react": "1.0.6", + "@gluestack-style/react": "1.0.7", "@gluestack-ui/actionsheet": "^0.2.16", "@gluestack-ui/alert-dialog": "^0.1.14", "@gluestack-ui/button": "^0.1.23", diff --git a/packages/animation-moti-driver/package.json b/packages/animation-moti-driver/package.json index 3a03aa7e..ca3d65f1 100644 --- a/packages/animation-moti-driver/package.json +++ b/packages/animation-moti-driver/package.json @@ -24,13 +24,13 @@ "clean": "rm -rf lib" }, "peerDependencies": { - "@gluestack-style/react": ">=0.2", + "@gluestack-style/react": ">=1.0.7", "moti": ">=0.26", "react-native-gesture-handler": ">=2.12", "react-native-reanimated": ">=3.5" }, "devDependencies": { - "@gluestack-style/react": "^0.2.49", + "@gluestack-style/react": "^1.0.7", "@types/react": "^18.0.22", "@types/react-native": "^0.69.15", "babel-plugin-transform-remove-console": "^6.9.4", diff --git a/packages/animation-resolver/package.json b/packages/animation-resolver/package.json index 98ae24a0..c428cf9a 100644 --- a/packages/animation-resolver/package.json +++ b/packages/animation-resolver/package.json @@ -22,10 +22,10 @@ "clean": "rm -rf lib" }, "peerDependencies": { - "@gluestack-style/react": ">=0.2" + "@gluestack-style/react": ">=1.0.7" }, "devDependencies": { - "@gluestack-style/react": "^0.2.49", + "@gluestack-style/react": "^1.0.7", "@types/react": "^18.0.22", "@types/react-native": "^0.69.15", "babel-plugin-transform-remove-console": "^6.9.4", diff --git a/packages/benchmark-next/package.json b/packages/benchmark-next/package.json index 28209bd1..cf42e97a 100644 --- a/packages/benchmark-next/package.json +++ b/packages/benchmark-next/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "@gluestack-style/babel-plugin-styled-resolver": "1.0.0", - "@gluestack-style/react": "1.0.6", + "@gluestack-style/react": "1.0.7", "@emotion/styled": "^11.3.0", "@expo/next-adapter": "^4.0.13", "@types/react": "17.0.1", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 78ce2539..1a3b7221 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @gluestack-style/react +## 1.0.7 + +### Patch Changes + +- fix: component typings + ## 0.2.9 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index b6b5f4e7..b5ebc04d 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.6", + "version": "1.0.7", "keywords": [ "React Native", "Next.js", diff --git a/packages/react/src/styled.tsx b/packages/react/src/styled.tsx index af357c97..c475b74a 100644 --- a/packages/react/src/styled.tsx +++ b/packages/react/src/styled.tsx @@ -10,6 +10,7 @@ import type { ExtendedConfigType, IComponentStyleConfig, StyledConfig, + UtilityProps, } from './types'; import { deepMerge, @@ -995,7 +996,12 @@ export function verboseStyled( // sxHash: BUILD_TIME_sxHash = '', ...componentProps }: Omit< - ComponentProps, + Omit & + Partial> & + Partial> & { + as?: any; + children?: any; + }, 'animationComponentGluestack' >, ref: React.ForwardedRef

diff --git a/packages/react/src/types.ts b/packages/react/src/types.ts index 93e57529..019753f3 100644 --- a/packages/react/src/types.ts +++ b/packages/react/src/types.ts @@ -735,69 +735,63 @@ interface GenericComponents { /********************* COMPONENT PROPS TYPE *****************************************/ export type ComponentProps = - Partial< - Omit & - SxStyleProps< - GenericComponentStyles, - Variants, - P, - 'animationComponentGluestack' extends keyof P - ? P['animationComponentGluestack'] extends true - ? Plugins - : [] - : [] - > & { - as?: any; - children?: any; - } & UtilityProps & { - states?: { - [K in IState]?: boolean; - }; - } & (GSConfig['globalStyle'] extends object - ? { - [Key in keyof MergeNestedThree< - GlobalVariants, - Variants, - // @ts-ignore - Components[`${ComCon}`]['theme']['variants'] - >]?: keyof MergeNestedThree< - GlobalVariants, - Variants, - // @ts-ignore - Components[`${ComCon}`]['theme']['variants'] - >[Key] extends 'true' | 'false' - ? boolean - : keyof MergeNestedThree< - GlobalVariants, - Variants, - // @ts-ignore - Components[`${ComCon}`]['theme']['variants'] - >[Key]; - } & Omit - : { - [Key in keyof MergeNested< - Variants, - // @ts-ignore - Components[`${ComCon}`]['theme']['variants'] - >]?: keyof MergeNested< - Variants, // @ts-ignore - Components[`${ComCon}`]['theme']['variants'] - >[Key] extends 'true' | 'false' - ? boolean - : keyof MergeNested< - Variants, - // @ts-ignore - Components[`${ComCon}`]['theme']['variants'] - >[Key]; - }) - >; + SxStyleProps< + GenericComponentStyles, + Variants, + P, + 'animationComponentGluestack' extends keyof P + ? P['animationComponentGluestack'] extends true + ? Plugins + : [] + : [] + > & { + states?: { + [K in IState]?: boolean; + }; + } & (GSConfig['globalStyle'] extends object + ? { + [Key in keyof MergeNestedThree< + GlobalVariants, + Variants, + // @ts-ignore + Components[`${ComCon}`]['theme']['variants'] + >]?: keyof MergeNestedThree< + GlobalVariants, + Variants, + // @ts-ignore + Components[`${ComCon}`]['theme']['variants'] + >[Key] extends 'true' | 'false' + ? boolean + : keyof MergeNestedThree< + GlobalVariants, + Variants, + // @ts-ignore + Components[`${ComCon}`]['theme']['variants'] + >[Key]; + } & Omit + : { + [Key in keyof MergeNested< + Variants, + // @ts-ignore + Components[`${ComCon}`]['theme']['variants'] + >]?: keyof MergeNested< + Variants, // @ts-ignore + Components[`${ComCon}`]['theme']['variants'] + >[Key] extends 'true' | 'false' + ? boolean + : keyof MergeNested< + Variants, + // @ts-ignore + Components[`${ComCon}`]['theme']['variants'] + >[Key]; + }); export type UtilityProps = Omit< TokenizedRNStyleProps>, keyof GenericComponentProps > & Omit< - AliasesProps>, + AliasesProps>, keyof GenericComponentProps >;